forked from enlightenment/efl
efl/ecore_imf/scim: use EINA_SAFETY macro for checking NULL
SVN revision: 82703
This commit is contained in:
parent
440bb7c23c
commit
95fc2dcc4e
|
@ -462,8 +462,7 @@ isf_imf_context_add(Ecore_IMF_Context *ctx)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
|
||||
if (!context_scim) return;
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
|
||||
context_scim->impl = NULL;
|
||||
|
||||
|
@ -545,9 +544,9 @@ isf_imf_context_del(Ecore_IMF_Context *ctx)
|
|||
if (!_ic_list) return;
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim)
|
||||
{
|
||||
if (context_scim->id != _ic_list->id)
|
||||
{
|
||||
EcoreIMFContextISF *pre = _ic_list;
|
||||
|
@ -565,10 +564,7 @@ isf_imf_context_del(Ecore_IMF_Context *ctx)
|
|||
}
|
||||
else
|
||||
_ic_list = _ic_list->next;
|
||||
}
|
||||
|
||||
if (context_scim && context_scim->impl)
|
||||
{
|
||||
_panel_client.prepare(context_scim->id);
|
||||
|
||||
if (context_scim == _focused_ic)
|
||||
|
@ -592,22 +588,15 @@ isf_imf_context_del(Ecore_IMF_Context *ctx)
|
|||
if (context_scim->impl->client_window)
|
||||
isf_imf_context_client_window_set(ctx, NULL);
|
||||
|
||||
if (context_scim->impl)
|
||||
{
|
||||
delete_ic_impl(context_scim->impl);
|
||||
context_scim->impl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (context_scim == _focused_ic)
|
||||
_focused_ic = 0;
|
||||
|
||||
if (context_scim)
|
||||
{
|
||||
delete context_scim;
|
||||
context_scim = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isf_imf_context_client_canvas_set
|
||||
|
@ -630,8 +619,10 @@ isf_imf_context_client_canvas_set(Ecore_IMF_Context *ctx, void *canvas)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->client_canvas != (Evas*) canvas)
|
||||
if (context_scim->impl->client_canvas != (Evas*) canvas)
|
||||
context_scim->impl->client_canvas = (Evas*)canvas;
|
||||
}
|
||||
|
||||
|
@ -654,8 +645,10 @@ isf_imf_context_client_window_set(Ecore_IMF_Context *ctx, void *window)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->client_window != (Ecore_X_Window)((Ecore_Window)window))
|
||||
if (context_scim->impl->client_window != (Ecore_X_Window)((Ecore_Window)window))
|
||||
{
|
||||
context_scim->impl->client_window = (Ecore_X_Window)((Ecore_Window)window);
|
||||
|
||||
|
@ -681,9 +674,12 @@ isf_imf_context_reset(Ecore_IMF_Context *ctx)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim != _focused_ic)
|
||||
return;
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim == _focused_ic)
|
||||
{
|
||||
WideString wstr = context_scim->impl->preedit_string;
|
||||
|
||||
_panel_client.prepare(context_scim->id);
|
||||
|
@ -701,7 +697,6 @@ isf_imf_context_reset(Ecore_IMF_Context *ctx)
|
|||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isf_imf_context_focus_in
|
||||
|
@ -715,9 +710,8 @@ EAPI void
|
|||
isf_imf_context_focus_in(Ecore_IMF_Context *ctx)
|
||||
{
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
|
||||
if (!context_scim)
|
||||
return;
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__<< "(" << context_scim->id << ")...\n";
|
||||
|
||||
|
@ -737,8 +731,6 @@ isf_imf_context_focus_in(Ecore_IMF_Context *ctx)
|
|||
bool need_reset = false;
|
||||
bool need_reg = false;
|
||||
|
||||
if (context_scim && context_scim->impl)
|
||||
{
|
||||
_focused_ic = context_scim;
|
||||
_panel_client.prepare(context_scim->id);
|
||||
|
||||
|
@ -812,7 +804,6 @@ isf_imf_context_focus_in(Ecore_IMF_Context *ctx)
|
|||
}
|
||||
|
||||
_panel_client.send();
|
||||
}
|
||||
|
||||
if (ecore_imf_context_input_panel_enabled_get(ctx))
|
||||
ecore_imf_context_input_panel_show(ctx);
|
||||
|
@ -830,12 +821,12 @@ EAPI void
|
|||
isf_imf_context_focus_out(Ecore_IMF_Context *ctx)
|
||||
{
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
|
||||
if (!context_scim) return;
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "(" << context_scim->id << ")...\n";
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim == _focused_ic)
|
||||
if (context_scim == _focused_ic)
|
||||
{
|
||||
WideString wstr = context_scim->impl->preedit_string;
|
||||
|
||||
|
@ -881,6 +872,9 @@ isf_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int cx, int cy, int
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
Ecore_Evas *ee;
|
||||
int canvas_x, canvas_y;
|
||||
int new_cursor_x, new_cursor_y;
|
||||
|
@ -888,8 +882,9 @@ isf_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int cx, int cy, int
|
|||
if (cw == 0 && ch == 0)
|
||||
return;
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim == _focused_ic)
|
||||
{
|
||||
if (context_scim != _focused_ic)
|
||||
return;
|
||||
|
||||
if (context_scim->impl->client_canvas)
|
||||
{
|
||||
ee = ecore_evas_ecore_evas_get(context_scim->impl->client_canvas);
|
||||
|
@ -922,7 +917,6 @@ isf_imf_context_cursor_location_set(Ecore_IMF_Context *ctx, int cx, int cy, int
|
|||
SCIM_DEBUG_FRONTEND(2) << "new cursor location = " << context_scim->impl->cursor_x << "," << context_scim->impl->cursor_y << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isf_imf_context_use_preedit_set
|
||||
|
@ -941,11 +935,11 @@ isf_imf_context_use_preedit_set(Ecore_IMF_Context* ctx, Eina_Bool use_preedit)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << (use_preedit ? "true" : "false") << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (!_on_the_spot) return;
|
||||
|
||||
if (context_scim && context_scim->impl)
|
||||
{
|
||||
bool old = context_scim->impl->use_preedit;
|
||||
context_scim->impl->use_preedit = use_preedit;
|
||||
if (context_scim == _focused_ic)
|
||||
|
@ -961,7 +955,6 @@ isf_imf_context_use_preedit_set(Ecore_IMF_Context* ctx, Eina_Bool use_preedit)
|
|||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
EAPI void
|
||||
isf_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char** str, Eina_List **attrs, int *cursor_pos)
|
||||
|
@ -969,8 +962,10 @@ isf_imf_context_preedit_string_with_attributes_get(Ecore_IMF_Context *ctx, char*
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->is_on)
|
||||
if (context_scim->impl->is_on)
|
||||
{
|
||||
String mbs = utf8_wcstombs(context_scim->impl->preedit_string);
|
||||
|
||||
|
@ -1116,8 +1111,10 @@ isf_imf_context_preedit_string_get(Ecore_IMF_Context *ctx, char** str, int *curs
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->is_on)
|
||||
if (context_scim->impl->is_on)
|
||||
{
|
||||
String mbs = utf8_wcstombs(context_scim->impl->preedit_string);
|
||||
|
||||
|
@ -1157,9 +1154,12 @@ isf_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim != _focused_ic)
|
||||
return;
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim == _focused_ic)
|
||||
{
|
||||
// Don't update spot location while updating preedit string.
|
||||
if (context_scim->impl->preedit_updating)
|
||||
return;
|
||||
|
@ -1167,7 +1167,6 @@ isf_imf_context_cursor_position_set(Ecore_IMF_Context *ctx, int cursor_pos)
|
|||
if (context_scim->impl->cursor_pos != cursor_pos)
|
||||
context_scim->impl->cursor_pos = cursor_pos;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* isf_imf_context_input_mode_set
|
||||
|
@ -1185,7 +1184,9 @@ isf_imf_context_input_mode_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Mode inpu
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
if (context_scim && context_scim->impl)
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
context_scim->impl->input_mode = input_mode;
|
||||
}
|
||||
|
||||
|
@ -1204,8 +1205,10 @@ isf_imf_context_prediction_allow_set(Ecore_IMF_Context* ctx, Eina_Bool predictio
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << (prediction ? "true" : "false") << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->prediction_allow != prediction)
|
||||
if (context_scim->impl->prediction_allow != prediction)
|
||||
context_scim->impl->prediction_allow = prediction;
|
||||
}
|
||||
|
||||
|
@ -1215,8 +1218,10 @@ isf_imf_context_autocapital_type_set(Ecore_IMF_Context* ctx, Ecore_IMF_Autocapit
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " = " << autocapital_type << "...\n";
|
||||
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF *)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
if (context_scim && context_scim->impl && context_scim->impl->autocapital_type != autocapital_type)
|
||||
if (context_scim->impl->autocapital_type != autocapital_type)
|
||||
context_scim->impl->autocapital_type = autocapital_type;
|
||||
}
|
||||
|
||||
|
@ -1241,11 +1246,10 @@ isf_imf_context_filter_event(Ecore_IMF_Context *ctx, Ecore_IMF_Event_Type type,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ic, EINA_FALSE);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ic->impl, EINA_FALSE);
|
||||
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
|
||||
if (ic == NULL || ic->impl == NULL)
|
||||
return ret;
|
||||
|
||||
KeyEvent key;
|
||||
|
||||
if (type == ECORE_IMF_EVENT_KEY_DOWN)
|
||||
|
@ -1298,12 +1302,12 @@ isf_imf_context_input_panel_show(Ecore_IMF_Context *ctx)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
if (ic == NULL || ic->impl == NULL)
|
||||
return;
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
ecore_x_e_virtual_keyboard_state_set
|
||||
(ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
|
||||
(context_scim->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_ON);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
|
@ -1311,12 +1315,12 @@ isf_imf_context_input_panel_hide(Ecore_IMF_Context *ctx)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
if (ic == NULL || ic->impl == NULL)
|
||||
return;
|
||||
EcoreIMFContextISF *context_scim = (EcoreIMFContextISF*)ecore_imf_context_data_get(ctx);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim);
|
||||
EINA_SAFETY_ON_NULL_RETURN(context_scim->impl);
|
||||
|
||||
ecore_x_e_virtual_keyboard_state_set
|
||||
(ic->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
|
||||
(context_scim->impl->client_window, ECORE_X_VIRTUAL_KEYBOARD_STATE_OFF);
|
||||
}
|
||||
|
||||
/* Panel Slot functions */
|
||||
|
@ -1339,62 +1343,70 @@ static void
|
|||
panel_slot_update_lookup_table_page_size(int context, int page_size)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " page_size=" << page_size << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->update_lookup_table_page_size(page_size);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_lookup_table_page_up(int context)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->lookup_table_page_up();
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_lookup_table_page_down(int context)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->lookup_table_page_down();
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_trigger_property(int context, const String &property)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " property=" << property << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->trigger_property(property);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_process_helper_event(int context, const String &target_uuid, const String &helper_uuid, const Transaction &trans)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " target=" << target_uuid
|
||||
<< " helper=" << helper_uuid << " ic=" << ic << " ic->impl=" << (ic ? ic->impl : 0) << " ic-uuid="
|
||||
<< ((ic && ic->impl) ? ic->impl->si->get_factory_uuid() : "" ) << "\n";
|
||||
if (ic && ic->impl && ic->impl->si->get_factory_uuid() == target_uuid)
|
||||
|
||||
if (ic->impl->si->get_factory_uuid() == target_uuid)
|
||||
{
|
||||
_panel_client.prepare(ic->id);
|
||||
SCIM_DEBUG_FRONTEND(2) << "call process_helper_event\n";
|
||||
|
@ -1407,27 +1419,29 @@ static void
|
|||
panel_slot_move_preedit_caret(int context, int caret_pos)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " caret=" << caret_pos << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->move_preedit_caret(caret_pos);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_select_candidate(int context, int cand_index)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " candidate=" << cand_index << " ic=" << ic << "\n";
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
|
||||
_panel_client.prepare(ic->id);
|
||||
ic->impl->si->select_candidate(cand_index);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_process_key_event(int context, const KeyEvent &key)
|
||||
|
@ -1443,25 +1457,27 @@ static void
|
|||
panel_slot_commit_string(int context, const WideString &wstr)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " str=" << utf8_wcstombs(wstr) << " ic=" << ic << "\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
if (_focused_ic != ic)
|
||||
return;
|
||||
|
||||
ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(wstr).c_str());
|
||||
ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(wstr).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_forward_key_event(int context, const KeyEvent &key)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " key=" << key.get_key_string() << " ic=" << ic << "\n";
|
||||
|
||||
if (ic && ic->impl && ic->impl->client_canvas)
|
||||
if (ic->impl->client_canvas)
|
||||
feed_key_event(ic->impl->client_canvas, key.get_key_string().c_str(), EINA_TRUE);
|
||||
}
|
||||
|
||||
|
@ -1469,44 +1485,42 @@ static void
|
|||
panel_slot_request_help(int context)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
_panel_client.prepare(ic->id);
|
||||
panel_req_show_help(ic);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_request_factory_menu(int context)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " ic=" << ic << "\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
_panel_client.prepare(ic->id);
|
||||
panel_req_show_factory_menu(ic);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_slot_change_factory(int context, const String &uuid)
|
||||
{
|
||||
EcoreIMFContextISF *ic = find_ic(context);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " context=" << context << " factory=" << uuid << " ic=" << ic << "\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
ic->impl->si->reset();
|
||||
_panel_client.prepare(ic->id);
|
||||
open_specific_factory(ic, uuid);
|
||||
_panel_client.send();
|
||||
}
|
||||
}
|
||||
|
||||
/* Panel Requestion functions. */
|
||||
static void
|
||||
|
@ -1514,14 +1528,15 @@ panel_req_show_help(EcoreIMFContextISF *ic)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
String help;
|
||||
|
||||
help = String("Smart Common Input Method platform ") +
|
||||
//String(SCIM_VERSION) +
|
||||
String("\n(C) 2002-2005 James Su <suzhe@tsinghua.org.cn>\n\n");
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
IMEngineFactoryPointer sf = _backend->get_factory(ic->impl->si->get_factory_uuid());
|
||||
if (sf)
|
||||
{
|
||||
|
@ -1535,7 +1550,6 @@ panel_req_show_help(EcoreIMFContextISF *ic)
|
|||
}
|
||||
_panel_client.show_help(ic->id, help);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_req_show_factory_menu(EcoreIMFContextISF *ic)
|
||||
|
@ -1565,8 +1579,12 @@ panel_req_update_factory_info(EcoreIMFContextISF *ic)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
if (ic && ic->impl && ic == _focused_ic)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (ic != _focused_ic)
|
||||
return;
|
||||
|
||||
PanelFactoryInfo info;
|
||||
if (ic->impl->is_on)
|
||||
{
|
||||
|
@ -1580,7 +1598,6 @@ panel_req_update_factory_info(EcoreIMFContextISF *ic)
|
|||
}
|
||||
_panel_client.update_factory_info(ic->id, info);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
panel_req_focus_in(EcoreIMFContextISF *ic)
|
||||
|
@ -1727,7 +1744,10 @@ turn_on_ic(EcoreIMFContextISF *ic)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
if (ic && ic->impl && !ic->impl->is_on)
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (!ic->impl->is_on)
|
||||
{
|
||||
ic->impl->is_on = true;
|
||||
|
||||
|
@ -1763,7 +1783,10 @@ turn_off_ic(EcoreIMFContextISF *ic)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
if (ic && ic->impl && ic->impl->is_on)
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (ic->impl->is_on)
|
||||
{
|
||||
ic->impl->is_on = false;
|
||||
|
||||
|
@ -1795,8 +1818,9 @@ set_ic_capabilities(EcoreIMFContextISF *ic)
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
{
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
unsigned int cap = SCIM_CLIENT_CAP_ALL_CAPABILITIES;
|
||||
|
||||
if (!_on_the_spot || !ic->impl->use_preedit)
|
||||
|
@ -1804,7 +1828,6 @@ set_ic_capabilities(EcoreIMFContextISF *ic)
|
|||
|
||||
ic->impl->si->update_client_capabilities(cap);
|
||||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
check_socket_frontend(void)
|
||||
|
@ -2032,8 +2055,8 @@ open_next_factory(EcoreIMFContextISF *ic)
|
|||
static void
|
||||
open_previous_factory(EcoreIMFContextISF *ic)
|
||||
{
|
||||
if (ic == NULL)
|
||||
return;
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(2) << __FUNCTION__ << " context=" << ic->id << "\n";
|
||||
IMEngineFactoryPointer sf = _backend->get_previous_factory("", "UTF-8", ic->impl->si->get_factory_uuid());
|
||||
|
@ -2063,8 +2086,8 @@ static void
|
|||
open_specific_factory(EcoreIMFContextISF *ic,
|
||||
const String &uuid)
|
||||
{
|
||||
if (ic == NULL)
|
||||
return;
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(2) << __FUNCTION__ << " context=" << ic->id << "\n";
|
||||
|
||||
|
@ -2283,11 +2306,7 @@ static void _x_send_key_event(const KeyEvent &key)
|
|||
|
||||
// Obtain the X11 display.
|
||||
Display *display = (Display *)ecore_x_display_get();
|
||||
if (display == NULL)
|
||||
{
|
||||
std::cerr << "ecore_x_display_get() failed\n";
|
||||
return;
|
||||
}
|
||||
EINA_SAFETY_ON_NULL_RETURN(display);
|
||||
|
||||
// Get the root window for the current display.
|
||||
Window winRoot = 0;
|
||||
|
@ -2376,9 +2395,12 @@ slot_show_preedit_string(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (_focused_ic != ic)
|
||||
return;
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
{
|
||||
if (ic->impl->use_preedit)
|
||||
{
|
||||
if (!ic->impl->preedit_started)
|
||||
|
@ -2391,7 +2413,6 @@ slot_show_preedit_string(IMEngineInstanceBase *si)
|
|||
else
|
||||
_panel_client.show_preedit_string(ic->id);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
slot_show_aux_string(IMEngineInstanceBase *si)
|
||||
|
@ -2399,8 +2420,9 @@ slot_show_aux_string(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.show_aux_string(ic->id);
|
||||
}
|
||||
|
||||
|
@ -2410,8 +2432,9 @@ slot_show_lookup_table(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.show_lookup_table(ic->id);
|
||||
}
|
||||
|
||||
|
@ -2421,9 +2444,12 @@ slot_hide_preedit_string(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (_focused_ic != ic)
|
||||
return;
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
{
|
||||
bool emit = false;
|
||||
if (ic->impl->preedit_string.length())
|
||||
{
|
||||
|
@ -2449,7 +2475,6 @@ slot_hide_preedit_string(IMEngineInstanceBase *si)
|
|||
else
|
||||
_panel_client.hide_preedit_string(ic->id);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
slot_hide_aux_string(IMEngineInstanceBase *si)
|
||||
|
@ -2457,8 +2482,9 @@ slot_hide_aux_string(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.hide_aux_string(ic->id);
|
||||
}
|
||||
|
||||
|
@ -2468,8 +2494,9 @@ slot_hide_lookup_table(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.hide_lookup_table(ic->id);
|
||||
}
|
||||
|
||||
|
@ -2479,8 +2506,10 @@ slot_update_preedit_caret(IMEngineInstanceBase *si, int caret)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic && ic->impl->preedit_caret != caret)
|
||||
if (_focused_ic == ic && ic->impl->preedit_caret != caret)
|
||||
{
|
||||
ic->impl->preedit_caret = caret;
|
||||
if (ic->impl->use_preedit)
|
||||
|
@ -2507,8 +2536,10 @@ slot_update_preedit_string(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic && (ic->impl->preedit_string != str || str.length()))
|
||||
if (_focused_ic == ic && (ic->impl->preedit_string != str || str.length()))
|
||||
{
|
||||
ic->impl->preedit_string = str;
|
||||
ic->impl->preedit_attrlist = attrs;
|
||||
|
@ -2541,8 +2572,9 @@ slot_update_aux_string(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.update_aux_string(ic->id, str, attrs);
|
||||
}
|
||||
|
||||
|
@ -2553,13 +2585,12 @@ slot_commit_string(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->ctx);
|
||||
|
||||
if (ic && ic->ctx)
|
||||
{
|
||||
ecore_imf_context_commit_event_add(ic->ctx, utf8_wcstombs(str).c_str());
|
||||
ecore_imf_context_event_callback_call(ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
slot_forward_key_event(IMEngineInstanceBase *si,
|
||||
|
@ -2568,8 +2599,9 @@ slot_forward_key_event(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
{
|
||||
if (!_fallback_instance->process_key_event(key))
|
||||
_x_send_key_event(key);
|
||||
|
@ -2583,8 +2615,9 @@ slot_update_lookup_table(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.update_lookup_table(ic->id, table);
|
||||
}
|
||||
|
||||
|
@ -2595,8 +2628,9 @@ slot_register_properties(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.register_properties(ic->id, properties);
|
||||
}
|
||||
|
||||
|
@ -2607,8 +2641,9 @@ slot_update_property(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
_panel_client.update_property(ic->id, property);
|
||||
}
|
||||
|
||||
|
@ -2618,8 +2653,9 @@ slot_beep(IMEngineInstanceBase *si)
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
if (_focused_ic == ic)
|
||||
ecore_x_bell(0);
|
||||
}
|
||||
|
||||
|
@ -2628,12 +2664,13 @@ slot_start_helper(IMEngineInstanceBase *si,
|
|||
const String &helper_uuid)
|
||||
{
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context="
|
||||
<< (ic ? ic->id : -1) << " ic=" << ic
|
||||
<< " ic-uuid=" << ((ic ) ? ic->impl->si->get_factory_uuid() : "") << "...\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
_panel_client.start_helper(ic->id, helper_uuid);
|
||||
}
|
||||
|
||||
|
@ -2642,10 +2679,10 @@ slot_stop_helper(IMEngineInstanceBase *si,
|
|||
const String &helper_uuid)
|
||||
{
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context=" << (ic ? ic->id : -1) << " ic=" << ic << "...\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
_panel_client.stop_helper(ic->id, helper_uuid);
|
||||
}
|
||||
|
||||
|
@ -2655,12 +2692,13 @@ slot_send_helper_event(IMEngineInstanceBase *si,
|
|||
const Transaction &trans)
|
||||
{
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic);
|
||||
EINA_SAFETY_ON_NULL_RETURN(ic->impl);
|
||||
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << " helper= " << helper_uuid << " context="
|
||||
<< (ic ? ic->id : -1) << " ic=" << ic
|
||||
<< " ic-uuid=" << ((ic) ? ic->impl->si->get_factory_uuid() : "") << "...\n";
|
||||
|
||||
if (ic && ic->impl)
|
||||
_panel_client.send_helper_event(ic->id, helper_uuid, trans);
|
||||
}
|
||||
|
||||
|
@ -2674,9 +2712,12 @@ slot_get_surrounding_text(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ic, false);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ic->impl, false);
|
||||
|
||||
if (_focused_ic != ic)
|
||||
return false;
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
{
|
||||
char *surrounding = NULL;
|
||||
int cursor_index;
|
||||
if (ecore_imf_context_surrounding_get(_focused_ic->ctx, &surrounding, &cursor_index))
|
||||
|
@ -2695,7 +2736,7 @@ slot_get_surrounding_text(IMEngineInstanceBase *si,
|
|||
cursor = before.length();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -2707,19 +2748,20 @@ slot_delete_surrounding_text(IMEngineInstanceBase *si,
|
|||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
EcoreIMFContextISF *ic = static_cast<EcoreIMFContextISF *>(si->get_frontend_data());
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(ic, false);
|
||||
|
||||
if (_focused_ic != ic)
|
||||
return false;
|
||||
|
||||
if (ic && ic->impl && _focused_ic == ic)
|
||||
{
|
||||
Ecore_IMF_Event_Delete_Surrounding ev;
|
||||
ev.ctx = _focused_ic->ctx;
|
||||
ev.n_chars = len;
|
||||
ev.offset = offset;
|
||||
ecore_imf_context_delete_surrounding_event_add(_focused_ic->ctx, offset, len);
|
||||
ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_DELETE_SURROUNDING, &ev);
|
||||
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void
|
||||
reload_config_callback(const ConfigPointer &config)
|
||||
|
@ -2756,7 +2798,7 @@ fallback_commit_string_cb(IMEngineInstanceBase *si EINA_UNUSED,
|
|||
{
|
||||
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
|
||||
|
||||
if (_focused_ic && _focused_ic->impl)
|
||||
if (_focused_ic)
|
||||
{
|
||||
ecore_imf_context_commit_event_add(_focused_ic->ctx, utf8_wcstombs(str).c_str());
|
||||
ecore_imf_context_event_callback_call(_focused_ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs(str).c_str());
|
||||
|
|
Loading…
Reference in New Issue