summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-24 15:59:24 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-25 19:48:03 +0200
commit2dc4673702b5c0326dd56d89da16f3f9e2ad2219 (patch)
treeae98ce2930b84ee7c0f59364299fffd398d113ab
parent35c0b7d3b883a32acf6ce5a518012e27a750de78 (diff)
efl_ui_list_item: remove this
this has nothing usefull in it. Additionally, future commits will brings up another design where there is a central default item style, which can be hinted. Differential Revision: https://phab.enlightenment.org/D9394
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c10
-rw-r--r--src/lib/elementary/Efl_Ui.h1
-rw-r--r--src/lib/elementary/Elementary.h1
-rw-r--r--src/lib/elementary/efl_ui_list.c1
-rw-r--r--src/lib/elementary/efl_ui_list.eo2
-rw-r--r--src/lib/elementary/efl_ui_list_default_item.eo2
-rw-r--r--src/lib/elementary/efl_ui_list_item.c83
-rw-r--r--src/lib/elementary/efl_ui_list_item.eo12
-rw-r--r--src/lib/elementary/efl_ui_list_item_private.h30
-rw-r--r--src/lib/elementary/efl_ui_list_placeholder_item.eo2
-rw-r--r--src/lib/elementary/meson.build3
11 files changed, 7 insertions, 140 deletions
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index dcb434fcf1..a7be7937df 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -30,7 +30,7 @@ _list_selected(void *data EINA_UNUSED, const Efl_Event *ev)
30 Eo *item = ev->info, *tmp; 30 Eo *item = ev->info, *tmp;
31 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected")); 31 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected"));
32 32
33 Eina_Iterator *selects = efl_ui_item_container_selected_items_get(list); 33 Eina_Iterator *selects = efl_ui_collection_selected_items_get(list);
34 34
35 EINA_ITERATOR_FOREACH(selects, tmp) 35 EINA_ITERATOR_FOREACH(selects, tmp)
36 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp)); 36 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp));
@@ -82,18 +82,18 @@ _anim_radio_changed(void *data, const Efl_Event *ev EINA_UNUSED)
82static void 82static void
83_scrl_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 83_scrl_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
84{ 84{
85 Efl_Ui_List_Item *item = efl_ui_item_container_last_selected_item_get(priv_d.list); 85 Efl_Ui_List_Default_Item *item = efl_ui_collection_last_selected_item_get(priv_d.list);
86 printf("show [%d:%p] [%d]\n", efl_ui_item_index_get(item), item, priv_d.anim); 86 printf("show [%d:%p] [%d]\n", efl_ui_item_index_get(item), item, priv_d.anim);
87 efl_ui_item_container_item_scroll(priv_d.list, item, priv_d.anim); 87 efl_ui_collection_item_scroll(priv_d.list, item, priv_d.anim);
88} 88}
89 89
90static void 90static void
91_scrl_align_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 91_scrl_align_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
92{ 92{
93 Efl_Ui_List_Item *item = efl_ui_item_container_last_selected_item_get(priv_d.list); 93 Efl_Ui_List_Default_Item *item = efl_ui_collection_last_selected_item_get(priv_d.list);
94 double align = efl_ui_range_value_get(priv_d.slider); 94 double align = efl_ui_range_value_get(priv_d.slider);
95 printf("show [%d:%p] [%.2lf], [%d]\n", efl_ui_item_index_get(item), item, align, priv_d.anim); 95 printf("show [%d:%p] [%.2lf], [%d]\n", efl_ui_item_index_get(item), item, align, priv_d.anim);
96 efl_ui_item_container_item_scroll_align(priv_d.list, item, align, priv_d.anim); 96 efl_ui_collection_item_scroll_align(priv_d.list, item, align, priv_d.anim);
97} 97}
98 98
99EAPI_MAIN int 99EAPI_MAIN int
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 7d16959036..4ec35d0499 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -255,7 +255,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
255# include <efl_ui_item_container.eo.h> 255# include <efl_ui_item_container.eo.h>
256# include <efl_ui_position_manager_list.eo.h> 256# include <efl_ui_position_manager_list.eo.h>
257# include <efl_ui_position_manager_grid.eo.h> 257# include <efl_ui_position_manager_grid.eo.h>
258# include <efl_ui_list_item.eo.h>
259# include <efl_ui_list_default_item.eo.h> 258# include <efl_ui_list_default_item.eo.h>
260# include <efl_ui_grid_item.eo.h> 259# include <efl_ui_grid_item.eo.h>
261# include <efl_ui_grid_default_item.eo.h> 260# include <efl_ui_grid_default_item.eo.h>
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 3316529acc..ba10773ff4 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -334,7 +334,6 @@ typedef Eo Efl_Ui_Focus_Manager;
334# include <efl_ui_item_part_extra.eo.h> 334# include <efl_ui_item_part_extra.eo.h>
335# include <efl_ui_item_part_content.eo.h> 335# include <efl_ui_item_part_content.eo.h>
336# include <efl_ui_item.eo.h> 336# include <efl_ui_item.eo.h>
337# include <efl_ui_list_item.eo.h>
338# include <efl_ui_list_default_item.eo.h> 337# include <efl_ui_list_default_item.eo.h>
339# include <efl_ui_list_placeholder_item.eo.h> 338# include <efl_ui_list_placeholder_item.eo.h>
340# include <efl_ui_list.eo.h> 339# include <efl_ui_list.eo.h>
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 8d8cbc25f8..eb842e137a 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -8,7 +8,6 @@
8 8
9#include <Efl_Ui.h> 9#include <Efl_Ui.h>
10#include "elm_priv.h" 10#include "elm_priv.h"
11#include "efl_ui_list_item_private.h"
12#include "efl_ui_item_private.h" 11#include "efl_ui_item_private.h"
13 12
14#define MY_CLASS EFL_UI_LIST_CLASS 13#define MY_CLASS EFL_UI_LIST_CLASS
diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo
index cf99aad862..6254e16a18 100644
--- a/src/lib/elementary/efl_ui_list.eo
+++ b/src/lib/elementary/efl_ui_list.eo
@@ -1,5 +1,3 @@
1import efl_ui_list_item;
2
3class @beta Efl.Ui.List extends Efl.Ui.Item_Container 1class @beta Efl.Ui.List extends Efl.Ui.Item_Container
4{ 2{
5 [[Simple list widget with Pack interface.]] 3 [[Simple list widget with Pack interface.]]
diff --git a/src/lib/elementary/efl_ui_list_default_item.eo b/src/lib/elementary/efl_ui_list_default_item.eo
index ee4e770f5d..90cc024b97 100644
--- a/src/lib/elementary/efl_ui_list_default_item.eo
+++ b/src/lib/elementary/efl_ui_list_default_item.eo
@@ -1,5 +1,5 @@
1 1
2class @beta Efl.Ui.List_Default_Item extends Efl.Ui.List_Item implements 2class @beta Efl.Ui.List_Default_Item extends Efl.Ui.Item implements
3 Efl.Text, 3 Efl.Text,
4 Efl.Text_Markup, 4 Efl.Text_Markup,
5 Efl.Content 5 Efl.Content
diff --git a/src/lib/elementary/efl_ui_list_item.c b/src/lib/elementary/efl_ui_list_item.c
deleted file mode 100644
index 1fe67e9c0c..0000000000
--- a/src/lib/elementary/efl_ui_list_item.c
+++ /dev/null
@@ -1,83 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#define EFL_ACCESS_PROTECTED
6#define EFL_UI_WIDGET_PART_BG_PROTECTED
7
8#include <Elementary.h>
9
10#include "elm_priv.h"
11#include "efl_ui_list_item_private.h"
12
13#define MY_CLASS EFL_UI_LIST_ITEM_CLASS
14#define MY_CLASS_PFX efl_ui_list_item
15
16#define MY_CLASS_NAME "Efl.Ui.List_Item"
17
18static void
19_sizing_eval(Evas_Object *obj, Efl_Ui_List_Item_Data *pd)
20{
21 Evas_Coord minh = -1, minw = -1;
22 Evas_Coord rest_w = 0, rest_h = 0;
23 ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd);
24
25 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
26 rest_w, rest_h);
27 evas_object_size_hint_min_set(obj, minw, minh);
28
29 pd->needs_size_calc = EINA_FALSE;
30}
31
32static void
33_efl_ui_list_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Item_Data *pd)
34{
35 if (pd->needs_size_calc) return;
36 pd->needs_size_calc = EINA_TRUE;
37
38 efl_canvas_group_change(obj);
39}
40
41EOLIAN static void
42_efl_ui_list_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Item_Data *pd)
43{
44 if (pd->needs_size_calc)
45 {
46 _sizing_eval(obj, pd);
47 pd->needs_size_calc = EINA_FALSE;
48 }
49}
50
51EOLIAN static Eo *
52_efl_ui_list_item_efl_object_constructor(Eo *obj, Efl_Ui_List_Item_Data *pd)
53{
54 pd->obj = obj;
55 obj = efl_constructor(efl_super(obj, MY_CLASS));
56
57 return obj;
58}
59
60EOLIAN static Efl_Object *
61_efl_ui_list_item_efl_object_finalize(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED)
62{
63 Eo *eo;
64 eo = efl_finalize(efl_super(obj, MY_CLASS));
65 ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
66
67 return eo;
68}
69
70EOLIAN static void
71_efl_ui_list_item_efl_object_destructor(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED)
72{
73 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
74
75 efl_destructor(efl_super(obj, MY_CLASS));
76}
77
78/* Internal EO APIs and hidden overrides */
79
80#define EFL_UI_LIST_ITEM_EXTRA_OPS \
81 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_list_item)
82
83#include "efl_ui_list_item.eo.c"
diff --git a/src/lib/elementary/efl_ui_list_item.eo b/src/lib/elementary/efl_ui_list_item.eo
deleted file mode 100644
index 2997926cfd..0000000000
--- a/src/lib/elementary/efl_ui_list_item.eo
+++ /dev/null
@@ -1,12 +0,0 @@
1
2abstract @beta Efl.Ui.List_Item extends Efl.Ui.Item
3{
4 implements {
5 //Efl.Object
6 Efl.Object.constructor;
7 Efl.Object.finalize;
8 Efl.Object.destructor;
9 //Efl.Canvas
10 Efl.Canvas.Group.group_calculate;
11 }
12}
diff --git a/src/lib/elementary/efl_ui_list_item_private.h b/src/lib/elementary/efl_ui_list_item_private.h
deleted file mode 100644
index 0df36bc459..0000000000
--- a/src/lib/elementary/efl_ui_list_item_private.h
+++ /dev/null
@@ -1,30 +0,0 @@
1#ifndef EFL_UI_LIST_ITEM_PRIVATE_H
2#define EFL_UI_LIST_ITEM_PRIVATE_H
3
4#include "Elementary.h"
5
6typedef struct _Efl_Ui_List_Item_Data
7{
8 // Eo Objects
9 Eo *obj; /* Self-Object */
10 Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */
11} Efl_Ui_List_Item_Data;
12
13
14#define EFL_UI_LIST_ITEM_DATA_GET(o, pd) \
15 Efl_Ui_List_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_LIST_ITEM_CLASS)
16
17#define EFL_UI_LIST_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \
18 EFL_UI_LIST_ITEM_DATA_GET(o, ptr); \
19 if (EINA_UNLIKELY(!ptr)) \
20 { \
21 ERR("No widget data for object %p (%s)", \
22 o, evas_object_type_get(o)); \
23 return __VA_ARGS__; \
24 }
25
26#define EFL_UI_LIST_ITEM_CHECK_OR_RETURN(obj, ...) \
27 if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_LIST_ITEM_CLASS))) \
28 return __VA_ARGS__;
29
30#endif
diff --git a/src/lib/elementary/efl_ui_list_placeholder_item.eo b/src/lib/elementary/efl_ui_list_placeholder_item.eo
index e9dbcab477..83a0f9954e 100644
--- a/src/lib/elementary/efl_ui_list_placeholder_item.eo
+++ b/src/lib/elementary/efl_ui_list_placeholder_item.eo
@@ -1,5 +1,5 @@
1 1
2class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.List_Item implements Efl.Content 2class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.Item implements Efl.Content
3{ 3{
4 [[List Placeholder 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
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index e3bc6024f0..9d2bb71ae8 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -121,7 +121,6 @@ pub_eo_files = [
121 'efl_ui_item_part_extra.eo', 121 'efl_ui_item_part_extra.eo',
122 'efl_ui_item_part_content.eo', 122 'efl_ui_item_part_content.eo',
123 'efl_ui_item.eo', 123 'efl_ui_item.eo',
124 'efl_ui_list_item.eo',
125 'efl_ui_list_default_item.eo', 124 'efl_ui_list_default_item.eo',
126 'efl_ui_list_placeholder_item.eo', 125 'efl_ui_list_placeholder_item.eo',
127 'efl_ui_list.eo', 126 'efl_ui_list.eo',
@@ -354,7 +353,6 @@ elementary_headers_unstable = [
354 'elm_widget_toolbar.h', 353 'elm_widget_toolbar.h',
355 'efl_ui_video_private.h', 354 'efl_ui_video_private.h',
356 'efl_ui_item_private.h', 355 'efl_ui_item_private.h',
357 'efl_ui_list_item_private.h',
358 'efl_ui_grid_item_private.h', 356 'efl_ui_grid_item_private.h',
359 'efl_ui_list_view_private.h', 357 'efl_ui_list_view_private.h',
360 'efl_ui_list_view_seg_array.h', 358 'efl_ui_list_view_seg_array.h',
@@ -895,7 +893,6 @@ elementary_src = [
895 'efl_ui_focus_util.c', 893 'efl_ui_focus_util.c',
896 'elm_widget_item_static_focus.c', 894 'elm_widget_item_static_focus.c',
897 'efl_ui_item.c', 895 'efl_ui_item.c',
898 'efl_ui_list_item.c',
899 'efl_ui_list_default_item.c', 896 'efl_ui_list_default_item.c',
900 'efl_ui_list_placeholder_item.c', 897 'efl_ui_list_placeholder_item.c',
901 'efl_ui_list.c', 898 'efl_ui_list.c',