forked from enlightenment/efl
Elementary: remove needless structs in Efl_Ui_List
This commit is contained in:
parent
ee0cbdad17
commit
4362047313
|
@ -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>
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -9,5 +9,3 @@ struct Efl.Ui.List.LayoutItem {
|
|||
}
|
||||
|
||||
struct @extern Efl.Ui.List.SegArray.Node; [[ ]]
|
||||
struct @extern Efl_Ui_List_Item; [[ ]]
|
||||
|
||||
|
|
Loading…
Reference in New Issue