edje: Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements. 14/58214/3 accepted/tizen/mobile/20160129.083815 accepted/tizen/tv/20160129.083837 accepted/tizen/wearable/20160129.083856 submit/tizen/20160129.051436
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 16 Jul 2015 04:43:05 +0000 (13:43 +0900)
committerYoungbok Shin <youngb.shin@samsung.com>
Fri, 29 Jan 2016 04:49:13 +0000 (20:49 -0800)
@tizen_feature

Change-Id: I3852c2c724c5d4e996b11713f1f3915408e87adb

src/lib/edje/Edje_Common.h
src/lib/edje/edje_entry.c
src/lib/edje/edje_private.h
src/lib/edje/edje_util.c

index b867220..2e433e6 100644 (file)
@@ -2186,6 +2186,33 @@ EAPI Eina_Bool edje_audio_channel_mute_get(Edje_Channel channel);
  * @since 1.10
  */
 EAPI const char *edje_object_part_object_name_get(const Evas_Object *obj);
+
+/**
+ * @internal
+ * @brief These APIs are for communicating with edje_entry for not moving
+ *        cursor position meanwhile.
+ *
+ * @remarks Tizen only feature (2015.07.16)
+ *
+ * @remarks Applications NEVER USE THESE APIs for private purporse.
+ *
+ * @see edje_object_part_text_thaw()
+ */
+EAPI void                    edje_object_part_text_freeze    (Evas_Object *obj, const char *part);
+
+/**
+ * @internal
+ * @brief These APIs are for communicating with edje_entry for not moving
+ *        cursor position meanwhile.
+ *
+ * @remarks Tizen only feature (2015.07.16)
+ *
+ * @remarks Applications NEVER USE THESE APIs for private purporse.
+ *
+ * @see edje_object_part_text_freeze()
+ */
+EAPI void                    edje_object_part_text_thaw      (Evas_Object *obj, const char *part);
+
 /**
  * @}
  */
index 3209954..83b0839 100644 (file)
@@ -47,6 +47,9 @@ struct _Entry
    Eina_Bool              input_panel_enable : 1;
    Eina_Bool              prediction_allow : 1;
    Eina_Bool              anchors_updated : 1;
+   // TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+   Eina_Bool freeze : 1;
+   //
 
 #ifdef HAVE_ECORE_IMF
    Eina_Bool              have_preedit : 1;
@@ -2879,9 +2882,16 @@ _edje_entry_text_markup_set(Edje_Real_Part *rp, const char *text)
 
    _anchors_get(en->cursor, rp->object, en);
    _edje_emit(en->ed, "entry,changed", rp->part->name);
-   _edje_entry_imf_cursor_info_set(en);
-
-   _edje_entry_real_part_configure(en->ed, rp);
+   // TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+   //_edje_entry_imf_cursor_info_set(en);
+   //
+   //_edje_entry_real_part_configure(en->ed, rp);
+   if (!en->freeze)
+     {
+        _edje_entry_imf_cursor_info_set(en);
+        _edje_entry_real_part_configure(en->ed, rp);
+     }
+   //
 #if 0
    /* Don't emit cursor changed cause it didn't. It's just init to 0. */
    _edje_emit(en->ed, "cursor,changed", rp->part->name);
@@ -2944,7 +2954,11 @@ _edje_entry_set_cursor_start(Edje_Real_Part *rp)
    if (!en) return;
    _curs_start(en->cursor, rp->object, en);
 
-   _edje_entry_imf_cursor_info_set(en);
+   // TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+   //_edje_entry_imf_cursor_info_set(en);
+   if (!en->freeze)
+     _edje_entry_imf_cursor_info_set(en);
+   //
 }
 
 void
@@ -3955,9 +3969,17 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
    evas_textblock_cursor_pos_set(c, pos);
    _sel_update(en->ed, c, rp->object, rp->typedata.text->entry_data);
 
-   _edje_entry_imf_cursor_info_set(en);
+   // TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+   //_edje_entry_imf_cursor_info_set(en);
+   //_edje_emit(en->ed, "cursor,changed", rp->part->name);
+   //_edje_entry_real_part_configure(en->ed, rp);
    _edje_emit(en->ed, "cursor,changed", rp->part->name);
-   _edje_entry_real_part_configure(en->ed, rp);
+   if (!en->freeze)
+     {
+        _edje_entry_imf_cursor_info_set(en);
+        _edje_entry_real_part_configure(en->ed, rp);
+     }
+   //
 }
 
 int
@@ -4503,4 +4525,35 @@ _edje_entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Context *ctx EINA_UN
 
 #endif
 
+// TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+void _edje_entry_freeze(Edje_Real_Part *rp)
+{
+   Entry *en = NULL;
+
+   if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+       (!rp->typedata.text)) return;
+
+   en = rp->typedata.text->entry_data;
+   if (!en) return;
+
+   en->freeze = EINA_TRUE;
+}
+
+void _edje_entry_thaw(Edje_Real_Part *rp)
+{
+   Entry *en = NULL;
+
+   if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+       (!rp->typedata.text)) return;
+
+   en = rp->typedata.text->entry_data;
+   if (!en) return;
+
+   en->freeze = EINA_FALSE;
+
+   _edje_entry_imf_cursor_info_set(en);
+   _edje_entry_real_part_configure(en->ed, rp);
+}
+////////////////////////////////////////////////////////////////////////////////////////////////
+
 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
index ee0e51a..62c899c 100644 (file)
@@ -2680,6 +2680,10 @@ void _edje_entry_input_panel_return_key_disabled_set(Edje_Real_Part *rp, Eina_Bo
 Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp);
 void _edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand);
 Eina_Bool _edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp);
+// TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+void _edje_entry_freeze(Edje_Real_Part *rp);
+void _edje_entry_thaw(Edje_Real_Part *rp);
+//
 
 void _edje_external_init(void);
 void _edje_external_shutdown(void);
index 357717d..2190e38 100644 (file)
@@ -5816,4 +5816,36 @@ _edje_part_mask_flags_set(Edje *ed EINA_UNUSED, Edje_Real_Part *rp, Evas_Event_F
    rp->part->mask_flags = mask_flags;
 }
 
+// TIZEN_ONLY(20150716): Add edje_object_part_text_freeze, thaw APIs for freezing cursor movements.
+EAPI void edje_object_part_text_freeze(Evas_Object *obj, const char *part)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return;
+   rp = _edje_real_part_recursive_get(&ed, part);
+   if (!rp) return;
+   if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return;
+   if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return;
+
+   _edje_entry_freeze(rp);
+}
+
+EAPI void edje_object_part_text_thaw(Evas_Object *obj, const char *part)
+{
+   Edje *ed;
+   Edje_Real_Part *rp;
+
+   ed = _edje_fetch(obj);
+   if ((!ed) || (!part)) return;
+   rp = _edje_real_part_recursive_get(&ed, part);
+   if (!rp) return;
+   if ((rp->part->type != EDJE_PART_TYPE_TEXTBLOCK)) return;
+   if (rp->part->entry_mode <= EDJE_ENTRY_EDIT_MODE_NONE) return;
+
+   _edje_entry_thaw(rp);
+}
+/////////////////////////////////////////////////////////////////////////////////////////////////////
+
 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/