From: Alsor Zhou Date: Mon, 26 Oct 2009 05:47:48 +0000 (+0800) Subject: Remove pre-edit editing from source X-Git-Url: http://git.maemo.org/git/?p=mim;a=commitdiff_plain;h=87812583e0e004dc0d2aea248ceb9dba2fd05aa7 Remove pre-edit editing from source --- diff --git a/src/ui/mim-immodule.c b/src/ui/mim-immodule.c index b2ef13e..91c3b75 100644 --- a/src/ui/mim-immodule.c +++ b/src/ui/mim-immodule.c @@ -243,60 +243,11 @@ at_initial_position (GtkIMContext *context) 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"); } @@ -311,7 +262,6 @@ no_sequence_matches (GtkIMContext *context, GdkEventKey *event) { 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; } @@ -357,7 +307,6 @@ mim_filter_keypress (GtkIMContext *context, clear_compose_buffer (); } - g_signal_emit_by_name (context, "preedit-changed"); return TRUE; } @@ -366,7 +315,6 @@ mim_filter_keypress (GtkIMContext *context, if (find_incomplete_compose_sequence (compose_buffer) != NULL) { - g_signal_emit_by_name (context, "preedit-changed"); return TRUE; } @@ -379,7 +327,6 @@ mim_filter_keypress (GtkIMContext *context, comp_seq->is_terminator); clear_compose_buffer (); preceding_possible_final_form = comp_seq; - g_signal_emit_by_name (context, "preedit-changed"); return TRUE; } else @@ -389,7 +336,6 @@ mim_filter_keypress (GtkIMContext *context, 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; } } @@ -415,7 +361,6 @@ mim_filter_keypress (GtkIMContext *context, 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); @@ -431,7 +376,6 @@ static void mim_class_init (GtkIMContextClass *clazz) { clazz->filter_keypress = mim_filter_keypress; - clazz->get_preedit_string = mim_get_preedit_string; clazz->reset = mim_reset; } @@ -484,12 +428,14 @@ static const GtkIMContextInfo *info_list[] = 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