int ime_commit_string(const char *str)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!str) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
g_core.commit_string(-1, NULL, str);
return IME_ERROR_NONE;
int ime_update_preedit_string(const char *str, Eina_List *attrs)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!str) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
scim::AttributeList attrv;
ime_preedit_attribute *attr = NULL;
int ime_delete_surrounding_text(int offset, int len)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (len <= 0) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
g_core.delete_surrounding_text(offset, len);
return IME_ERROR_NONE;
{
SclSize portrait_size, landscape_size;
+ if (portrait_width < 1 || portrait_height < 1 || landscape_width < 1 || landscape_height < 1) {
+ LOGW("IME_ERROR_INVALID_PARAMETER");
+ return IME_ERROR_INVALID_PARAMETER;
+ }
+
if (!g_running) {
LOGW("IME_ERROR_NOT_RUNNING");
return IME_ERROR_NOT_RUNNING;
int ime_destroy_option_window(Evas_Object *window)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!window) {
LOGW("Window pointer is null.");
return IME_ERROR_INVALID_PARAMETER;
}
+ 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.");
return IME_ERROR_NO_CALLBACK_FUNCTION;
int ime_context_get_layout(ime_context_h context, Ecore_IMF_Input_Panel_Layout *layout)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !layout) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*layout = context->layout;
return IME_ERROR_NONE;
int ime_context_get_layout_variation(ime_context_h context, ime_layout_variation_e *layout_variation)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !layout_variation) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*layout_variation = static_cast<ime_layout_variation_e>(context->layout_variation);
return IME_ERROR_NONE;
int ime_context_get_cursor_position(ime_context_h context, int *cursor_pos)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !cursor_pos) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*cursor_pos = context->cursor_pos;
return IME_ERROR_NONE;
int ime_context_get_autocapital_type(ime_context_h context, Ecore_IMF_Autocapital_Type *autocapital_type)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !autocapital_type) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*autocapital_type = context->autocapital_type;
return IME_ERROR_NONE;
int ime_context_get_return_key_type(ime_context_h context, Ecore_IMF_Input_Panel_Return_Key_Type *return_key_type)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !return_key_type) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*return_key_type = context->return_key_type;
return IME_ERROR_NONE;
int ime_context_get_return_key_state(ime_context_h context, bool *return_key_state)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !return_key_state) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*return_key_state = static_cast<bool>(context->return_key_disabled);
return IME_ERROR_NONE;
int ime_context_get_prediction_mode(ime_context_h context, bool *prediction_mode)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !prediction_mode) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*prediction_mode = static_cast<bool>(context->prediction_allow);
return IME_ERROR_NONE;
int ime_context_get_password_mode(ime_context_h context, bool *password_mode)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !password_mode) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*password_mode = static_cast<bool>(context->password_mode);
return IME_ERROR_NONE;
int ime_context_get_input_hint(ime_context_h context, Ecore_IMF_Input_Hints *input_hint)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !input_hint) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*input_hint = context->input_hint;
return IME_ERROR_NONE;
int ime_context_get_bidi_direction(ime_context_h context, Ecore_IMF_BiDi_Direction *bidi)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !bidi) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*bidi = context->bidi_direction;
return IME_ERROR_NONE;
int ime_context_get_language(ime_context_h context, Ecore_IMF_Input_Panel_Lang *language)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!context || !language) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*language = context->language;
return IME_ERROR_NONE;
int ime_device_info_get_name(ime_device_info_h dev_info, char **dev_name)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!dev_info || !dev_name) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
if (!dev_info->dev_name)
*dev_name = strdup("");
else
int ime_device_info_get_class(ime_device_info_h dev_info, Ecore_IMF_Device_Class *dev_class)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!dev_info || !dev_class) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*dev_class = dev_info->dev_class;
return IME_ERROR_NONE;
int ime_device_info_get_subclass(ime_device_info_h dev_info, Ecore_IMF_Device_Subclass *dev_subclass)
{
- if (!g_running) {
- LOGW("IME_ERROR_NOT_RUNNING");
- return IME_ERROR_NOT_RUNNING;
- }
-
if (!dev_info || !dev_subclass) {
LOGW("IME_ERROR_INVALID_PARAMETER");
return IME_ERROR_INVALID_PARAMETER;
}
+ if (!g_running) {
+ LOGW("IME_ERROR_NOT_RUNNING");
+ return IME_ERROR_NOT_RUNNING;
+ }
+
*dev_subclass = dev_info->dev_subclass;
return IME_ERROR_NONE;