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,
22 if (event->type == GDK_KEY_RELEASE)
25 /* don't filter key events with accelerator modifiers held down */
26 // if (event->state & (gtk_accelerator_get_default_mod_mask()
27 // & ~GDK_SHIFT_MASK))
34 mim_set_client_window(GtkIMContext *context,
38 /*TODO: create new client window */
39 //mim_mui_create_window();
44 mim_reset(GtkIMContext *context)
49 mim_class_init(GtkIMContextClass *clazz)
51 clazz->filter_keypress = mim_filter_keypress;
52 clazz->reset = mim_reset;
53 clazz->set_client_window = mim_set_client_window;
57 mim_init(GtkIMContext *im_context)
62 mim_register_type(GTypeModule *module)
64 static const GTypeInfo object_info =
66 sizeof(GtkIMContextClass),
68 (GBaseFinalizeFunc) NULL,
69 (GClassInitFunc) mim_class_init,
70 NULL, /* class_finalize */
71 NULL, /* class_data */
74 (GInstanceInitFunc) mim_init,
77 type_mim = g_type_module_register_type(module,
79 "GtkIMContextYiddishNoah",
85 GtkIMContextInfo mim_info =
88 N_("MiM"), /* Human readable name */
89 GETTEXT_PACKAGE, /* Translation domain */
90 LOCALEDIR, /* Dir for bindtextdomain */
91 "zh_CN", /* Languages for which this module is the default */
95 GtkIMContextInfo *info_list[] =
101 im_module_init(GTypeModule *module)
103 g_debug("mim-immodule imported!");
104 mim_register_type(module);
105 /*TODO: Mask off the accelerators, except the CTRL (need for CTRL
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") == 0)
127 return GTK_IM_CONTEXT(g_object_new(type_mim, NULL));