forked from enlightenment/efl
ecore_imf/ibus: fix indentation
This commit is contained in:
parent
505491c47c
commit
478433f0cf
|
@ -80,16 +80,16 @@ utf8_offset_to_index(const char *str, int offset)
|
|||
static int
|
||||
sort_cb(const void *d1, const void *d2)
|
||||
{
|
||||
const Ecore_IMF_Preedit_Attr *attr1 = d1;
|
||||
const Ecore_IMF_Preedit_Attr *attr2 = d2;
|
||||
const Ecore_IMF_Preedit_Attr *attr1 = d1;
|
||||
const Ecore_IMF_Preedit_Attr *attr2 = d2;
|
||||
|
||||
if (!attr1) return 1;
|
||||
if (!attr2) return -1;
|
||||
if (!attr1) return 1;
|
||||
if (!attr2) return -1;
|
||||
|
||||
if (attr1->start_index < attr2->start_index)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
if (attr1->start_index < attr2->start_index)
|
||||
return -1;
|
||||
else
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -233,44 +233,44 @@ _request_surrounding_text(IBusIMContext *ibusimcontext)
|
|||
EINA_SAFETY_ON_NULL_RETURN(ibusimcontext->ibuscontext);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ibusimcontext->ctx);
|
||||
|
||||
if ((ibusimcontext->caps & IBUS_CAP_SURROUNDING_TEXT) != 0 &&
|
||||
ibus_input_context_needs_surrounding_text(ibusimcontext->ibuscontext))
|
||||
{
|
||||
char *surrounding = NULL;
|
||||
int cursor_pos;
|
||||
IBusText *ibustext;
|
||||
if ((ibusimcontext->caps & IBUS_CAP_SURROUNDING_TEXT) != 0 &&
|
||||
ibus_input_context_needs_surrounding_text(ibusimcontext->ibuscontext))
|
||||
{
|
||||
char *surrounding = NULL;
|
||||
int cursor_pos;
|
||||
IBusText *ibustext;
|
||||
|
||||
EINA_LOG_DBG ("requesting surrounding text...\n");
|
||||
EINA_LOG_DBG ("requesting surrounding text...\n");
|
||||
|
||||
if (ecore_imf_context_surrounding_get(ibusimcontext->ctx,
|
||||
&surrounding,
|
||||
&cursor_pos))
|
||||
{
|
||||
if (!surrounding)
|
||||
return;
|
||||
if (ecore_imf_context_surrounding_get(ibusimcontext->ctx,
|
||||
&surrounding,
|
||||
&cursor_pos))
|
||||
{
|
||||
if (!surrounding)
|
||||
return;
|
||||
|
||||
if (cursor_pos < 0)
|
||||
{
|
||||
free(surrounding);
|
||||
return;
|
||||
}
|
||||
if (cursor_pos < 0)
|
||||
{
|
||||
free(surrounding);
|
||||
return;
|
||||
}
|
||||
|
||||
ibustext = ibus_text_new_from_string(surrounding);
|
||||
ibustext = ibus_text_new_from_string(surrounding);
|
||||
|
||||
ibus_input_context_set_surrounding_text(ibusimcontext->ibuscontext,
|
||||
ibustext,
|
||||
cursor_pos,
|
||||
cursor_pos);
|
||||
ibus_input_context_set_surrounding_text(ibusimcontext->ibuscontext,
|
||||
ibustext,
|
||||
cursor_pos,
|
||||
cursor_pos);
|
||||
|
||||
free(surrounding);
|
||||
}
|
||||
else
|
||||
{
|
||||
ibusimcontext->caps &= ~IBUS_CAP_SURROUNDING_TEXT;
|
||||
ibus_input_context_set_capabilities(ibusimcontext->ibuscontext,
|
||||
ibusimcontext->caps);
|
||||
}
|
||||
}
|
||||
free(surrounding);
|
||||
}
|
||||
else
|
||||
{
|
||||
ibusimcontext->caps &= ~IBUS_CAP_SURROUNDING_TEXT;
|
||||
ibus_input_context_set_capabilities(ibusimcontext->ibuscontext,
|
||||
ibusimcontext->caps);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IBusIMContext *
|
||||
|
|
|
@ -59,8 +59,8 @@ static Ecore_IMF_Context_Class ibus_imf_class = {
|
|||
NULL
|
||||
};
|
||||
|
||||
static Ecore_IMF_Context *im_module_create (void);
|
||||
static Ecore_IMF_Context *im_module_exit (void);
|
||||
static Ecore_IMF_Context *im_module_create(void);
|
||||
static Ecore_IMF_Context *im_module_exit(void);
|
||||
|
||||
static Eina_Bool
|
||||
im_module_init(void)
|
||||
|
@ -73,10 +73,10 @@ im_module_init(void)
|
|||
if (strcmp(s, "x11")) return EINA_FALSE;
|
||||
}
|
||||
ecore_main_loop_glib_integrate();
|
||||
ibus_init();
|
||||
ecore_imf_module_register(&ibus_im_info, im_module_create, im_module_exit);
|
||||
ibus_init();
|
||||
ecore_imf_module_register(&ibus_im_info, im_module_create, im_module_exit);
|
||||
|
||||
return EINA_TRUE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static void im_module_shutdown(void)
|
||||
|
@ -86,31 +86,31 @@ static void im_module_shutdown(void)
|
|||
static Ecore_IMF_Context *
|
||||
im_module_exit(void)
|
||||
{
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static Ecore_IMF_Context *
|
||||
im_module_create(void)
|
||||
{
|
||||
Ecore_IMF_Context *ctx = NULL;
|
||||
IBusIMContext *ctxd = NULL;
|
||||
Ecore_IMF_Context *ctx = NULL;
|
||||
IBusIMContext *ctxd = NULL;
|
||||
|
||||
ctxd = ecore_imf_context_ibus_new();
|
||||
if (!ctxd)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
ctxd = ecore_imf_context_ibus_new();
|
||||
if (!ctxd)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ctx = ecore_imf_context_new(&ibus_imf_class);
|
||||
if (!ctx)
|
||||
{
|
||||
free(ctxd);
|
||||
return NULL;
|
||||
}
|
||||
ctx = ecore_imf_context_new(&ibus_imf_class);
|
||||
if (!ctx)
|
||||
{
|
||||
free(ctxd);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ecore_imf_context_data_set(ctx, ctxd);
|
||||
ecore_imf_context_data_set(ctx, ctxd);
|
||||
|
||||
return ctx;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
EINA_MODULE_INIT(im_module_init);
|
||||
|
|
Loading…
Reference in New Issue