return TRUE;
}
-
-static void
-mim_get_preedit_string (GtkIMContext *context,
- gchar **str,
- PangoAttrList **attrs,
- gint *cursor_pos)
-{
- ComposeSequence *comp_seq;
- gboolean is_initial;
- gchar *string;
- gint len;
-
- is_initial = at_initial_position (context)
- && preceding_possible_final_form == NULL;
-
- comp_seq = find_complete_compose_sequence (compose_buffer);
- if (comp_seq == NULL)
- string = "";
- else
- string = get_appropriate_string (comp_seq, is_initial);
-
- if (preceding_possible_final_form != NULL)
- *str = g_strdup_printf ("%s%s", preceding_possible_final_form->normal,
- string);
- else
- *str = g_strdup (string);
-
- len = strlen (*str);
-
- if (attrs)
- {
- *attrs = pango_attr_list_new ();
-
- if (len != 0)
- {
- PangoAttribute *attr;
- attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
- attr->start_index = 0;
- attr->end_index = len;
- pango_attr_list_insert (*attrs, attr);
- }
- }
-
- if (cursor_pos)
- *cursor_pos = len;
-}
-
-
static void
mim_reset (GtkIMContext *context)
{
clear_compose_buffer ();
preceding_possible_final_form = NULL;
- g_signal_emit_by_name (context, "preedit-changed");
}
{
buf[g_unichar_to_utf8 (uc, buf)] = '\0';
g_signal_emit_by_name (context, "commit", buf);
- g_signal_emit_by_name (context, "preedit-changed");
return TRUE;
}
clear_compose_buffer ();
}
- g_signal_emit_by_name (context, "preedit-changed");
return TRUE;
}
if (find_incomplete_compose_sequence (compose_buffer) != NULL)
{
- g_signal_emit_by_name (context, "preedit-changed");
return TRUE;
}
comp_seq->is_terminator);
clear_compose_buffer ();
preceding_possible_final_form = comp_seq;
- g_signal_emit_by_name (context, "preedit-changed");
return TRUE;
}
else
g_signal_emit_by_name (context, "commit",
get_appropriate_string (comp_seq, is_initial));
clear_compose_buffer ();
- g_signal_emit_by_name (context, "preedit-changed");
return TRUE;
}
}
g_signal_emit_by_name (context, "commit",
get_appropriate_string (comp_seq, is_initial));
clear_compose_buffer ();
- g_signal_emit_by_name (context, "preedit-changed");
}
return mim_filter_keypress (context, event);
mim_class_init (GtkIMContextClass *clazz)
{
clazz->filter_keypress = mim_filter_keypress;
- clazz->get_preedit_string = mim_get_preedit_string;
clazz->reset = mim_reset;
}
void
im_module_init (GTypeModule *module)
{
+ g_debug("mim-immodule imported!");
mim_register_type (module);
}
void
im_module_exit ()
{
+ g_debug("mim-immodule released!");
}
void