summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Jr <larry.olj@gmail.com>2018-01-31 16:55:42 -0200
committerLarry Jr <larry.olj@gmail.com>2018-01-31 16:57:33 -0200
commitd27aed8d04dcbd07c1e107980874ee8f36ac5856 (patch)
tree7fd4c568b1a5fd3b61087e4040668878fe9bea3d
parent78bc97e79be32034f3a2b9e58bdafa2b7ad1a492 (diff)
Elementary: remove needless structs in Efl_Ui_Listdevs/larrylira/efl_ui_list
-rw-r--r--src/lib/elementary/Elementary.h4
-rw-r--r--src/lib/elementary/efl_ui_list.c4
-rw-r--r--src/lib/elementary/efl_ui_list_precise_layouter.c8
-rw-r--r--src/lib/elementary/efl_ui_list_private.h8
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.c40
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.eo4
-rw-r--r--src/lib/elementary/efl_ui_list_segarray.h2
-rw-r--r--src/lib/elementary/efl_ui_list_types.eot2
8 files changed, 30 insertions, 42 deletions
diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h
index 54142ee83a..3bcec5e288 100644
--- a/src/lib/elementary/Elementary.h
+++ b/src/lib/elementary/Elementary.h
@@ -280,8 +280,6 @@ typedef Eo Efl_Ui_Focus_Manager;
280 280
281#ifdef EFL_EO_API_SUPPORT 281#ifdef EFL_EO_API_SUPPORT
282# include <efl_selection_types.eot.h> 282# include <efl_selection_types.eot.h>
283# include <efl_ui_list_segarray.h>
284# include <efl_ui_list_segarray.eo.h>
285# include <efl_config_global.eo.h> 283# include <efl_config_global.eo.h>
286# include <efl_ui_widget.eo.h> 284# include <efl_ui_widget.eo.h>
287# include <efl_ui_widget_part.eo.h> 285# include <efl_ui_widget_part.eo.h>
@@ -324,6 +322,8 @@ typedef Eo Efl_Ui_Focus_Manager;
324# include <efl_ui_slider_interval.eo.h> 322# include <efl_ui_slider_interval.eo.h>
325# include <efl_ui_layout_factory.eo.h> 323# include <efl_ui_layout_factory.eo.h>
326# include <efl_ui_list_types.eot.h> 324# include <efl_ui_list_types.eot.h>
325# include <efl_ui_list_segarray.h>
326# include <efl_ui_list_segarray.eo.h>
327# include <efl_ui_list_model.eo.h> 327# include <efl_ui_list_model.eo.h>
328# include <efl_ui_list_relayout.eo.h> 328# include <efl_ui_list_relayout.eo.h>
329# include <efl_ui_list.eo.h> 329# 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 e332d9cf40..aff2a066bb 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -821,8 +821,8 @@ _efl_ui_list_efl_access_selection_selected_child_get(Eo *obj EINA_UNUSED, Efl_Ui
821{ 821{
822 if(child_index < (int) eina_list_count(pd->selected_items)) 822 if(child_index < (int) eina_list_count(pd->selected_items))
823 { 823 {
824 Efl_Ui_List_Item* items = eina_list_nth(pd->selected_items, child_index); 824 Efl_Ui_List_LayoutItem* items = eina_list_nth(pd->selected_items, child_index);
825 return items[child_index].item.layout; 825 return items[child_index].layout;
826 } 826 }
827 else 827 else
828 return NULL; 828 return NULL;
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.c b/src/lib/elementary/efl_ui_list_precise_layouter.c
index 7c4d0f564f..fbe72d444a 100644
--- a/src/lib/elementary/efl_ui_list_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_list_precise_layouter.c
@@ -244,13 +244,11 @@ _child_removed_cb(void *data, const Efl_Event *event)
244 Efl_Ui_List_LayoutItem *layout_item, *litem; 244 Efl_Ui_List_LayoutItem *layout_item, *litem;
245 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata; 245 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata;
246 Efl_Ui_List_SegArray_Node *itemnode; 246 Efl_Ui_List_SegArray_Node *itemnode;
247 Efl_Ui_List_Item* item;
248 int i; 247 int i;
249 248
250 item = efl_ui_list_segarray_remove(pd->segarray, evt->index); 249 litem = efl_ui_list_segarray_remove(pd->segarray, evt->index);
251 if (!item) return; 250 if (!litem) return;
252 251
253 litem = (Efl_Ui_List_LayoutItem *)item;
254 itemnode = litem->tree_node; 252 itemnode = litem->tree_node;
255 nodedata = itemnode->layout_data; 253 nodedata = itemnode->layout_data;
256 254
@@ -295,7 +293,7 @@ _child_removed_cb(void *data, const Efl_Event *event)
295 293
296 efl_ui_list_model_unrealize(pd->modeler, litem); 294 efl_ui_list_model_unrealize(pd->modeler, litem);
297 295
298 free(item); 296 free(litem);
299 pd->recalc = EINA_TRUE; 297 pd->recalc = EINA_TRUE;
300 evas_object_smart_changed(pd->modeler); 298 evas_object_smart_changed(pd->modeler);
301} 299}
diff --git a/src/lib/elementary/efl_ui_list_private.h b/src/lib/elementary/efl_ui_list_private.h
index f0ba576b99..021aeb0baf 100644
--- a/src/lib/elementary/efl_ui_list_private.h
+++ b/src/lib/elementary/efl_ui_list_private.h
@@ -12,16 +12,8 @@
12#include <Elementary.h> 12#include <Elementary.h>
13#include "elm_priv.h" 13#include "elm_priv.h"
14 14
15typedef struct _Efl_Ui_List_Item Efl_Ui_List_Item;
16typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data; 15typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
17 16
18struct _Efl_Ui_List_Item
19{
20 Efl_Ui_List_LayoutItem item;
21 Efl_Future *future;
22 Efl_Ui_List *list;
23};
24
25int efl_ui_list_item_index_get(Efl_Ui_List_LayoutItem *item); 17int efl_ui_list_item_index_get(Efl_Ui_List_LayoutItem *item);
26 18
27typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data; 19typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
diff --git a/src/lib/elementary/efl_ui_list_segarray.c b/src/lib/elementary/efl_ui_list_segarray.c
index efa0b3d5c2..a458fd1133 100644
--- a/src/lib/elementary/efl_ui_list_segarray.c
+++ b/src/lib/elementary/efl_ui_list_segarray.c
@@ -75,7 +75,7 @@ static Efl_Ui_List_SegArray_Node*
75_alloc_node(Efl_Ui_List_SegArray_Data* pd, int first) 75_alloc_node(Efl_Ui_List_SegArray_Data* pd, int first)
76{ 76{
77 Efl_Ui_List_SegArray_Node* node; 77 Efl_Ui_List_SegArray_Node* node;
78 node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + pd->step_size*sizeof(Efl_Ui_List_Item*)); 78 node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + pd->step_size*sizeof(Efl_Ui_List_LayoutItem*));
79 node->first = first; 79 node->first = first;
80 node->max = pd->step_size; 80 node->max = pd->step_size;
81 pd->root = (void*)eina_rbtree_inline_insert(EINA_RBTREE_GET(pd->root), EINA_RBTREE_GET(node), 81 pd->root = (void*)eina_rbtree_inline_insert(EINA_RBTREE_GET(pd->root), EINA_RBTREE_GET(node),
@@ -95,26 +95,26 @@ _efl_ui_list_segarray_flush(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd)
95 pd->count = 0; 95 pd->count = 0;
96} 96}
97 97
98static Efl_Ui_List_Item* _create_item_partial(Efl_Model* model) 98static Efl_Ui_List_LayoutItem* _create_item_partial(Efl_Model* model)
99{ 99{
100 Efl_Ui_List_Item* item = calloc(1, sizeof(Efl_Ui_List_Item)); 100 Efl_Ui_List_LayoutItem* item = calloc(1, sizeof(Efl_Ui_List_LayoutItem));
101 item->item.children = model; 101 item->children = model;
102 return item; 102 return item;
103} 103}
104 104
105static Efl_Ui_List_Item* _create_item(Efl_Model* model, Efl_Ui_List_SegArray_Node* node, unsigned int index) 105static Efl_Ui_List_LayoutItem* _create_item(Efl_Model* model, Efl_Ui_List_SegArray_Node* node, unsigned int index)
106{ 106{
107 Efl_Ui_List_Item* item = _create_item_partial(model); 107 Efl_Ui_List_LayoutItem* item = _create_item_partial(model);
108 item->item.index_offset = index - node->first; 108 item->index_offset = index - node->first;
109 item->item.tree_node = node; 109 item->tree_node = node;
110 return item; 110 return item;
111} 111}
112 112
113EOLIAN static Efl_Ui_List_Item* 113EOLIAN static Efl_Ui_List_LayoutItem*
114_efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd, int index) 114_efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd, int index)
115{ 115{
116 Efl_Ui_List_SegArray_Node *node; 116 Efl_Ui_List_SegArray_Node *node;
117 Efl_Ui_List_Item *item, *rt; 117 Efl_Ui_List_LayoutItem *item, *rt;
118 Eina_Iterator* iterator; 118 Eina_Iterator* iterator;
119 int offset; 119 int offset;
120 120
@@ -133,7 +133,7 @@ _efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd,
133 { 133 {
134 node->pointers[offset] = node->pointers[offset+1]; 134 node->pointers[offset] = node->pointers[offset+1];
135 item = node->pointers[offset]; 135 item = node->pointers[offset];
136 --item->item.index_offset; 136 --item->index_offset;
137 ++offset; 137 ++offset;
138 } 138 }
139 139
@@ -146,7 +146,7 @@ _efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd,
146} 146}
147 147
148static void 148static void
149_efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray_Data* pd, int index, Efl_Ui_List_Item* item, Efl_Ui_List_SegArray_Node* node) 149_efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray_Data* pd, int index, Efl_Ui_List_LayoutItem* item, Efl_Ui_List_SegArray_Node* node)
150{ 150{
151 Eina_Iterator* iterator; 151 Eina_Iterator* iterator;
152 int pos; 152 int pos;
@@ -154,8 +154,8 @@ _efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray_Data* pd, int index, E
154 if(node && node->length != node->max && (index - node->first) <= node->length) 154 if(node && node->length != node->max && (index - node->first) <= node->length)
155 { 155 {
156 pos = index - node->first; 156 pos = index - node->first;
157 item->item.tree_node = node; 157 item->tree_node = node;
158 item->item.index_offset = pos; 158 item->index_offset = pos;
159 if(pos < node->length) 159 if(pos < node->length)
160 { 160 {
161 assert(node->length != node->max); 161 assert(node->length != node->max);
@@ -178,8 +178,8 @@ _efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray_Data* pd, int index, E
178 node = _alloc_node(pd, index); 178 node = _alloc_node(pd, index);
179 node->pointers[0] = item; 179 node->pointers[0] = item;
180 node->length++; 180 node->length++;
181 item->item.index_offset = 0; 181 item->index_offset = 0;
182 item->item.tree_node = node; 182 item->tree_node = node;
183 } 183 }
184 184
185 node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT]; 185 node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
@@ -197,7 +197,7 @@ EOLIAN static void
197_efl_ui_list_segarray_insert(Eo *obj EINA_UNUSED, Efl_Ui_List_SegArray_Data* pd, int index, Efl_Model* model) 197_efl_ui_list_segarray_insert(Eo *obj EINA_UNUSED, Efl_Ui_List_SegArray_Data* pd, int index, Efl_Model* model)
198{ 198{
199 Efl_Ui_List_SegArray_Node* node, *next; 199 Efl_Ui_List_SegArray_Node* node, *next;
200 Efl_Ui_List_Item* item; 200 Efl_Ui_List_LayoutItem* item;
201 201
202 item = _create_item_partial(model); 202 item = _create_item_partial(model);
203 203
@@ -262,7 +262,7 @@ _efl_ui_list_segarray_accessor_get_at(Efl_Ui_List_Segarray_Eina_Accessor* acc,
262 if (node && (node->first <= idx && node->first + node->length > idx)) 262 if (node && (node->first <= idx && node->first + node->length > idx))
263 { 263 {
264 int i = idx - node->first; 264 int i = idx - node->first;
265 Efl_Ui_List_Item* item = node->pointers[i]; 265 Efl_Ui_List_LayoutItem* item = node->pointers[i];
266 *data = item; 266 *data = item;
267 return EINA_TRUE; 267 return EINA_TRUE;
268 } 268 }
@@ -270,13 +270,13 @@ _efl_ui_list_segarray_accessor_get_at(Efl_Ui_List_Segarray_Eina_Accessor* acc,
270} 270}
271 271
272EOLIAN static void 272EOLIAN static void
273_efl_ui_list_segarray_setup(Eo *obj, Efl_Ui_List_SegArray_Data *pd, int size) 273_efl_ui_list_segarray_setup(Eo *obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd, int size)
274{ 274{
275 pd->step_size = size; 275 pd->step_size = size;
276} 276}
277 277
278EOLIAN static Eo * 278EOLIAN static Eo *
279_efl_ui_list_segarray_efl_object_constructor(Eo *obj, Efl_Ui_List_SegArray_Data *pd) 279_efl_ui_list_segarray_efl_object_constructor(Eo *obj, Efl_Ui_List_SegArray_Data *pd EINA_UNUSED)
280{ 280{
281 obj = efl_constructor(efl_super(obj, MY_CLASS)); 281 obj = efl_constructor(efl_super(obj, MY_CLASS));
282 282
diff --git a/src/lib/elementary/efl_ui_list_segarray.eo b/src/lib/elementary/efl_ui_list_segarray.eo
index 4021aa9d1b..7380657d8c 100644
--- a/src/lib/elementary/efl_ui_list_segarray.eo
+++ b/src/lib/elementary/efl_ui_list_segarray.eo
@@ -9,7 +9,7 @@ class Efl.Ui.List.SegArray (Efl.Object)
9 [[ Get a SegArray List items accessor ]] 9 [[ Get a SegArray List items accessor ]]
10 } 10 }
11 values { 11 values {
12 acc: accessor<ptr(Efl_Ui_List_Item)>; 12 acc: accessor<ptr(Efl.Ui.List.LayoutItem)>;
13 } 13 }
14 } 14 }
15 @property node_accessor { 15 @property node_accessor {
@@ -52,7 +52,7 @@ class Efl.Ui.List.SegArray (Efl.Object)
52 params { 52 params {
53 @in index: int; 53 @in index: int;
54 } 54 }
55 return: ptr(Efl_Ui_List_Item); 55 return: ptr(Efl.Ui.List.LayoutItem) @owned;
56 } 56 }
57 } 57 }
58 implements { 58 implements {
diff --git a/src/lib/elementary/efl_ui_list_segarray.h b/src/lib/elementary/efl_ui_list_segarray.h
index 801aa060ed..41f871923c 100644
--- a/src/lib/elementary/efl_ui_list_segarray.h
+++ b/src/lib/elementary/efl_ui_list_segarray.h
@@ -13,7 +13,7 @@ typedef struct _Efl_Ui_List_SegArray_Node
13 13
14 void* layout_data; 14 void* layout_data;
15 15
16 Efl_Ui_List_Item* pointers[0]; 16 Efl_Ui_List_LayoutItem* pointers[0];
17} Efl_Ui_List_SegArray_Node; 17} Efl_Ui_List_SegArray_Node;
18 18
19typedef struct _Efl_Ui_List_SegArray_Data 19typedef struct _Efl_Ui_List_SegArray_Data
diff --git a/src/lib/elementary/efl_ui_list_types.eot b/src/lib/elementary/efl_ui_list_types.eot
index cdbeeaa930..dc955ef482 100644
--- a/src/lib/elementary/efl_ui_list_types.eot
+++ b/src/lib/elementary/efl_ui_list_types.eot
@@ -9,5 +9,3 @@ struct Efl.Ui.List.LayoutItem {
9} 9}
10 10
11struct @extern Efl.Ui.List.SegArray.Node; [[ ]] 11struct @extern Efl.Ui.List.SegArray.Node; [[ ]]
12struct @extern Efl_Ui_List_Item; [[ ]]
13