forked from enlightenment/efl
efl/ecore_imf: namespace all functions.
SVN revision: 82417
This commit is contained in:
parent
19b5f5a1b5
commit
b7c81581c5
|
@ -64,51 +64,53 @@ struct _Ecore_IMF_Context_Data
|
||||||
};
|
};
|
||||||
|
|
||||||
/* prototype */
|
/* prototype */
|
||||||
Ecore_IMF_Context_Data *imf_context_data_new(void);
|
static Ecore_IMF_Context_Data *_ecore_imf_xim_context_data_new(void);
|
||||||
void imf_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data);
|
static void _ecore_imf_xim_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data);
|
||||||
|
|
||||||
static void add_feedback_attr(Eina_List **attrs,
|
static void _ecore_imf_xim_feedback_attr_add(Eina_List **attrs,
|
||||||
const char *str,
|
const char *str,
|
||||||
XIMFeedback feedback,
|
XIMFeedback feedback,
|
||||||
int start_pos,
|
int start_pos,
|
||||||
int end_pos);
|
int end_pos);
|
||||||
|
|
||||||
static void reinitialize_ic(Ecore_IMF_Context *ctx);
|
static void _ecore_imf_xim_ic_reinitialize(Ecore_IMF_Context *ctx);
|
||||||
static void set_ic_client_window(Ecore_IMF_Context *ctx,
|
static void _ecore_imf_xim_ic_client_window_set(Ecore_IMF_Context *ctx,
|
||||||
Ecore_X_Window window);
|
Ecore_X_Window window);
|
||||||
static int preedit_start_callback(XIC xic,
|
static int _ecore_imf_xim_preedit_start_call(XIC xic,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data);
|
XPointer call_data);
|
||||||
static void preedit_done_callback(XIC xic,
|
static void _ecore_imf_xim_preedit_done_call(XIC xic,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data);
|
XPointer call_data);
|
||||||
static int xim_text_to_utf8(Ecore_IMF_Context *ctx,
|
static void _ecore_imf_xim_preedit_draw_call(XIC xic,
|
||||||
XIMText *xim_text,
|
|
||||||
char **text);
|
|
||||||
static void preedit_draw_callback(XIC xic,
|
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XIMPreeditDrawCallbackStruct *call_data);
|
XIMPreeditDrawCallbackStruct *call_data);
|
||||||
static void preedit_caret_callback(XIC xic,
|
static void _ecore_imf_xim_preedit_caret_call(XIC xic,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XIMPreeditCaretCallbackStruct *call_data);
|
XIMPreeditCaretCallbackStruct *call_data);
|
||||||
static XVaNestedList preedit_callback_set(Ecore_IMF_Context *ctx);
|
|
||||||
static XIC get_ic(Ecore_IMF_Context *ctx);
|
static int _ecore_imf_xim_text_to_utf8(Ecore_IMF_Context *ctx,
|
||||||
static XIM_Im_Info *get_im(Ecore_X_Window window,
|
XIMText *xim_text,
|
||||||
|
char **text);
|
||||||
|
|
||||||
|
static XVaNestedList _ecore_imf_xim_preedit_callback_set(Ecore_IMF_Context *ctx);
|
||||||
|
static XIC _ecore_imf_xim_ic_get(Ecore_IMF_Context *ctx);
|
||||||
|
static XIM_Im_Info *_ecore_imf_xim_im_get(Ecore_X_Window window,
|
||||||
char *locale);
|
char *locale);
|
||||||
static void xim_info_try_im(XIM_Im_Info *info);
|
static void _ecore_imf_xim_info_im_init(XIM_Im_Info *info);
|
||||||
static void xim_info_display_closed(Ecore_X_Display *display,
|
static void _ecore_imf_xim_info_im_shutdown(Ecore_X_Display *display,
|
||||||
int is_error,
|
int is_error,
|
||||||
XIM_Im_Info *info);
|
XIM_Im_Info *info);
|
||||||
static void xim_instantiate_callback(Display *display,
|
static void _ecore_imf_xim_instantiate_cb(Display *display,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data);
|
XPointer call_data);
|
||||||
static void setup_im(XIM_Im_Info *info);
|
static void _ecore_imf_xim_destroy_cb(XIM xim,
|
||||||
static void xim_destroy_callback(XIM xim,
|
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data);
|
XPointer call_data);
|
||||||
|
static void _ecore_imf_xim_im_setup(XIM_Im_Info *info);
|
||||||
|
|
||||||
static unsigned int
|
static unsigned int
|
||||||
utf8_offset_to_index(const char *str, int offset)
|
_ecore_imf_xim_utf8_offset_to_index(const char *str, int offset)
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
int i;
|
int i;
|
||||||
|
@ -127,7 +129,7 @@ _ecore_imf_context_xim_add(Ecore_IMF_Context *ctx)
|
||||||
|
|
||||||
EINA_LOG_DBG("in");
|
EINA_LOG_DBG("in");
|
||||||
|
|
||||||
imf_context_data = imf_context_data_new();
|
imf_context_data = _ecore_imf_xim_context_data_new();
|
||||||
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
||||||
|
|
||||||
imf_context_data->use_preedit = EINA_TRUE;
|
imf_context_data->use_preedit = EINA_TRUE;
|
||||||
|
@ -156,7 +158,7 @@ _ecore_imf_context_xim_del(Ecore_IMF_Context *ctx)
|
||||||
dsp = ecore_x_display_get();
|
dsp = ecore_x_display_get();
|
||||||
XUnregisterIMInstantiateCallback(dsp,
|
XUnregisterIMInstantiateCallback(dsp,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
xim_instantiate_callback,
|
_ecore_imf_xim_instantiate_cb,
|
||||||
(XPointer)imf_context_data->im_info);
|
(XPointer)imf_context_data->im_info);
|
||||||
}
|
}
|
||||||
else if (imf_context_data->im_info->im)
|
else if (imf_context_data->im_info->im)
|
||||||
|
@ -170,9 +172,9 @@ _ecore_imf_context_xim_del(Ecore_IMF_Context *ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_ic_client_window(ctx, 0);
|
_ecore_imf_xim_ic_client_window_set(ctx, 0);
|
||||||
|
|
||||||
imf_context_data_destroy(imf_context_data);
|
_ecore_imf_xim_context_data_destroy(imf_context_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -180,7 +182,7 @@ _ecore_imf_context_xim_client_window_set(Ecore_IMF_Context *ctx,
|
||||||
void *window)
|
void *window)
|
||||||
{
|
{
|
||||||
EINA_LOG_DBG("in");
|
EINA_LOG_DBG("in");
|
||||||
set_ic_client_window(ctx, (Ecore_X_Window)((Ecore_Window)window));
|
_ecore_imf_xim_ic_client_window_set(ctx, (Ecore_X_Window)((Ecore_Window)window));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -244,7 +246,7 @@ _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx
|
||||||
if (new_feedback != last_feedback)
|
if (new_feedback != last_feedback)
|
||||||
{
|
{
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
add_feedback_attr(attrs, *str, last_feedback, start, i);
|
_ecore_imf_xim_feedback_attr_add(attrs, *str, last_feedback, start, i);
|
||||||
|
|
||||||
last_feedback = new_feedback;
|
last_feedback = new_feedback;
|
||||||
start = i;
|
start = i;
|
||||||
|
@ -252,7 +254,7 @@ _ecore_imf_context_xim_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx
|
||||||
}
|
}
|
||||||
|
|
||||||
if (start >= 0)
|
if (start >= 0)
|
||||||
add_feedback_attr(attrs, *str, last_feedback, start, i);
|
_ecore_imf_xim_feedback_attr_add(attrs, *str, last_feedback, start, i);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -402,12 +404,12 @@ _ecore_imf_context_xim_use_preedit_set(Ecore_IMF_Context *ctx,
|
||||||
if (imf_context_data->use_preedit != use_preedit)
|
if (imf_context_data->use_preedit != use_preedit)
|
||||||
{
|
{
|
||||||
imf_context_data->use_preedit = use_preedit;
|
imf_context_data->use_preedit = use_preedit;
|
||||||
reinitialize_ic(ctx);
|
_ecore_imf_xim_ic_reinitialize(ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_feedback_attr(Eina_List **attrs,
|
_ecore_imf_xim_feedback_attr_add(Eina_List **attrs,
|
||||||
const char *str,
|
const char *str,
|
||||||
XIMFeedback feedback,
|
XIMFeedback feedback,
|
||||||
int start_pos,
|
int start_pos,
|
||||||
|
@ -415,8 +417,8 @@ add_feedback_attr(Eina_List **attrs,
|
||||||
{
|
{
|
||||||
Ecore_IMF_Preedit_Attr *attr = NULL;
|
Ecore_IMF_Preedit_Attr *attr = NULL;
|
||||||
|
|
||||||
unsigned int start_index = utf8_offset_to_index(str, start_pos);
|
unsigned int start_index = _ecore_imf_xim_utf8_offset_to_index(str, start_pos);
|
||||||
unsigned int end_index = utf8_offset_to_index(str, end_pos);
|
unsigned int end_index = _ecore_imf_xim_utf8_offset_to_index(str, end_pos);
|
||||||
|
|
||||||
if (feedback & FEEDBACK_MASK)
|
if (feedback & FEEDBACK_MASK)
|
||||||
{
|
{
|
||||||
|
@ -580,7 +582,7 @@ _ecore_imf_context_xim_filter_event(Ecore_IMF_Context *ctx,
|
||||||
if (!imf_context_data) return EINA_FALSE;
|
if (!imf_context_data) return EINA_FALSE;
|
||||||
ic = imf_context_data->ic;
|
ic = imf_context_data->ic;
|
||||||
if (!ic)
|
if (!ic)
|
||||||
ic = get_ic(ctx);
|
ic = _ecore_imf_xim_ic_get(ctx);
|
||||||
|
|
||||||
if (type == ECORE_IMF_EVENT_KEY_DOWN)
|
if (type == ECORE_IMF_EVENT_KEY_DOWN)
|
||||||
{
|
{
|
||||||
|
@ -760,8 +762,8 @@ xim_imf_module_exit(void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
Eina_Bool
|
static Eina_Bool
|
||||||
ecore_imf_xim_init(void)
|
_ecore_imf_xim_init(void)
|
||||||
{
|
{
|
||||||
EINA_LOG_DBG("%s in", __FUNCTION__);
|
EINA_LOG_DBG("%s in", __FUNCTION__);
|
||||||
eina_init();
|
eina_init();
|
||||||
|
@ -773,29 +775,29 @@ ecore_imf_xim_init(void)
|
||||||
return EINA_TRUE;
|
return EINA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
ecore_imf_xim_shutdown(void)
|
_ecore_imf_xim_shutdown(void)
|
||||||
{
|
{
|
||||||
while (open_ims)
|
while (open_ims)
|
||||||
{
|
{
|
||||||
XIM_Im_Info *info = open_ims->data;
|
XIM_Im_Info *info = open_ims->data;
|
||||||
Ecore_X_Display *display = ecore_x_display_get();
|
Ecore_X_Display *display = ecore_x_display_get();
|
||||||
|
|
||||||
xim_info_display_closed(display, EINA_FALSE, info);
|
_ecore_imf_xim_info_im_shutdown(display, EINA_FALSE, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
ecore_x_shutdown();
|
ecore_x_shutdown();
|
||||||
eina_shutdown();
|
eina_shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_MODULE_INIT(ecore_imf_xim_init);
|
EINA_MODULE_INIT(_ecore_imf_xim_init);
|
||||||
EINA_MODULE_SHUTDOWN(ecore_imf_xim_shutdown);
|
EINA_MODULE_SHUTDOWN(_ecore_imf_xim_shutdown);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* internal functions
|
* internal functions
|
||||||
*/
|
*/
|
||||||
Ecore_IMF_Context_Data *
|
static Ecore_IMF_Context_Data *
|
||||||
imf_context_data_new(void)
|
_ecore_imf_xim_context_data_new(void)
|
||||||
{
|
{
|
||||||
Ecore_IMF_Context_Data *imf_context_data = NULL;
|
Ecore_IMF_Context_Data *imf_context_data = NULL;
|
||||||
char *locale;
|
char *locale;
|
||||||
|
@ -813,12 +815,12 @@ imf_context_data_new(void)
|
||||||
|
|
||||||
return imf_context_data;
|
return imf_context_data;
|
||||||
error:
|
error:
|
||||||
imf_context_data_destroy(imf_context_data);
|
_ecore_imf_xim_context_data_destroy(imf_context_data);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
imf_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data)
|
_ecore_imf_xim_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data)
|
||||||
{
|
{
|
||||||
if (!imf_context_data)
|
if (!imf_context_data)
|
||||||
return;
|
return;
|
||||||
|
@ -839,7 +841,7 @@ imf_context_data_destroy(Ecore_IMF_Context_Data *imf_context_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
preedit_start_callback(XIC xic EINA_UNUSED,
|
_ecore_imf_xim_preedit_start_call(XIC xic EINA_UNUSED,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data EINA_UNUSED)
|
XPointer call_data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -858,7 +860,7 @@ preedit_start_callback(XIC xic EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
preedit_done_callback(XIC xic EINA_UNUSED,
|
_ecore_imf_xim_preedit_done_call(XIC xic EINA_UNUSED,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data EINA_UNUSED)
|
XPointer call_data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -886,7 +888,7 @@ preedit_done_callback(XIC xic EINA_UNUSED,
|
||||||
|
|
||||||
/* FIXME */
|
/* FIXME */
|
||||||
static int
|
static int
|
||||||
xim_text_to_utf8(Ecore_IMF_Context *ctx EINA_UNUSED,
|
_ecore_imf_xim_text_to_utf8(Ecore_IMF_Context *ctx EINA_UNUSED,
|
||||||
XIMText *xim_text,
|
XIMText *xim_text,
|
||||||
char **text)
|
char **text)
|
||||||
{
|
{
|
||||||
|
@ -930,7 +932,7 @@ xim_text_to_utf8(Ecore_IMF_Context *ctx EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
preedit_draw_callback(XIC xic EINA_UNUSED,
|
_ecore_imf_xim_preedit_draw_call(XIC xic EINA_UNUSED,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XIMPreeditDrawCallbackStruct *call_data)
|
XIMPreeditDrawCallbackStruct *call_data)
|
||||||
{
|
{
|
||||||
|
@ -954,7 +956,7 @@ preedit_draw_callback(XIC xic EINA_UNUSED,
|
||||||
if (ret == EINA_FALSE) goto done;
|
if (ret == EINA_FALSE) goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
new_text_length = xim_text_to_utf8(ctx, t, &tmp);
|
new_text_length = _ecore_imf_xim_text_to_utf8(ctx, t, &tmp);
|
||||||
if (tmp)
|
if (tmp)
|
||||||
{
|
{
|
||||||
int tmp_len;
|
int tmp_len;
|
||||||
|
@ -1021,7 +1023,7 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
preedit_caret_callback(XIC xic EINA_UNUSED,
|
_ecore_imf_xim_preedit_caret_call(XIC xic EINA_UNUSED,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XIMPreeditCaretCallbackStruct *call_data)
|
XIMPreeditCaretCallbackStruct *call_data)
|
||||||
{
|
{
|
||||||
|
@ -1044,22 +1046,22 @@ preedit_caret_callback(XIC xic EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static XVaNestedList
|
static XVaNestedList
|
||||||
preedit_callback_set(Ecore_IMF_Context *ctx)
|
_ecore_imf_xim_preedit_callback_set(Ecore_IMF_Context *ctx)
|
||||||
{
|
{
|
||||||
Ecore_IMF_Context_Data *imf_context_data;
|
Ecore_IMF_Context_Data *imf_context_data;
|
||||||
imf_context_data = ecore_imf_context_data_get(ctx);
|
imf_context_data = ecore_imf_context_data_get(ctx);
|
||||||
|
|
||||||
imf_context_data->preedit_start_cb.client_data = (XPointer)ctx;
|
imf_context_data->preedit_start_cb.client_data = (XPointer)ctx;
|
||||||
imf_context_data->preedit_start_cb.callback = (XIMProc)preedit_start_callback;
|
imf_context_data->preedit_start_cb.callback = (XIMProc)_ecore_imf_xim_preedit_start_call;
|
||||||
|
|
||||||
imf_context_data->preedit_done_cb.client_data = (XPointer)ctx;
|
imf_context_data->preedit_done_cb.client_data = (XPointer)ctx;
|
||||||
imf_context_data->preedit_done_cb.callback = (XIMProc)preedit_done_callback;
|
imf_context_data->preedit_done_cb.callback = (XIMProc)_ecore_imf_xim_preedit_done_call;
|
||||||
|
|
||||||
imf_context_data->preedit_draw_cb.client_data = (XPointer)ctx;
|
imf_context_data->preedit_draw_cb.client_data = (XPointer)ctx;
|
||||||
imf_context_data->preedit_draw_cb.callback = (XIMProc)preedit_draw_callback;
|
imf_context_data->preedit_draw_cb.callback = (XIMProc)_ecore_imf_xim_preedit_draw_call;
|
||||||
|
|
||||||
imf_context_data->preedit_caret_cb.client_data = (XPointer)ctx;
|
imf_context_data->preedit_caret_cb.client_data = (XPointer)ctx;
|
||||||
imf_context_data->preedit_caret_cb.callback = (XIMProc)preedit_caret_callback;
|
imf_context_data->preedit_caret_cb.callback = (XIMProc)_ecore_imf_xim_preedit_caret_call;
|
||||||
|
|
||||||
return XVaCreateNestedList(0,
|
return XVaCreateNestedList(0,
|
||||||
XNPreeditStartCallback,
|
XNPreeditStartCallback,
|
||||||
|
@ -1074,7 +1076,7 @@ preedit_callback_set(Ecore_IMF_Context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
static XIC
|
static XIC
|
||||||
get_ic(Ecore_IMF_Context *ctx)
|
_ecore_imf_xim_ic_get(Ecore_IMF_Context *ctx)
|
||||||
{
|
{
|
||||||
Ecore_IMF_Context_Data *imf_context_data;
|
Ecore_IMF_Context_Data *imf_context_data;
|
||||||
XIC ic;
|
XIC ic;
|
||||||
|
@ -1156,7 +1158,7 @@ get_ic(Ecore_IMF_Context *ctx)
|
||||||
{
|
{
|
||||||
im_style |= XIMPreeditCallbacks;
|
im_style |= XIMPreeditCallbacks;
|
||||||
im_style |= XIMStatusNothing;
|
im_style |= XIMStatusNothing;
|
||||||
preedit_attr = preedit_callback_set(ctx);
|
preedit_attr = _ecore_imf_xim_preedit_callback_set(ctx);
|
||||||
}
|
}
|
||||||
name = XNPreeditAttributes;
|
name = XNPreeditAttributes;
|
||||||
}
|
}
|
||||||
|
@ -1234,7 +1236,7 @@ get_ic(Ecore_IMF_Context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reinitialize_ic(Ecore_IMF_Context *ctx)
|
_ecore_imf_xim_ic_reinitialize(Ecore_IMF_Context *ctx)
|
||||||
{
|
{
|
||||||
Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
|
Ecore_IMF_Context_Data *imf_context_data = ecore_imf_context_data_get(ctx);
|
||||||
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
||||||
|
@ -1256,7 +1258,7 @@ reinitialize_ic(Ecore_IMF_Context *ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_ic_client_window(Ecore_IMF_Context *ctx,
|
_ecore_imf_xim_ic_client_window_set(Ecore_IMF_Context *ctx,
|
||||||
Ecore_X_Window window)
|
Ecore_X_Window window)
|
||||||
{
|
{
|
||||||
EINA_LOG_DBG("in");
|
EINA_LOG_DBG("in");
|
||||||
|
@ -1266,7 +1268,7 @@ set_ic_client_window(Ecore_IMF_Context *ctx,
|
||||||
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
EINA_SAFETY_ON_NULL_RETURN(imf_context_data);
|
||||||
|
|
||||||
/* reinitialize IC */
|
/* reinitialize IC */
|
||||||
reinitialize_ic(ctx);
|
_ecore_imf_xim_ic_reinitialize(ctx);
|
||||||
|
|
||||||
old_win = imf_context_data->win;
|
old_win = imf_context_data->win;
|
||||||
EINA_LOG_DBG("old_win:%d window:%d ", old_win, window);
|
EINA_LOG_DBG("old_win:%d window:%d ", old_win, window);
|
||||||
|
@ -1285,7 +1287,7 @@ set_ic_client_window(Ecore_IMF_Context *ctx,
|
||||||
if (window) /* XXX */
|
if (window) /* XXX */
|
||||||
{
|
{
|
||||||
XIM_Im_Info *info = NULL;
|
XIM_Im_Info *info = NULL;
|
||||||
info = get_im(window, imf_context_data->locale);
|
info = _ecore_imf_xim_im_get(window, imf_context_data->locale);
|
||||||
imf_context_data->im_info = info;
|
imf_context_data->im_info = info;
|
||||||
imf_context_data->im_info->ics =
|
imf_context_data->im_info->ics =
|
||||||
eina_list_prepend(imf_context_data->im_info->ics,
|
eina_list_prepend(imf_context_data->im_info->ics,
|
||||||
|
@ -1296,7 +1298,7 @@ set_ic_client_window(Ecore_IMF_Context *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
static XIM_Im_Info *
|
static XIM_Im_Info *
|
||||||
get_im(Ecore_X_Window window,
|
_ecore_imf_xim_im_get(Ecore_X_Window window,
|
||||||
char *locale)
|
char *locale)
|
||||||
{
|
{
|
||||||
EINA_LOG_DBG("in");
|
EINA_LOG_DBG("in");
|
||||||
|
@ -1330,13 +1332,13 @@ get_im(Ecore_X_Window window,
|
||||||
info->reconnecting = EINA_FALSE;
|
info->reconnecting = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
xim_info_try_im(info);
|
_ecore_imf_xim_info_im_init(info);
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize info->im */
|
/* initialize info->im */
|
||||||
static void
|
static void
|
||||||
xim_info_try_im(XIM_Im_Info *info)
|
_ecore_imf_xim_info_im_init(XIM_Im_Info *info)
|
||||||
{
|
{
|
||||||
Ecore_X_Display *dsp;
|
Ecore_X_Display *dsp;
|
||||||
|
|
||||||
|
@ -1354,17 +1356,17 @@ xim_info_try_im(XIM_Im_Info *info)
|
||||||
{
|
{
|
||||||
XRegisterIMInstantiateCallback(dsp,
|
XRegisterIMInstantiateCallback(dsp,
|
||||||
NULL, NULL, NULL,
|
NULL, NULL, NULL,
|
||||||
xim_instantiate_callback,
|
_ecore_imf_xim_instantiate_cb,
|
||||||
(XPointer)info);
|
(XPointer)info);
|
||||||
info->reconnecting = EINA_TRUE;
|
info->reconnecting = EINA_TRUE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setup_im(info);
|
_ecore_imf_xim_im_setup(info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xim_info_display_closed(Ecore_X_Display *display EINA_UNUSED,
|
_ecore_imf_xim_info_im_shutdown(Ecore_X_Display *display EINA_UNUSED,
|
||||||
int is_error EINA_UNUSED,
|
int is_error EINA_UNUSED,
|
||||||
XIM_Im_Info *info)
|
XIM_Im_Info *info)
|
||||||
{
|
{
|
||||||
|
@ -1377,13 +1379,13 @@ xim_info_display_closed(Ecore_X_Display *display EINA_UNUSED,
|
||||||
info->ics = NULL;
|
info->ics = NULL;
|
||||||
|
|
||||||
EINA_LIST_FOREACH (ics, tmp_list, ctx)
|
EINA_LIST_FOREACH (ics, tmp_list, ctx)
|
||||||
set_ic_client_window(ctx, 0);
|
_ecore_imf_xim_ic_client_window_set(ctx, 0);
|
||||||
|
|
||||||
EINA_LIST_FREE (ics, ctx)
|
EINA_LIST_FREE (ics, ctx)
|
||||||
{
|
{
|
||||||
Ecore_IMF_Context_Data *imf_context_data;
|
Ecore_IMF_Context_Data *imf_context_data;
|
||||||
imf_context_data = ecore_imf_context_data_get(ctx);
|
imf_context_data = ecore_imf_context_data_get(ctx);
|
||||||
imf_context_data_destroy(imf_context_data);
|
_ecore_imf_xim_context_data_destroy(imf_context_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(info->locale);
|
free(info->locale);
|
||||||
|
@ -1395,7 +1397,7 @@ xim_info_display_closed(Ecore_X_Display *display EINA_UNUSED,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xim_instantiate_callback(Display *display,
|
_ecore_imf_xim_instantiate_cb(Display *display,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data EINA_UNUSED)
|
XPointer call_data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -1411,16 +1413,16 @@ xim_instantiate_callback(Display *display,
|
||||||
}
|
}
|
||||||
|
|
||||||
info->im = im;
|
info->im = im;
|
||||||
setup_im(info);
|
_ecore_imf_xim_im_setup(info);
|
||||||
|
|
||||||
XUnregisterIMInstantiateCallback(display, NULL, NULL, NULL,
|
XUnregisterIMInstantiateCallback(display, NULL, NULL, NULL,
|
||||||
xim_instantiate_callback,
|
_ecore_imf_xim_instantiate_cb,
|
||||||
(XPointer)info);
|
(XPointer)info);
|
||||||
info->reconnecting = EINA_FALSE;
|
info->reconnecting = EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_im(XIM_Im_Info *info)
|
_ecore_imf_xim_im_setup(XIM_Im_Info *info)
|
||||||
{
|
{
|
||||||
XIMValuesList *ic_values = NULL;
|
XIMValuesList *ic_values = NULL;
|
||||||
XIMCallback im_destroy_callback;
|
XIMCallback im_destroy_callback;
|
||||||
|
@ -1429,7 +1431,7 @@ setup_im(XIM_Im_Info *info)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
im_destroy_callback.client_data = (XPointer)info;
|
im_destroy_callback.client_data = (XPointer)info;
|
||||||
im_destroy_callback.callback = (XIMProc)xim_destroy_callback;
|
im_destroy_callback.callback = (XIMProc)_ecore_imf_xim_destroy_cb;
|
||||||
XSetIMValues(info->im,
|
XSetIMValues(info->im,
|
||||||
XNDestroyCallback, &im_destroy_callback,
|
XNDestroyCallback, &im_destroy_callback,
|
||||||
NULL);
|
NULL);
|
||||||
|
@ -1465,7 +1467,7 @@ setup_im(XIM_Im_Info *info)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
xim_destroy_callback(XIM xim EINA_UNUSED,
|
_ecore_imf_xim_destroy_cb(XIM xim EINA_UNUSED,
|
||||||
XPointer client_data,
|
XPointer client_data,
|
||||||
XPointer call_data EINA_UNUSED)
|
XPointer call_data EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -1473,8 +1475,8 @@ xim_destroy_callback(XIM xim EINA_UNUSED,
|
||||||
|
|
||||||
if (info->user) info->user->ic = NULL;
|
if (info->user) info->user->ic = NULL;
|
||||||
info->im = NULL;
|
info->im = NULL;
|
||||||
// reinitialize_ic(ctx);
|
// _ecore_imf_xim_ic_reinitialize(ctx);
|
||||||
xim_info_try_im(info);
|
_ecore_imf_xim_info_im_init(info);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue