rimmed pushed a commit to branch master. http://git.enlightenment.org/tools/eflete.git/commit/?id=d75eab5d81a81fcf5646be7640f31b735d5e102e
commit d75eab5d81a81fcf5646be7640f31b735d5e102e Author: Andrii Kroitor <[email protected]> Date: Mon Oct 5 17:37:01 2015 +0300 property: use editor api for part item source --- src/bin/editor/editor.h | 3 +++ src/bin/ui/property.c | 9 +++++---- src/bin/ui/property_macros.h | 23 ++++++----------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/src/bin/editor/editor.h b/src/bin/editor/editor.h index a41bb4b..b4c4dfe 100644 --- a/src/bin/editor/editor.h +++ b/src/bin/editor/editor.h @@ -426,6 +426,9 @@ Eina_Bool editor_part_item_position_row_set(Evas_Object *obj, Change *change, Eina_Bool merge, const char *part_name, const char *item_name, unsigned short new_val); Eina_Bool +editor_part_item_source_set(Evas_Object *obj, Change *change, Eina_Bool merge, const char *part_name, const char *item_name, + const char * new_val); +Eina_Bool editor_part_scale_set(Evas_Object *obj, Change *change, Eina_Bool merge, const char *part_name, Eina_Bool new_val); Eina_Bool diff --git a/src/bin/ui/property.c b/src/bin/ui/property.c index 2b1f606..82855a7 100644 --- a/src/bin/ui/property.c +++ b/src/bin/ui/property.c @@ -1409,7 +1409,7 @@ PART_ATTR_SOURCE_UPDATE(part, source) PART_ATTR_1CHECK_ADD(TEXT, SUB, VALUE, MEMBER, TOOLTIP) #define PART_ATTR_1COMBOBOX(TEXT, SUB, VALUE, MEMBER, TOOLTIP, DESCRIPTION) \ - PART_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, DESCRIPTION) \ + PART_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, PART_ARGS, DESCRIPTION) \ PART_ATTR_1COMBOBOX_ADD(TEXT, SUB, VALUE, MEMBER, TOOLTIP) #define PART_ATTR_1COMBOBOX_LIST(TEXT, SUB, VALUE, MEMBER, TYPE, LIST, TOOLTIP, DESCRIPTION) \ @@ -3550,8 +3550,8 @@ TODO("do not use collection lists from edje_edit directly") edje_mmap_collection_list_free(collections); } -#define PART_ITEM_ATTR_1COMBOBOX(TEXT, SUB, VALUE, MEMBER, TOOLTIP) \ - PART_ITEM_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER) \ +#define PART_ITEM_ATTR_1COMBOBOX(TEXT, SUB, VALUE, MEMBER, TOOLTIP, DESCRIPTION) \ + PART_ITEM_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, DESCRIPTION) \ PART_ITEM_ATTR_1COMBOBOX_ADD(TEXT, SUB, VALUE, MEMBER, TOOLTIP) #define PART_ITEM_ATTR_2SPINNER(TEXT, SUB, VALUE1, VALUE2, MEMBER, MIN, MAX, STEP, FMT, \ @@ -3567,7 +3567,8 @@ TODO("do not use collection lists from edje_edit directly") PART_ITEM_ATTR_1COMBOBOX_LIST_CALLBACK(TEXT, SUB, VALUE, TYPE) \ PART_ITEM_ATTR_1COMBOBOX_LIST_ADD(TEXT, SUB, VALUE, MEMBER, LIST, TOOLTIP) -PART_ITEM_ATTR_1COMBOBOX(_("source"), part_item, source, part_item, _("Sets the group this object will be made from.")) +PART_ITEM_ATTR_1COMBOBOX(_("source"), part_item, source, part_item, _("Sets the group this object will be made from."), + _("changed source to %s")) PART_ITEM_ATTR_2SPINNER(_("min"), part_item, min_w, min_h, part_item, 0.0, 999.0, 1.0, NULL, "x:", "%", "y:", "%", _("Set the item minimum size hint width in pixels"), _("Set the item minimum size hint height in pixels"), diff --git a/src/bin/ui/property_macros.h b/src/bin/ui/property_macros.h index 075d173..97314f3 100644 --- a/src/bin/ui/property_macros.h +++ b/src/bin/ui/property_macros.h @@ -801,7 +801,7 @@ prop_##MEMBER##_##VALUE##_add(Evas_Object *parent, \ * * @ingroup Property_Macro */ -#define PART_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, DESCRIPTION) \ +#define PART_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, ARGS, DESCRIPTION) \ static void \ _on_##MEMBER##_##VALUE##_change(void *data, \ Evas_Object *obj __UNUSED__, \ @@ -814,8 +814,8 @@ _on_##MEMBER##_##VALUE##_change(void *data, \ eina_stringshare_del(msg); \ if (item->index != 0) \ { \ - if (!editor_##SUB##_##VALUE##_set(pd->group->edit_object, change, false, \ - pd->part->name, item->title)) \ + if (!editor_##SUB##_##VALUE##_set(pd->group->edit_object, change, false \ + ARGS, item->title)) \ { \ ewe_combobox_select_item_set(obj, pd->attributes.part.previous_source); \ change_free(change); \ @@ -825,7 +825,7 @@ _on_##MEMBER##_##VALUE##_change(void *data, \ } \ else \ { \ - editor_##SUB##_##VALUE##_set(pd->group->edit_object, change, false, pd->part->name, NULL); \ + editor_##SUB##_##VALUE##_set(pd->group->edit_object, change, false ARGS, NULL); \ pd->attributes.part.previous_source = 0; \ } \ history_change_add(pd->group->history, change); \ @@ -1120,19 +1120,8 @@ prop_##MEMBER##_##VALUE##_update(Prop_Data *pd) \ * * @ingroup Property_Macro */ -#define PART_ITEM_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER) \ -static void \ -_on_##MEMBER##_##VALUE##_change(void *data, \ - Evas_Object *obj __UNUSED__, \ - void *ei) \ -{ \ - Prop_Data *pd = (Prop_Data *)data; \ - Ewe_Combobox_Item *item = ei; \ - edje_edit_##SUB##_##VALUE##_set(pd->group->edit_object, pd->part->name, \ - pd->item_name, item->title); \ - /*project_changed(false);*/ \ - evas_object_smart_callback_call(ap.win, SIGNAL_PROPERTY_ATTRIBUTE_CHANGED, NULL); \ -} +#define PART_ITEM_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, DESCRIPTION) \ + PART_ATTR_1COMBOBOX_CALLBACK(SUB, VALUE, MEMBER, PART_ITEM_ARGS, DESCRIPTION) /*****************************************************************************/ /* PART ITEM 2 SPINNER CONTROLS */ --
