Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/xkbutil.c

Issue 5449001: ibus-xkb-layouts: Support ibus-1.4. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/ibus-xkb-layouts.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/main.c ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <string.h> 1 #include <string.h>
2 #include <glib.h> 2 #include <glib.h>
3 #include "xkbutil.h" 3 #include "xkbutil.h"
4 4
5 #ifndef XKB_RULES_XML_FILE 5 #ifndef XKB_RULES_XML_FILE
6 #define XKB_RULES_XML_FILE "/usr/share/X11/xkb/rules/evdev.xml" 6 #define XKB_RULES_XML_FILE "/usr/share/X11/xkb/rules/evdev.xml"
7 #endif 7 #endif
8 8
9 static IBusEngineDesc * 9 static IBusEngineDesc *
10 ibus_xkb_engine_new (gchar *layout, 10 ibus_xkb_engine_new (gchar *layout,
(...skipping 15 matching lines...) Expand all
26 26
27 if (variant && *variant) { 27 if (variant && *variant) {
28 engine_layout = g_strdup_printf ("%s(%s)", layout, variant); 28 engine_layout = g_strdup_printf ("%s(%s)", layout, variant);
29 } 29 }
30 30
31 /* Adds special hotkey on Japanese keyboard to activate English input. */ 31 /* Adds special hotkey on Japanese keyboard to activate English input. */
32 if (g_strcmp0(language, "jpn") == 0) { 32 if (g_strcmp0(language, "jpn") == 0) {
33 engine_hotkeys = "Muhenkan"; 33 engine_hotkeys = "Muhenkan";
34 } 34 }
35 35
36 /* set default rank to 0 */
37 gint rank = 0;
38 if (g_strcmp0(layout, "us") == 0 && (!variant || !*variant)) {
39 rank = 100;
40 }
41
42 #if IBUS_CHECK_VERSION(1, 3, 99)
43 engine = ibus_engine_desc_new_varargs("name", engine_name,
44 "longname", (engine_longname ? engine_ longname : layout_desc),
45 "language", language,
46 "layout", (engine_layout ? engine_layo ut : layout),
47 "hotkeys", engine_hotkeys,
48 "rank", rank,
49 NULL);
50 #else
36 engine = ibus_engine_desc_new2(engine_name, 51 engine = ibus_engine_desc_new2(engine_name,
37 engine_longname ? engine_longname : layout_de sc, 52 engine_longname ? engine_longname : layout_de sc,
38 "", 53 "",
39 language, 54 language,
40 "", 55 "",
41 "", 56 "",
42 "", 57 "",
43 engine_layout ? engine_layout : layout, 58 engine_layout ? engine_layout : layout,
44 engine_hotkeys); 59 engine_hotkeys);
45 60 engine->rank = rank;
46 /* set default rank to 0 */ 61 #endif
47 engine->rank = 0;
48
49 if (g_strcmp0(layout, "us") == 0 && (!variant || !*variant)) {
50 engine->rank = 100;
51 }
52 62
53 g_free (engine_name); 63 g_free (engine_name);
54 g_free (engine_longname); 64 g_free (engine_longname);
55 g_free (engine_layout); 65 g_free (engine_layout);
56 66
57 return engine; 67 return engine;
58 } 68 }
59 69
60 static GList * 70 static GList *
61 ibus_xkb_create_engines (GList *engines, 71 ibus_xkb_create_engines (GList *engines,
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 235
226 engines = ibus_xkb_list_engines (); 236 engines = ibus_xkb_list_engines ();
227 237
228 for (p = engines; p != NULL; p = p->next) { 238 for (p = engines; p != NULL; p = p->next) {
229 ibus_component_add_engine (component, (IBusEngineDesc *) p->data); 239 ibus_component_add_engine (component, (IBusEngineDesc *) p->data);
230 } 240 }
231 241
232 g_list_free (engines); 242 g_list_free (engines);
233 return component; 243 return component;
234 } 244 }
OLDNEW
« no previous file with comments | « src/main.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698