ECORE_IMF_INPUT_PANEL_ORIENT_90_CCW /* CounterClockwise */
} Ecore_IMF_Input_Panel_Orient;
- typedef struct
+ typedef struct _Disable_Key_Item Disable_Key_Item;
+
+ struct _Disable_Key_Item
{
int layout_idx;
int key_idx;
Eina_Bool disabled;
- } Disable_Key_Item;
+ };
+
+ typedef struct _Private_Key_Item Private_Key_Item;
- typedef struct
+ struct _Private_Key_Item
{
int layout_idx;
int key_idx;
char data[128]; // label or image path
int key_value;
char key_string[32];
- } Private_Key_Item;
+ };
/* Events sent by the Input Method */
typedef struct _Ecore_IMF_Event_Preedit_Start Ecore_IMF_Event_Preedit_Start;
unsigned int end_index;
};
+ typedef struct _Ecore_IMF_Input_Panel_Event_Callback Ecore_IMF_Input_Panel_Event_Callback;
+
+ struct _Ecore_IMF_Input_Panel_Event_Callback
+ {
+ void (*func)(void *data, Ecore_IMF_Context *ctx, int value);
+ const void *data;
+ Ecore_IMF_Input_Panel_Event type;
+ };
+
struct _Ecore_IMF_Context_Class
{
void (*add) (Ecore_IMF_Context *ctx);
* }
* @endcode
*/
- EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx);
+ EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get (Ecore_IMF_Context *ctx);
/**
* Application can register a callback function which will be called if there is change in ise state,language,mode etc.
* }
* @endcode
*/
- EAPI void ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
+ EAPI void ecore_imf_context_input_panel_key_disabled_set (Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
+
+ EAPI Eina_List *ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx);
- EAPI Eina_List *ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx);
+ EAPI Eina_List *ecore_imf_context_input_panel_event_callback_list_get (Ecore_IMF_Context *ctx);
/**
* Move the soft keyboard to the new position.
* }
* @endcode
*/
- EAPI void ecore_imf_context_input_panel_move (Ecore_IMF_Context *ctx, int x, int y);
+ EAPI void ecore_imf_context_input_panel_move (Ecore_IMF_Context *ctx, int x, int y);
EAPI void ecore_imf_context_input_panel_caps_mode_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Caps_Mode mode);
EINA_LIST_FREE(ctx->disabled_key_list, data)
free(data);
+ EINA_LIST_FREE(ctx->callbacks, data)
+ free(data);
+
ctx->private_key_list = NULL;
ctx->disabled_key_list = NULL;
+ ctx->callbacks = NULL;
free(ctx);
}
ctx->input_panel_layout = ECORE_IMF_INPUT_PANEL_LAYOUT_NORMAL;
ctx->input_panel_orient = ECORE_IMF_INPUT_PANEL_ORIENT_NONE;
ctx->use_effect = EINA_TRUE;
+ ctx->disabled_key_list = NULL;
+ ctx->private_key_list = NULL;
ctx->callbacks = NULL;
return ctx;
return;
}
- if (label == NULL && img_path == NULL)
+ if (!label && !img_path)
{
printf ("input parameters error!!! \n");
return;
}
EAPI Eina_List *
-ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_key_disabled_list_get (Ecore_IMF_Context *ctx)
{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_key_disabled_list_get");
+ return NULL;
+ }
+
return ctx->disabled_key_list;
}
+EAPI Eina_List *
+ecore_imf_context_input_panel_event_callback_list_get (Ecore_IMF_Context *ctx)
+{
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_event_callback_list_get");
+ return NULL;
+ }
+
+ return ctx->callbacks;
+}
+
EAPI void
ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
{
}
EAPI void
-ecore_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value), const void *data)
+ecore_imf_context_input_panel_event_callback_add (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value), const void *data)
{
+ Ecore_IMF_Input_Panel_Event_Callback *it;
+
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_event_callback_add");
if (ctx->klass->input_panel_event_callback_add)
{
- ctx->klass->input_panel_event_callback_add(ctx, type, pEventCallBackFunc, data);
+ it = calloc(1, sizeof(Ecore_IMF_Input_Panel_Event_Callback));
+ if (!it) return;
+
+ it->func = func;
+ it->data = data;;
+ it->type = type;
+
+ ctx->callbacks = eina_list_append(ctx->callbacks, it);
+
+ ctx->klass->input_panel_event_callback_add(ctx, type, func, data);
}
}
EAPI void
-ecore_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*pEventCallBackFunc) (void *data, Ecore_IMF_Context *ctx, int value))
+ecore_imf_context_input_panel_event_callback_del (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Event type, void (*func) (void *data, Ecore_IMF_Context *ctx, int value))
{
+ Eina_List *l;
+ Ecore_IMF_Input_Panel_Event_Callback *it;
+
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,"ecore_imf_context_input_panel_event_callback_del");
if (ctx->klass->input_panel_event_callback_del)
{
- ctx->klass->input_panel_event_callback_del(ctx, type, pEventCallBackFunc);
+ for (l = ctx->callbacks; l;)
+ {
+ it = (Ecore_IMF_Input_Panel_Event_Callback *)l->data;
+
+ if (it && it->func == func && it->type == type)
+ {
+ ctx->callbacks = eina_list_remove(ctx->callbacks, it);
+ free(it);
+ break;
+ }
+ l = l->next;
+ }
+
+ ctx->klass->input_panel_event_callback_del(ctx, type, func);
}
}