#define _ECORE_IMF_H
#include <Eina.h>
+#include <Ecore_IMF_Input_Panel_Key.h>
#ifdef EAPI
# undef EAPI
ECORE_IMF_INPUT_PANEL_MODE_EVENT, /**< Input Panel MODE Event */
ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, /**< Input Panel LANGUAGE Event */
ECORE_IMF_INPUT_PANEL_SHIFT_MODE_EVENT, /**< Input Panel SHIFT MODE */
- ECORE_IMF_INPUT_PANEL_PREDICTION_MODE_EVENT /**< Input Panel PREDICTION MODE */
+ ECORE_IMF_INPUT_PANEL_PREEDIT_MODE_EVENT, /**< Input Panel PREEDIT MODE */
+ ECORE_IMF_INPUT_PANEL_COMPLETION_MODE_EVENT, /**< Input Panel COMPLETION MODE */
+ ECORE_IMF_INPUT_PANEL_CUSTOM_INPUT_MODE_EVENT /**< Input Panel CUSTOM INPUT MODE */
} Ecore_IMF_Input_Panel_Event;
typedef enum
{
- ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Notification after the display of the input panel */
- ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Notification prior to the dismissal of the input panel */
- ECORE_IMF_INPUT_PANEL_STATE_WILL_SHOW /**< Notification prior to the display of the input panel */
+ ECORE_IMF_INPUT_PANEL_STATE_SHOW, /**< Show Input panel */
+ ECORE_IMF_INPUT_PANEL_STATE_HIDE, /**< Hide Input panel */
+ ECORE_IMF_INPUT_PANEL_STATE_INVALID
} Ecore_IMF_Input_Panel_State;
+typedef struct
+{
+ int layout_idx;
+ int key_idx;
+ Eina_Bool disabled;
+} Disable_Key_Item;
+
+typedef struct
+{
+ int layout_idx;
+ int key_idx;
+ int type;
+ 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;
typedef struct _Ecore_IMF_Event_Preedit_End Ecore_IMF_Event_Preedit_End;
typedef enum
{
- ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic @since 1.2 */
- ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet @since 1.2 */
+ ECORE_IMF_INPUT_PANEL_LANG_AUTOMATIC, /**< Automatic */
+ ECORE_IMF_INPUT_PANEL_LANG_ALPHABET /**< Alphabet */
} Ecore_IMF_Input_Panel_Lang;
-typedef enum
-{
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, /**< Default @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_DONE, /**< Done @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_GO, /**< Go @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, /**< Join @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, /**< Login @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, /**< Next @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, /**< Search or magnifier icon @since 1.2 */
- ECORE_IMF_INPUT_PANEL_RETURN_KEY_TYPE_SEND /**< Send @since 1.2 */
-} Ecore_IMF_Input_Panel_Return_Key_Type;
-
struct _Ecore_IMF_Event_Preedit_Start
{
Ecore_IMF_Context *ctx;
void (*cursor_location_set) (Ecore_IMF_Context *ctx, int x, int y, int w, int h);
void (*input_panel_imdata_set)(Ecore_IMF_Context *ctx, const void* data, int len);
void (*input_panel_imdata_get)(Ecore_IMF_Context *ctx, void* data, int *len);
- void (*input_panel_return_key_type_set) (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type);
- void (*input_panel_return_key_disabled_set) (Ecore_IMF_Context *ctx, Eina_Bool disabled);
void (*input_panel_geometry_get)(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
+ void (*input_panel_private_key_set)(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char* label, const char* value);
+ void (*input_panel_key_disabled_set)(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled);
Ecore_IMF_Input_Panel_State (*input_panel_state_get) (Ecore_IMF_Context *ctx);
void (*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), void *data);
void (*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));
EAPI Eina_Bool ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_imdata_set(Ecore_IMF_Context *ctx, const void *data, int len);
EAPI void ecore_imf_context_input_panel_imdata_get(Ecore_IMF_Context *ctx, void *data, int *len);
-EAPI void ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type actiontype);
-EAPI Ecore_IMF_Input_Panel_Return_Key_Type ecore_imf_context_input_panel_return_key_type_get(Ecore_IMF_Context *ctx);
-EAPI void ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled);
-EAPI Eina_Bool ecore_imf_context_input_panel_return_key_disabled_get(Ecore_IMF_Context *ctx);
EAPI void ecore_imf_context_input_panel_geometry_get(Ecore_IMF_Context *ctx, int *x, int *y, int *w, int *h);
EAPI Ecore_IMF_Input_Panel_State ecore_imf_context_input_panel_state_get(Ecore_IMF_Context *ctx);
EAPI void 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);
EAPI void
ecore_imf_context_del(Ecore_IMF_Context *ctx)
{
+ void *data;
Ecore_IMF_Func_Node *fn;
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
}
ECORE_MAGIC_SET(ctx, ECORE_MAGIC_NONE);
+
+ EINA_LIST_FREE(ctx->private_key_list, data)
+ free(data);
+
+ EINA_LIST_FREE(ctx->disabled_key_list, data)
+ free(data);
+
+ ctx->private_key_list = NULL;
+ ctx->disabled_key_list = NULL;
+
free(ctx);
}
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_control_panel_show(Ecore_IMF_Context *ctx)
+ecore_imf_context_control_panel_show (Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_control_panel_hide(Ecore_IMF_Context *ctx)
+ecore_imf_context_control_panel_hide (Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_layout_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
+ecore_imf_context_input_panel_layout_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Layout layout)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI Ecore_IMF_Input_Panel_Layout
-ecore_imf_context_input_panel_layout_get(Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_layout_get (Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
}
if (ctx->klass->input_panel_layout_get)
- return ctx->input_panel_layout;
+ {
+ return ctx->input_panel_layout;
+ }
else
return ECORE_IMF_INPUT_PANEL_LAYOUT_INVALID;
}
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_language_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
+ecore_imf_context_input_panel_language_set (Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Lang lang)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI Ecore_IMF_Input_Panel_Lang
-ecore_imf_context_input_panel_language_get(Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_language_get (Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
* @since 1.1.0
*/
EAPI void
-ecore_imf_context_input_panel_enabled_set(Ecore_IMF_Context *ctx,
+ecore_imf_context_input_panel_enabled_set (Ecore_IMF_Context *ctx,
Eina_Bool enabled)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
* @since 1.1.0
*/
EAPI Eina_Bool
-ecore_imf_context_input_panel_enabled_get(Ecore_IMF_Context *ctx)
+ecore_imf_context_input_panel_enabled_get (Ecore_IMF_Context *ctx)
{
if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
{
}
/**
- * Set the "return" key type. This type is used to set string or icon on the "return" key of the input panel.
- *
- * An input panel displays the string or icon associated with this type
- *
- * @param ctx An #Ecore_IMF_Context.
- * @param return_key_type The type of "return" key on the input panel
- * @ingroup Ecore_IMF_Context_Group
- * @since 1.2.0
- */
-EAPI void
-ecore_imf_context_input_panel_return_key_type_set(Ecore_IMF_Context *ctx, Ecore_IMF_Input_Panel_Return_Key_Type return_key_type)
-{
- if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
- {
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_return_key_type_set");
- return;
- }
-
- ctx->input_panel_return_key_type = return_key_type;
- if (ctx->klass->input_panel_return_key_type_set) ctx->klass->input_panel_return_key_type_set(ctx, return_key_type);
-}
-
-/**
- * Get the "return" key type.
- *
- * @see ecore_imf_context_input_panel_return_key_type_set() for more details
- *
- * @param ctx An #Ecore_IMF_Context.
- * @return The type of "return" key on the input panel
- * @ingroup Ecore_IMF_Context_Group
- * @since 1.2.0
- */
-EAPI Ecore_IMF_Input_Panel_Return_Key_Type
-ecore_imf_context_input_panel_return_key_type_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_return_key_type_get");
- return EINA_FALSE;
- }
-
- return ctx->input_panel_return_key_type;
-}
-
-/**
- * Set the return key on the input panel to be disabled.
- *
- * @param ctx An #Ecore_IMF_Context.
- * @param disabled The state
- * @ingroup Ecore_IMF_Context_Group
- * @since 1.2.0
- */
-EAPI void
-ecore_imf_context_input_panel_return_key_disabled_set(Ecore_IMF_Context *ctx, Eina_Bool disabled)
-{
- if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
- {
- ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
- "ecore_imf_context_input_panel_return_key_disabled_set");
- return;
- }
-
- ctx->input_panel_return_key_disabled = disabled;
- if (ctx->klass->input_panel_return_key_disabled_set) ctx->klass->input_panel_return_key_disabled_set(ctx, disabled);
-}
-
-/**
- * Get whether the return key on the input panel should be disabled or not.
- *
- * @param ctx An #Ecore_IMF_Context.
- * @return EINA_TRUE if it should be disabled
- * @ingroup Ecore_IMF_Context_Group
- * @since 1.2.0
- */
-EAPI Eina_Bool
-ecore_imf_context_input_panel_return_key_disabled_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_return_key_disabled_get");
- return EINA_FALSE;
- }
-
- return ctx->input_panel_return_key_disabled;
-}
-
-/**
* Get the position of the current active input panel.
*
* @param ctx An #Ecore_IMF_Context.
EINA_DEPRECATED EAPI void
ecore_imf_context_input_panel_private_key_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, const char *img_path, const char *label, int key_value, const char *key_string)
{
- // will be deleted
+ Private_Key_Item *key_item;
+ Eina_List *l;
+ Eina_Bool exist = EINA_FALSE;
+
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_private_key_set");
+ return;
+ }
+
+ if ((!label) && (!img_path)) return;
+
+ EINA_LIST_FOREACH(ctx->private_key_list, l, key_item)
+ {
+ if (key_item && (key_item->layout_idx == layout_index) &&
+ (key_item->key_idx == key_index))
+ {
+ // if exist in the list
+ exist = EINA_TRUE;
+ if (label)
+ {
+ key_item->type = 0;
+ strcpy(key_item->data, label);
+ }
+ else
+ {
+ key_item->type = 1;
+ strcpy(key_item->data, img_path);
+ }
+ key_item->key_value = key_value;
+ strcpy(key_item->key_string, key_string);
+ }
+ }
+
+ if (!exist)
+ {
+ key_item = calloc(1, sizeof(Private_Key_Item));
+ if (!key_item) return;
+
+ key_item->layout_idx = layout_index;
+ key_item->key_idx = key_index;;
+ if (label)
+ {
+ key_item->type = 0;
+ strcpy(key_item->data, label);
+ }
+ else
+ {
+ key_item->type = 1;
+ strcpy(key_item->data, img_path);
+ }
+ key_item->key_value = key_value;
+
+ if (key_string)
+ strcpy(key_item->key_string, key_string);
+
+ ctx->private_key_list = eina_list_append(ctx->private_key_list, key_item);
+ }
+
+// if (ctx->klass->input_panel_private_key_set) ctx->klass->input_panel_private_key_set(ctx, layout_index, key_index, img_path, label, value);
}
/**
EINA_DEPRECATED EAPI Eina_List *
ecore_imf_context_input_panel_private_key_list_get(Ecore_IMF_Context *ctx)
{
- // will be deleted
- return NULL;
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_private_key_list_get");
+ return NULL;
+ }
+
+ return ctx->private_key_list;
}
/**
EINA_DEPRECATED EAPI void
ecore_imf_context_input_panel_key_disabled_set(Ecore_IMF_Context *ctx, int layout_index, int key_index, Eina_Bool disabled)
{
- // will be deleted
+ Disable_Key_Item *key_item;
+ Eina_List *l;
+ Eina_Bool exist = EINA_FALSE;
+
+ if (!ECORE_MAGIC_CHECK(ctx, ECORE_MAGIC_CONTEXT))
+ {
+ ECORE_MAGIC_FAIL(ctx, ECORE_MAGIC_CONTEXT,
+ "ecore_imf_context_input_panel_key_disabled_set");
+ return;
+ }
+
+ EINA_LIST_FOREACH(ctx->disabled_key_list, l, key_item)
+ {
+ if (key_item && (key_item->layout_idx == layout_index) &&
+ (key_item->key_idx == key_index))
+ {
+ key_item->disabled = disabled;
+ exist = EINA_TRUE;
+ }
+ }
+
+ if (!exist)
+ {
+ key_item = calloc(1, sizeof(Disable_Key_Item));
+ if (!key_item) return;
+
+ key_item->layout_idx = layout_index;
+ key_item->key_idx = key_index;;
+ key_item->disabled = disabled;
+
+ ctx->disabled_key_list = eina_list_append(ctx->disabled_key_list, key_item);
+ }
+
+// if (ctx->klass->input_panel_key_disabled_set) ctx->klass->input_panel_key_disabled_set(ctx, layout_index, key_index, disabled);
}
/**
EINA_DEPRECATED EAPI Eina_List *
ecore_imf_context_input_panel_key_disabled_list_get(Ecore_IMF_Context *ctx)
{
- // will be deleted
- return NULL;
+ return ctx->disabled_key_list;
}
/**