2 * GTK+ MiM input module
9 #include <gtk/gtkimcontext.h>
10 #include <gtk/gtkimmodule.h>
11 #include <gdk/gdkkeysyms.h>
14 #include "im-extra-intl.h"
19 mim_filter_keypress(GtkIMContext *context, GdkEventKey *event)
24 if (event->type == GDK_KEY_RELEASE)
27 /* don't filter key events with accelerator modifiers held down */
28 if (event->state & (gtk_accelerator_get_default_mod_mask()
36 mim_set_client_window(GtkIMContext *context,
40 /* create new client window */
41 //mim_mui_create_window();
46 mim_reset(GtkIMContext *context)
51 mim_class_init(GtkIMContextClass *clazz)
53 clazz->filter_keypress = mim_filter_keypress;
54 clazz->reset = mim_reset;
55 clazz->set_client_window = mim_set_client_window;
59 mim_init(GtkIMContext *im_context)
64 mim_register_type(GTypeModule *module)
66 static const GTypeInfo object_info =
68 sizeof(GtkIMContextClass),
70 (GBaseFinalizeFunc) NULL,
71 (GClassInitFunc) mim_class_init,
72 NULL, /* class_finalize */
73 NULL, /* class_data */
76 (GInstanceInitFunc) mim_init,
79 type_mim = g_type_module_register_type(module,
81 "GtkIMContextYiddishNoah",
87 GtkIMContextInfo mim_info =
90 N_("MiM"), /* Human readable name */
91 GETTEXT_PACKAGE, /* Translation domain */
92 LOCALEDIR, /* Dir for bindtextdomain */
93 "zh_CN", /* Languages for which this module is the default */
97 GtkIMContextInfo *info_list[] =
103 im_module_init(GTypeModule *module)
105 g_debug("mim-immodule imported!");
106 mim_register_type(module);
112 g_debug("mim-immodule released!");
116 im_module_list(const GtkIMContextInfo ***contexts,
119 *contexts = info_list;
120 *n_contexts = G_N_ELEMENTS(info_list);
124 im_module_create(const gchar *context_id)
126 if (strcmp(context_id, "mim-n") == 0)
127 return GTK_IM_CONTEXT(g_object_new(type_mim, NULL));