id = getenv("ECORE_IMF_MODULE");
if (id)
{
- if (strcmp(id, "none") == 0) return NULL;
- if (ecore_imf_module_get(id)) return id;
+ if (strcmp(id, "none") == 0) return NULL;
+ if (ecore_imf_module_get(id)) return id;
}
modules = ecore_imf_module_available_get();
EINA_LIST_FREE(modules, module)
{
- if (canvas_type &&
- strcmp(module->info->canvas_type, canvas_type) == 0)
- continue;
-
- const char *p = module->info->default_locales;
- while (p)
- {
- const char *q = strchr(p, ':');
- int goodness = _ecore_imf_context_match_locale(locale, p, q ? (size_t)(q - p) : strlen (p));
-
- if (goodness > best_goodness)
- {
- id = module->info->id;
- best_goodness = goodness;
- }
-
- p = q ? q + 1 : NULL;
- }
+ if (canvas_type &&
+ strcmp(module->info->canvas_type, canvas_type) == 0)
+ continue;
+
+ const char *p = module->info->default_locales;
+ while (p)
+ {
+ const char *q = strchr(p, ':');
+ int goodness = _ecore_imf_context_match_locale(locale, p, q ? (size_t)(q - p) : strlen (p));
+
+ if (goodness > best_goodness)
+ {
+ id = module->info->id;
+ best_goodness = goodness;
+ }
+
+ p = q ? q + 1 : NULL;
+ }
}
free(locale);
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_info_get");
- return NULL;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_info_get");
+ return NULL;
}
return ctx->module->info;
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_del");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_del");
+ return;
}
if (ctx->klass->del) ctx->klass->del(ctx);
ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_client_window_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_client_window_set");
+ return;
}
if (ctx->klass->client_window_set) ctx->klass->client_window_set(ctx, window);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_client_canvas_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_client_canvas_set");
+ return;
}
if (ctx->klass->client_canvas_set) ctx->klass->client_canvas_set(ctx, canvas);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_show");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_show");
+ return;
}
if (ctx->klass->show) ctx->klass->show(ctx);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_hide");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_hide");
+ return;
}
if (ctx->klass->hide) ctx->klass->hide(ctx);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_preedit_string_get");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_preedit_string_get");
+ return;
}
if (ctx->klass->preedit_string_get)
ctx->klass->preedit_string_get(ctx, str, cursor_pos);
else
{
- if (str) *str = strdup("");
- if (cursor_pos) *cursor_pos = 0;
+ if (str) *str = strdup("");
+ if (cursor_pos) *cursor_pos = 0;
}
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_focus_in");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_focus_in");
+ return;
}
if (ctx->klass->focus_in) ctx->klass->focus_in(ctx);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_focus_out");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_focus_out");
+ return;
}
if (ctx->klass->focus_out) ctx->klass->focus_out(ctx);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_reset");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_reset");
+ return;
}
if (ctx->klass->reset) ctx->klass->reset(ctx);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_cursor_position_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_cursor_position_set");
+ return;
}
if (ctx->klass->cursor_position_set) ctx->klass->cursor_position_set(ctx, cursor_pos);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_use_preedit_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_use_preedit_set");
+ return;
}
if (ctx->klass->use_preedit_set) ctx->klass->use_preedit_set(ctx, use_preedit);
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_retrieve_surrounding_callback_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_retrieve_surrounding_callback_set");
+ return;
}
ctx->retrieve_surrounding_func = func;
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_mode_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_mode_set");
+ return;
}
if (ctx->klass->input_mode_set) ctx->klass->input_mode_set(ctx, input_mode);
ctx->input_mode = input_mode;
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_mode_set");
- return 0;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_mode_set");
+ return 0;
}
return ctx->input_mode;
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_filter_event");
- return EINA_FALSE;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_filter_event");
+ return EINA_FALSE;
}
if (ctx->klass->filter_event) return ctx->klass->filter_event(ctx, type, event);
return EINA_FALSE;
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_data_set");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_data_set");
+ return;
}
ctx->data = data;
}
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_data_get");
- return NULL;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_data_get");
+ return NULL;
}
return ctx->data;
}
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_surrounding_get");
- return EINA_FALSE;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_surrounding_get");
+ return EINA_FALSE;
}
if (ctx->retrieve_surrounding_func)
{
- result = ctx->retrieve_surrounding_func(ctx->retrieve_surrounding_data, ctx, text, cursor_pos);
- if (!result)
- {
- if (text) *text = NULL;
- if (cursor_pos) *cursor_pos = 0;
- }
+ result = ctx->retrieve_surrounding_func(ctx->retrieve_surrounding_data, ctx, text, cursor_pos);
+ if (!result)
+ {
+ if (text) *text = NULL;
+ if (cursor_pos) *cursor_pos = 0;
+ }
}
return result;
}
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_preedit_start_event_add");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_preedit_start_event_add");
+ return;
}
ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Start));
ev->ctx = ctx;
ecore_event_add(ECORE_IMF_EVENT_PREEDIT_START,
- ev, _ecore_imf_event_free_preedit, NULL);
+ ev, _ecore_imf_event_free_preedit, NULL);
}
/**
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_preedit_end_event_add");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_preedit_end_event_add");
+ return;
}
ev = malloc(sizeof(Ecore_IMF_Event_Preedit_End));
ev->ctx = ctx;
ecore_event_add(ECORE_IMF_EVENT_PREEDIT_END,
- ev, _ecore_imf_event_free_preedit, NULL);
+ ev, _ecore_imf_event_free_preedit, NULL);
}
/**
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_preedit_changed_event_add");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_preedit_changed_event_add");
+ return;
}
ev = malloc(sizeof(Ecore_IMF_Event_Preedit_Changed));
ev->ctx = ctx;
ecore_event_add(ECORE_IMF_EVENT_PREEDIT_CHANGED,
- ev, _ecore_imf_event_free_preedit, NULL);
+ ev, _ecore_imf_event_free_preedit, NULL);
}
static void
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_commit_event_add");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_commit_event_add");
+ return;
}
ev = malloc(sizeof(Ecore_IMF_Event_Commit));
ev->ctx = ctx;
ev->str = str ? strdup(str) : NULL;
ecore_event_add(ECORE_IMF_EVENT_COMMIT,
- ev, _ecore_imf_event_free_commit, NULL);
+ ev, _ecore_imf_event_free_commit, NULL);
}
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_delete_surrounding_event_add");
- return;
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_delete_surrounding_event_add");
+ return;
}
ev = malloc(sizeof(Ecore_IMF_Event_Delete_Surrounding));
ev->offset = offset;
ev->n_chars = n_chars;
ecore_event_add(ECORE_IMF_EVENT_DELETE_SURROUNDING,
- ev, _ecore_imf_event_free_delete_surrounding, NULL);
+ ev, _ecore_imf_event_free_delete_surrounding, NULL);
}
/* Converts the Evas modifiers to Ecore_IMF keyboard modifiers */
static void
_ecore_imf_evas_event_modifiers_wrap(Evas_Modifier *evas_modifiers,
- Ecore_IMF_Keyboard_Modifiers *imf_keyboard_modifiers)
+ Ecore_IMF_Keyboard_Modifiers *imf_keyboard_modifiers)
{
if (!evas_modifiers || !imf_keyboard_modifiers)
return;
/* Converts the Evas locks to Ecore_IMF keyboard locks */
static void
_ecore_imf_evas_event_locks_wrap(Evas_Lock *evas_locks,
- Ecore_IMF_Keyboard_Locks *imf_keyboard_locks)
+ Ecore_IMF_Keyboard_Locks *imf_keyboard_locks)
{
if (!evas_locks || !imf_keyboard_locks)
return;
/* Converts the Evas mouse flags to Ecore_IMF mouse flags */
static void
_ecore_imf_evas_event_mouse_flags_wrap(Evas_Button_Flags evas_flags,
- Ecore_IMF_Mouse_Flags *imf_flags)
+ Ecore_IMF_Mouse_Flags *imf_flags)
{
if (!imf_flags)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_in_wrap(Evas_Event_Mouse_In *evas_event,
- Ecore_IMF_Event_Mouse_In *imf_event)
+ Ecore_IMF_Event_Mouse_In *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_out_wrap(Evas_Event_Mouse_Out *evas_event,
- Ecore_IMF_Event_Mouse_Out *imf_event)
+ Ecore_IMF_Event_Mouse_Out *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_move_wrap(Evas_Event_Mouse_Move *evas_event,
- Ecore_IMF_Event_Mouse_Move *imf_event)
+ Ecore_IMF_Event_Mouse_Move *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_down_wrap(Evas_Event_Mouse_Down *evas_event,
- Ecore_IMF_Event_Mouse_Down *imf_event)
+ Ecore_IMF_Event_Mouse_Down *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_up_wrap(Evas_Event_Mouse_Up *evas_event,
- Ecore_IMF_Event_Mouse_Up *imf_event)
+ Ecore_IMF_Event_Mouse_Up *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_mouse_wheel_wrap(Evas_Event_Mouse_Wheel *evas_event,
- Ecore_IMF_Event_Mouse_Wheel *imf_event)
+ Ecore_IMF_Event_Mouse_Wheel *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_key_down_wrap(Evas_Event_Key_Down *evas_event,
- Ecore_IMF_Event_Key_Down *imf_event)
+ Ecore_IMF_Event_Key_Down *imf_event)
{
if (!evas_event || !imf_event)
return;
*/
EAPI void
ecore_imf_evas_event_key_up_wrap(Evas_Event_Key_Up *evas_event,
- Ecore_IMF_Event_Key_Up *imf_event)
+ Ecore_IMF_Event_Key_Up *imf_event)
{
imf_event->keyname = evas_event->keyname ? evas_event->keyname : _ecore_imf_evas_event_empty;
imf_event->key = evas_event->key ? evas_event->key : _ecore_imf_evas_event_empty;
if (modifiers & ECORE_EVENT_MODIFIER_WIN)
{
- evas_key_modifier_on(e, "Super");
- evas_key_modifier_on(e, "Hyper");
+ evas_key_modifier_on(e, "Super");
+ evas_key_modifier_on(e, "Hyper");
}
else
{
- evas_key_modifier_off(e, "Super");
- evas_key_modifier_off(e, "Hyper");
+ evas_key_modifier_off(e, "Super");
+ evas_key_modifier_off(e, "Hyper");
}
if (modifiers & ECORE_EVENT_LOCK_SCROLL)
switch (io)
{
case ECORE_IN:
- evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
- break;
+ evas_event_feed_mouse_in(lookup->evas, e->timestamp, NULL);
+ break;
case ECORE_OUT:
- evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
- break;
+ evas_event_feed_mouse_out(lookup->evas, e->timestamp, NULL);
+ break;
default:
- break;
+ break;
}
lookup->move_mouse(lookup->window, e->x, e->y, e->timestamp);
if (!ecore_init())
{
- return --_ecore_event_evas_init_count;
+ return --_ecore_event_evas_init_count;
}
if (!ecore_event_init())
{
- goto shutdown_ecore;
+ goto shutdown_ecore;
}
ecore_event_evas_handlers[0] = ecore_event_handler_add(ECORE_EVENT_KEY_DOWN,
- ecore_event_evas_key_down,
- NULL);
+ ecore_event_evas_key_down,
+ NULL);
ecore_event_evas_handlers[1] = ecore_event_handler_add(ECORE_EVENT_KEY_UP,
- ecore_event_evas_key_up,
- NULL);
+ ecore_event_evas_key_up,
+ NULL);
ecore_event_evas_handlers[2] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN,
- ecore_event_evas_mouse_button_down,
- NULL);
+ ecore_event_evas_mouse_button_down,
+ NULL);
ecore_event_evas_handlers[3] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP,
- ecore_event_evas_mouse_button_up,
- NULL);
+ ecore_event_evas_mouse_button_up,
+ NULL);
ecore_event_evas_handlers[4] = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE,
- ecore_event_evas_mouse_move,
- NULL);
+ ecore_event_evas_mouse_move,
+ NULL);
ecore_event_evas_handlers[5] = ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL,
- ecore_event_evas_mouse_wheel,
- NULL);
+ ecore_event_evas_mouse_wheel,
+ NULL);
ecore_event_evas_handlers[6] = ecore_event_handler_add(ECORE_EVENT_MOUSE_IN,
- ecore_event_evas_mouse_in,
- NULL);
+ ecore_event_evas_mouse_in,
+ NULL);
ecore_event_evas_handlers[7] = ecore_event_handler_add(ECORE_EVENT_MOUSE_OUT,
- ecore_event_evas_mouse_out,
- NULL);
+ ecore_event_evas_mouse_out,
+ NULL);
_window_hash = eina_hash_pointer_new(free);
_window_hash = NULL;
for (i = 0; i < sizeof(ecore_event_evas_handlers) / sizeof(Ecore_Event_Handler *); i++)
{
- ecore_event_handler_del(ecore_event_evas_handlers[i]);
- ecore_event_evas_handlers[i] = NULL;
+ ecore_event_handler_del(ecore_event_evas_handlers[i]);
+ ecore_event_evas_handlers[i] = NULL;
}
ecore_event_shutdown();