2018-04-22 23:13:59 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define EFL_UI_LIST_DEFAULT_ITEM_PROTECTED
|
2018-05-03 16:34:17 -07:00
|
|
|
#define EFL_PART_PROTECTED
|
2018-04-22 23:13:59 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
|
|
|
|
#include "elm_priv.h"
|
|
|
|
#include "elm_part_helper.h"
|
|
|
|
|
|
|
|
#define MY_CLASS EFL_UI_LIST_DEFAULT_ITEM_CLASS
|
|
|
|
#define MY_CLASS_PFX efl_ui_list_default_item
|
|
|
|
|
|
|
|
#define MY_CLASS_NAME "Efl.Ui.List_Default_Item"
|
|
|
|
|
|
|
|
EOLIAN static Efl_Object *
|
|
|
|
_efl_ui_list_default_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Eo *eo;
|
|
|
|
eo = efl_finalize(efl_super(obj, MY_CLASS));
|
|
|
|
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
|
2019-03-04 10:37:07 -08:00
|
|
|
Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, NULL);
|
2018-04-22 23:13:59 -07:00
|
|
|
|
2019-03-04 10:36:41 -08:00
|
|
|
if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
|
2018-04-22 23:13:59 -07:00
|
|
|
CRI("Default Item(%p) failed to set theme [efl/list_item]!", eo);
|
|
|
|
return eo;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_list_default_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
|
|
|
|
{
|
|
|
|
efl_destructor(efl_super(obj, MY_CLASS));
|
|
|
|
}
|
|
|
|
|
|
|
|
ELM_PART_TEXT_DEFAULT_GET(efl_ui_list_default_item, "efl.text")
|
|
|
|
ELM_PART_TEXT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
|
|
|
|
ELM_PART_MARKUP_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
|
|
|
|
ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_default_item, "efl.icon")
|
efl_ui : refactoring efl.part in item based classes.
Summary:
Most of item-based class will have similar efl.part such as text, icon, end.
creating this efl part per each class will be very hard to maintaining the class
and unnecessary eo generation.
so combine them in efl.parts of efl_ui_item.
sub item classes can use this efl.part by declairing ther own eo definition.
Reviewers: cedric, Jaehyun_Cho, segfaultxavi, eagleeye
Reviewed By: cedric, eagleeye
Subscribers: herb, woohyun, q66, lauromoura, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8582
2019-05-29 21:22:03 -07:00
|
|
|
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void)
|
2018-04-22 23:13:59 -07:00
|
|
|
|
|
|
|
EOLIAN static Efl_Object *
|
2018-05-03 16:34:17 -07:00
|
|
|
_efl_ui_list_default_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
|
2018-04-22 23:13:59 -07:00
|
|
|
{
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
|
|
|
|
if (eina_streq(part, "text"))
|
efl_ui : refactoring efl.part in item based classes.
Summary:
Most of item-based class will have similar efl.part such as text, icon, end.
creating this efl part per each class will be very hard to maintaining the class
and unnecessary eo generation.
so combine them in efl.parts of efl_ui_item.
sub item classes can use this efl.part by declairing ther own eo definition.
Reviewers: cedric, Jaehyun_Cho, segfaultxavi, eagleeye
Reviewed By: cedric, eagleeye
Subscribers: herb, woohyun, q66, lauromoura, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8582
2019-05-29 21:22:03 -07:00
|
|
|
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_TEXT_CLASS, obj, "efl.text");
|
2018-04-22 23:13:59 -07:00
|
|
|
else if (eina_streq(part, "icon"))
|
efl_ui : refactoring efl.part in item based classes.
Summary:
Most of item-based class will have similar efl.part such as text, icon, end.
creating this efl part per each class will be very hard to maintaining the class
and unnecessary eo generation.
so combine them in efl.parts of efl_ui_item.
sub item classes can use this efl.part by declairing ther own eo definition.
Reviewers: cedric, Jaehyun_Cho, segfaultxavi, eagleeye
Reviewed By: cedric, eagleeye
Subscribers: herb, woohyun, q66, lauromoura, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D8582
2019-05-29 21:22:03 -07:00
|
|
|
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_ICON_CLASS, obj, "efl.icon");
|
|
|
|
else if (eina_streq(part, "extra"))
|
|
|
|
return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_EXTRA_CLASS, obj, "efl.extra");
|
2018-04-22 23:13:59 -07:00
|
|
|
|
2018-05-03 16:34:17 -07:00
|
|
|
return efl_part_get(efl_super(obj, MY_CLASS), part);
|
2018-04-22 23:13:59 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Internal EO APIs and hidden overrides */
|
|
|
|
#define EFL_UI_LIST_DEFAULT_ITEM_EXTRA_OPS \
|
|
|
|
ELM_PART_TEXT_DEFAULT_OPS(efl_ui_list_default_item), \
|
|
|
|
ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_default_item)
|
|
|
|
|
|
|
|
#include "efl_ui_list_default_item.eo.c"
|