static void _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos) { EINA_LOG_DBG("in"); #ifdef ENABLE_XIM Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); _ecore_imf_context_xim_preedit_string_get(ctx, str, cursor_pos); if (!attrs) return; if (!imf_context_data || !imf_context_data->feedbacks) return; int i = 0; XIMFeedback last_feedback = 0; int start = -1; for (i = 0; i < imf_context_data->preedit_length; i++) { XIMFeedback new_feedback = imf_context_data->feedbacks[i] & FEEDBACK_MASK; if (new_feedback != last_feedback) { if (start >= 0) add_feedback_attr(attrs, *str, last_feedback, start, i); last_feedback = new_feedback; start = i; } } if (start >= 0) add_feedback_attr(attrs, *str, last_feedback, start, i); #else (void)ctx; if (str) *str = NULL; if (attrs) *attrs = NULL; if (cursor_pos) *cursor_pos = 0; #endif }
static void _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char **str, Eina_List **attrs, int *cursor_pos) { Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx); DBG("ctx=%p, imf_context_data=%p, str=%p, attrs=%p, cursor_pos=%p", ctx, imf_context_data, str, attrs, cursor_pos); _ecore_imf_context_xim_preedit_string_get(ctx, str, cursor_pos); if (!attrs) return; if (!imf_context_data || !imf_context_data->feedbacks) return; int i = 0; XIMFeedback last_feedback = 0; int start = -1; for (i = 0; i < imf_context_data->preedit_length; i++) { XIMFeedback new_feedback = imf_context_data->feedbacks[i] & FEEDBACK_MASK; if (new_feedback != last_feedback) { if (start >= 0) _ecore_imf_xim_feedback_attr_add(attrs, *str, last_feedback, start, i); last_feedback = new_feedback; start = i; } } if (start >= 0) _ecore_imf_xim_feedback_attr_add(attrs, *str, last_feedback, start, i); }