efl_ui_win_autodel_set(efl_added, 1));
table = efl_add(EFL_UI_TABLE_CLASS, win,
- efl_pack_padding_set(efl_added, 5, 5, 1));
+ efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1));
efl_content_set(win, table);
// Objects below the snapshot
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE),
- efl_pack_padding_set(efl_added, 5, 5, 1),
+ efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1),
efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5),
- efl_pack_align_set(efl_added, 0, 0.5));
+ efl_gfx_arrangement_content_align_set(efl_added, 0, 0.5));
efl_pack(box, box2);
for (size_t k = 0; k < EINA_C_ARRAY_LENGTH(images); k++)
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE),
- efl_pack_align_set(efl_added, 0.5, 0.5));
+ efl_gfx_arrangement_content_align_set(efl_added, 0.5, 0.5));
efl_pack(flip, box2);
// Note: No TEXT object with EO APIs
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_gfx_hint_weight_set(efl_added, 1.0, 0.0),
efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_TRUE),
- efl_pack_align_set(efl_added, 0.5, 0.5));
+ efl_gfx_arrangement_content_align_set(efl_added, 0.5, 0.5));
efl_pack(flip, box2);
const struct { const char *name, *code; } programs [] = {
Eo *win = data, *box;
box = efl_key_wref_get(win, "box");
- efl_pack_padding_set(box, val, val, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(box, val, val, EINA_TRUE);
}
static void
box = efl_key_wref_get(win, "box");
val = elm_slider_value_get(event->object);
- efl_pack_align_get(box, NULL, &av);
- efl_pack_align_set(box, val, av);
+ efl_gfx_arrangement_content_align_get(box, NULL, &av);
+ efl_gfx_arrangement_content_align_set(box, val, av);
}
static void
box = efl_key_wref_get(win, "box");
val = elm_slider_value_get(event->object);
- efl_pack_align_get(box, &ah, NULL);
- efl_pack_align_set(box, ah, val);
+ efl_gfx_arrangement_content_align_get(box, &ah, NULL);
+ efl_gfx_arrangement_content_align_set(box, ah, val);
}
static void
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
- efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
efl_content_set(f, hbox);
- efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
/* weights radio group */
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
efl_key_wref_set(win, "box", bx);
- efl_pack_padding_set(bx, 10, 10, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(bx, 10, 10, EINA_TRUE);
efl_gfx_hint_align_set(bx, 0.5, 0.5);
efl_gfx_hint_weight_set(bx, 1, 1);
efl_content_set(f, bx);
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Padding Size", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Side Page Num", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL,
efl_added, NULL));
in_box1 = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1,
efl_ui_pager_current_page_get(pager)));
in_box2 = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2);
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current Page", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Scroll Block", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Loop", btn, NULL,
efl_added, NULL));
back_btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Indicator", btn, NULL,
efl_added, NULL));
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
- efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
vbox = efl_add(EFL_UI_BOX_CLASS, f,
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
- efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_gfx_hint_margin_set(efl_added, 2, 2, 2, 2),
efl_content_set(f, efl_added));
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
- efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_CANVAS_RECTANGLE_CLASS, hbox,
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
- efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
hbox = efl_add(EFL_UI_BOX_CLASS, vbox,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
- efl_pack_padding_set(efl_added, 2, 2, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE),
efl_pack(vbox, efl_added));
efl_add(EFL_UI_TEXT_CLASS, hbox,
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5),
efl_content_set(win, efl_added));
hbox = efl_add(EFL_UI_BOX_CLASS, f,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
- efl_pack_padding_set(efl_added, 10, 0, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 0, EINA_TRUE),
efl_content_set(f, efl_added));
/* contents */
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Current", btn, NULL, efl_added, NULL));
sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box,
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL));
/* Pack Begin */
efl_pack_end(box, efl_added));
in_box = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_end(box, efl_added));
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Unpack", btn, NULL, efl_added, NULL));
/* Clear */
efl_pack_end(box, efl_added));
in_box = efl_add(EFL_UI_BOX_CLASS, box,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack_end(box, efl_added));
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Tab", btn, NULL, efl_added, NULL));
label_check = efl_add(EFL_UI_CHECK_CLASS, box,
efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi));
box = efl_add(EFL_UI_BOX_CLASS, navi,
- efl_pack_padding_set(efl_added, 10, 10, EINA_TRUE),
+ efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
elm_naviframe_item_push(navi, "Transition", btn, NULL, efl_added, NULL));
btn = efl_add(EFL_UI_BUTTON_CLASS, box,
padding_slider_cb(void *data, const Efl_Event *event)
{
int val = elm_slider_value_get(event->object);
- efl_pack_padding_set(data, val, val, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(data, val, val, EINA_TRUE);
}
static void
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
- efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_weight_set(vbox, 1, 1);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
elm_object_content_set(f, hbox);
- efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE);
/* weights radio group */
vbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
- efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE);
efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5);
elm_win_resize_object_add(win, vbox);
efl_gfx_entity_visible_set(vbox, 1);
hbox = efl_add(EFL_UI_BOX_CLASS, win,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
elm_object_content_set(f, hbox);
- efl_pack_padding_set(hbox, 5, 0, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(hbox, 5, 0, EINA_TRUE);
efl_gfx_entity_visible_set(hbox, 1);
ico = elm_icon_add(win);
// TEST#1 : Create Grid
gd->grid = grid = EoGenerate(EFL_UI_GRID_CLASS, box, (horiz ? EFL_UI_DIR_HORIZONTAL : EFL_UI_DIR_VERTICAL));
efl_ui_grid_item_size_set(grid, EINA_SIZE2D(100, 120)); // 4X4
- efl_pack_padding_set(grid, 5.0, 5.0, EINA_TRUE);
- efl_pack_align_set(grid, 0.5, 0.5);
+ efl_gfx_arrangement_content_padding_set(grid, 5.0, 5.0, EINA_TRUE);
+ efl_gfx_arrangement_content_align_set(grid, 0.5, 0.5);
efl_pack_end(box, grid);
-
+
// TEST#2 : Set Item Default Size
Efl_Ui_Grid_Item *target = NULL;
#include "interfaces/efl_pack_layout.eo.h"
#include "interfaces/efl_pack_linear.eo.h"
#include "interfaces/efl_pack_table.eo.h"
+#include "interfaces/efl_gfx_arrangement.eo.h"
/* Input and Output */
#include "interfaces/efl_io_closer.eo.h"
--- /dev/null
+interface @beta Efl.Gfx.Arrangement
+{
+ [[API common to all UI container objects.]]
+ methods
+ {
+ @property content_align {
+ [[Alignment of the container within its bounds]]
+ set {}
+ get {}
+ values {
+ align_horiz: double; [[Horizontal alignment]]
+ align_vert: double; [[Vertical alignment]]
+ }
+ }
+ @property content_padding {
+ [[Padding between items contained in this object.]]
+ set {}
+ get {}
+ values {
+ pad_horiz: double; [[Horizontal padding]]
+ pad_vert: double; [[Vertical padding]]
+ scalable: bool; [[$true if scalable, $false otherwise]]
+ }
+ }
+ }
+}
#include "interfaces/efl_pack_layout.eo.c"
#include "interfaces/efl_pack_linear.eo.c"
#include "interfaces/efl_pack_table.eo.c"
-
+#include "interfaces/efl_gfx_arrangement.eo.c"
#include "interfaces/efl_model.eo.c"
#include "interfaces/efl_interpolator.eo.c"
#include "interfaces/efl_orientation.eo.c"
}
return: bool; [[$false if $subobj could not be packed.]]
}
- @property pack_align {
- [[Alignment of the container within its bounds]]
- set {}
- get {}
- values {
- align_horiz: double; [[Horizontal alignment]]
- align_vert: double; [[Vertical alignment]]
- }
- }
- @property pack_padding {
- [[Padding between items contained in this object.]]
- set {}
- get {}
- values {
- pad_horiz: double; [[Horizontal padding]]
- pad_vert: double; [[Vertical padding]]
- scalable: bool; [[$true if scalable, $false otherwise]]
- }
- }
}
}
'efl_pack_layout.eo',
'efl_pack_linear.eo',
'efl_pack_table.eo',
+ 'efl_gfx_arrangement.eo',
'efl_ui_i18n.eo',
'efl_ui_direction.eo',
'efl_ui_direction_readonly.eo',
if (spd->pager.obj)
{
efl_ui_direction_set(spd->idbox, EFL_UI_DIR_HORIZONTAL);
- efl_pack_padding_set(spd->idbox, 15, 15, EINA_TRUE);
+ efl_gfx_arrangement_content_padding_set(spd->idbox, 15, 15, EINA_TRUE);
pd->v = eina_value_float_new(0.0);
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v, Eina_Bool scalable)
+_efl_ui_box_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v, Eina_Bool scalable)
{
scalable = !!scalable;
if (h < 0) h = 0;
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_box_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
if (scalable) *scalable = pd->pad.scalable;
if (h) *h = pd->pad.h;
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v)
+_efl_ui_box_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_Box_Data *pd, double h, double v)
{
if (h < 0) h = -1;
else if (h > 1) h = 1;
}
EOLIAN static void
-_efl_ui_box_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
+_efl_ui_box_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, double *h, double *v)
{
if (h) *h = pd->align.h;
if (v) *v = pd->align.v;
class @beta Efl.Ui.Box extends Efl.Ui.Widget implements Efl.Pack_Linear, Efl.Pack_Layout,
- Efl.Ui.Direction
+ Efl.Ui.Direction, Efl.Gfx.Arrangement
{
[[The box widget.
By default, the box will use an internal function to set the layout to
a single row, either vertical or horizontal. This layout is affected
- by a number of parameters. The values given by @Efl.Pack.pack_padding.set
- and @Efl.Pack.pack_align.set and the hints set to each object in the box.
+ by a number of parameters. The values given by @Efl.Gfx.Arrangement.content_padding.set
+ and @Efl.Gfx.Arrangement.content_align.set and the hints set to each object in the box.
FIXME:
THIS CLASS NEEDS GOOD UP TO DATE DOCUMENTATION. LEGACY BOX AND UI BOX
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
- Efl.Pack.pack_padding { get; set; }
- Efl.Pack.pack_align { get; set; }
+ Efl.Gfx.Arrangement.content_padding { get; set; }
+ Efl.Gfx.Arrangement.content_align { get; set; }
Efl.Pack_Linear.pack_begin;
Efl.Pack_Linear.pack_end;
Efl.Pack_Linear.pack_before;
&calc[1].margin[0], &calc[1].margin[1]);
calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj);
- efl_pack_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable);
+ efl_gfx_arrangement_content_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable);
calc[0].pad = pad_scalable ? (calc[0].pad * calc[0].scale) : calc[0].pad;
calc[1].pad = pad_scalable ? (calc[1].pad * calc[1].scale) : calc[1].pad;
// pack align is used if "no item has a weight"
- efl_pack_align_get(obj, &calc[0].align, &calc[1].align);
+ efl_gfx_arrangement_content_align_get(obj, &calc[0].align, &calc[1].align);
if (calc[0].align < 0)
{
calc[0].fill = EINA_TRUE;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
+_efl_ui_grid_efl_gfx_arrangement_content_padding_set(Eo *obj EINA_UNUSED,
Efl_Ui_Grid_Data *pd,
double h,
double v,
}
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
+_efl_ui_grid_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED,
Efl_Ui_Grid_Data *pd,
double *h,
double *v,
}
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double h, double v)
+_efl_ui_grid_efl_gfx_arrangement_content_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double h, double v)
{
pd->item.align.w = h;
pd->item.align.h = v;
}
EOLIAN static void
-_efl_ui_grid_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double *h, double *v)
+_efl_ui_grid_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Grid_Data *pd, double *h, double *v)
{
*h = pd->item.align.w;
*v = pd->item.align.h;
Efl.Ui.Direction,
Efl.Ui.Clickable,
Efl.Ui.Selectable,
- Efl.Ui.Multi_Selectable
+ Efl.Ui.Multi_Selectable,
+ Efl.Gfx.Arrangement
{
[[Simple grid widget with Pack interface.]]
methods {
Efl.Pack_Linear.pack_content_get;
Efl.Pack_Layout.layout_update;
Efl.Pack_Layout.layout_request;
- Efl.Pack.pack_padding { get; set; }
- Efl.Pack.pack_align { get; set; }
+ Efl.Gfx.Arrangement.content_padding { get; set; }
+ Efl.Gfx.Arrangement.content_align { get; set; }
//Efl.Ui.Scrollable
Efl.Ui.Scrollable_Interactive.match_content { set; }
}
EOLIAN static void
-_efl_ui_list_efl_pack_pack_padding_set(Eo *obj EINA_UNUSED,
+_efl_ui_list_efl_gfx_arrangement_content_padding_set(Eo *obj EINA_UNUSED,
Efl_Ui_List_Data *pd,
double h,
double v,
Eina_Bool scalable)
{
- efl_pack_padding_set(pd->box, h, v, scalable);
+ efl_gfx_arrangement_content_padding_set(pd->box, h, v, scalable);
}
EOLIAN static void
-_efl_ui_list_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
+_efl_ui_list_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED,
Efl_Ui_List_Data *pd,
double *h,
double *v,
Eina_Bool *scalable)
{
- efl_pack_padding_get(pd->box, h, v, scalable);
+ efl_gfx_arrangement_content_padding_get(pd->box, h, v, scalable);
}
/* FIXME: align could not work properly on the list
EOLIAN static void
- _efl_ui_list_efl_pack_pack_align_set(Eo *obj, Efl_Ui_List_Data *pd, double h, double v)
+ _efl_ui_list_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_List_Data *pd, double h, double v)
{
- efl_pack_align_set(pd->box, h, v);
+ efl_gfx_arrangement_content_align_set(pd->box, h, v);
}
EOLIAN static void
- _efl_ui_list_efl_pack_pack_align_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, double *h, double *v)
+ _efl_ui_list_efl_gfx_arrangement_content_align_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, double *h, double *v)
{
- efl_pack_align_get(pd->box, &h, &v);
+ efl_gfx_arrangement_content_align_get(pd->box, &h, &v);
}
*/
Efl.Pack_Linear, Efl.Pack_Layout,
Efl.Ui.Clickable,
Efl.Ui.Selectable,
- Efl.Ui.Multi_Selectable
+ Efl.Ui.Multi_Selectable,
+ Efl.Gfx.Arrangement
{
[[Simple list widget with Pack interface.]]
methods {
Efl.Pack_Linear.pack_index_get;
Efl.Pack_Layout.layout_update;
Efl.Pack_Layout.layout_request;
- Efl.Pack.pack_padding { get; set; }
- //Efl.Pack.pack_align { get; set; }
+ Efl.Gfx.Arrangement.content_padding { get; set; }
//Efl.Ui.Scrollable
Efl.Ui.Scrollable_Interactive.match_content { set; }
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v, Eina_Bool scalable)
+_efl_ui_table_efl_gfx_arrangement_content_padding_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v, Eina_Bool scalable)
{
scalable = !!scalable;
if (h < 0) h = 0;
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v, Eina_Bool *scalable)
+_efl_ui_table_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v, Eina_Bool *scalable)
{
if (scalable) *scalable = pd->pad.scalable;
if (h) *h = pd->pad.h;
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v)
+_efl_ui_table_efl_gfx_arrangement_content_align_set(Eo *obj, Efl_Ui_Table_Data *pd, double h, double v)
{
if (h < 0) h = -1;
else if (h > 1) h = 1;
}
EOLIAN static void
-_efl_ui_table_efl_pack_pack_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v)
+_efl_ui_table_efl_gfx_arrangement_content_align_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, double *h, double *v)
{
if (h) *h = pd->align.h;
if (v) *v = pd->align.v;
class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pack_Layout,
- Efl.Ui.Direction
+ Efl.Ui.Direction, Efl.Gfx.Arrangement
{
[[Efl UI table class]]
methods {
Efl.Pack.unpack_all;
Efl.Pack.unpack;
Efl.Pack.pack;
- Efl.Pack.pack_padding { get; set; }
- Efl.Pack.pack_align { get; set; }
+ Efl.Gfx.Arrangement.content_padding { get; set; }
+ Efl.Gfx.Arrangement.content_align { get; set; }
Efl.Pack_Table.pack_table;
Efl.Pack_Table.table_content_get;
Efl.Pack_Table.table_contents_get;
if (vpadstr) v_pad = atoi(vpadstr);
scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
- efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
+ efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
EINA_LIST_FOREACH(sd->items, elist, eo_item)
{
if (vpadstr) v_pad = atoi(vpadstr);
scale = efl_gfx_entity_scale_get(obj) * elm_config_scale_get() / edje_object_base_scale_get(wd->resize_obj);
- efl_pack_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
+ efl_gfx_arrangement_content_padding_set(sd->palette_box, h_pad * scale, v_pad * scale, 0);
/* TIZEN_ONLY(20161117): Fix palette align issue
- efl_pack_align_set(sd->palette_box, 0.0, 0.0);
+ efl_gfx_arrangement_content_align_set(sd->palette_box, 0.0, 0.0);
*/
- efl_pack_align_set(sd->palette_box, 0.5, 0.5);
+ efl_gfx_arrangement_content_align_set(sd->palette_box, 0.5, 0.5);
/* END */
if (!elm_layout_content_set(obj, "elm.palette", sd->palette_box))
elm_layout_content_set(obj, "palette", sd->palette_box);
{
int i, max_index = (sizeof(hints) / sizeof(Hint));
- efl_pack_align_set(layout, 0.8, 0.2);
+ efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
int i, max_index2, max_index3;
Eo *btn, *btn2, *btn3;
- efl_pack_align_set(layout, 0.8, 0.2);
+ efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
Eina_Bool b;
//align test
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.5));
ck_assert(EINA_DBL_EQ(v, 0.5));
- efl_pack_align_set(layout, 0.3, 0.8234);
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_set(layout, 0.3, 0.8234);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
- efl_pack_align_set(layout, -0.23, 123);
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_set(layout, -0.23, 123);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, -1));
ck_assert(EINA_DBL_EQ(v, 1));
//padding test
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.0));
ck_assert(EINA_DBL_EQ(v, 0.0));
ck_assert_int_eq(b, 0);
- efl_pack_padding_set(layout, 0.3, 0.8234, 1);
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_set(layout, 0.3, 0.8234, 1);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
ck_assert_int_eq(b, 1);
- efl_pack_padding_set(layout, -1.23, 123, 45);
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_set(layout, -1.23, 123, 45);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0));
ck_assert(EINA_DBL_EQ(v, 123));
ck_assert_int_eq(b, 1);
win = win_add();
layout = efl_add(EFL_UI_BOX_FLOW_CLASS, win,
- efl_pack_align_set(efl_added, 0.8, 0.2),
+ efl_gfx_arrangement_content_align_set(efl_added, 0.8, 0.2),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
}
win = win_add();
layout = efl_add(EFL_UI_BOX_STACK_CLASS, win,
- efl_pack_align_set(efl_added, 0.8, 0.2),
+ efl_gfx_arrangement_content_align_set(efl_added, 0.8, 0.2),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
}
{
int i, max_index = (sizeof(hints) / sizeof(Hint));
- efl_pack_align_set(layout, 0.8, 0.2);
+ efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, layout,
int i, max_index2, max_index3;
Eo *btn, *btn2, *btn3;
- efl_pack_align_set(layout, 0.8, 0.2);
+ efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
max_index2 = ((sizeof(hints2) / sizeof(Hint)) / 2);
int i, j, max_index = (sizeof(hints_matrix) / sizeof(Hint));
Eo *btn[9];
- efl_pack_align_set(layout, 0.8, 0.2);
+ efl_gfx_arrangement_content_align_set(layout, 0.8, 0.2);
efl_ui_direction_set(layout, EFL_UI_DIR_VERTICAL);
efl_gfx_hint_margin_set(layout, 10, 10, 20, 20);
efl_ui_table_homogeneous_set(layout, 0, 1);
- efl_pack_padding_set(layout, 10, 5, 0);
+ efl_gfx_arrangement_content_padding_set(layout, 10, 5, 0);
for (i = 0; i < 3; i++)
{
Efl_Ui_Dir dirh, dirv;
//align test
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.5));
ck_assert(EINA_DBL_EQ(v, 0.5));
- efl_pack_align_set(layout, 0.3, 0.8234);
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_set(layout, 0.3, 0.8234);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
- efl_pack_align_set(layout, -0.23, 123);
- efl_pack_align_get(layout, &h, &v);
+ efl_gfx_arrangement_content_align_set(layout, -0.23, 123);
+ efl_gfx_arrangement_content_align_get(layout, &h, &v);
ck_assert(EINA_DBL_EQ(h, -1));
ck_assert(EINA_DBL_EQ(v, 1));
//padding test
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.0));
ck_assert(EINA_DBL_EQ(v, 0.0));
ck_assert_int_eq(b, 0);
- efl_pack_padding_set(layout, 0.3, 0.8234, 1);
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_set(layout, 0.3, 0.8234, 1);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0.3));
ck_assert(EINA_DBL_EQ(v, 0.8234));
ck_assert_int_eq(b, 1);
- efl_pack_padding_set(layout, -1.23, 123, 45);
- efl_pack_padding_get(layout, &h, &v, &b);
+ efl_gfx_arrangement_content_padding_set(layout, -1.23, 123, 45);
+ efl_gfx_arrangement_content_padding_get(layout, &h, &v, &b);
ck_assert(EINA_DBL_EQ(h, 0));
ck_assert(EINA_DBL_EQ(v, 123));
ck_assert_int_eq(b, 1);
--- /dev/null
+#ifdef HAVE_CONFIG_H
+# include "elementary_config.h"
+#endif
+
+#include <Efl_Ui.h>
+#include "efl_ui_spec_suite.h"
+#include "suite_helpers.h"
+
+/* spec-meta-start
+ {"test-interface":"Efl.Gfx.Arrangement",
+ "test-widgets": ["Efl.Ui.Box", "Efl.Ui.Table"]}
+ spec-meta-end */
+
+EFL_START_TEST(pack_align)
+{
+#define TUPLE_CHECK(H,V,rh,rv) \
+ do { \
+ double v, h; \
+ efl_gfx_arrangement_content_align_set(widget, H, V); \
+ efl_gfx_arrangement_content_align_get(widget, &h, &v); \
+ ck_assert(v == rv); \
+ ck_assert(h == rh); \
+ } while(0);
+
+ TUPLE_CHECK( 1.0, 1.0, 1.0, 1.0);
+ TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0);
+ TUPLE_CHECK(- 1.0, - 1.0, -1.0, -1.0);
+ TUPLE_CHECK(-42.0, -42.0, -1.0, -1.0);
+ TUPLE_CHECK( 42.0, 42.0, 1.0, 1.0);
+ TUPLE_CHECK(-42.0, 42.0, -1.0, 1.0);
+ TUPLE_CHECK( 42.0, -42.0, 1.0, -1.0);
+#undef TUPLE_CHECK
+}
+EFL_END_TEST
+
+EFL_START_TEST(pack_padding)
+{
+#define TUPLE_CHECK(H, V, rh, rv, S, rs) \
+ do { \
+ double v, h; \
+ Eina_Bool r; \
+ efl_gfx_arrangement_content_padding_set(widget, H, V, S); \
+ efl_gfx_arrangement_content_padding_get(widget, &h, &v, &r); \
+ ck_assert(v == rv); \
+ ck_assert(h == rh); \
+ ck_assert_int_eq(r, S); \
+ } while(0);
+
+ TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0, EINA_TRUE, EINA_TRUE);
+ TUPLE_CHECK( -1.0, -123.0, 0.0, 0.0, EINA_FALSE, EINA_FALSE);
+ TUPLE_CHECK( -1.0, 123.0, 0.0, 123.0, EINA_FALSE, EINA_FALSE);
+#undef TUPLE_CHECK
+}
+EFL_END_TEST
+
+void
+efl_gfx_arrangement_behavior_test(TCase *tc)
+{
+ tcase_add_test(tc, pack_align);
+ tcase_add_test(tc, pack_padding);
+}
}
EFL_END_TEST
-EFL_START_TEST(pack_align)
-{
-#define TUPLE_CHECK(H,V,rh,rv) \
- do { \
- double v, h; \
- efl_pack_align_set(widget, H, V); \
- efl_pack_align_get(widget, &h, &v); \
- ck_assert(v == rv); \
- ck_assert(h == rh); \
- } while(0);
-
- TUPLE_CHECK( 1.0, 1.0, 1.0, 1.0);
- TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0);
- TUPLE_CHECK(- 1.0, - 1.0, -1.0, -1.0);
- TUPLE_CHECK(-42.0, -42.0, -1.0, -1.0);
- TUPLE_CHECK( 42.0, 42.0, 1.0, 1.0);
- TUPLE_CHECK(-42.0, 42.0, -1.0, 1.0);
- TUPLE_CHECK( 42.0, -42.0, 1.0, -1.0);
-#undef TUPLE_CHECK
-}
-EFL_END_TEST
-
-EFL_START_TEST(pack_padding)
-{
-#define TUPLE_CHECK(H, V, rh, rv, S, rs) \
- do { \
- double v, h; \
- Eina_Bool r; \
- efl_pack_padding_set(widget, H, V, S); \
- efl_pack_padding_get(widget, &h, &v, &r); \
- ck_assert(v == rv); \
- ck_assert(h == rh); \
- ck_assert_int_eq(r, S); \
- } while(0);
-
- TUPLE_CHECK( 0.0, 0.0, 0.0, 0.0, EINA_TRUE, EINA_TRUE);
- TUPLE_CHECK( -1.0, -123.0, 0.0, 0.0, EINA_FALSE, EINA_FALSE);
- TUPLE_CHECK( -1.0, 123.0, 0.0, 123.0, EINA_FALSE, EINA_FALSE);
-#undef TUPLE_CHECK
-}
-EFL_END_TEST
-
EFL_START_TEST(evt_content_added)
{
Eina_Bool called = EINA_TRUE;
tcase_add_test(tc, pack1);
tcase_add_test(tc, pack2);
tcase_add_test(tc, pack3);
- tcase_add_test(tc, pack_align);
- tcase_add_test(tc, pack_padding);
tcase_add_test(tc, evt_content_added);
tcase_add_test(tc, evt_content_removed);
tcase_add_test(tc, child_killed);
void efl_pack_behavior_test(TCase *tc);
void efl_pack_linear_behavior_test(TCase *tc);
void efl_content_behavior_test(TCase *tc);
+void efl_gfx_arrangement_behavior_test(TCase *tc);
void efl_test_container_content_equal(Efl_Ui_Widget **wid, unsigned int len);
void efl_test_container_expect_evt_content_added(Efl_Ui_Widget *widget, const Efl_Event_Description *ev, Eina_Bool *flag, void *event_data);
'efl_test_pack.c',
'efl_test_pack_linear.c',
'efl_test_content.c',
+ 'efl_test_gfx_arrangement.c'
])
efl_ui_suite_behavior_src = files([