efl_ui_win_autodel_set(efl_added, EINA_TRUE)
);
- list = efl_new(EFL_UI_LIST_POSITION_MANAGER_CLASS);
+ list = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS);
item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win,
efl_ui_item_container_position_manager_set(efl_added, list));
efl_content_set(win, item_container);
efl_ui_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object));
}
-void create_item_container_ui(Efl_Ui_Item_Position_Manager *manager, const Efl_Class *item, const char *name)
+void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl_Class *item, const char *name)
{
Efl_Ui_Win *win, *o, *tbl, *item_container, *bx;
Match_Content_Ctx *ctx = calloc(1, sizeof(*ctx));
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- create_item_container_ui(efl_new(EFL_UI_GRID_POSITION_MANAGER_CLASS), EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container Grid");
+ create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS), EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container Grid");
}
void test_efl_ui_item_container_list(void *data EINA_UNUSED,
Evas_Object *obj EINA_UNUSED,
void *event_info EINA_UNUSED)
{
- create_item_container_ui(efl_new(EFL_UI_LIST_POSITION_MANAGER_CLASS), EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container List");
+ create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS), EFL_UI_LIST_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container List");
}
# include <efl_ui_spin_button.eo.h>
# include <efl_ui_slider.eo.h>
# include <efl_ui_item.eo.h>
-# include <efl_ui_item_position_manager.eo.h>
+# include <efl_ui_position_manager_entity.eo.h>
# include <efl_ui_item_container.eo.h>
-# include <efl_ui_list_position_manager.eo.h>
-# include <efl_ui_grid_position_manager.eo.h>
+# include <efl_ui_position_manager_list.eo.h>
+# include <efl_ui_position_manager_grid.eo.h>
# include <efl_ui_list_item.eo.h>
# include <efl_ui_list_default_item.eo.h>
# include <efl_ui_grid_item.eo.h>
+++ /dev/null
-class @beta Efl.Ui.Grid_Position_Manager extends Efl.Object implements Efl.Ui.Item_Position_Manager
-{
- [[Implementation of @Efl.Ui.Item_Position_Manager for two-dimensional grids.
-
- Every item in the grid has the same size, which is the biggest minimum size of all items.
- ]]
- implements {
- Efl.Ui.Item_Position_Manager.data_access {set;}
- Efl.Ui.Item_Position_Manager.viewport {set;}
- Efl.Ui.Item_Position_Manager.scroll_position {set;}
- Efl.Ui.Item_Position_Manager.item_added;
- Efl.Ui.Item_Position_Manager.item_removed;
- Efl.Ui.Item_Position_Manager.position_single_item;
- Efl.Ui.Item_Position_Manager.item_size_changed;
- Efl.Ui.Layout_Orientable.orientation {set; get;}
- }
-}
Efl_Ui_Select_Mode mode;
Efl_Ui_Layout_Orientation dir;
Eina_Size2D content_min_size;
- Efl_Ui_Item_Position_Manager *pos_man;
+ Efl_Ui_Position_Manager_Entity *pos_man;
struct {
Eina_Accessor pass_on;
unsigned int last_index;
MY_DATA_GET(data, pd);
Eina_Rect rect = efl_ui_scrollable_viewport_geometry_get(data);
- efl_ui_item_position_manager_viewport_set(pd->pos_man, rect);
+ efl_ui_position_manager_entity_viewport_set(pd->pos_man, rect);
}
static void
if (max.y > 0.0)
rpos.y = (double)pos.y/(double)max.y;
- efl_ui_item_position_manager_scroll_position_set(pd->pos_man, rpos.x, rpos.y);
+ efl_ui_position_manager_entity_scroll_position_set(pd->pos_man, rpos.x, rpos.y);
}
EFL_CALLBACKS_ARRAY_DEFINE(pan_events_cb,
if (!pd->smanager) return;
- ipos = efl_ui_item_position_manager_position_single_item(pd->pos_man, eina_list_data_idx(pd->items, item));
+ ipos = efl_ui_position_manager_entity_position_single_item(pd->pos_man, eina_list_data_idx(pd->items, item));
view = efl_ui_scrollable_viewport_geometry_get(pd->smanager);
vpos = efl_ui_scrollable_content_pos_get(pd->smanager);
MY_DATA_GET(obj, pd);
int idx = eina_list_data_idx(pd->items, ev->object);
- efl_ui_item_position_manager_item_size_changed(pd->pos_man, idx, idx);
+ efl_ui_position_manager_entity_item_size_changed(pd->pos_man, idx, idx);
}
static void
pd->items = eina_list_remove(pd->items, item);
pd->selected = eina_list_remove(pd->selected, item);
efl_event_callback_array_del(item, active_item(), obj);
- efl_ui_item_position_manager_item_removed(pd->pos_man, id, item);
+ efl_ui_position_manager_entity_item_removed(pd->pos_man, id, item);
return EINA_TRUE;
}
pd->obj_accessor.last_index = id;
pd->obj_accessor.current = pd->items;
}
- efl_ui_item_position_manager_item_added(pd->pos_man, id, subobj);
+ efl_ui_position_manager_entity_item_added(pd->pos_man, id, subobj);
}
EOLIAN static Eina_Bool
}
EFL_CALLBACKS_ARRAY_DEFINE(pos_manager_cbs,
- {EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_SIZE_CHANGED, _pos_content_size_changed_cb},
- {EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_MIN_SIZE_CHANGED, _pos_content_min_size_changed_cb},
+ {EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_SIZE_CHANGED, _pos_content_size_changed_cb},
+ {EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_MIN_SIZE_CHANGED, _pos_content_min_size_changed_cb},
)
EOLIAN static void
-_efl_ui_item_container_position_manager_set(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item_Position_Manager *layouter)
+_efl_ui_item_container_position_manager_set(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Position_Manager_Entity *layouter)
{
if (layouter)
- EINA_SAFETY_ON_FALSE_RETURN(efl_isa(layouter, EFL_UI_ITEM_POSITION_MANAGER_INTERFACE));
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(layouter, EFL_UI_POSITION_MANAGER_ENTITY_INTERFACE));
if (pd->pos_man)
{
efl_event_callback_array_del(pd->pos_man, pos_manager_cbs(), obj);
- efl_ui_item_position_manager_data_access_set(pd->pos_man, NULL, NULL, 0);
+ efl_ui_position_manager_entity_data_access_set(pd->pos_man, NULL, NULL, 0);
efl_del(pd->pos_man);
}
pd->pos_man = layouter;
{
efl_parent_set(pd->pos_man, obj);
efl_event_callback_array_add(pd->pos_man, pos_manager_cbs(), obj);
- efl_ui_item_position_manager_data_access_set(pd->pos_man, &pd->obj_accessor.pass_on, &pd->size_accessor, eina_list_count(pd->items));
- efl_ui_item_position_manager_viewport_set(pd->pos_man, efl_ui_scrollable_viewport_geometry_get(obj));
+ efl_ui_position_manager_entity_data_access_set(pd->pos_man, &pd->obj_accessor.pass_on, &pd->size_accessor, eina_list_count(pd->items));
+ efl_ui_position_manager_entity_viewport_set(pd->pos_man, efl_ui_scrollable_viewport_geometry_get(obj));
efl_ui_layout_orientation_set(pd->pos_man, pd->dir);
}
}
-EOLIAN static Efl_Ui_Item_Position_Manager*
+EOLIAN static Efl_Ui_Position_Manager_Entity*
_efl_ui_item_container_position_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd)
{
return pd->pos_man;
@property position_manager {
[[Position manager object that handles placement of items.]]
values {
- position_manager : Efl.Ui.Item_Position_Manager @owned; [[The objects ownership is passed to the item container.]]
+ position_manager : Efl.Ui.Position_Manager.Entity @owned; [[The objects ownership is passed to the item container.]]
}
}
}
+++ /dev/null
-class @beta Efl.Ui.List_Position_Manager extends Efl.Object implements Efl.Ui.Item_Position_Manager
-{
- [[Implementation of Efl.Ui.Item_Position_manager for a list
-
- Every item in the list will get at least his minsize applied, changes to the misize are listend to and change the layouting of all items. This supports the vertical and horizontal orientation.
- ]]
- implements {
- Efl.Object.destructor;
- Efl.Ui.Item_Position_Manager.data_access {set;}
- Efl.Ui.Item_Position_Manager.viewport {set;}
- Efl.Ui.Item_Position_Manager.scroll_position {set;}
- Efl.Ui.Item_Position_Manager.item_added;
- Efl.Ui.Item_Position_Manager.item_removed;
- Efl.Ui.Item_Position_Manager.position_single_item;
- Efl.Ui.Item_Position_Manager.item_size_changed;
- Efl.Ui.Layout_Orientable.orientation {set; get;}
- }
-}
#include <Efl_Ui.h>
#include "elm_priv.h"
-#define MY_CLASS EFL_UI_ITEM_POSITION_MANAGER_CLASS
+#define MY_CLASS EFL_UI_POSITION_MANAGER_ENTITY_CLASS
-#include "efl_ui_item_position_manager.eo.c"
+#include "efl_ui_position_manager_entity.eo.c"
-interface @beta Efl.Ui.Item_Position_Manager extends Efl.Ui.Layout_Orientable
+interface @beta Efl.Ui.Position_Manager.Entity extends Efl.Ui.Layout_Orientable
{
[[
This abstracts the basic placement of items in a not defined form under a viewport.
#include "elm_widget.h"
#include "elm_priv.h"
-#define MY_CLASS EFL_UI_GRID_POSITION_MANAGER_CLASS
+#define MY_CLASS EFL_UI_POSITION_MANAGER_GRID_CLASS
#define MY_DATA_GET(obj, pd) \
- Efl_Ui_Grid_Position_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ Efl_Ui_Position_Manager_Grid_Data *pd = efl_data_scope_get(obj, MY_CLASS);
typedef struct {
Eina_Accessor *content_acc, *size_acc;
int columns;
int rows;
} current_display_table;
-} Efl_Ui_Grid_Position_Manager_Data;
+} Efl_Ui_Position_Manager_Grid_Data;
static inline void
-vis_change_segment(Efl_Ui_Grid_Position_Manager_Data *pd, int a, int b, Eina_Bool flag)
+vis_change_segment(Efl_Ui_Position_Manager_Grid_Data *pd, int a, int b, Eina_Bool flag)
{
for (int i = MIN(a, b); i < MAX(a, b); ++i)
{
}
static void
-_reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd)
+_reposition_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
Eina_Size2D space_size;
int relevant_space_size, relevant_viewport;
}
static inline void
-_flush_abs_size(Eo *obj, Efl_Ui_Grid_Position_Manager_Data *pd)
+_flush_abs_size(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd)
{
int minor, major;
Eina_Size2D vp_size;
if (vp_size.h != pd->last_viewport_size.h || vp_size.w != pd->last_viewport_size.w)
{
pd->last_viewport_size = vp_size;
- efl_event_callback_call(obj, EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_SIZE_CHANGED, &vp_size);
+ efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_SIZE_CHANGED, &vp_size);
}
}
static inline void
-_update_min_size(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, int added_index)
+_update_min_size(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int added_index)
{
Eina_Size2D elemsize;
}
static inline void
-_flush_min_size(Eo *obj, Efl_Ui_Grid_Position_Manager_Data *pd)
+_flush_min_size(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd)
{
Eina_Size2D min_size = pd->max_min_size;
if (pd->prev_min_size.w != min_size.w || pd->prev_min_size.h != min_size.h)
{
pd->prev_min_size = min_size;
- efl_event_callback_call(obj, EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_MIN_SIZE_CHANGED, &min_size);
+ efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_MIN_SIZE_CHANGED, &min_size);
}
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_data_access_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, Eina_Accessor *obj_access, Eina_Accessor *size_access, int size)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_data_access_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Eina_Accessor *obj_access, Eina_Accessor *size_access, int size)
{
pd->size_acc = size_access;
pd->content_acc = obj_access;
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_viewport_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, Eina_Rect viewport)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_viewport_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Eina_Rect viewport)
{
pd->viewport = viewport;
_flush_abs_size(obj, pd);
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_scroll_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, double x, double y)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_scroll_position_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, double x, double y)
{
pd->scroll_position.x = x;
pd->scroll_position.y = y;
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_item_added(Eo *obj, Efl_Ui_Grid_Position_Manager_Data *pd, int added_index, Efl_Gfx_Entity *subobj EINA_UNUSED)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_added(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, int added_index, Efl_Gfx_Entity *subobj EINA_UNUSED)
{
pd->size ++;
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_item_removed(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, int removed_index EINA_UNUSED, Efl_Gfx_Entity *subobj EINA_UNUSED)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_removed(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int removed_index EINA_UNUSED, Efl_Gfx_Entity *subobj EINA_UNUSED)
{
EINA_SAFETY_ON_FALSE_RETURN(pd->size > 0);
pd->size --;
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_item_size_changed(Eo *obj, Efl_Ui_Grid_Position_Manager_Data *pd, int start_id, int end_id)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_item_size_changed(Eo *obj, Efl_Ui_Position_Manager_Grid_Data *pd, int start_id, int end_id)
{
for (int i = start_id; i <= end_id; ++i)
{
}
EOLIAN static void
-_efl_ui_grid_position_manager_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, Efl_Ui_Layout_Orientation dir)
+_efl_ui_position_manager_grid_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, Efl_Ui_Layout_Orientation dir)
{
pd->dir = dir;
_flush_min_size(obj, pd);
EOLIAN static Efl_Ui_Layout_Orientation
-_efl_ui_grid_position_manager_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd)
+_efl_ui_position_manager_grid_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd)
{
return pd->dir;
}
EOLIAN static Eina_Rect
-_efl_ui_grid_position_manager_efl_ui_item_position_manager_position_single_item(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Position_Manager_Data *pd, int idx)
+_efl_ui_position_manager_grid_efl_ui_position_manager_entity_position_single_item(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_Grid_Data *pd, int idx)
{
Eina_Rect geom;
Eina_Size2D space_size;
return geom;
}
-#include "efl_ui_grid_position_manager.eo.c"
+#include "efl_ui_position_manager_grid.eo.c"
--- /dev/null
+class @beta Efl.Ui.Position_Manager.Grid extends Efl.Object implements Efl.Ui.Position_Manager.Entity
+{
+ [[Implementation of @Efl.Ui.Position_Manager.Entity for two-dimensional grids.
+
+ Every item in the grid has the same size, which is the biggest minimum size of all items.
+ ]]
+ implements {
+ Efl.Ui.Position_Manager.Entity.data_access {set;}
+ Efl.Ui.Position_Manager.Entity.viewport {set;}
+ Efl.Ui.Position_Manager.Entity.scroll_position {set;}
+ Efl.Ui.Position_Manager.Entity.item_added;
+ Efl.Ui.Position_Manager.Entity.item_removed;
+ Efl.Ui.Position_Manager.Entity.position_single_item;
+ Efl.Ui.Position_Manager.Entity.item_size_changed;
+ Efl.Ui.Layout_Orientable.orientation {set; get;}
+ }
+}
#include "elm_widget.h"
#include "elm_priv.h"
-#define MY_CLASS EFL_UI_LIST_POSITION_MANAGER_CLASS
+#define MY_CLASS EFL_UI_POSITION_MANAGER_LIST_CLASS
#define MY_DATA_GET(obj, pd) \
- Efl_Ui_List_Position_Manager_Data *pd = efl_data_scope_get(obj, MY_CLASS);
+ Efl_Ui_Position_Manager_List_Data *pd = efl_data_scope_get(obj, MY_CLASS);
typedef struct {
Eina_Accessor *content_acc, *size_acc;
struct {
unsigned int start_id, end_id;
} prev_run;
-} Efl_Ui_List_Position_Manager_Data;
+} Efl_Ui_Position_Manager_List_Data;
/*
* The here used cache is a sum map
*/
static void
-cache_require(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd)
+cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
unsigned int i;
}
static void
-cache_invalidate(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd)
+cache_invalidate(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
if (pd->size_cache)
free(pd->size_cache);
}
static inline int
-cache_access(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd, unsigned int idx)
+cache_access(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, unsigned int idx)
{
EINA_SAFETY_ON_FALSE_RETURN_VAL(idx <= pd->size, 0);
return pd->size_cache[idx];
}
static void
-recalc_absolut_size(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd)
+recalc_absolut_size(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
{
Eina_Size2D min_size = EINA_SIZE2D(-1, -1);
cache_require(obj, pd);
pd->abs_size.w = MAX(cache_access(obj, pd, pd->size), pd->abs_size.w);
}
- efl_event_callback_call(obj, EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_SIZE_CHANGED, &pd->abs_size);
+ efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_SIZE_CHANGED, &pd->abs_size);
if (pd->dir == EFL_UI_LAYOUT_ORIENTATION_VERTICAL)
{
min_size.h = pd->maximum_min_size;
}
- efl_event_callback_call(obj, EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_MIN_SIZE_CHANGED, &min_size);
+ efl_event_callback_call(obj, EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_MIN_SIZE_CHANGED, &min_size);
}
static inline void
-vis_change_segment(Efl_Ui_List_Position_Manager_Data *pd, int a, int b, Eina_Bool flag)
+vis_change_segment(Efl_Ui_Position_Manager_List_Data *pd, int a, int b, Eina_Bool flag)
{
for (int i = MIN(a, b); i < MAX(a, b); ++i)
{
}
static void
-position_content(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd)
+position_content(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
Eina_Rect geom;
Eina_Size2D space_size;
}
static void
-schedule_recalc_absolut_size(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd)
+schedule_recalc_absolut_size(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
{
if (pd->rebuild_absolut_size) return;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_data_access_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd, Eina_Accessor *content_access, Eina_Accessor *size_access, int size)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_data_access_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, Eina_Accessor *content_access, Eina_Accessor *size_access, int size)
{
cache_invalidate(obj, pd);
pd->content_acc = content_access;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_viewport_set(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd, Eina_Rect size)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_viewport_set(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, Eina_Rect size)
{
pd->viewport = size;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_scroll_position_set(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd, double x, double y)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_scroll_position_set(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, double x, double y)
{
pd->scroll_position.x = x;
pd->scroll_position.y = y;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_item_added(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd, int added_index EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_added(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int added_index EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
if (pd->size == 0)
{
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_item_removed(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd, int removed_index EINA_UNUSED, Efl_Gfx_Entity *subobj)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_removed(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, int removed_index EINA_UNUSED, Efl_Gfx_Entity *subobj)
{
pd->size --;
if (subobj)
}
EOLIAN static Eina_Rect
-_efl_ui_list_position_manager_efl_ui_item_position_manager_position_single_item(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd, int idx)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_position_single_item(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, int idx)
{
Eina_Rect geom;
Eina_Size2D space_size;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_item_position_manager_item_size_changed(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd, int start_id EINA_UNUSED, int end_id EINA_UNUSED)
+_efl_ui_position_manager_list_efl_ui_position_manager_entity_item_size_changed(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd, int start_id EINA_UNUSED, int end_id EINA_UNUSED)
{
cache_invalidate(obj, pd);
schedule_recalc_absolut_size(obj, pd);
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd, Efl_Ui_Layout_Orientation dir)
+_efl_ui_position_manager_list_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd, Efl_Ui_Layout_Orientation dir)
{
pd->dir = dir;
//in order to reset the state of the visible items, just hide everything and set the old segment accordingly
}
EOLIAN static Efl_Ui_Layout_Orientation
-_efl_ui_list_position_manager_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_Position_Manager_Data *pd)
+_efl_ui_position_manager_list_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd)
{
return pd->dir;
}
EOLIAN static void
-_efl_ui_list_position_manager_efl_object_destructor(Eo *obj, Efl_Ui_List_Position_Manager_Data *pd)
+_efl_ui_position_manager_list_efl_object_destructor(Eo *obj, Efl_Ui_Position_Manager_List_Data *pd)
{
if (pd->rebuild_absolut_size)
eina_future_cancel(pd->rebuild_absolut_size);
}
-#include "efl_ui_list_position_manager.eo.c"
+#include "efl_ui_position_manager_list.eo.c"
--- /dev/null
+class @beta Efl.Ui.Position_Manager.List extends Efl.Object implements Efl.Ui.Position_Manager.Entity
+{
+ [[Implementation of @Efl.Ui.Position_Manager.Entity for a list
+
+ Every item in the list will get at least his minsize applied, changes to the misize are listend to and change the layouting of all items. This supports the vertical and horizontal orientation.
+ ]]
+ implements {
+ Efl.Object.destructor;
+ Efl.Ui.Position_Manager.Entity.data_access {set;}
+ Efl.Ui.Position_Manager.Entity.viewport {set;}
+ Efl.Ui.Position_Manager.Entity.scroll_position {set;}
+ Efl.Ui.Position_Manager.Entity.item_added;
+ Efl.Ui.Position_Manager.Entity.item_removed;
+ Efl.Ui.Position_Manager.Entity.position_single_item;
+ Efl.Ui.Position_Manager.Entity.item_size_changed;
+ Efl.Ui.Layout_Orientable.orientation {set; get;}
+ }
+}
'efl_ui_clickable_util.eo',
'efl_ui_format.eo',
'efl_ui_item_container.eo',
- 'efl_ui_item_position_manager.eo',
- 'efl_ui_list_position_manager.eo',
- 'efl_ui_grid_position_manager.eo',
+ 'efl_ui_position_manager_entity.eo',
+ 'efl_ui_position_manager_list.eo',
+ 'efl_ui_position_manager_grid.eo',
]
#<--TIZEN_ONLY
'efl_ui_format.c',
'efl_ui_scroll_util.c',
'efl_ui_item_container.c',
- 'efl_ui_item_position_manager.c',
- 'efl_ui_list_position_manager.c',
- 'efl_ui_grid_position_manager.c',
+ 'efl_ui_position_manager_entity.c',
+ 'efl_ui_position_manager_list.c',
+ 'efl_ui_position_manager_grid.c',
]
#<--TIZEN_ONLY
static void
item_container_setup()
{
- Eo * list = efl_new(EFL_UI_GRID_POSITION_MANAGER_CLASS);
- position_manager = efl_new(EFL_UI_GRID_POSITION_MANAGER_CLASS);
+ Eo * list = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS);
+ position_manager = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS);
win = win_add();
item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win,
efl_ui_item_container_position_manager_set(efl_added, list));
EFL_START_TEST(finalizer_check)
{
- Eo *grid = efl_new(EFL_UI_GRID_POSITION_MANAGER_CLASS);
- Eo *list = efl_new(EFL_UI_GRID_POSITION_MANAGER_CLASS);
+ Eo *grid = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS);
+ Eo *list = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS);
Eo *random_obj = efl_add(EFL_UI_BUTTON_CLASS, win);
Eo *o;
static void
item_container_setup()
{
- Eo * list = efl_new(EFL_UI_LIST_POSITION_MANAGER_CLASS);
- position_manager = efl_new(EFL_UI_LIST_POSITION_MANAGER_CLASS);
+ Eo * list = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS);
+ position_manager = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS);
win = win_add();
item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win,
efl_ui_item_container_position_manager_set(efl_added, list));
inner_size_acc.lock = _lock_cb;
inner_size_acc.clone = _clone_cb;
- efl_ui_item_position_manager_data_access_set(position_manager,
+ efl_ui_position_manager_entity_data_access_set(position_manager,
eina_array_accessor_new(arr_obj),
&inner_size_acc, 0);
}
eina_inarray_push(arr_size, &size);
- efl_ui_item_position_manager_item_added(position_manager, idx, obj);
+ efl_ui_position_manager_entity_item_added(position_manager, idx, obj);
return idx;
}
_initial_setup();
//try to resize the viewport while we have no item
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
_iterate_a_few();
_add_item(efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, win), EINA_SIZE2D(20, 20));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
_iterate_a_few();
}
EFL_END_TEST
_initial_setup();
//try to resize the viewport while we have no item
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
_iterate_a_few();
_add_item(NULL, EINA_SIZE2D(20, 20));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 0, 0));
_iterate_a_few();
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(20, 20, 200, 200));
_iterate_a_few();
_update_item(0, efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, win), EINA_SIZE2D(20, 20));
_iterate_a_few();
{
Eina_Size2D size = EINA_SIZE2D(-2, -2), min_size = EINA_SIZE2D(-2, -2);
efl_event_callback_add(position_manager,
- EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_SIZE_CHANGED, _content_size_cb, &size);
+ EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_SIZE_CHANGED, _content_size_cb, &size);
efl_event_callback_add(position_manager,
- EFL_UI_ITEM_POSITION_MANAGER_EVENT_CONTENT_MIN_SIZE_CHANGED, _content_size_cb, &min_size);
+ EFL_UI_POSITION_MANAGER_ENTITY_EVENT_CONTENT_MIN_SIZE_CHANGED, _content_size_cb, &min_size);
_initial_setup();
_add_item(efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, win), EINA_SIZE2D(20, 20));
_add_item(efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, win), EINA_SIZE2D(20, 30));
- efl_ui_item_position_manager_viewport_set(position_manager, EINA_RECT(0, 0, 200, 200));
+ efl_ui_position_manager_entity_viewport_set(position_manager, EINA_RECT(0, 0, 200, 200));
_iterate_a_few();
ck_assert_int_ne(size.w, -2);
_test_efl_ui_item_container_list_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
{
efl_constructor(efl_super(obj, TEST_EFL_UI_ITEM_CONTAINER_LIST_CLASS));
- efl_ui_item_container_position_manager_set(obj, efl_new(EFL_UI_LIST_POSITION_MANAGER_CLASS));
+ efl_ui_item_container_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS));
return obj;
}