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
This commit is contained in:
Jean-Philippe Andre 2017-11-29 15:34:52 +09:00
parent 6225293d2e
commit 8faa65d90b
4 changed files with 29 additions and 26 deletions

View 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

View 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);
/**

View 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

View 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;