aboutsummaryrefslogtreecommitdiffstats
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
parentelementary: efl_ui_list change SegArray tree to Efl.Object (diff)
downloadefl-devs/larrylira/efl_ui_list.tar.gz
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;
#ifdef EFL_EO_API_SUPPORT
# include <efl_selection_types.eot.h>
-# include <efl_ui_list_segarray.h>
-# include <efl_ui_list_segarray.eo.h>
# include <efl_config_global.eo.h>
# include <efl_ui_widget.eo.h>
# include <efl_ui_widget_part.eo.h>
@@ -324,6 +322,8 @@ typedef Eo Efl_Ui_Focus_Manager;
# include <efl_ui_slider_interval.eo.h>
# include <efl_ui_layout_factory.eo.h>
# include <efl_ui_list_types.eot.h>
+# include <efl_ui_list_segarray.h>
+# include <efl_ui_list_segarray.eo.h>
# include <efl_ui_list_model.eo.h>
# include <efl_ui_list_relayout.eo.h>
# 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
{
if(child_index < (int) eina_list_count(pd->selected_items))
{
- Efl_Ui_List_Item* items = eina_list_nth(pd->selected_items, child_index);
- return items[child_index].item.layout;
+ Efl_Ui_List_LayoutItem* items = eina_list_nth(pd->selected_items, child_index);
+ return items[child_index].layout;
}
else
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)
Efl_Ui_List_LayoutItem *layout_item, *litem;
Efl_Ui_List_Precise_Layouter_Node_Data *nodedata;
Efl_Ui_List_SegArray_Node *itemnode;
- Efl_Ui_List_Item* item;
int i;
- item = efl_ui_list_segarray_remove(pd->segarray, evt->index);
- if (!item) return;
+ litem = efl_ui_list_segarray_remove(pd->segarray, evt->index);
+ if (!litem) return;
- litem = (Efl_Ui_List_LayoutItem *)item;
itemnode = litem->tree_node;
nodedata = itemnode->layout_data;
@@ -295,7 +293,7 @@ _child_removed_cb(void *data, const Efl_Event *event)
efl_ui_list_model_unrealize(pd->modeler, litem);
- free(item);
+ free(litem);
pd->recalc = EINA_TRUE;
evas_object_smart_changed(pd->modeler);
}
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 @@
#include <Elementary.h>
#include "elm_priv.h"
-typedef struct _Efl_Ui_List_Item Efl_Ui_List_Item;
typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
-struct _Efl_Ui_List_Item
-{
- Efl_Ui_List_LayoutItem item;
- Efl_Future *future;
- Efl_Ui_List *list;
-};
-
int efl_ui_list_item_index_get(Efl_Ui_List_LayoutItem *item);
typedef 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*
_alloc_node(Efl_Ui_List_SegArray_Data* pd, int first)
{
Efl_Ui_List_SegArray_Node* node;
- node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + pd->step_size*sizeof(Efl_Ui_List_Item*));
+ node = calloc(1, sizeof(Efl_Ui_List_SegArray_Node) + pd->step_size*sizeof(Efl_Ui_List_LayoutItem*));
node->first = first;
node->max = pd->step_size;
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)
pd->count = 0;
}
-static Efl_Ui_List_Item* _create_item_partial(Efl_Model* model)
+static Efl_Ui_List_LayoutItem* _create_item_partial(Efl_Model* model)
{
- Efl_Ui_List_Item* item = calloc(1, sizeof(Efl_Ui_List_Item));
- item->item.children = model;
+ Efl_Ui_List_LayoutItem* item = calloc(1, sizeof(Efl_Ui_List_LayoutItem));
+ item->children = model;
return item;
}
-static Efl_Ui_List_Item* _create_item(Efl_Model* model, Efl_Ui_List_SegArray_Node* node, unsigned int index)
+static Efl_Ui_List_LayoutItem* _create_item(Efl_Model* model, Efl_Ui_List_SegArray_Node* node, unsigned int index)
{
- Efl_Ui_List_Item* item = _create_item_partial(model);
- item->item.index_offset = index - node->first;
- item->item.tree_node = node;
+ Efl_Ui_List_LayoutItem* item = _create_item_partial(model);
+ item->index_offset = index - node->first;
+ item->tree_node = node;
return item;
}
-EOLIAN static Efl_Ui_List_Item*
+EOLIAN static Efl_Ui_List_LayoutItem*
_efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd, int index)
{
Efl_Ui_List_SegArray_Node *node;
- Efl_Ui_List_Item *item, *rt;
+ Efl_Ui_List_LayoutItem *item, *rt;
Eina_Iterator* iterator;
int offset;
@@ -133,7 +133,7 @@ _efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd,
{
node->pointers[offset] = node->pointers[offset+1];
item = node->pointers[offset];
- --item->item.index_offset;
+ --item->index_offset;
++offset;
}
@@ -146,7 +146,7 @@ _efl_ui_list_segarray_remove(Eo* obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd,
}
static void
-_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)
+_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)
{
Eina_Iterator* iterator;
int pos;
@@ -154,8 +154,8 @@ _efl_ui_list_segarray_insert_at_node(Efl_Ui_List_SegArray_Data* pd, int index, E
if(node && node->length != node->max && (index - node->first) <= node->length)
{
pos = index - node->first;
- item->item.tree_node = node;
- item->item.index_offset = pos;
+ item->tree_node = node;
+ item->index_offset = pos;
if(pos < node->length)
{
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
node = _alloc_node(pd, index);
node->pointers[0] = item;
node->length++;
- item->item.index_offset = 0;
- item->item.tree_node = node;
+ item->index_offset = 0;
+ item->tree_node = node;
}
node = (void*)EINA_RBTREE_GET(node)->son[EINA_RBTREE_LEFT];
@@ -197,7 +197,7 @@ EOLIAN static void
_efl_ui_list_segarray_insert(Eo *obj EINA_UNUSED, Efl_Ui_List_SegArray_Data* pd, int index, Efl_Model* model)
{
Efl_Ui_List_SegArray_Node* node, *next;
- Efl_Ui_List_Item* item;
+ Efl_Ui_List_LayoutItem* item;
item = _create_item_partial(model);
@@ -262,7 +262,7 @@ _efl_ui_list_segarray_accessor_get_at(Efl_Ui_List_Segarray_Eina_Accessor* acc,
if (node && (node->first <= idx && node->first + node->length > idx))
{
int i = idx - node->first;
- Efl_Ui_List_Item* item = node->pointers[i];
+ Efl_Ui_List_LayoutItem* item = node->pointers[i];
*data = item;
return EINA_TRUE;
}
@@ -270,13 +270,13 @@ _efl_ui_list_segarray_accessor_get_at(Efl_Ui_List_Segarray_Eina_Accessor* acc,
}
EOLIAN static void
-_efl_ui_list_segarray_setup(Eo *obj, Efl_Ui_List_SegArray_Data *pd, int size)
+_efl_ui_list_segarray_setup(Eo *obj EINA_UNUSED, Efl_Ui_List_SegArray_Data *pd, int size)
{
pd->step_size = size;
}
EOLIAN static Eo *
-_efl_ui_list_segarray_efl_object_constructor(Eo *obj, Efl_Ui_List_SegArray_Data *pd)
+_efl_ui_list_segarray_efl_object_constructor(Eo *obj, Efl_Ui_List_SegArray_Data *pd EINA_UNUSED)
{
obj = efl_constructor(efl_super(obj, MY_CLASS));
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)
[[ Get a SegArray List items accessor ]]
}
values {
- acc: accessor<ptr(Efl_Ui_List_Item)>;
+ acc: accessor<ptr(Efl.Ui.List.LayoutItem)>;
}
}
@property node_accessor {
@@ -52,7 +52,7 @@ class Efl.Ui.List.SegArray (Efl.Object)
params {
@in index: int;
}
- return: ptr(Efl_Ui_List_Item);
+ return: ptr(Efl.Ui.List.LayoutItem) @owned;
}
}
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
void* layout_data;
- Efl_Ui_List_Item* pointers[0];
+ Efl_Ui_List_LayoutItem* pointers[0];
} Efl_Ui_List_SegArray_Node;
typedef 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 {
}
struct @extern Efl.Ui.List.SegArray.Node; [[ ]]
-struct @extern Efl_Ui_List_Item; [[ ]]
-