2016-04-11 22:10:05 -07:00
|
|
|
#ifndef EFL_UI_BOX_PRIVATE_H
|
|
|
|
#define EFL_UI_BOX_PRIVATE_H
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
2016-04-19 01:43:28 -07:00
|
|
|
#define EFL_PACK_LAYOUT_PROTECTED
|
2016-04-11 22:10:05 -07:00
|
|
|
|
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
2016-04-12 02:16:20 -07:00
|
|
|
// FIXME: stop using Evas.Box
|
|
|
|
#include <../evas/canvas/evas_box.eo.h>
|
|
|
|
|
Efl.Ui.Box: Implement way to override layout function
So, since we don't have function pointers, all the solutions
to reimplementing the layout function are quite convoluted:
1. use events
2. reimplement layout func
3. use an extra object
4. use a generic class (non instanciated)
Promises don't apply here (layout will run multiple times).
Problems:
1. Multiple event callbacks will be called, resulting in
potential performance impact, extra events, etc...
Also, there is no way to define standard implementations
that would be provided by the framework.
2. Reimplementation of a function requires extra EO work
(create an EO class, etc...), doesn't allow on-the-fly
change of the layout method.
3. Probably the best solution is to have an object implementing
the layout. But this means creating an extra object along
with the container.
4. To avoid the extra object, use a class, and reimplement
a @class function. This unfortunately requires extra
EO work.
Solution 4. has been selected, but it's not very nice...
2016-04-12 00:20:54 -07:00
|
|
|
// FIXME: stop using evas box
|
|
|
|
void _efl_ui_box_custom_layout(Efl_Ui_Box *box, Evas_Object_Box_Data *priv);
|
2016-04-11 22:10:05 -07:00
|
|
|
|
|
|
|
typedef struct _Efl_Ui_Box_Data Efl_Ui_Box_Data;
|
|
|
|
typedef struct _Box_Item_Iterator Box_Item_Iterator;
|
|
|
|
|
|
|
|
struct _Efl_Ui_Box_Data
|
|
|
|
{
|
2017-08-09 06:36:29 -07:00
|
|
|
Efl_Ui_Dir dir;
|
2016-04-11 22:10:05 -07:00
|
|
|
Eina_Bool homogeneous : 1;
|
|
|
|
Eina_Bool delete_me : 1;
|
|
|
|
Eina_Bool recalc : 1;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
double h, v;
|
|
|
|
Eina_Bool scalable: 1;
|
|
|
|
} pad;
|
2016-04-15 01:06:14 -07:00
|
|
|
|
|
|
|
struct {
|
|
|
|
double h, v;
|
|
|
|
} align;
|
2016-04-11 22:10:05 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _Box_Item_Iterator
|
|
|
|
{
|
|
|
|
Eina_Iterator iterator;
|
2016-04-12 02:16:20 -07:00
|
|
|
Eina_List *list;
|
2016-04-11 22:10:05 -07:00
|
|
|
Eina_Iterator *real_iterator;
|
|
|
|
Efl_Ui_Box *object;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|