1 |
matsuu 11/05/28 01:56:00 |
2 |
|
3 |
Added: ibus-unikey-ibus-1.4.patch |
4 |
Log: |
5 |
Version bumped, bug #353798. Support ibus-1.4. |
6 |
|
7 |
(Portage version: 2.1.9.49/cvs/Linux x86_64) |
8 |
|
9 |
Revision Changes Path |
10 |
1.1 app-i18n/ibus-unikey/files/ibus-unikey-ibus-1.4.patch |
11 |
|
12 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-i18n/ibus-unikey/files/ibus-unikey-ibus-1.4.patch?rev=1.1&view=markup |
13 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-i18n/ibus-unikey/files/ibus-unikey-ibus-1.4.patch?rev=1.1&content-type=text/plain |
14 |
|
15 |
Index: ibus-unikey-ibus-1.4.patch |
16 |
=================================================================== |
17 |
diff -ru ibus-unikey-0.5.1.orig/src/engine.cpp ibus-unikey-0.5.1/src/engine.cpp |
18 |
--- ibus-unikey-0.5.1.orig/src/engine.cpp 2010-09-11 20:56:49.000000000 +0900 |
19 |
+++ ibus-unikey-0.5.1/src/engine.cpp 2011-02-21 10:29:28.751755007 +0900 |
20 |
@@ -138,9 +138,8 @@ |
21 |
|
22 |
static void ibus_unikey_engine_init(IBusUnikeyEngine* unikey) |
23 |
{ |
24 |
- GValue v = {0}; |
25 |
+ GVariant *v = NULL; |
26 |
gchar* str; |
27 |
- gboolean succ; |
28 |
guint i; |
29 |
|
30 |
unikey->preeditstr = new std::string(); |
31 |
@@ -160,10 +159,10 @@ |
32 |
|
33 |
// read config value |
34 |
// read Input Method |
35 |
- succ = ibus_config_get_value(config, "engine/Unikey", "InputMethod", &v); |
36 |
- if (succ) |
37 |
+ v = ibus_config_get_value(config, "engine/Unikey", "InputMethod"); |
38 |
+ if (v) |
39 |
{ |
40 |
- str = (gchar*)g_value_get_string(&v); |
41 |
+ str = (gchar*)g_variant_get_string(v, NULL); |
42 |
for (i = 0; i < NUM_INPUTMETHOD; i++) |
43 |
{ |
44 |
if (strcasecmp(str, Unikey_IMNames[i]) == 0) |
45 |
@@ -171,14 +170,14 @@ |
46 |
unikey->im = Unikey_IM[i]; |
47 |
} |
48 |
} |
49 |
- g_value_unset(&v); |
50 |
+ g_variant_unref(v); |
51 |
} // end read Input Method |
52 |
|
53 |
// read Output Charset |
54 |
- succ = ibus_config_get_value(config, "engine/Unikey", "OutputCharset", &v); |
55 |
- if (succ) |
56 |
+ v = ibus_config_get_value(config, "engine/Unikey", "OutputCharset"); |
57 |
+ if (v) |
58 |
{ |
59 |
- str = (gchar*)g_value_get_string(&v); |
60 |
+ str = (gchar*)g_variant_get_string(v, NULL); |
61 |
for (i = 0; i < NUM_OUTPUTCHARSET; i++) |
62 |
{ |
63 |
if (strcasecmp(str, Unikey_OCNames[i]) == 0) |
64 |
@@ -186,64 +185,64 @@ |
65 |
unikey->oc = Unikey_OC[i]; |
66 |
} |
67 |
} |
68 |
- g_value_unset(&v); |
69 |
+ g_variant_unref(v); |
70 |
} // end read Output Charset |
71 |
|
72 |
// read Unikey Option |
73 |
// freemarking |
74 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "FreeMarking", &v); |
75 |
- if (succ) |
76 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "FreeMarking"); |
77 |
+ if (v) |
78 |
{ |
79 |
- unikey->ukopt.freeMarking = g_value_get_boolean(&v); |
80 |
- g_value_unset(&v); |
81 |
+ unikey->ukopt.freeMarking = g_variant_get_boolean(v); |
82 |
+ g_variant_unref(v); |
83 |
} |
84 |
|
85 |
// modernstyle |
86 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "ModernStyle", &v); |
87 |
- if (succ) |
88 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "ModernStyle"); |
89 |
+ if (v) |
90 |
{ |
91 |
- unikey->ukopt.modernStyle = g_value_get_boolean(&v); |
92 |
- g_value_unset(&v); |
93 |
+ unikey->ukopt.modernStyle = g_variant_get_boolean(v); |
94 |
+ g_variant_unref(v); |
95 |
} |
96 |
|
97 |
// macroEnabled |
98 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "MacroEnabled", &v); |
99 |
- if (succ) |
100 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "MacroEnabled"); |
101 |
+ if (v) |
102 |
{ |
103 |
- unikey->ukopt.macroEnabled = g_value_get_boolean(&v); |
104 |
- g_value_unset(&v); |
105 |
+ unikey->ukopt.macroEnabled = g_variant_get_boolean(v); |
106 |
+ g_variant_unref(v); |
107 |
} |
108 |
|
109 |
// spellCheckEnabled |
110 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "SpellCheckEnabled", &v); |
111 |
- if (succ) |
112 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "SpellCheckEnabled"); |
113 |
+ if (v) |
114 |
{ |
115 |
- unikey->ukopt.spellCheckEnabled = g_value_get_boolean(&v); |
116 |
- g_value_unset(&v); |
117 |
+ unikey->ukopt.spellCheckEnabled = g_variant_get_boolean(v); |
118 |
+ g_variant_unref(v); |
119 |
} |
120 |
|
121 |
// autoNonVnRestore |
122 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "AutoNonVnRestore", &v); |
123 |
- if (succ) |
124 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "AutoNonVnRestore"); |
125 |
+ if (v) |
126 |
{ |
127 |
- unikey->ukopt.autoNonVnRestore = g_value_get_boolean(&v); |
128 |
- g_value_unset(&v); |
129 |
+ unikey->ukopt.autoNonVnRestore = g_variant_get_boolean(v); |
130 |
+ g_variant_unref(v); |
131 |
} |
132 |
|
133 |
// ProcessWAtBegin |
134 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "ProcessWAtBegin", &v); |
135 |
- if (succ) |
136 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "ProcessWAtBegin"); |
137 |
+ if (v) |
138 |
{ |
139 |
- unikey->process_w_at_begin = g_value_get_boolean(&v); |
140 |
- g_value_unset(&v); |
141 |
+ unikey->process_w_at_begin = g_variant_get_boolean(v); |
142 |
+ g_variant_unref(v); |
143 |
} |
144 |
|
145 |
// MouseCapture |
146 |
- succ = ibus_config_get_value(config, "engine/Unikey/Options", "MouseCapture", &v); |
147 |
- if (succ) |
148 |
+ v = ibus_config_get_value(config, "engine/Unikey/Options", "MouseCapture"); |
149 |
+ if (v) |
150 |
{ |
151 |
- unikey->mouse_capture = g_value_get_boolean(&v); |
152 |
- g_value_unset(&v); |
153 |
+ unikey->mouse_capture = g_variant_get_boolean(v); |
154 |
+ g_variant_unref(v); |
155 |
} |
156 |
// end read Unikey Option |
157 |
// end read config value |
158 |
@@ -331,7 +330,7 @@ |
159 |
{ |
160 |
IBusProperty* prop; |
161 |
IBusText* label; |
162 |
- GValue v = {0}; |
163 |
+ GVariant *v; |
164 |
guint i, j; |
165 |
|
166 |
unikey = (IBusUnikeyEngine*)engine; |
167 |
@@ -346,9 +345,8 @@ |
168 |
{ |
169 |
unikey->im = Unikey_IM[i]; |
170 |
|
171 |
- g_value_init(&v, G_TYPE_STRING); |
172 |
- g_value_set_string(&v, Unikey_IMNames[i]); |
173 |
- ibus_config_set_value(config, "engine/Unikey", "InputMethod", &v); |
174 |
+ v = g_variant_new_string(Unikey_IMNames[i]); |
175 |
+ ibus_config_set_value(config, "engine/Unikey", "InputMethod", v); |
176 |
|
177 |
// update label |
178 |
for (j=0; j<unikey->prop_list->properties->len; j++) |
179 |
@@ -391,9 +389,8 @@ |
180 |
{ |
181 |
unikey->oc = Unikey_OC[i]; |
182 |
|
183 |
- g_value_init(&v, G_TYPE_STRING); |
184 |
- g_value_set_string(&v, Unikey_OCNames[i]); |
185 |
- ibus_config_set_value(config, "engine/Unikey", "OutputCharset", &v); |
186 |
+ v = g_variant_new_string(Unikey_OCNames[i]); |
187 |
+ ibus_config_set_value(config, "engine/Unikey", "OutputCharset", v); |
188 |
|
189 |
// update label |
190 |
for (j=0; j<unikey->prop_list->properties->len; j++) |
191 |
@@ -431,9 +428,8 @@ |
192 |
{ |
193 |
unikey->ukopt.spellCheckEnabled = !unikey->ukopt.spellCheckEnabled; |
194 |
|
195 |
- g_value_init(&v, G_TYPE_BOOLEAN); |
196 |
- g_value_set_boolean(&v, unikey->ukopt.spellCheckEnabled); |
197 |
- ibus_config_set_value(config, "engine/Unikey/Options", "SpellCheckEnabled", &v); |
198 |
+ v = g_variant_new_boolean (unikey->ukopt.spellCheckEnabled); |
199 |
+ ibus_config_set_value(config, "engine/Unikey/Options", "SpellCheckEnabled", v); |
200 |
|
201 |
// update state of state |
202 |
for (j = 0; j < unikey->menu_opt->properties->len ; j++) |
203 |
@@ -456,9 +452,8 @@ |
204 |
{ |
205 |
unikey->ukopt.macroEnabled = !unikey->ukopt.macroEnabled; |
206 |
|
207 |
- g_value_init(&v, G_TYPE_BOOLEAN); |
208 |
- g_value_set_boolean(&v, unikey->ukopt.macroEnabled); |
209 |
- ibus_config_set_value(config, "engine/Unikey/Options", "MacroEnabled", &v); |
210 |
+ v = g_variant_new_boolean(unikey->ukopt.macroEnabled); |
211 |
+ ibus_config_set_value(config, "engine/Unikey/Options", "MacroEnabled", v); |
212 |
|
213 |
// update state of state |
214 |
for (j = 0; j < unikey->menu_opt->properties->len ; j++) |
215 |
@@ -481,9 +476,8 @@ |
216 |
{ |
217 |
unikey->mouse_capture = !unikey->mouse_capture; |
218 |
|
219 |
- g_value_init(&v, G_TYPE_BOOLEAN); |
220 |
- g_value_set_boolean(&v, unikey->mouse_capture); |
221 |
- ibus_config_set_value(config, "engine/Unikey/Options", "MouseCapture", &v); |
222 |
+ v = g_variant_new_boolean(unikey->mouse_capture); |
223 |
+ ibus_config_set_value(config, "engine/Unikey/Options", "MouseCapture", v); |
224 |
|
225 |
// update state of state |
226 |
for (j = 0; j < unikey->menu_opt->properties->len ; j++) |
227 |
diff -ru ibus-unikey-0.5.1.orig/src/main.cpp ibus-unikey-0.5.1/src/main.cpp |
228 |
--- ibus-unikey-0.5.1.orig/src/main.cpp 2010-09-12 16:17:47.000000000 +0900 |
229 |
+++ ibus-unikey-0.5.1/src/main.cpp 2011-02-21 09:48:48.188754964 +0900 |
230 |
@@ -58,7 +58,7 @@ |
231 |
for (p = engines; p != NULL; p = p->next) |
232 |
{ |
233 |
IBusEngineDesc* engine = (IBusEngineDesc*)p->data; |
234 |
- ibus_factory_add_engine(factory, engine->name, IBUS_TYPE_UNIKEY_ENGINE); |
235 |
+ ibus_factory_add_engine(factory, ibus_engine_desc_get_name(engine), IBUS_TYPE_UNIKEY_ENGINE); |
236 |
} |
237 |
|
238 |
if (ibus) |
239 |
Only in ibus-unikey-0.5.1.orig/src: unikey.xml.in |
240 |
diff -ru ibus-unikey-0.5.1.orig/src/utils.cpp ibus-unikey-0.5.1/src/utils.cpp |
241 |
--- ibus-unikey-0.5.1.orig/src/utils.cpp 2010-06-12 01:43:48.000000000 +0900 |
242 |
+++ ibus-unikey-0.5.1/src/utils.cpp 2011-02-21 10:04:31.003755036 +0900 |
243 |
@@ -35,20 +35,20 @@ |
244 |
"", |
245 |
PACKAGE_NAME); |
246 |
|
247 |
- engine = ibus_engine_desc_new |
248 |
+ engine = ibus_engine_desc_new_varargs |
249 |
( |
250 |
- "Unikey", |
251 |
- "Unikey", |
252 |
- IU_DESC, |
253 |
- "vi", |
254 |
- "GPLv2", |
255 |
- "Lê Quốc Tuấn <mr.lequoctuan@×××××.com>", |
256 |
- PKGDATADIR"/icons/ibus-unikey.png", |
257 |
- "us" |
258 |
+ "name", "Unikey", |
259 |
+ "longname", "Unikey", |
260 |
+ "description", IU_DESC, |
261 |
+ "language", "vi", |
262 |
+ "license", "GPLv2", |
263 |
+ "author", "Lê Quốc Tuấn <mr.lequoctuan@×××××.com>", |
264 |
+ "icon", PKGDATADIR"/icons/ibus-unikey.png", |
265 |
+ "layout", "us", |
266 |
+ "rank", 99, |
267 |
+ NULL |
268 |
); |
269 |
|
270 |
- engine->rank = 99; |
271 |
- |
272 |
ibus_component_add_engine(component, engine); |
273 |
|
274 |
return component; |