int ime_event_set_focus_in_cb(ime_focus_in_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.focus_in = callback_func;
g_event_callback.focus_in_user_data = user_data;
int ime_event_set_focus_out_cb(ime_focus_out_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.focus_out = callback_func;
g_event_callback.focus_out_user_data = user_data;
int ime_event_set_surrounding_text_updated_cb(ime_surrounding_text_updated_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.surrounding_text_updated = callback_func;
g_event_callback.surrounding_text_updated_user_data = user_data;
int ime_event_set_input_context_reset_cb(ime_input_context_reset_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.input_context_reset = callback_func;
g_event_callback.input_context_reset_user_data = user_data;
int ime_event_set_cursor_position_updated_cb(ime_cursor_position_updated_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.cursor_position_updated = callback_func;
g_event_callback.cursor_position_updated_user_data = user_data;
int ime_event_set_language_requested_cb(ime_language_requested_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.language_requested = callback_func;
g_event_callback.language_requested_user_data = user_data;
int ime_event_set_language_set_cb(ime_language_set_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.language_set = callback_func;
g_event_callback.language_set_user_data = user_data;
int ime_event_set_imdata_set_cb(ime_imdata_set_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.imdata_set = callback_func;
g_event_callback.imdata_set_user_data = user_data;
int ime_event_set_imdata_requested_cb(ime_imdata_requested_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.imdata_requested = callback_func;
g_event_callback.imdata_requested_user_data = user_data;
int ime_event_set_layout_set_cb(ime_layout_set_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.layout_set = callback_func;
g_event_callback.layout_set_user_data = user_data;
int ime_event_set_return_key_type_set_cb(ime_return_key_type_set_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.return_key_type_set = callback_func;
g_event_callback.return_key_type_set_user_data = user_data;
int ime_event_set_return_key_state_set_cb(ime_return_key_state_set_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.return_key_state_set = callback_func;
g_event_callback.return_key_state_set_user_data = user_data;
int ime_event_set_geometry_requested_cb(ime_geometry_requested_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.geometry_requested = callback_func;
g_event_callback.geometry_requested_user_data = user_data;
int ime_event_set_process_key_event_cb(ime_process_key_event_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.process_key_event = callback_func;
g_event_callback.process_key_event_user_data = user_data;
int ime_event_set_display_language_changed_cb(ime_display_language_changed_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.display_language_changed = callback_func;
g_event_callback.display_language_changed_user_data = user_data;
int ime_event_set_rotation_degree_changed_cb(ime_rotation_degree_changed_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.rotation_degree_changed = callback_func;
g_event_callback.rotation_degree_changed_user_data = user_data;
int ime_event_set_accessibility_state_changed_cb(ime_accessibility_state_changed_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.accessibility_state_changed = callback_func;
g_event_callback.accessibility_state_changed_user_data = user_data;
int ime_event_set_option_window_created_cb(ime_option_window_created_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.option_window_created = callback_func;
g_event_callback.option_window_created_user_data = user_data;
int ime_event_set_option_window_destroyed_cb(ime_option_window_destroyed_cb callback_func, void *user_data)
{
- if (!callback_func)
+ if (!callback_func) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
- if (g_running)
+ if (g_running) {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
g_event_callback.option_window_destroyed = callback_func;
g_event_callback.option_window_destroyed_user_data = user_data;
int ime_send_key_event(ime_key_code_e keycode, ime_key_mask_e keymask, bool forward_key)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
if (forward_key)
g_core.forward_key_event(-1, NULL, (sclu32)keycode, (sclu16)keymask);
int ime_commit_string(const char *str)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!str)
+ if (!str) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
g_core.commit_string(-1, NULL, str);
int ime_show_preedit_string(void)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
g_core.show_preedit_string(-1, NULL);
int ime_hide_preedit_string(void)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
g_core.hide_preedit_string(-1, NULL);
int ime_update_preedit_string(const char *str, Eina_List *attrs)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!str)
+ if (!str) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
scim::AttributeList attrv;
ime_preedit_attribute *attr = NULL;
int ime_request_surrounding_text(int maxlen_before, int maxlen_after)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!g_event_callback.surrounding_text_updated)
+ if (!g_event_callback.surrounding_text_updated) {
+ LOGW("IME_ERROR_NO_CALLBACK_FUNCTION");
return IME_ERROR_NO_CALLBACK_FUNCTION;
+ }
g_core.get_surrounding_text(NULL, maxlen_before, maxlen_after);
int ime_delete_surrounding_text(int offset, int len)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (len <= 0)
+ if (len <= 0) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
g_core.delete_surrounding_text(offset, len);
if (!g_running) {
set_last_result(IME_ERROR_NOT_RUNNING);
+ LOGW("IME_ERROR_NOT_RUNNING");
return NULL;
}
}
else {
set_last_result(IME_ERROR_OPERATION_FAILED);
+ LOGW("IME_ERROR_OPERATION_FAILED");
}
return win;
{
SclSize portrait_size, landscape_size;
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
portrait_size.width = portrait_width;
portrait_size.height = portrait_height;
int ime_create_option_window(void)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
if (!g_event_callback.option_window_created || !g_event_callback.option_window_destroyed) {
LOGW("ime_create_option_window_cb() and ime_destroy_option_window_cb() callback functions are not set.");
if (g_core.create_option_window())
return IME_ERROR_NONE;
- else
+ else {
+ LOGW("IME_ERROR_OPERATION_FAILED");
return IME_ERROR_OPERATION_FAILED;
+ }
}
int ime_destroy_option_window(Evas_Object *window)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
if (!window) {
LOGW("Window pointer is null.");
int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !layout)
+ if (!context || !layout) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*layout = context->layout;
int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !layout_variation)
+ if (!context || !layout_variation) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*layout_variation = static_cast<ime_layout_variation_e>(context->layout_variation);
int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !cursor_pos)
+ if (!context || !cursor_pos) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*cursor_pos = context->cursor_pos;
int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !autocapital_type)
+ if (!context || !autocapital_type) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*autocapital_type = context->autocapital_type;
int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !return_key_type)
+ if (!context || !return_key_type) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*return_key_type = context->return_key_type;
int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !return_key_state)
+ if (!context || !return_key_state) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*return_key_state = static_cast<bool>(context->return_key_disabled);
int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !prediction_mode)
+ if (!context || !prediction_mode) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*prediction_mode = static_cast<bool>(context->prediction_allow);
int ime_context_get_password_mode(ime_context_h context, bool *password_mode)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !password_mode)
+ if (!context || !password_mode) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*password_mode = static_cast<bool>(context->password_mode);
int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !input_hint)
+ if (!context || !input_hint) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*input_hint = context->input_hint;
int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !bidi)
+ if (!context || !bidi) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*bidi = context->bidi_direction;
int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!context || !language)
+ if (!context || !language) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*language = context->language;
int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!dev_info || !dev_name)
+ if (!dev_info || !dev_name) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
if (!dev_info->dev_name)
*dev_name = strdup("");
int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!dev_info || !dev_class)
+ if (!dev_info || !dev_class) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*dev_class = dev_info->dev_class;
int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass)
{
- if (!g_running)
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
+ }
- if (!dev_info || !dev_subclass)
+ if (!dev_info || !dev_subclass) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
+ }
*dev_subclass = dev_info->dev_subclass;