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

Side by Side Diff: src/main.c

Issue 5535007: ibus-chewing: Support IBus-1.4 API. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/ibus-chewing.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/IBusChewingEngine-def.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 /* vim:set et sts=4: */ 1 /* vim:set et sts=4: */
2 /* 2 /*
3 * Copyright © 2009 Red Hat, Inc. All rights reserved. 3 * Copyright © 2009 Red Hat, Inc. All rights reserved.
4 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com> 4 * Copyright © 2009 Ding-Yi Chen <dchen at redhat.com>
5 * 5 *
6 * This file is part of the ibus-chewing Project. 6 * This file is part of the ibus-chewing Project.
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2 10 * as published by the Free Software Foundation; either version 2
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 gpointer user_data) 52 gpointer user_data)
53 { 53 {
54 g_debug ("bus disconnected"); 54 g_debug ("bus disconnected");
55 ibus_quit (); 55 ibus_quit ();
56 } 56 }
57 57
58 58
59 static void 59 static void
60 start_component (void) 60 start_component (void)
61 { 61 {
62 ibus_init();
62 bus = ibus_bus_new (); 63 bus = ibus_bus_new ();
63 g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NU LL); 64 g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NU LL);
64 iConfig = ibus_bus_get_config (bus); 65 iConfig = ibus_bus_get_config (bus);
65 if (iConfig) 66 if (iConfig)
66 g_object_ref_sink (iConfig); 67 g_object_ref_sink (iConfig);
67 68
68 IBusConnection *iConnection=ibus_bus_get_connection (bus); 69 factory = ibus_factory_new (ibus_bus_get_connection (bus));
69 factory = ibus_factory_new (iConnection);
70 ibus_factory_add_engine (factory, "chewing", IBUS_TYPE_CHEWING_ENGINE); 70 ibus_factory_add_engine (factory, "chewing", IBUS_TYPE_CHEWING_ENGINE);
71 71
72 if (ibus) { 72 if (ibus) {
73 ibus_bus_request_name (bus, "org.freedesktop.IBus.Chewing", 0); 73 ibus_bus_request_name (bus, "org.freedesktop.IBus.Chewing", 0);
74 }else { 74 }else {
75 IBusComponent *component; 75 IBusComponent *component;
76 // component = ibus_component_new_from_file ( DATADIR "/ibus/component/ch ewing.xml"); 76 // component = ibus_component_new_from_file ( DATADIR "/ibus/component/ch ewing.xml");
77 component=ibus_component_new("org.freedesktop.IBus.Chewing", 77 component=ibus_component_new("org.freedesktop.IBus.Chewing",
78 _("Chewing component"), PKGDATADIR, "GPLv2+", 78 _("Chewing component"), PKGDATADIR, "GPLv2+",
79 _("Peng Huang, Ding-Yi Chen"), 79 _("Peng Huang, Ding-Yi Chen"),
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 148
149 if (!g_option_context_parse (context, &argc, &argv, &error)) { 149 if (!g_option_context_parse (context, &argc, &argv, &error)) {
150 g_print ("Option parsing failed: %s\n", error->message); 150 g_print ("Option parsing failed: %s\n", error->message);
151 exit (-1); 151 exit (-1);
152 } 152 }
153 153
154 g_option_context_free (context); 154 g_option_context_free (context);
155 start_component (); 155 start_component ();
156 return 0; 156 return 0;
157 } 157 }
OLDNEW
« no previous file with comments | « src/IBusChewingEngine-def.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698