summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 15:34:52 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-29 15:36:44 +0900
commit8faa65d90b5e148b30ffa7c589f7ff7bc14026f7 (patch)
tree0a4f98e340fc3741b1c424abde53627e6f06c20e
parent6225293d2ec7c82074cb2818487cd9ead06df863 (diff)
edje: Move text_change_cb to legacy only
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
-rw-r--r--src/lib/edje/Edje_Common.h12
-rw-r--r--src/lib/edje/Edje_Legacy.h24
-rw-r--r--src/lib/edje/edje_object.eo11
-rw-r--r--src/lib/edje/edje_util.c8
4 files changed, 29 insertions, 26 deletions
diff --git a/src/lib/edje/Edje_Common.h b/src/lib/edje/Edje_Common.h
index 3f2c81066a..69e4585e55 100644
--- a/src/lib/edje/Edje_Common.h
+++ b/src/lib/edje/Edje_Common.h
@@ -1325,18 +1325,6 @@ typedef enum _Edje_Text_Effect
1325 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< right shadow direction value */ 1325 EDJE_TEXT_EFFECT_SHADOW_DIRECTION_RIGHT = (0x7 << 4) /**< right shadow direction value */
1326} Edje_Text_Effect; 1326} Edje_Text_Effect;
1327 1327
1328/**
1329 * @typedef (*Edje_Text_Change_Cb)
1330 *
1331 * Callback prototype for Edje_Text_Change.
1332 * @param data User provided data to pass to the callback
1333 * @param obj The Evas_Object
1334 * @param part The edje part
1335 */
1336typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part);
1337/**
1338 * @}
1339 */
1340 1328
1341/** 1329/**
1342 * @defgroup Edje_Text_Selection Edje Text Selection 1330 * @defgroup Edje_Text_Selection Edje Text Selection
diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h
index 018ef463b8..0c35d4ac42 100644
--- a/src/lib/edje/Edje_Legacy.h
+++ b/src/lib/edje/Edje_Legacy.h
@@ -437,6 +437,30 @@ EAPI int edje_object_freeze(Edje_Object *obj);
437 */ 437 */
438EAPI int edje_object_thaw(Edje_Object *obj); 438EAPI int edje_object_thaw(Edje_Object *obj);
439 439
440/**
441 * @typedef (*Edje_Text_Change_Cb)
442 *
443 * Callback prototype for Edje_Text_Change.
444 * @param data User provided data to pass to the callback
445 * @param obj The Evas_Object
446 * @param part The edje part
447 */
448typedef void (*Edje_Text_Change_Cb) (void *data, Evas_Object *obj, const char *part);
449/**
450 * @}
451 */
452
453/**
454 * @brief Sets the object text callback.
455 *
456 * This function sets the callback to be called when the text changes.
457 *
458 * @param[in] obj The object.
459 * @param[in] func The callback function to handle the text change
460 * @param[in] data The data associated to the callback function.
461 */
462EAPI void edje_object_text_change_cb_set(Edje_Object *obj, Edje_Text_Change_Cb func, void *data);
463
440 464
441 465
442/** 466/**
diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo
index b8b83fe525..90fd21ac2d 100644
--- a/src/lib/edje/edje_object.eo
+++ b/src/lib/edje/edje_object.eo
@@ -73,17 +73,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part,
73 } 73 }
74 74
75 /* TEXT PART APIS BEGIN ---------------------------------------------- */ 75 /* TEXT PART APIS BEGIN ---------------------------------------------- */
76 @property text_change_cb {
77 set {
78 [[Sets the object text callback.
79
80 This function sets the callback to be called when the text changes.]]
81 }
82 values {
83 func: Edje.Text.Change_Cb; [[The callback function to handle the text change]]
84 data: void_ptr; [[The data associated to the callback function.]]
85 }
86 }
87 @property item_provider { 76 @property item_provider {
88 set { 77 set {
89 [[Sets the function that provides item objects for named items in an edje entry text 78 [[Sets the function that provides item objects for named items in an edje entry text
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index d26774bd92..f1b00c7eb4 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -1916,12 +1916,14 @@ _edje_object_item_provider_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Item_Provider
1916 ed->item_provider.data = data; 1916 ed->item_provider.data = data;
1917} 1917}
1918 1918
1919/* FIXDOC: New Function */ 1919EAPI void
1920EOLIAN void 1920edje_object_text_change_cb_set(Eo *obj, Edje_Text_Change_Cb func, void *data)
1921_edje_object_text_change_cb_set(Eo *obj EINA_UNUSED, Edje *ed, Edje_Text_Change_Cb func, void *data)
1922{ 1921{
1923 unsigned short i; 1922 unsigned short i;
1923 Edje *ed;
1924 1924
1925 ed = _edje_fetch(obj);
1926 if (!ed) return;
1925 ed->text_change.func = func; 1927 ed->text_change.func = func;
1926 ed->text_change.data = data; 1928 ed->text_change.data = data;
1927 1929