2017-12-12 16:59:48 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
|
|
|
|
#include <assert.h>
|
|
|
|
|
|
|
|
#include "elm_priv.h"
|
2019-01-27 22:39:35 -08:00
|
|
|
#include "efl_ui_list_view_relayout.eo.h"
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
#include "efl_ui_list_view_seg_array.h"
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
#define MY_CLASS EFL_UI_LIST_VIEW_PRECISE_LAYOUTER_CLASS
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
typedef struct _Efl_Ui_List_View_Precise_Layouter_Data
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
Efl_Model* model;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Model *modeler;
|
2017-12-12 16:59:48 -08:00
|
|
|
Ecore_Job *calc_job;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array *seg_array;
|
2018-02-06 16:28:51 -08:00
|
|
|
|
|
|
|
Eina_Size2D min;
|
|
|
|
|
|
|
|
unsigned int calc_progress;
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
int count_total;
|
2018-02-06 16:28:51 -08:00
|
|
|
|
|
|
|
Eina_Bool initialized : 1;
|
|
|
|
Eina_Bool recalc : 1;
|
|
|
|
Eina_Bool resize : 1;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
} Efl_Ui_List_View_Precise_Layouter_Data;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
typedef struct _Efl_Ui_List_View_Precise_Layouter_Node_Data
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
Eina_Size2D min;
|
|
|
|
Eina_Size2D size;
|
2018-02-06 16:28:51 -08:00
|
|
|
|
|
|
|
Eina_Bool realized;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
} Efl_Ui_List_View_Precise_Layouter_Node_Data;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
typedef struct _Efl_Ui_List_View_Precise_Layouter_Callback_Data
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd;
|
|
|
|
Efl_Ui_List_View_Layout_Item *item;
|
|
|
|
} Efl_Ui_List_View_Precise_Layouter_Callback_Data;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
#include "efl_ui_list_view_precise_layouter.eo.h"
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
static void _efl_ui_list_view_relayout_layout_do(Efl_Ui_List_View_Precise_Layouter_Data *);
|
|
|
|
static Eina_Bool _initilize(Eo *, Efl_Ui_List_View_Precise_Layouter_Data*, Efl_Ui_List_View_Model*, Efl_Ui_List_View_Seg_Array*);
|
|
|
|
static void _finalize(Eo *, Efl_Ui_List_View_Precise_Layouter_Data*);
|
|
|
|
static void _node_realize(Efl_Ui_List_View_Precise_Layouter_Data*, Efl_Ui_List_View_Seg_Array_Node*);
|
|
|
|
static void _node_unrealize(Efl_Ui_List_View_Precise_Layouter_Data*, Efl_Ui_List_View_Seg_Array_Node*);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_item_size_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Layout_Item* item)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
int boxx, boxy, boxw, boxh, boxl, boxr, boxt, boxb, pad[4];
|
|
|
|
double align[2];
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
Eina_Bool fill[2];
|
2017-12-12 16:59:48 -08:00
|
|
|
Eina_Size2D max;
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]);
|
2017-12-12 16:59:48 -08:00
|
|
|
evas_object_geometry_get(pd->modeler, &boxx, &boxy, &boxw, &boxh);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb);
|
|
|
|
efl_gfx_hint_align_get(item->layout, &align[0], &align[1]);
|
|
|
|
efl_gfx_hint_fill_get(item->layout, &fill[0], &fill[1]);
|
|
|
|
max = efl_gfx_hint_size_max_get(item->layout);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
// box outer margin
|
|
|
|
boxw -= boxl + boxr;
|
|
|
|
boxh -= boxt + boxb;
|
|
|
|
boxx += boxl;
|
|
|
|
boxy += boxt;
|
|
|
|
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
if (EINA_DBL_EQ(align[0], -1))
|
|
|
|
{
|
|
|
|
align[0] = 0.5;
|
|
|
|
fill[0] = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if (align[0] < 0)
|
|
|
|
{
|
|
|
|
align[0] = 0;
|
|
|
|
}
|
|
|
|
if (EINA_DBL_EQ(align[1], -1))
|
|
|
|
{
|
|
|
|
align[1] = 0.5;
|
|
|
|
fill[1] = EINA_TRUE;
|
|
|
|
}
|
|
|
|
else if (align[1] < 0)
|
|
|
|
{
|
|
|
|
align[1] = 0;
|
|
|
|
}
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
if (align[0] > 1) align[0] = 1;
|
|
|
|
if (align[1] > 1) align[1] = 1;
|
|
|
|
|
|
|
|
if (max.w <= 0) max.w = INT_MAX;
|
|
|
|
if (max.h <= 0) max.h = INT_MAX;
|
|
|
|
if (max.w < item->min.w) max.w = item->min.w;
|
|
|
|
if (max.h < item->min.h) max.h = item->min.h;
|
|
|
|
|
|
|
|
// horizontally
|
|
|
|
if (max.w < INT_MAX)
|
|
|
|
{
|
|
|
|
item->size.w = MIN(MAX(item->min.w - pad[0] - pad[1], max.w), boxw);
|
|
|
|
item->pos.x = boxx + pad[0];
|
|
|
|
}
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
else if (fill[0])
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
// fill x
|
|
|
|
item->size.w = boxw - pad[0] - pad[1];
|
|
|
|
item->pos.x = boxx + pad[0];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->size.w = item->min.w - pad[0] - pad[1];
|
|
|
|
item->pos.x = boxx + ((boxw - item->size.w) * align[0]) + pad[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
// vertically
|
|
|
|
if (max.h < INT_MAX)
|
|
|
|
{
|
|
|
|
item->size.h = MIN(MAX(item->min.h - pad[2] - pad[3], max.h), boxh);
|
|
|
|
item->pos.y = boxy + pad[2];
|
|
|
|
}
|
gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.
@feature
Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'
Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri
Reviewed By: Jaehyun_Cho
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T3912
Differential Revision: https://phab.enlightenment.org/D7409
2019-01-15 23:47:51 -08:00
|
|
|
else if (fill[1])
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
// fill y
|
|
|
|
item->size.h = item->min.h - pad[2] - pad[3];
|
|
|
|
item->pos.y = boxy + pad[2];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
item->size.h = item->min.h - pad[2] - pad[3];
|
|
|
|
item->pos.y = boxy + ((item->min.h - item->size.h) * align[1]) + pad[2];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
static Eina_Size2D
|
|
|
|
_item_min_calc(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Layout_Item* item)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2019-01-10 23:24:14 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array_Node *itemnode = item->tree_node;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Layout_Item *layout_item;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i, pad[4];
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
Eina_Size2D min = efl_gfx_hint_size_combined_min_get(item->layout);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_get(item->layout, &pad[0], &pad[1], &pad[2], &pad[3]);
|
2017-12-12 16:59:48 -08:00
|
|
|
min.w += pad[0] + pad[1];
|
|
|
|
min.h += pad[2] + pad[3];
|
|
|
|
|
2017-12-14 16:23:07 -08:00
|
|
|
if (item->min.h == min.h && item->min.w == min.w)
|
2019-01-10 23:24:14 -08:00
|
|
|
return min;
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(itemnode, min);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN_VAL(itemnode->layout_data, min);
|
|
|
|
nodedata = itemnode->layout_data;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
pd->min.h += min.h - item->min.h;
|
|
|
|
nodedata->min.h += min.h - item->min.h;
|
|
|
|
|
|
|
|
if (nodedata->min.w <= min.w)
|
|
|
|
nodedata->min.w = min.w;
|
|
|
|
else if (nodedata->min.w == item->min.w)
|
|
|
|
{
|
|
|
|
nodedata->min.w = 0;
|
|
|
|
for (i = 0; i != itemnode->length; ++i)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)itemnode->pointers[i];
|
2017-12-12 16:59:48 -08:00
|
|
|
if (nodedata->min.w < layout_item->min.w)
|
|
|
|
nodedata->min.w = layout_item->min.w;
|
|
|
|
|
|
|
|
if (item->min.w == layout_item->min.w)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pd->min.w <= min.w)
|
|
|
|
pd->min.w = min.w;
|
|
|
|
else if (pd->min.w == item->min.w)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node2;
|
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2017-12-12 16:59:48 -08:00
|
|
|
pd->min.w = min.w;
|
|
|
|
|
2018-01-17 21:13:05 -08:00
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, node2)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata2 = node2->layout_data;
|
2018-01-17 21:13:05 -08:00
|
|
|
if (pd->min.w < nodedata2->min.w)
|
|
|
|
pd->min.w = nodedata2->min.w;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-01-17 21:13:05 -08:00
|
|
|
if (item->min.w == nodedata2->min.w)
|
2017-12-12 16:59:48 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
}
|
|
|
|
|
|
|
|
item->min.w = min.w;
|
|
|
|
item->min.h = min.h;
|
2019-01-10 23:24:14 -08:00
|
|
|
return item->min;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_item_size_hint_change(void *data, Evas *e EINA_UNUSED,
|
2019-01-10 23:24:14 -08:00
|
|
|
Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Callback_Data *cb_data = data;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd = cb_data->pd;
|
|
|
|
Efl_Ui_List_View_Layout_Item *item = cb_data->item;;
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node = item->tree_node;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = node->layout_data;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
_item_min_calc(pd, item);
|
2017-12-12 16:59:48 -08:00
|
|
|
if (!nodedata->realized)
|
|
|
|
{
|
|
|
|
free(evas_object_event_callback_del(item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change));
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_model_unrealize(pd->modeler, item);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_on_modeler_resize(void *data, Evas *e EINA_UNUSED,
|
|
|
|
Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd = data;
|
2017-12-12 16:59:48 -08:00
|
|
|
pd->resize = EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
2018-02-06 16:28:51 -08:00
|
|
|
typedef struct _Request Request;
|
|
|
|
struct _Request
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd;
|
2018-02-06 16:28:51 -08:00
|
|
|
unsigned int index;
|
|
|
|
};
|
|
|
|
|
|
|
|
static Eina_Value
|
|
|
|
_children_get(void *data, const Eina_Value v, const Eina_Future *dead_future EINA_UNUSED)
|
|
|
|
{
|
|
|
|
Request *r = data;
|
|
|
|
|
|
|
|
if (eina_value_type_get(&v) == EINA_VALUE_TYPE_ERROR)
|
|
|
|
goto on_error;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_seg_array_insert_value(r->pd->seg_array, r->index, v);
|
2018-02-06 16:28:51 -08:00
|
|
|
r->pd->recalc = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(r->pd->modeler);
|
|
|
|
|
|
|
|
on_error:
|
|
|
|
free(r);
|
|
|
|
return v;
|
|
|
|
}
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
static void
|
|
|
|
_child_added_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Efl_Model_Children_Event* evt = event->info;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd = data;
|
2018-02-06 16:28:51 -08:00
|
|
|
Eina_Future *f;
|
|
|
|
Request *r;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-02-06 16:28:51 -08:00
|
|
|
r = calloc(1, sizeof (Request));
|
2018-06-07 14:44:37 -07:00
|
|
|
if (!r) return;
|
2018-02-06 16:28:51 -08:00
|
|
|
|
|
|
|
r->index = evt->index;
|
|
|
|
r->pd = pd;
|
|
|
|
|
|
|
|
f = efl_model_children_slice_get(pd->model, evt->index, 1);
|
2018-11-07 06:52:41 -08:00
|
|
|
f = eina_future_then(f, _children_get, r, NULL);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_child_removed_cb(void *data, const Efl_Event *event)
|
|
|
|
{
|
|
|
|
Efl_Model_Children_Event* evt = event->info;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd = data;
|
|
|
|
Efl_Ui_List_View_Layout_Item *layout_item, *litem;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata;
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *itemnode;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
litem = efl_ui_list_view_seg_array_remove(pd->seg_array, evt->index);
|
2018-01-31 10:55:42 -08:00
|
|
|
if (!litem) return;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
itemnode = litem->tree_node;
|
|
|
|
nodedata = itemnode->layout_data;
|
|
|
|
|
|
|
|
free(evas_object_event_callback_del(litem->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change));
|
|
|
|
|
|
|
|
pd->min.h -= litem->min.h;
|
|
|
|
nodedata->min.h -= litem->min.h;
|
|
|
|
|
|
|
|
if (nodedata->min.w == litem->min.w)
|
|
|
|
nodedata->min.w = 0;
|
2017-12-13 06:36:21 -08:00
|
|
|
|
|
|
|
for (i = 0; i != itemnode->length; ++i)
|
2019-01-10 23:24:14 -08:00
|
|
|
{
|
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)itemnode->pointers[i];
|
|
|
|
if (nodedata->min.w < layout_item->min.w)
|
|
|
|
nodedata->min.w = layout_item->min.w;
|
|
|
|
|
|
|
|
if (litem->min.w == layout_item->min.w)
|
|
|
|
{
|
|
|
|
nodedata->min.w = layout_item->min.w;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
if (pd->min.w == litem->min.w)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node2;
|
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2017-12-12 16:59:48 -08:00
|
|
|
pd->min.w = 0;
|
|
|
|
|
2018-01-17 21:13:05 -08:00
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, node2)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata2 = node2->layout_data;
|
2018-01-17 21:13:05 -08:00
|
|
|
if (pd->min.w < nodedata2->min.w)
|
|
|
|
pd->min.w = nodedata2->min.w;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-01-17 21:13:05 -08:00
|
|
|
if (litem->min.w == nodedata2->min.w)
|
2017-12-12 16:59:48 -08:00
|
|
|
break;
|
|
|
|
}
|
2019-01-10 23:24:14 -08:00
|
|
|
eina_accessor_free(nodes);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_model_unrealize(pd->modeler, litem);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-01-31 10:55:42 -08:00
|
|
|
free(litem);
|
2017-12-12 16:59:48 -08:00
|
|
|
pd->recalc = EINA_TRUE;
|
|
|
|
evas_object_smart_changed(pd->modeler);
|
|
|
|
}
|
|
|
|
|
2018-06-07 14:44:37 -07:00
|
|
|
static void
|
|
|
|
_child_count_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd = data;
|
2018-06-07 14:44:37 -07:00
|
|
|
pd->count_total = efl_model_children_count_get(pd->model);
|
|
|
|
if (pd->count_total)
|
|
|
|
efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _child_count_changed_cb, pd);
|
|
|
|
}
|
|
|
|
|
2018-01-22 11:52:51 -08:00
|
|
|
static Eina_Bool
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_initilize(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Model *modeler, Efl_Ui_List_View_Seg_Array *seg_array)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
if(pd->initialized)
|
2018-01-22 11:52:51 -08:00
|
|
|
return EINA_TRUE;
|
|
|
|
|
2018-11-29 09:11:51 -08:00
|
|
|
efl_replace(&pd->modeler, modeler);
|
|
|
|
|
|
|
|
if(!pd->model || !pd->modeler)
|
2018-01-22 11:52:51 -08:00
|
|
|
return EINA_FALSE;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
pd->recalc = EINA_TRUE;
|
|
|
|
pd->initialized = EINA_TRUE;
|
|
|
|
|
2019-01-24 05:29:28 -08:00
|
|
|
pd->seg_array = seg_array;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_model_load_range_set(pd->modeler, 0, pd->count_total); // load all
|
2017-12-12 16:59:48 -08:00
|
|
|
efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILD_ADDED, _child_added_cb, pd);
|
|
|
|
efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILD_REMOVED, _child_removed_cb, pd);
|
|
|
|
|
2018-06-07 14:44:37 -07:00
|
|
|
evas_object_event_callback_add(modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
|
2017-12-12 16:59:48 -08:00
|
|
|
pd->min.w = 0;
|
|
|
|
pd->min.h = 0;
|
2018-01-22 11:52:51 -08:00
|
|
|
|
|
|
|
return EINA_TRUE;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_finalize(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array_Node* node;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i = 0;
|
|
|
|
|
2018-11-29 09:11:51 -08:00
|
|
|
if (pd->model)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2018-11-29 09:11:51 -08:00
|
|
|
efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILD_ADDED, _child_added_cb, pd);
|
|
|
|
efl_event_callback_del(pd->model, EFL_MODEL_EVENT_CHILD_REMOVED, _child_removed_cb, pd);
|
|
|
|
pd->count_total = 0;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
2018-11-29 09:11:51 -08:00
|
|
|
if (pd->seg_array)
|
|
|
|
{
|
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, node)
|
|
|
|
{
|
|
|
|
_node_unrealize(pd, node);
|
|
|
|
free(node->layout_data);
|
|
|
|
}
|
|
|
|
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
}
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
pd->min.w = 0;
|
|
|
|
pd->min.h = 0;
|
|
|
|
|
2018-11-29 09:11:51 -08:00
|
|
|
if (pd->modeler)
|
|
|
|
{
|
|
|
|
evas_object_event_callback_del_full(pd->modeler, EVAS_CALLBACK_RESIZE, _on_modeler_resize, pd);
|
|
|
|
efl_ui_list_view_model_min_size_set(pd->modeler, pd->min);
|
|
|
|
}
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2019-01-24 05:29:28 -08:00
|
|
|
pd->seg_array = NULL;
|
2018-11-29 09:11:51 -08:00
|
|
|
efl_replace(&pd->modeler, NULL);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
pd->initialized = EINA_FALSE;
|
2018-06-07 14:44:37 -07:00
|
|
|
pd->recalc = EINA_TRUE;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_node_realize(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Seg_Array_Node *node)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Layout_Item* layout_item;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = node->layout_data;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i;
|
|
|
|
|
2018-01-22 11:52:51 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(nodedata);
|
2017-12-12 16:59:48 -08:00
|
|
|
if (nodedata->realized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
nodedata->realized = EINA_TRUE;
|
|
|
|
|
|
|
|
for (i = 0; i != node->length; ++i)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)node->pointers[i];
|
|
|
|
efl_ui_list_view_model_realize(pd->modeler, layout_item);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_node_unrealize(Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Seg_Array_Node *node)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Layout_Item* layout_item;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Callback_Data *cb_data;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = node->layout_data;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i;
|
|
|
|
|
2018-01-22 11:52:51 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(nodedata);
|
2017-12-12 16:59:48 -08:00
|
|
|
if (!nodedata->realized)
|
|
|
|
return;
|
|
|
|
|
|
|
|
nodedata->realized = EINA_FALSE;
|
|
|
|
|
|
|
|
for (i = 0; i != node->length; ++i)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)node->pointers[i];
|
2017-12-12 16:59:48 -08:00
|
|
|
if (layout_item->layout)
|
|
|
|
{
|
|
|
|
cb_data = evas_object_event_callback_del(layout_item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change);
|
|
|
|
free(cb_data);
|
2019-01-10 23:24:14 -08:00
|
|
|
efl_ui_list_view_model_unrealize(pd->modeler, layout_item);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_calc_range(Efl_Ui_List_View_Precise_Layouter_Data *pd)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node;
|
2018-01-19 09:27:26 -08:00
|
|
|
Evas_Coord ch, ny;
|
2017-12-19 19:30:29 -08:00
|
|
|
Eina_Rect vgmt;
|
|
|
|
Eina_Position2D spos;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i;
|
|
|
|
|
2017-12-19 19:30:29 -08:00
|
|
|
vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
|
|
|
|
spos = efl_ui_scrollable_content_pos_get(pd->modeler);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-01-19 09:27:26 -08:00
|
|
|
ny = spos.y - (vgmt.h / 2);
|
|
|
|
if (ny < 0) spos.y = 0;
|
|
|
|
else spos.y = ny;
|
|
|
|
vgmt.h *= 2;
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
ch = 0;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2017-12-12 16:59:48 -08:00
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, node)
|
|
|
|
{
|
|
|
|
nodedata = node->layout_data;
|
|
|
|
if (!nodedata || !nodedata->min.h)
|
|
|
|
continue;
|
|
|
|
|
2017-12-19 19:30:29 -08:00
|
|
|
if ((ch > spos.y || nodedata->min.h + ch > spos.y) && (ch < (spos.y + vgmt.h) || nodedata->min.h + ch < spos.y + vgmt.h))
|
2017-12-12 16:59:48 -08:00
|
|
|
_node_realize(pd, node);
|
|
|
|
else
|
|
|
|
_node_unrealize(pd, node);
|
|
|
|
|
|
|
|
ch += nodedata->min.h;
|
|
|
|
}
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_calc_size_job(void *data)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Data *pd;
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node;
|
|
|
|
Efl_Ui_List_View_Layout_Item *layout_item;
|
2019-01-10 23:24:14 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata;
|
2017-12-12 16:59:48 -08:00
|
|
|
Eo *obj = data;
|
|
|
|
int i;
|
|
|
|
double start_time = ecore_time_get();
|
|
|
|
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(data);
|
|
|
|
pd = efl_data_scope_get(obj, MY_CLASS);
|
|
|
|
if (EINA_UNLIKELY(!pd)) return;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2017-12-12 16:59:48 -08:00
|
|
|
while (eina_accessor_data_get(nodes, pd->calc_progress, (void **)&node))
|
|
|
|
{
|
|
|
|
pd->calc_progress++;
|
|
|
|
if (!node->layout_data)
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
node->layout_data = calloc(1, sizeof(Efl_Ui_List_View_Precise_Layouter_Node_Data));
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
nodedata = node->layout_data;
|
|
|
|
if (pd->calc_progress == 1)
|
|
|
|
nodedata->realized = EINA_TRUE;
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
for (i = 0; i != node->length; ++i)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)node->pointers[i];
|
2017-12-12 16:59:48 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(layout_item);
|
|
|
|
|
|
|
|
// cache size of new items
|
2019-01-10 23:24:14 -08:00
|
|
|
if ((layout_item->min.w == 0) && (layout_item->min.h == 0) && (!layout_item->layout))
|
|
|
|
efl_ui_list_view_model_realize(pd->modeler, layout_item);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
2019-01-10 23:24:14 -08:00
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
if ( (ecore_time_get() - start_time ) > 0.01 )
|
|
|
|
{
|
|
|
|
ecore_job_del(pd->calc_job);
|
|
|
|
pd->calc_job = ecore_job_add(_calc_size_job, obj);
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
return;
|
2019-01-10 23:24:14 -08:00
|
|
|
}
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
pd->calc_progress = 0;
|
|
|
|
pd->calc_job = NULL;
|
2018-06-07 14:44:37 -07:00
|
|
|
pd->recalc = EINA_FALSE;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static Efl_Object *
|
2019-01-10 23:24:14 -08:00
|
|
|
_efl_ui_list_view_precise_layouter_efl_object_constructor(Eo *obj, Efl_Ui_List_View_Precise_Layouter_Data *pd)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
|
|
|
pd->initialized = EINA_FALSE;
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
}
|
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
EOLIAN static void
|
|
|
|
_efl_ui_list_view_precise_layouter_efl_ui_list_view_relayout_content_created(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Ui_List_View_Layout_Item *item)
|
|
|
|
{
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Callback_Data *cb_data;
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(item);
|
|
|
|
EINA_SAFETY_ON_NULL_RETURN(item->layout);
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *node = item->tree_node;
|
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = node->layout_data;
|
|
|
|
|
|
|
|
Eina_Size2D min = _item_min_calc(pd, item);
|
|
|
|
|
|
|
|
if (min.w && min.h && !nodedata->realized)
|
|
|
|
{
|
|
|
|
efl_ui_list_view_model_unrealize(pd->modeler, item);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
cb_data = calloc(1, sizeof(Efl_Ui_List_View_Precise_Layouter_Callback_Data));
|
2019-01-29 16:38:11 -08:00
|
|
|
if (!cb_data) return;
|
2019-01-10 23:24:14 -08:00
|
|
|
cb_data->pd = pd;
|
|
|
|
cb_data->item = item;
|
|
|
|
evas_object_event_callback_add(item->layout, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_item_size_hint_change, cb_data);
|
|
|
|
|
|
|
|
_item_size_calc(pd, item);
|
|
|
|
}
|
|
|
|
|
2018-01-19 09:27:26 -08:00
|
|
|
EOLIAN static Eina_List *
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_efl_ui_list_view_precise_layouter_efl_ui_list_view_relayout_elements_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd)
|
2018-01-19 09:27:26 -08:00
|
|
|
{
|
|
|
|
Eina_List *elements_order = NULL;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Layout_Item* layout_item;
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *items_node;
|
2018-01-19 09:27:26 -08:00
|
|
|
int i, j = 0;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2018-01-19 09:27:26 -08:00
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, items_node)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
|
2018-01-19 09:27:26 -08:00
|
|
|
if (!nodedata || !nodedata->realized)
|
|
|
|
continue;
|
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
for (j = 0; j != items_node->length;++j)
|
2018-01-19 09:27:26 -08:00
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)items_node->pointers[j];
|
2018-01-19 09:27:26 -08:00
|
|
|
if (layout_item->layout)
|
|
|
|
elements_order = eina_list_append(elements_order, layout_item->layout);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-11-29 09:11:51 -08:00
|
|
|
eina_accessor_free(nodes);
|
|
|
|
return elements_order;
|
2018-01-19 09:27:26 -08:00
|
|
|
}
|
|
|
|
|
2017-12-12 16:59:48 -08:00
|
|
|
EOLIAN static void
|
2019-01-10 23:24:14 -08:00
|
|
|
_efl_ui_list_view_precise_layouter_efl_ui_list_view_relayout_model_set(Eo *obj, Efl_Ui_List_View_Precise_Layouter_Data *pd, Efl_Model *model)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2018-02-06 16:28:51 -08:00
|
|
|
_finalize(obj, pd);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-02-06 16:28:51 -08:00
|
|
|
efl_replace(&pd->model, model);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2018-06-07 14:44:37 -07:00
|
|
|
if (pd->model)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2018-02-06 16:28:51 -08:00
|
|
|
pd->count_total = efl_model_children_count_get(pd->model);
|
2018-06-07 14:44:37 -07:00
|
|
|
if (pd->count_total && pd->modeler)
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_model_load_range_set(pd->modeler, 0, pd->count_total); // load all
|
2018-06-07 14:44:37 -07:00
|
|
|
else
|
|
|
|
efl_event_callback_add(pd->model, EFL_MODEL_EVENT_CHILDREN_COUNT_CHANGED, _child_count_changed_cb, pd);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_efl_ui_list_view_relayout_layout_do(Efl_Ui_List_View_Precise_Layouter_Data *pd)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2017-12-19 19:30:29 -08:00
|
|
|
Eina_Rect vgmt;
|
|
|
|
Eina_Position2D spos;
|
2017-12-12 16:59:48 -08:00
|
|
|
double cur_pos = 0;
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Layout_Item* layout_item;
|
|
|
|
Efl_Ui_List_View_Seg_Array_Node *items_node;
|
2017-12-12 16:59:48 -08:00
|
|
|
int i, j = 0;
|
2019-01-10 23:24:14 -08:00
|
|
|
int boxx, boxy, boxw, boxh, extra = 0, rounding = 0;
|
|
|
|
int boxl = 0, boxr = 0, boxt = 0, boxb = 0;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
_calc_range(pd);
|
|
|
|
|
|
|
|
evas_object_geometry_get(pd->modeler, &boxx, &boxy, &boxw, &boxh);
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_margin_get(pd->modeler, &boxl, &boxr, &boxt, &boxb);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
|
|
|
// box outer margin
|
|
|
|
boxw -= boxl + boxr;
|
|
|
|
boxh -= boxt + boxb;
|
|
|
|
boxx += boxl;
|
|
|
|
boxy += boxt;
|
|
|
|
|
|
|
|
// available space. if <0 we overflow
|
|
|
|
extra = boxh - pd->min.h;
|
|
|
|
if (extra < 0) extra = 0;
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
efl_ui_list_view_model_min_size_set(pd->modeler, pd->min);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2017-12-19 19:30:29 -08:00
|
|
|
vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
|
|
|
|
spos = efl_ui_scrollable_content_pos_get(pd->modeler);
|
2017-12-12 16:59:48 -08:00
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Eina_Accessor *nodes = efl_ui_list_view_seg_array_node_accessor_get(pd->seg_array);
|
2017-12-12 16:59:48 -08:00
|
|
|
EINA_ACCESSOR_FOREACH(nodes, i, items_node)
|
|
|
|
{
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
Efl_Ui_List_View_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
|
2019-01-10 23:24:14 -08:00
|
|
|
if (!items_node->layout_data)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!nodedata->realized)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2019-01-10 23:24:14 -08:00
|
|
|
cur_pos += nodedata->min.h;
|
|
|
|
continue;
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
for (j = 0; j != items_node->length;++j)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2019-01-10 23:24:14 -08:00
|
|
|
layout_item = (Efl_Ui_List_View_Layout_Item *)items_node->pointers[j];
|
|
|
|
double x, y, w, h;
|
|
|
|
double weight_x, weight_y;
|
|
|
|
if (!(layout_item->min.w && layout_item->min.h))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
// extra rounding up (compensate cumulative error)
|
|
|
|
if ((i == (pd->count_total - 1)) && (cur_pos - floor(cur_pos) >= 0.5))
|
|
|
|
rounding = 1;
|
|
|
|
|
|
|
|
if (layout_item->layout)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2019-01-10 23:24:14 -08:00
|
|
|
if (pd->resize)
|
|
|
|
_item_size_calc(pd, layout_item);
|
|
|
|
|
2019-02-21 09:19:45 -08:00
|
|
|
efl_gfx_hint_weight_get(layout_item->layout, &weight_x, &weight_y);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
2019-01-10 23:24:14 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
cur_pos += layout_item->size.h;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
x = layout_item->pos.x;
|
|
|
|
y = layout_item->pos.y + cur_pos;
|
|
|
|
w = layout_item->size.w;
|
|
|
|
h = layout_item->size.h + rounding + weight_y * extra;
|
|
|
|
cur_pos += h;
|
|
|
|
|
|
|
|
if (w < pd->min.w) w = pd->min.w;
|
|
|
|
if (w > vgmt.w) w = vgmt.w;
|
|
|
|
|
|
|
|
evas_object_geometry_set(layout_item->layout, (x + 0 - spos.x), (y + 0 - spos.y), w, h);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
eina_accessor_free(nodes);
|
|
|
|
|
|
|
|
pd->resize = EINA_FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
EOLIAN static void
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_efl_ui_list_view_precise_layouter_efl_ui_list_view_relayout_layout_do
|
|
|
|
(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Precise_Layouter_Data *pd
|
2019-01-10 23:24:14 -08:00
|
|
|
, Efl_Ui_List_View_Model *modeler, int first EINA_UNUSED, Efl_Ui_List_View_Seg_Array *seg_array)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
2018-11-29 09:11:51 -08:00
|
|
|
if (!_initilize(obj, pd, modeler, seg_array) || !pd->seg_array)
|
2018-01-22 11:52:51 -08:00
|
|
|
return;
|
2017-12-12 16:59:48 -08:00
|
|
|
|
2019-01-10 23:24:14 -08:00
|
|
|
if (!pd->calc_job && pd->recalc && efl_ui_list_view_seg_array_count(seg_array) > 0)
|
2017-12-12 16:59:48 -08:00
|
|
|
{
|
|
|
|
// cache size of new items
|
|
|
|
pd->calc_progress = 0;
|
|
|
|
pd->calc_job = ecore_job_add(_calc_size_job, obj);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
_efl_ui_list_view_relayout_layout_do(pd);
|
2017-12-12 16:59:48 -08:00
|
|
|
}
|
|
|
|
|
efl_ui : change efl_ui_view_list to efl_ui_list_view.
Summary:
View is not a namespace, but an interface,
So, View_List cannot be under the view namespace for now.
it looks more suite to be end as View than List on this widget name.
Firstly, it follows our common naming rules of class.
Also, List_View is commonly presentable name on most UI frameworks,
so it is very easy to understand what this widget can do for the user.
Test Plan:
Make works.
Example is not works for now til stable model interface.
Reviewers: felipealmeida, woohyun, cedric, Hermet
Reviewed By: Hermet
Subscribers: larryolj, cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7234
2018-11-04 21:27:05 -08:00
|
|
|
#include "efl_ui_list_view_precise_layouter.eo.c"
|