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

Side by Side Diff: src/main.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 | « no previous file | src/xkbutil.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <ibus.h> 1 #include <ibus.h>
2 #include <locale.h> 2 #include <locale.h>
3 #include <stdio.h> 3 #include <stdio.h>
4 #include <stdlib.h> 4 #include <stdlib.h>
5 #include "engine.h" 5 #include "engine.h"
6 #include "xkbutil.h" 6 #include "xkbutil.h"
7 7
8 static IBusBus *bus = NULL; 8 static IBusBus *bus = NULL;
9 static IBusFactory *factory = NULL; 9 static IBusFactory *factory = NULL;
10 10
(...skipping 30 matching lines...) Expand all
41 bus = ibus_bus_new (); 41 bus = ibus_bus_new ();
42 g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NU LL); 42 g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NU LL);
43 43
44 component = ibus_xkb_get_component (); 44 component = ibus_xkb_get_component ();
45 45
46 factory = ibus_factory_new (ibus_bus_get_connection (bus)); 46 factory = ibus_factory_new (ibus_bus_get_connection (bus));
47 47
48 engines = ibus_component_get_engines (component); 48 engines = ibus_component_get_engines (component);
49 for (p = engines; p != NULL; p = p->next) { 49 for (p = engines; p != NULL; p = p->next) {
50 IBusEngineDesc *engine = (IBusEngineDesc *)p->data; 50 IBusEngineDesc *engine = (IBusEngineDesc *)p->data;
51 #if IBUS_CHECK_VERSION(1, 3, 99)
52 ibus_factory_add_engine (factory, ibus_engine_desc_get_name(engine), IBU S_TYPE_XKB_LAYOUT_ENGINE);
53 #else
51 ibus_factory_add_engine (factory, engine->name, IBUS_TYPE_XKB_LAYOUT_ENG INE); 54 ibus_factory_add_engine (factory, engine->name, IBUS_TYPE_XKB_LAYOUT_ENG INE);
55 #endif
52 } 56 }
53 57
54 if (ibus) { 58 if (ibus) {
55 ibus_bus_request_name (bus, "org.freedesktop.IBus.XKBLayouts", 0); 59 ibus_bus_request_name (bus, "org.freedesktop.IBus.XKBLayouts", 0);
56 } 60 }
57 else { 61 else {
58 ibus_bus_register_component (bus, component); 62 ibus_bus_register_component (bus, component);
59 } 63 }
60 64
61 g_object_unref (component); 65 g_object_unref (component);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 104 }
101 105
102 if (xml) { 106 if (xml) {
103 print_engines_xml (); 107 print_engines_xml ();
104 exit (0); 108 exit (0);
105 } 109 }
106 110
107 start_component (); 111 start_component ();
108 return 0; 112 return 0;
109 } 113 }
OLDNEW
« no previous file with comments | « no previous file | src/xkbutil.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698