-
-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;
-}
-
-