upload edje_0.9.92.060+svn.49543slp2+3build09
authorJihoon Kim <jihoon48.kim@samsung.com>
Thu, 8 Jul 2010 08:38:46 +0000 (17:38 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 8 Jul 2010 08:38:46 +0000 (17:38 +0900)
debian/changelog
src/lib/Edje.h
src/lib/edje_entry.c [changed mode: 0755->0644]
src/lib/edje_private.h [changed mode: 0755->0644]
src/lib/edje_util.c [changed mode: 0755->0644]

index ef88a26..e538d23 100644 (file)
@@ -1,3 +1,11 @@
+edje (0.9.92.060+svn.49543slp2+3build09) unstable; urgency=low
+
+  * Add APIs related to input panel
+  * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/EFL-pkgs/edje
+  * Tag: edje_0.9.92.060+svn.49543slp2+3build09
+
+ -- Jihoon Kim <jihoon48.kim@samsung.com>  Thu, 08 Jul 2010 17:36:04 +0900
+
 edje (0.9.92.060+svn.49543slp2+3build08) unstable; urgency=low
 
   * Packaging.
index 9294cc0..5c0b19d 100644 (file)
@@ -433,6 +433,7 @@ typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Mess
    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);
@@ -540,7 +541,7 @@ typedef void (*Edje_Message_Handler_Cb) (void *data, Evas_Object *obj, Edje_Mess
 #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);
old mode 100755 (executable)
new mode 100644 (file)
index e5ac95f..80ca162
@@ -34,6 +34,8 @@ static int _edje_entry_imf_event_changed_cb(void *data, int type, void *event);
 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;
@@ -71,6 +73,7 @@ struct _Entry
 #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;
@@ -97,6 +100,21 @@ struct _Anchor
 };
 
 #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__)
 {
@@ -107,12 +125,19 @@ _edje_entry_focus_in_cb(void *data, Evas_Object *o __UNUSED__, const char *emiss
    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);
+         }
      }
 }
 
@@ -131,6 +156,12 @@ _edje_entry_focus_out_cb(void *data, Evas_Object *o __UNUSED__, const char *emis
    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
 
@@ -152,11 +183,17 @@ _edje_focus_in_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
    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
 }
@@ -179,12 +216,17 @@ _edje_focus_out_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__,
        (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
 }
@@ -1424,7 +1466,7 @@ _edje_key_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, v
    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;
@@ -1819,7 +1861,9 @@ _edje_key_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, voi
      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;
@@ -1994,6 +2038,12 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
        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
    
@@ -2230,6 +2280,10 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
    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);
@@ -2728,6 +2782,13 @@ _edje_entry_imf_context_get(Edje_Real_Part *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)
 {
old mode 100755 (executable)
new mode 100644 (file)
index a771fc1..9732aec
@@ -1297,6 +1297,7 @@ extern FLOAT_T          _edje_scale;
 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;
@@ -1608,7 +1609,11 @@ void _edje_entry_cursor_geometry_get(Edje_Real_Part *rp, Evas_Coord *cx, Evas_Co
 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);
old mode 100755 (executable)
new mode 100644 (file)
index ac44eeb..05ed5ed
@@ -31,6 +31,7 @@ FLOAT_T _edje_scale = ZERO;
 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
@@ -266,6 +267,16 @@ edje_object_scale_get(const Evas_Object *obj)
    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.
  *
@@ -1909,6 +1920,20 @@ edje_object_part_text_imf_context_get(const Evas_Object *obj, const char *part)
 }
 #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
  *