forked from enlightenment/efl
efl_ui_grid_item: remove this
this is not needed anymore, the grid items can also just inherit directly from the items. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9395
This commit is contained in:
parent
530d03dcf6
commit
167d2475e8
|
@ -256,7 +256,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
|
||||||
# include <efl_ui_position_manager_list.eo.h>
|
# include <efl_ui_position_manager_list.eo.h>
|
||||||
# include <efl_ui_position_manager_grid.eo.h>
|
# include <efl_ui_position_manager_grid.eo.h>
|
||||||
# include <efl_ui_list_default_item.eo.h>
|
# include <efl_ui_list_default_item.eo.h>
|
||||||
# include <efl_ui_grid_item.eo.h>
|
|
||||||
# include <efl_ui_grid_default_item.eo.h>
|
# include <efl_ui_grid_default_item.eo.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -337,7 +337,6 @@ typedef Eo Efl_Ui_Focus_Manager;
|
||||||
# include <efl_ui_list_default_item.eo.h>
|
# include <efl_ui_list_default_item.eo.h>
|
||||||
# include <efl_ui_list_placeholder_item.eo.h>
|
# include <efl_ui_list_placeholder_item.eo.h>
|
||||||
# include <efl_ui_list.eo.h>
|
# include <efl_ui_list.eo.h>
|
||||||
# include <efl_ui_grid_item.eo.h>
|
|
||||||
# include <efl_ui_grid_default_item.eo.h>
|
# include <efl_ui_grid_default_item.eo.h>
|
||||||
# include <efl_ui_grid.eo.h>
|
# include <efl_ui_grid.eo.h>
|
||||||
# include <efl_ui_list_view_types.eot.h>
|
# include <efl_ui_list_view_types.eot.h>
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
#include <Efl_Ui.h>
|
#include <Efl_Ui.h>
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
#include "efl_ui_item_private.h"
|
#include "efl_ui_item_private.h"
|
||||||
#include "efl_ui_grid_item_private.h"
|
|
||||||
|
|
||||||
#define MY_CLASS EFL_UI_GRID_CLASS
|
#define MY_CLASS EFL_UI_GRID_CLASS
|
||||||
#define MY_CLASS_PFX efl_ui_grid
|
#define MY_CLASS_PFX efl_ui_grid
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
import efl_ui_grid_item;
|
|
||||||
|
|
||||||
class @beta Efl.Ui.Grid extends Efl.Ui.Item_Container
|
class @beta Efl.Ui.Grid extends Efl.Ui.Item_Container
|
||||||
{
|
{
|
||||||
[[Simple grid widget with Pack interface.]]
|
[[Simple grid widget with Pack interface.]]
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Grid_Item implements
|
class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Item implements
|
||||||
Efl.Text,
|
Efl.Text,
|
||||||
Efl.Text_Markup,
|
Efl.Text_Markup,
|
||||||
Efl.Ui.L10n,
|
Efl.Ui.L10n,
|
||||||
|
|
|
@ -1,83 +0,0 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
|
||||||
# include "elementary_config.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define EFL_ACCESS_PROTECTED
|
|
||||||
#define EFL_UI_WIDGET_PART_BG_PROTECTED
|
|
||||||
|
|
||||||
#include <Elementary.h>
|
|
||||||
|
|
||||||
#include "elm_priv.h"
|
|
||||||
#include "efl_ui_grid_item_private.h"
|
|
||||||
|
|
||||||
#define MY_CLASS EFL_UI_GRID_ITEM_CLASS
|
|
||||||
#define MY_CLASS_PFX efl_ui_grid_item
|
|
||||||
|
|
||||||
#define MY_CLASS_NAME "Efl.Ui.Grid_Item"
|
|
||||||
|
|
||||||
static void
|
|
||||||
_sizing_eval(Evas_Object *obj, Efl_Ui_Grid_Item_Data *pd)
|
|
||||||
{
|
|
||||||
Evas_Coord minh = -1, minw = -1;
|
|
||||||
Evas_Coord rest_w = 0, rest_h = 0;
|
|
||||||
ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd);
|
|
||||||
|
|
||||||
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
|
|
||||||
rest_w, rest_h);
|
|
||||||
evas_object_size_hint_min_set(obj, minw, minh);
|
|
||||||
|
|
||||||
pd->needs_size_calc = EINA_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
_efl_ui_grid_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Grid_Item_Data *pd)
|
|
||||||
{
|
|
||||||
if (pd->needs_size_calc) return;
|
|
||||||
pd->needs_size_calc = EINA_TRUE;
|
|
||||||
|
|
||||||
efl_canvas_group_change(obj);
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static void
|
|
||||||
_efl_ui_grid_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Grid_Item_Data *pd)
|
|
||||||
{
|
|
||||||
if (pd->needs_size_calc)
|
|
||||||
{
|
|
||||||
_sizing_eval(obj, pd);
|
|
||||||
pd->needs_size_calc = EINA_FALSE;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static Eo *
|
|
||||||
_efl_ui_grid_item_efl_object_constructor(Eo *obj, Efl_Ui_Grid_Item_Data *pd)
|
|
||||||
{
|
|
||||||
pd->obj = obj;
|
|
||||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
|
||||||
|
|
||||||
return obj;
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static Efl_Object *
|
|
||||||
_efl_ui_grid_item_efl_object_finalize(Eo *obj, Efl_Ui_Grid_Item_Data *pd EINA_UNUSED)
|
|
||||||
{
|
|
||||||
Eo *eo;
|
|
||||||
eo = efl_finalize(efl_super(obj, MY_CLASS));
|
|
||||||
ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo);
|
|
||||||
|
|
||||||
return eo;
|
|
||||||
}
|
|
||||||
|
|
||||||
EOLIAN static void
|
|
||||||
_efl_ui_grid_item_efl_object_destructor(Eo *obj, Efl_Ui_Grid_Item_Data *pd EINA_UNUSED)
|
|
||||||
{
|
|
||||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
|
||||||
|
|
||||||
efl_destructor(efl_super(obj, MY_CLASS));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Internal EO APIs and hidden overrides */
|
|
||||||
|
|
||||||
#define EFL_UI_GRID_ITEM_EXTRA_OPS \
|
|
||||||
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_grid_item)
|
|
||||||
|
|
||||||
#include "efl_ui_grid_item.eo.c"
|
|
|
@ -1,12 +0,0 @@
|
||||||
|
|
||||||
abstract @beta Efl.Ui.Grid_Item extends Efl.Ui.Item
|
|
||||||
{
|
|
||||||
implements {
|
|
||||||
//Efl.Object
|
|
||||||
Efl.Object.constructor;
|
|
||||||
Efl.Object.finalize;
|
|
||||||
Efl.Object.destructor;
|
|
||||||
//Efl.Canvas
|
|
||||||
Efl.Canvas.Group.group_calculate;
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,40 +0,0 @@
|
||||||
#ifndef EFL_UI_GRID_ITEM_PRIVATE_H
|
|
||||||
#define EFL_UI_GRID_ITEM_PRIVATE_H
|
|
||||||
|
|
||||||
#include "Elementary.h"
|
|
||||||
|
|
||||||
typedef struct _Efl_Ui_Grid_Item_Data
|
|
||||||
{
|
|
||||||
// Eo Objects
|
|
||||||
Eo *obj; /* Self-Object */
|
|
||||||
Eina_Rect geo;
|
|
||||||
int index;
|
|
||||||
struct {
|
|
||||||
int row;
|
|
||||||
int col;
|
|
||||||
} pos;
|
|
||||||
|
|
||||||
/* Boolean Values */
|
|
||||||
Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */
|
|
||||||
Eina_Bool update_me: 1;
|
|
||||||
Eina_Bool update_begin: 1;
|
|
||||||
} Efl_Ui_Grid_Item_Data;
|
|
||||||
|
|
||||||
|
|
||||||
#define EFL_UI_GRID_ITEM_DATA_GET(o, pd) \
|
|
||||||
Efl_Ui_Grid_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_GRID_ITEM_CLASS)
|
|
||||||
|
|
||||||
#define EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \
|
|
||||||
EFL_UI_GRID_ITEM_DATA_GET(o, ptr); \
|
|
||||||
if (EINA_UNLIKELY(!ptr)) \
|
|
||||||
{ \
|
|
||||||
ERR("No widget data for object %p (%s)", \
|
|
||||||
o, evas_object_type_get(o)); \
|
|
||||||
return __VA_ARGS__; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define EFL_UI_GRID_ITEM_CHECK_OR_RETURN(obj, ...) \
|
|
||||||
if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_GRID_ITEM_CLASS))) \
|
|
||||||
return __VA_ARGS__;
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -124,7 +124,6 @@ pub_eo_files = [
|
||||||
'efl_ui_list_default_item.eo',
|
'efl_ui_list_default_item.eo',
|
||||||
'efl_ui_list_placeholder_item.eo',
|
'efl_ui_list_placeholder_item.eo',
|
||||||
'efl_ui_list.eo',
|
'efl_ui_list.eo',
|
||||||
'efl_ui_grid_item.eo',
|
|
||||||
'efl_ui_grid_default_item.eo',
|
'efl_ui_grid_default_item.eo',
|
||||||
'efl_ui_grid.eo',
|
'efl_ui_grid.eo',
|
||||||
'efl_ui_panes_part.eo',
|
'efl_ui_panes_part.eo',
|
||||||
|
@ -353,7 +352,6 @@ elementary_headers_unstable = [
|
||||||
'elm_widget_toolbar.h',
|
'elm_widget_toolbar.h',
|
||||||
'efl_ui_video_private.h',
|
'efl_ui_video_private.h',
|
||||||
'efl_ui_item_private.h',
|
'efl_ui_item_private.h',
|
||||||
'efl_ui_grid_item_private.h',
|
|
||||||
'efl_ui_list_view_private.h',
|
'efl_ui_list_view_private.h',
|
||||||
'efl_ui_list_view_seg_array.h',
|
'efl_ui_list_view_seg_array.h',
|
||||||
'elm_widget_web.h',
|
'elm_widget_web.h',
|
||||||
|
@ -896,7 +894,6 @@ elementary_src = [
|
||||||
'efl_ui_list_default_item.c',
|
'efl_ui_list_default_item.c',
|
||||||
'efl_ui_list_placeholder_item.c',
|
'efl_ui_list_placeholder_item.c',
|
||||||
'efl_ui_list.c',
|
'efl_ui_list.c',
|
||||||
'efl_ui_grid_item.c',
|
|
||||||
'efl_ui_grid_default_item.c',
|
'efl_ui_grid_default_item.c',
|
||||||
'efl_ui_grid.c',
|
'efl_ui_grid.c',
|
||||||
'efl_ui_list_view.c',
|
'efl_ui_list_view.c',
|
||||||
|
|
|
@ -26,7 +26,7 @@ static Eina_Bool
|
||||||
grid_item_pack(Eo *grid, int count, Eina_List **l)
|
grid_item_pack(Eo *grid, int count, Eina_List **l)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
||||||
|
@ -51,7 +51,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_pack)
|
EFL_START_TEST(efl_ui_grid_pack)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
||||||
|
@ -65,7 +65,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_unpack)
|
EFL_START_TEST(efl_ui_grid_unpack)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid);
|
||||||
|
@ -82,7 +82,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_unpack_all)
|
EFL_START_TEST(efl_ui_grid_unpack_all)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
int count_before = 10;
|
int count_before = 10;
|
||||||
int count;
|
int count;
|
||||||
Eina_Iterator *itor;
|
Eina_Iterator *itor;
|
||||||
|
@ -119,7 +119,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_pack_end)
|
EFL_START_TEST(efl_ui_grid_pack_end)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item, *compare;
|
Efl_Ui_Grid_Default_Item *item, *compare;
|
||||||
int count_before = 10;
|
int count_before = 10;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_pack_begin)
|
EFL_START_TEST(efl_ui_grid_pack_begin)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item, *compare;
|
Efl_Ui_Grid_Default_Item *item, *compare;
|
||||||
int count_before = 10;
|
int count_before = 10;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_pack_after)
|
EFL_START_TEST(efl_ui_grid_pack_after)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item, *after, *compare;
|
Efl_Ui_Grid_Default_Item *item, *after, *compare;
|
||||||
int count_before = 10;
|
int count_before = 10;
|
||||||
int count;
|
int count;
|
||||||
int index = 5;
|
int index = 5;
|
||||||
|
@ -186,7 +186,7 @@ EFL_END_TEST
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_pack_before)
|
EFL_START_TEST(efl_ui_grid_pack_before)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item, *before, *compare;
|
Efl_Ui_Grid_Default_Item *item, *before, *compare;
|
||||||
int count_before = 10;
|
int count_before = 10;
|
||||||
int count;
|
int count;
|
||||||
int index = 5;
|
int index = 5;
|
||||||
|
@ -224,7 +224,7 @@ EFL_END_TEST
|
||||||
EFL_START_TEST(efl_ui_grid_content_iterate)
|
EFL_START_TEST(efl_ui_grid_content_iterate)
|
||||||
{
|
{
|
||||||
int count = 10;
|
int count = 10;
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
Eina_List *item_list = NULL;
|
Eina_List *item_list = NULL;
|
||||||
Eina_Iterator *item_itr;
|
Eina_Iterator *item_itr;
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(grid_scroll_callbacks,
|
||||||
|
|
||||||
EFL_START_TEST(efl_ui_grid_scroll)
|
EFL_START_TEST(efl_ui_grid_scroll)
|
||||||
{
|
{
|
||||||
Efl_Ui_Grid_Item *item;
|
Efl_Ui_Grid_Default_Item *item;
|
||||||
Efl_Loop_Timer *timer;
|
Efl_Loop_Timer *timer;
|
||||||
|
|
||||||
ck_assert(grid_item_pack(grid, 100, NULL) != EINA_FALSE);
|
ck_assert(grid_item_pack(grid, 100, NULL) != EINA_FALSE);
|
||||||
|
|
Loading…
Reference in New Issue