1 /* vim:set et sts=4: */
11 static IBusBus *bus = NULL;
12 static IBusFactory *factory = NULL;
15 static gboolean ibus = FALSE;
16 static gboolean verbose = FALSE;
18 static const GOptionEntry entries[] =
20 { "ibus", 'i', 0, G_OPTION_ARG_NONE, &ibus, "component is executed by ibus", NULL },
21 { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "verbose", NULL },
27 ibus_disconnected_cb (IBusBus *bus,
30 g_debug ("bus disconnected");
36 start_component (void)
38 IBusComponent *component;
42 bus = ibus_bus_new ();
43 g_signal_connect (bus, "disconnected", G_CALLBACK (ibus_disconnected_cb), NULL);
45 ibus_hangul_init (bus);
47 component = ibus_component_new ("org.freedesktop.IBus.Hangul",
48 N_("Hangul input method"),
51 "Peng Huang <shawn.p.huang@gmail.com>",
52 "http://code.google.com/p/ibus/",
55 ibus_component_add_engine (component,
56 ibus_engine_desc_new ("hangul",
57 N_("Hangul Input Method"),
58 N_("Hangul Input Method"),
61 "Peng Huang <shawn.p.huang@gmail.com>",
62 PKGDATADIR"/icon/ibus-hangul.svg",
65 factory = ibus_factory_new (ibus_bus_get_connection (bus));
67 ibus_factory_add_engine (factory, "hangul", IBUS_TYPE_HANGUL_ENGINE);
70 ibus_bus_request_name (bus, "org.freedesktop.IBus.Hangul", 0);
73 ibus_bus_register_component (bus, component);
76 g_object_unref (component);
84 main (gint argc, gchar **argv)
87 GOptionContext *context;
89 setlocale (LC_ALL, "");
91 context = g_option_context_new ("- ibus hangul engine component");
93 g_option_context_add_main_entries (context, entries, "ibus-hangul");
95 if (!g_option_context_parse (context, &argc, &argv, &error)) {
96 g_print ("Option parsing failed: %s\n", error->message);