aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/elementary/efl_ui_list_default_item.c
blob: 19bfed4e0d1ecdad69dc49dbea14d25371fa2821 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#ifdef HAVE_CONFIG_H
# include "elementary_config.h"
#endif

#define EFL_UI_LIST_DEFAULT_ITEM_PROTECTED
#define EFL_PART_PROTECTED

#include <Elementary.h>

#include "elm_priv.h"
#include "efl_ui_list_default_item_part_icon.eo.h"
#include "efl_ui_list_default_item_part_end.eo.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);
   Efl_Ui_Theme_Apply theme_apply = efl_ui_layout_object_theme_set(obj, "list_item", NULL, NULL);

   if (theme_apply == EFL_UI_THEME_APPLY_FAILED)
     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));
}

/* Efl.Part */

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")
ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_default_item, void
)

Eina_Bool
_efl_ui_list_default_item_part_icon_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
}

Efl_Gfx_Entity *
_efl_ui_list_default_item_part_icon_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}

Efl_Gfx_Entity *
_efl_ui_list_default_item_part_icon_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
#include "efl_ui_list_default_item_part_icon.eo.c"

Eina_Bool
_efl_ui_list_default_item_part_end_efl_content_content_set(Eo *obj, void *pd EINA_UNUSED, Efl_Gfx_Entity *content)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), content);
}

Efl_Gfx_Entity *
_efl_ui_list_default_item_part_end_efl_content_content_get(const Eo *obj, void *pd EINA_UNUSED)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_get(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}

Efl_Gfx_Entity *
_efl_ui_list_default_item_part_end_efl_content_content_unset(Eo *obj, void *pd EINA_UNUSED)
{
   Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
   return efl_content_unset(efl_part(efl_super(wd->obj, MY_CLASS), wd->part));
}
#include "efl_ui_list_default_item_part_end.eo.c"

EOLIAN static Efl_Object *
_efl_ui_list_default_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
{
   EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
   if (eina_streq(part, "text"))
     return ELM_PART_IMPLEMENT(EFL_UI_LAYOUT_PART_TEXT_CLASS, obj, "efl.text");
   else if (eina_streq(part, "icon"))
     return ELM_PART_IMPLEMENT(EFL_UI_LIST_DEFAULT_ITEM_PART_ICON_CLASS, obj, "efl.icon");
   else if (eina_streq(part, "end"))
     return ELM_PART_IMPLEMENT(EFL_UI_LIST_DEFAULT_ITEM_PART_END_CLASS, obj, "efl.end");

   return efl_part_get(efl_super(obj, MY_CLASS), part);
}
/* Efl.Part end */

/* 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"