EAPI double edje_scale_get (void);
EAPI Eina_Bool edje_object_scale_set (Evas_Object *obj, double scale);
EAPI double edje_object_scale_get (const Evas_Object *obj);
+ EAPI void edje_input_panel_enabled_set (Eina_Bool enabled);
/* edje_load.c */
EAPI Eina_List *edje_file_collection_list (const char *file);
#ifdef HAVE_ECORE_IMF
EAPI const Ecore_IMF_Context *edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part);
#endif
- EAPI void edje_object_part_text_input_panel_enable_set(const Evas_Object *obj, const char *part, Eina_Bool disabled);
+ EAPI void edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool disabled);
EAPI void edje_object_text_insert_filter_callback_add (Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data);
EAPI void edje_object_text_insert_filter_callback_del (Evas_Object *obj, const char *part, void (*func) (void *data, Evas_Object *obj, const char *part, char **text), const void *data);
static int _edje_entry_imf_event_delete_surrounding_cb(void *data, int type, void *event);
#endif
+static Eina_Bool keypad_show = EINA_FALSE;
+
typedef struct _Entry Entry;
typedef struct _Sel Sel;
typedef struct _Anchor Anchor;
#ifdef HAVE_ECORE_IMF
int comp_len;
Eina_Bool have_composition : 1;
+ Eina_Bool input_panel_enable : 1;
Ecore_IMF_Context *imf_context;
Ecore_Event_Handler *imf_ee_handler_commit;
};
#ifdef HAVE_ECORE_IMF
+static int _hide_timer_handler(void *data)
+{
+ Entry *en = (Entry *)data;
+
+ if (!keypad_show)
+ {
+ if (en->imf_context)
+ {
+ ecore_imf_context_input_panel_hide(en->imf_context);
+ }
+ }
+
+ return ECORE_CALLBACK_CANCEL;
+}
+
static void
_edje_entry_focus_in_cb(void *data, Evas_Object *o __UNUSED__, const char *emission __UNUSED__, const char *source __UNUSED__)
{
if (!rp || !rp->entry_data || !rp->edje || !rp->edje->obj) return;
en = rp->entry_data;
+ if (!en) return;
if (!en->imf_context) return;
if (evas_object_focus_get(rp->edje->obj))
{
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_focus_in(en->imf_context);
+
+ if (en->input_panel_enable)
+ {
+ keypad_show = EINA_TRUE;
+ ecore_imf_context_input_panel_show(en->imf_context);
+ }
}
}
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_cursor_position_set(en->imf_context, evas_textblock_cursor_pos_get(en->cursor));
ecore_imf_context_focus_out(en->imf_context);
+
+ if (en->input_panel_enable)
+ {
+ keypad_show = EINA_FALSE;
+ ecore_timer_add(0.2, _hide_timer_handler, en);
+ }
}
#endif
if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
-
+
if (en->imf_context)
{
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_focus_in(en->imf_context);
+
+ if (en->input_panel_enable)
+ {
+ keypad_show = EINA_TRUE;
+ ecore_imf_context_input_panel_show(en->imf_context);
+ }
}
#endif
}
(rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_EDITABLE))
return;
- if (en->imf_context)
+ if (!en->imf_context) return;
+
+ ecore_imf_context_reset(en->imf_context);
+ ecore_imf_context_cursor_position_set(en->imf_context,
+ evas_textblock_cursor_pos_get(en->cursor));
+ ecore_imf_context_focus_out(en->imf_context);
+
+ if (en->input_panel_enable)
{
- ecore_imf_context_reset(en->imf_context);
- ecore_imf_context_cursor_position_set(en->imf_context,
- evas_textblock_cursor_pos_get(en->cursor));
- ecore_imf_context_focus_out(en->imf_context);
+ keypad_show = EINA_FALSE;
+ ecore_timer_add(0.2, _hide_timer_handler, en);
}
#endif
}
if (!ev->key) return;
#ifdef HAVE_ECORE_IMF
-#if 0 // FIXME -- keyboard activated IMF
+#if 1 // FIXME -- keyboard activated IMF
if (en->imf_context)
{
Ecore_IMF_Event_Key_Down ecore_ev;
return;
#ifdef HAVE_ECORE_IMF
-#if 0 // FIXME key activation imf
+#if 1 // FIXME key activation imf
+ Evas_Event_Key_Up *ev = event_info;
+
if (en->imf_context)
{
Ecore_IMF_Event_Key_Up ecore_ev;
ecore_imf_context_reset(en->imf_context);
ecore_imf_context_cursor_position_set(en->imf_context,
evas_textblock_cursor_pos_get(en->cursor));
+
+ if (en->input_panel_enable)
+ {
+ keypad_show = EINA_TRUE;
+ ecore_imf_context_input_panel_show(en->imf_context);
+ }
}
#endif
rp->entry_data = en;
en->rp = rp;
+#ifdef HAVE_ECORE_IMF
+ en->input_panel_enable = _edje_input_panel_enable;
+#endif
+
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_DOWN, _edje_part_mouse_down_cb, rp);
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_UP, _edje_part_mouse_up_cb, rp);
evas_object_event_callback_add(rp->object, EVAS_CALLBACK_MOUSE_MOVE, _edje_part_mouse_move_cb, rp);
}
#endif
+void
+_edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled)
+{
+ Entry *en = rp->entry_data;
+ en->input_panel_enable = enabled;
+}
+
static Evas_Textblock_Cursor *
_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
{
extern int _edje_freeze_val;
extern int _edje_freeze_calc_count;
extern Eina_List *_edje_freeze_calc_list;
+extern Eina_Bool _edje_input_panel_enable;
extern Eina_Mempool *_edje_real_part_mp;
extern Eina_Mempool *_edje_real_part_state_mp;
void _edje_entry_select_allow_set(Edje_Real_Part *rp, Eina_Bool allow);
Eina_Bool _edje_entry_select_allow_get(const Edje_Real_Part *rp);
void _edje_entry_select_abort(Edje_Real_Part *rp);
-
+void _edje_entry_autocapitalization_set(Edje_Real_Part *rp, Eina_Bool on);
+#ifdef HAVE_ECORE_IMF
+const Ecore_IMF_Context *_edje_entry_imf_context_get(Edje_Real_Part *rp);
+#endif
+void _edje_entry_input_panel_enabled_set(Edje_Real_Part *rp, Eina_Bool enabled);
Eina_Bool _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur);
Eina_Bool _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur);
Eina_Bool _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur);
int _edje_freeze_val = 0;
int _edje_freeze_calc_count = 0;
Eina_List *_edje_freeze_calc_list = NULL;
+Eina_Bool _edje_input_panel_enable = EINA_FALSE;
typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data;
struct _Edje_List_Foreach_Data
return TO_DOUBLE(ed->scale);
}
+EAPI void
+edje_input_panel_enabled_set(Eina_Bool enabled)
+{
+ Eina_List *l;
+ Evas_Object *data;
+
+ if (_edje_input_panel_enable == enabled) return;
+ _edje_input_panel_enable = enabled;
+}
+
/**
* @brief Get Edje object data.
*
}
#endif
+EAPI void
+edje_object_part_text_input_panel_enabled_set(const Evas_Object *obj, const char *part, Eina_Bool enabled)
+{
+ Edje *ed;
+ Edje_Real_Part *rp;
+
+ ed = _edje_fetch(obj);
+ if ((!ed) || (!part)) return;
+ rp = _edje_real_part_recursive_get(ed, (char *)part);
+ if (!rp) return;
+ if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ _edje_entry_input_panel_enabled_set(rp, enabled);
+}
+
/**
* @brief XX
*