edje: Move text_change_cb to legacy only
authorJean-Philippe Andre <jp.andre@samsung.com>
Wed, 29 Nov 2017 06:34:52 +0000 (15:34 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Wed, 29 Nov 2017 06:36:44 +0000 (15:36 +0900)
This should probably be replaced by a well defined signal.

Note: If edje sends signals on swallow/unswallow and text set/unset we
could simplify some of the elementary code, eg. for button's icon
handling. The theme should be handling the padding automatically, it's
not the elementary widget's role

Ref T5315

src/lib/edje/Edje_Common.h
src/lib/edje/Edje_Legacy.h
src/lib/edje/edje_object.eo
src/lib/edje/edje_util.c

index 3f2c810..69e4585 100644 (file)
@@ -1325,18 +1325,6 @@ typedef enum _Edje_Text_Effect
    EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT        = (0x7 << 4)  /**< right shadow direction value */
 } Edje_Text_Effect;
 
-/**
- * @typedef (*Edje_Text_Change_Cb)
- *
- * Callback prototype for Edje_Text_Change.
- * @param data User provided data to pass to the callback
- * @param obj The Evas_Object
- * @param part The edje part
- */
-typedef void         (*Edje_Text_Change_Cb)     (void *data, Evas_Object *obj, const char *part);
-/**
- * @}
- */
 
 /**
  * @defgroup Edje_Text_Selection Edje Text Selection
index 018ef46..0c35d4a 100644 (file)
@@ -437,6 +437,30 @@ EAPI int edje_object_freeze(Edje_Object *obj);
  */
 EAPI int edje_object_thaw(Edje_Object *obj);
 
+/**
+ * @typedef (*Edje_Text_Change_Cb)
+ *
+ * Callback prototype for Edje_Text_Change.
+ * @param data User provided data to pass to the callback
+ * @param obj The Evas_Object
+ * @param part The edje part
+ */
+typedef void         (*Edje_Text_Change_Cb)     (void *data, Evas_Object *obj, const char *part);
+/**
+ * @}
+ */
+
+/**
+ * @brief Sets the object text callback.
+ *
+ * This function sets the callback to be called when the text changes.
+ *
+ * @param[in] obj The object.
+ * @param[in] func The callback function to handle the text change
+ * @param[in] data The data associated to the callback function.
+ */
+EAPI void edje_object_text_change_cb_set(Edje_Object *obj, Edje_Text_Change_Cb func, void *data);
+
 
 
 /**
index b8b83fe..90fd21a 100644 (file)
@@ -73,17 +73,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
       }
 
       /* TEXT PART APIS BEGIN ---------------------------------------------- */
-      @property text_change_cb {
-         set {
-            [[Sets the object text callback.
-
-              This function sets the callback to be called when the text changes.]]
-         }
-         values {
-            func: Edje.Text.Change_Cb; [[The callback function to handle the text change]]
-            data: void_ptr; [[The data associated to the callback function.]]
-         }
-      }
       @property item_provider {
          set {
             [[Sets the function that provides item objects for named items in an edje entry text
index d26774b..f1b00c7 100644 (file)
@@ -1916,12 +1916,14 @@ _edje_object_item_provider_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Item_Provider
    ed->item_provider.data = data;
 }
 
-/* FIXDOC: New Function */
-EOLIAN void
-_edje_object_text_change_cb_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Text_Change_Cb func, void *data)
+EAPI void
+edje_object_text_change_cb_set(Eo *obj, Edje_Text_Change_Cb func, void *data)
 {
    unsigned short i;
+   Edje *ed;
 
+   ed = _edje_fetch(obj);
+   if (!ed) return;
    ed->text_change.func = func;
    ed->text_change.data = data;