summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Jade Lee <sh10233.lee@samsung.com>2019-05-30 15:07:42 +0900
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>2019-05-30 15:40:31 +0900
commit57233f552c49eb8958a76ef575d794bc3b78f177 (patch)
tree5961bbe905c49fb6a247d48eb936965e2477242c
parent01cb1c32bd8be0854348740f93dcaa1c45a7dff7 (diff)
efl_ui: rename list empty item to list placeholder item.
Summary: legacy full style item is introduced Efl.Ui.ListEmptyItem Class in new Efl Interface, but using "Empty" name is too ambiguous to present style usage. Thanks to @cedric and @segfaultxavi, I found better name for this class, Efl.Ui.ListPlaceHolderItem, as item hold the place which need to be replaced and relayouted by user generated content. Depends on D8582 Reviewers: cedric, segfaultxavi, eagleeye Reviewed By: eagleeye Subscribers: cedric, #reviewers, segfaultxavi, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9034
-rw-r--r--data/elementary/themes/edc/efl/list.edc2
-rw-r--r--src/Makefile_Elementary.am4
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c12
-rw-r--r--src/lib/elementary/Elementary.h2
-rw-r--r--src/lib/elementary/efl_ui_list_empty_item.c57
-rw-r--r--src/lib/elementary/efl_ui_list_placeholder_item.c57
-rw-r--r--src/lib/elementary/efl_ui_list_placeholder_item.eo (renamed from src/lib/elementary/efl_ui_list_empty_item.eo)6
-rw-r--r--src/lib/elementary/meson.build4
-rw-r--r--src/tests/elementary/spec/efl_test_content.c2
9 files changed, 73 insertions, 73 deletions
diff --git a/data/elementary/themes/edc/efl/list.edc b/data/elementary/themes/edc/efl/list.edc
index e10c64b49a..b0a08c1e50 100644
--- a/data/elementary/themes/edc/efl/list.edc
+++ b/data/elementary/themes/edc/efl/list.edc
@@ -293,7 +293,7 @@ group { "efl/list_item";
293 } 293 }
294} 294}
295 295
296group { "efl/list_item:empty"; 296group { "efl/list_item:placeholder";
297 data.item: "selectraise" "on"; 297 data.item: "selectraise" "on";
298 data.item: "focusraise" "on"; 298 data.item: "focusraise" "on";
299 images.image: "bevel_curved_horiz_out.png" COMP; 299 images.image: "bevel_curved_horiz_out.png" COMP;
diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am
index e3fb705e8e..972edc7274 100644
--- a/src/Makefile_Elementary.am
+++ b/src/Makefile_Elementary.am
@@ -87,7 +87,7 @@ elm_public_eolian_files = \
87 lib/elementary/efl_ui_item.eo \ 87 lib/elementary/efl_ui_item.eo \
88 lib/elementary/efl_ui_list_item.eo \ 88 lib/elementary/efl_ui_list_item.eo \
89 lib/elementary/efl_ui_list_default_item.eo \ 89 lib/elementary/efl_ui_list_default_item.eo \
90 lib/elementary/efl_ui_list_empty_item.eo \ 90 lib/elementary/efl_ui_list_placeholder_item.eo \
91 lib/elementary/efl_ui_list.eo \ 91 lib/elementary/efl_ui_list.eo \
92 lib/elementary/efl_ui_grid_item.eo \ 92 lib/elementary/efl_ui_grid_item.eo \
93 lib/elementary/efl_ui_grid_default_item.eo \ 93 lib/elementary/efl_ui_grid_default_item.eo \
@@ -1176,7 +1176,7 @@ lib_elementary_libelementary_la_SOURCES = \
1176 lib/elementary/efl_ui_item.c \ 1176 lib/elementary/efl_ui_item.c \
1177 lib/elementary/efl_ui_list_item.c \ 1177 lib/elementary/efl_ui_list_item.c \
1178 lib/elementary/efl_ui_list_default_item.c \ 1178 lib/elementary/efl_ui_list_default_item.c \
1179 lib/elementary/efl_ui_list_empty_item.c \ 1179 lib/elementary/efl_ui_list_placeholder_item.c \
1180 lib/elementary/efl_ui_list.c \ 1180 lib/elementary/efl_ui_list.c \
1181 lib/elementary/efl_ui_grid_item.c \ 1181 lib/elementary/efl_ui_grid_item.c \
1182 lib/elementary/efl_ui_grid_default_item.c \ 1182 lib/elementary/efl_ui_grid_default_item.c \
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index f3c29e96e6..f204e7bf09 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -106,7 +106,7 @@ elm_main(int argc EINA_UNUSED, char **argv)
106 Eo *slider, *scrl_btn; 106 Eo *slider, *scrl_btn;
107 int i; 107 int i;
108 char buf[256]; 108 char buf[256];
109 Eina_Bool emptystyle = EINA_FALSE; 109 Eina_Bool placeholder = EINA_FALSE;
110 110
111 win = elm_win_util_standard_add("list", "list"); 111 win = elm_win_util_standard_add("list", "list");
112 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); 112 elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED);
@@ -119,8 +119,8 @@ elm_main(int argc EINA_UNUSED, char **argv)
119 efl_gfx_hint_fill_set(wbox, EINA_TRUE, EINA_TRUE); 119 efl_gfx_hint_fill_set(wbox, EINA_TRUE, EINA_TRUE);
120 120
121 if ((argv[1] != NULL) && 121 if ((argv[1] != NULL) &&
122 (!strcmp(argv[1], "empty"))) 122 (!strcmp(argv[1], "placeholder")))
123 emptystyle = EINA_TRUE; 123 placeholder = EINA_TRUE;
124 124
125 priv_d.list = list = efl_add(EFL_UI_LIST_CLASS, wbox); 125 priv_d.list = list = efl_add(EFL_UI_LIST_CLASS, wbox);
126 efl_gfx_hint_weight_set(list, EFL_GFX_HINT_EXPAND, 0.9); 126 efl_gfx_hint_weight_set(list, EFL_GFX_HINT_EXPAND, 0.9);
@@ -133,13 +133,13 @@ elm_main(int argc EINA_UNUSED, char **argv)
133 133
134 for (i = 0; i < NUM_ITEMS; i++) 134 for (i = 0; i < NUM_ITEMS; i++)
135 { 135 {
136 if (emptystyle) item = efl_add(EFL_UI_LIST_EMPTY_ITEM_CLASS, list); 136 if (placeholder) item = efl_add(EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS, list);
137 else item = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, list); 137 else item = efl_add(EFL_UI_LIST_DEFAULT_ITEM_CLASS, list);
138 138
139 /* disable case test */ 139 /* disable case test */
140 if (i == 1) efl_ui_widget_disabled_set(item, EINA_TRUE); 140 if (i == 1) efl_ui_widget_disabled_set(item, EINA_TRUE);
141 141
142 if (emptystyle) 142 if (placeholder)
143 { 143 {
144 ibox = efl_add(EFL_UI_BOX_CLASS, item); 144 ibox = efl_add(EFL_UI_BOX_CLASS, item);
145 efl_ui_layout_orientation_set(ibox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); 145 efl_ui_layout_orientation_set(ibox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL);
@@ -148,7 +148,7 @@ elm_main(int argc EINA_UNUSED, char **argv)
148 efl_gfx_hint_weight_set(txt, 0.95, EFL_GFX_HINT_EXPAND); 148 efl_gfx_hint_weight_set(txt, 0.95, EFL_GFX_HINT_EXPAND);
149 efl_text_halign_set(txt, 0.2); 149 efl_text_halign_set(txt, 0.2);
150 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE); 150 efl_text_interactive_selection_allowed_set(txt, EINA_FALSE);
151 snprintf(buf, sizeof(buf), "empty style item [%d]", i); 151 snprintf(buf, sizeof(buf), "placeholder style item [%d]", i);
152 efl_text_set(txt, buf); 152 efl_text_set(txt, buf);
153 efl_pack_end(ibox, txt); 153 efl_pack_end(ibox, txt);
154 154
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 07075d247f..d062183d79 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -341,7 +341,7 @@ typedef Eo Efl_Ui_Focus_Manager;
341# include <efl_ui_item.eo.h> 341# include <efl_ui_item.eo.h>
342# include <efl_ui_list_item.eo.h> 342# include <efl_ui_list_item.eo.h>
343# include <efl_ui_list_default_item.eo.h> 343# include <efl_ui_list_default_item.eo.h>
344# include <efl_ui_list_empty_item.eo.h> 344# include <efl_ui_list_placeholder_item.eo.h>
345# include <efl_ui_list.eo.h> 345# include <efl_ui_list.eo.h>
346# include <efl_ui_grid_item.eo.h> 346# include <efl_ui_grid_item.eo.h>
347# include <efl_ui_grid_default_item.eo.h> 347# include <efl_ui_grid_default_item.eo.h>
diff --git a/src/lib/elementary/efl_ui_list_empty_item.c b/src/lib/elementary/efl_ui_list_empty_item.c
deleted file mode 100644
index 8df9b78685..0000000000
--- a/src/lib/elementary/efl_ui_list_empty_item.c
+++ /dev/null
@@ -1,57 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_UI_LIST_EMPTY_ITEM_PROTECTED
6#define EFL_PART_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "elm_part_helper.h"
12
13#define MY_CLASS EFL_UI_LIST_EMPTY_ITEM_CLASS
14#define MY_CLASS_PFX efl_ui_list_empty_item
15
16#define MY_CLASS_NAME "Efl.Ui.List_Empty_Item"
17
18EOLIAN static Efl_Object *
19_efl_ui_list_empty_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
20{
21 Eo *eo;
22 eo = efl_finalize(efl_super(obj, MY_CLASS));
23 ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
24 Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "empty");
25
26 if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
27 CRI("Empty Item(%p) failed to set theme [efl/list_item:empty]!", eo);
28 return eo;
29}
30
31EOLIAN static void
32_efl_ui_list_empty_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
33{
34 efl_destructor(efl_super(obj, MY_CLASS));
35}
36
37/* Efl.Part */
38ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_empty_item, "efl.content")
39ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_empty_item, void)
40/* Efl.Part end */
41
42EOLIAN static Efl_Object *
43_efl_ui_list_empty_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
44{
45 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
46 if (eina_streq(part, "content"))
47 return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_CONTENT_CLASS, obj, "efl.content");
48
49 return efl_part_get(efl_super(obj, MY_CLASS), part);
50}
51
52/* Internal EO APIs and hidden overrides */
53
54#define EFL_UI_LIST_EMPTY_ITEM_EXTRA_OPS \
55 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_empty_item)
56
57#include "efl_ui_list_empty_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_placeholder_item.c b/src/lib/elementary/efl_ui_list_placeholder_item.c
new file mode 100644
index 0000000000..1e4d291fe5
--- /dev/null
+++ b/src/lib/elementary/efl_ui_list_placeholder_item.c
@@ -0,0 +1,57 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_UI_LIST_PLACEHOLDER_ITEM_PROTECTED
6#define EFL_PART_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "elm_part_helper.h"
12
13#define MY_CLASS EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS
14#define MY_CLASS_PFX efl_ui_list_placeholder_item
15
16#define MY_CLASS_NAME "Efl.Ui.List_Placeholder_Item"
17
18EOLIAN static Efl_Object *
19_efl_ui_list_placeholder_item_efl_object_finalize(Eo *obj, void *pd EINA_UNUSED)
20{
21 Eo *eo;
22 eo = efl_finalize(efl_super(obj, MY_CLASS));
23 ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
24 Eina_Error theme_apply_ret = efl_ui_layout_theme_set(obj, "list_item", NULL, "placeholder");
25
26 if (theme_apply_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC)
27 CRI("Empty Item(%p) failed to set theme [efl/list_item:placeholder]!", eo);
28 return eo;
29}
30
31EOLIAN static void
32_efl_ui_list_placeholder_item_efl_object_destructor(Eo *obj, void *pd EINA_UNUSED)
33{
34 efl_destructor(efl_super(obj, MY_CLASS));
35}
36
37/* Efl.Part */
38ELM_PART_CONTENT_DEFAULT_GET(efl_ui_list_placeholder_item, "efl.content")
39ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_list_placeholder_item, void)
40/* Efl.Part end */
41
42EOLIAN static Efl_Object *
43_efl_ui_list_placeholder_item_efl_part_part_get(const Eo *obj, void *wd EINA_UNUSED, const char *part)
44{
45 EINA_SAFETY_ON_NULL_RETURN_VAL(part, NULL);
46 if (eina_streq(part, "content"))
47 return ELM_PART_IMPLEMENT(EFL_UI_ITEM_PART_CONTENT_CLASS, obj, "efl.content");
48
49 return efl_part_get(efl_super(obj, MY_CLASS), part);
50}
51
52/* Internal EO APIs and hidden overrides */
53
54#define EFL_UI_LIST_PLACEHOLDER_ITEM_EXTRA_OPS \
55 ELM_PART_CONTENT_DEFAULT_OPS(efl_ui_list_placeholder_item)
56
57#include "efl_ui_list_placeholder_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_empty_item.eo b/src/lib/elementary/efl_ui_list_placeholder_item.eo
index a656c75537..e9dbcab477 100644
--- a/src/lib/elementary/efl_ui_list_empty_item.eo
+++ b/src/lib/elementary/efl_ui_list_placeholder_item.eo
@@ -1,12 +1,12 @@
1 1
2class @beta Efl.Ui.List_Empty_Item extends Efl.Ui.List_Item implements Efl.Content 2class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.List_Item implements Efl.Content
3{ 3{
4 [[List Empty Item class. This item have only one swallow space, 4 [[List Placeholder Item class. This item have only one swallow space,
5 thus user can decorate item by filling the swallow with 5 thus user can decorate item by filling the swallow with
6 any kind of container.]] 6 any kind of container.]]
7 data: null; 7 data: null;
8 parts { 8 parts {
9 content: Efl.Ui.Item_Part_Content; [[the content part for list empty item. 9 content: Efl.Ui.Item_Part_Content; [[the content part for list placeholder item.
10 the content part is empty slot for user customizing. 10 the content part is empty slot for user customizing.
11 fill the place with container widget such as layout, box, table.]] 11 fill the place with container widget such as layout, box, table.]]
12 } 12 }
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 6aaa474eec..3d5372b5dc 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -122,7 +122,7 @@ pub_eo_files = [
122 'efl_ui_item.eo', 122 'efl_ui_item.eo',
123 'efl_ui_list_item.eo', 123 'efl_ui_list_item.eo',
124 'efl_ui_list_default_item.eo', 124 'efl_ui_list_default_item.eo',
125 'efl_ui_list_empty_item.eo', 125 'efl_ui_list_placeholder_item.eo',
126 'efl_ui_list.eo', 126 'efl_ui_list.eo',
127 'efl_ui_grid_item.eo', 127 'efl_ui_grid_item.eo',
128 'efl_ui_grid_default_item.eo', 128 'efl_ui_grid_default_item.eo',
@@ -898,7 +898,7 @@ elementary_src = [
898 'efl_ui_item.c', 898 'efl_ui_item.c',
899 'efl_ui_list_item.c', 899 'efl_ui_list_item.c',
900 'efl_ui_list_default_item.c', 900 'efl_ui_list_default_item.c',
901 'efl_ui_list_empty_item.c', 901 'efl_ui_list_placeholder_item.c',
902 'efl_ui_list.c', 902 'efl_ui_list.c',
903 'efl_ui_grid_item.c', 903 'efl_ui_grid_item.c',
904 'efl_ui_grid_default_item.c', 904 'efl_ui_grid_default_item.c',
diff --git a/src/tests/elementary/spec/efl_test_content.c b/src/tests/elementary/spec/efl_test_content.c
index 58736843ee..4800a1ba53 100644
--- a/src/tests/elementary/spec/efl_test_content.c
+++ b/src/tests/elementary/spec/efl_test_content.c
@@ -9,7 +9,7 @@
9/* spec-meta-start 9/* spec-meta-start
10 {"test-interface":"Efl.Content", 10 {"test-interface":"Efl.Content",
11 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item", 11 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Frame", "Efl.Ui.Grid_Default_Item",
12 "Efl.Ui.List_Default_Item", "Efl.Ui.List_Empty_Item", 12 "Efl.Ui.List_Default_Item", "Efl.Ui.List_Placeholder_Item",
13 "Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar", 13 "Efl.Ui.Navigation_Layout", "Efl.Ui.Panel", "Efl.Ui.Progressbar",
14 "Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]} 14 "Efl.Ui.Radio", "Efl.Ui.Popup", "Efl.Ui.Tab_Page", "Efl.Ui.Scroller"]}
15 15