summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-08-09 22:36:29 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-08-10 14:42:08 +0900
commitb1488b98ded09ff510b56b4fe18a7a30f146167b (patch)
tree088addb73bd605d13bdb3e4a218f5d860b8d1635
parentd4b4ee867be2819eea69ec7b92cd2843ae33c7c7 (diff)
efl.ui.box: Switch to Efl.Ui.Dir (EO)
This makes the default box vertical, just like in legacy. The flow box is horizontal by default. Ref T5870
-rw-r--r--src/bin/elementary/test_bg.c1
-rw-r--r--src/bin/elementary/test_evas_mask.c4
-rw-r--r--src/bin/elementary/test_evas_snapshot.c1
-rw-r--r--src/bin/elementary/test_events.c3
-rw-r--r--src/bin/elementary/test_gfx_filters.c8
-rw-r--r--src/bin/elementary/test_photocam.c2
-rw-r--r--src/bin/elementary/test_ui_box.c27
-rw-r--r--src/bin/elementary/test_ui_grid.c14
-rw-r--r--src/bin/elementary/test_win_inline.c3
-rw-r--r--src/lib/elementary/efl_ui_box.c26
-rw-r--r--src/lib/elementary/efl_ui_box.eo19
-rw-r--r--src/lib/elementary/efl_ui_box_flow.c3
-rw-r--r--src/lib/elementary/efl_ui_box_layout.c3
-rw-r--r--src/lib/elementary/efl_ui_box_private.h8
-rw-r--r--src/lib/elementary/elm_priv.h15
15 files changed, 88 insertions, 49 deletions
diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c
index 4fe764c640..ff043cde29 100644
--- a/src/bin/elementary/test_bg.c
+++ b/src/bin/elementary/test_bg.c
@@ -334,6 +334,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
334 efl_ui_win_alpha_set(efl_added, 1)); 334 efl_ui_win_alpha_set(efl_added, 1));
335 335
336 box = efl_add(EFL_UI_BOX_CLASS, win, 336 box = efl_add(EFL_UI_BOX_CLASS, win,
337 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
337 efl_gfx_size_hint_weight_set(efl_added, 1, 1), 338 efl_gfx_size_hint_weight_set(efl_added, 1, 1),
338 efl_content_set(win, efl_added)); 339 efl_content_set(win, efl_added));
339 340
diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c
index b3a4ffa532..482fe12e94 100644
--- a/src/bin/elementary/test_evas_mask.c
+++ b/src/bin/elementary/test_evas_mask.c
@@ -113,7 +113,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
113 efl_ui_win_autodel_set(efl_added, 1)); 113 efl_ui_win_autodel_set(efl_added, 1));
114 114
115 box = efl_add(EFL_UI_BOX_CLASS, win, 115 box = efl_add(EFL_UI_BOX_CLASS, win,
116 efl_orientation_set(efl_added, EFL_ORIENT_DOWN), 116 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
117 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0)); 117 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
118 efl_content_set(win, box); 118 efl_content_set(win, box);
119 119
@@ -156,7 +156,7 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
156 efl_content_set(efl_part(ly, "content"), gl); 156 efl_content_set(efl_part(ly, "content"), gl);
157 157
158 box2 = efl_add(EFL_UI_BOX_CLASS, win, 158 box2 = efl_add(EFL_UI_BOX_CLASS, win,
159 efl_orientation_set(efl_added, EFL_ORIENT_RIGHT), 159 efl_ui_direction_set(efl_added, EFL_UI_DIR_LTR),
160 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 160 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
161 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), 161 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
162 efl_pack(box, efl_added)); 162 efl_pack(box, efl_added));
diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c
index 245d330067..f47756d672 100644
--- a/src/bin/elementary/test_evas_snapshot.c
+++ b/src/bin/elementary/test_evas_snapshot.c
@@ -183,6 +183,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e
183 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win)); 183 efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _radius_set, win));
184 184
185 box = efl_add(EFL_UI_BOX_CLASS, win, 185 box = efl_add(EFL_UI_BOX_CLASS, win,
186 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
186 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), 187 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
187 efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, GRID_SIZE, 1)); 188 efl_pack_grid(grid, efl_added, 0, GRID_SIZE + 1, GRID_SIZE, 1));
188 189
diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c
index f027d7249a..ae88b01c86 100644
--- a/src/bin/elementary/test_events.c
+++ b/src/bin/elementary/test_events.c
@@ -166,7 +166,8 @@ test_events(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
166 win = elm_win_util_standard_add("buttons", "Buttons"); 166 win = elm_win_util_standard_add("buttons", "Buttons");
167 elm_win_autodel_set(win, EINA_TRUE); 167 elm_win_autodel_set(win, EINA_TRUE);
168 168
169 bx = efl_add(EFL_UI_BOX_CLASS, win, efl_orientation_set(efl_added, EFL_ORIENT_VERTICAL)); 169 bx = efl_add(EFL_UI_BOX_CLASS, win,
170 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL));
170 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 171 evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
171 evas_object_size_hint_align_set(bx, -1, -1); 172 evas_object_size_hint_align_set(bx, -1, -1);
172 efl_content_set(win, bx); 173 efl_content_set(win, bx);
diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c
index e4cbecaa30..bc54e113f7 100644
--- a/src/bin/elementary/test_gfx_filters.c
+++ b/src/bin/elementary/test_gfx_filters.c
@@ -330,14 +330,14 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
330 efl_ui_win_autodel_set(efl_added, 1)); 330 efl_ui_win_autodel_set(efl_added, 1));
331 331
332 box = efl_add(EFL_UI_BOX_CLASS, win, 332 box = efl_add(EFL_UI_BOX_CLASS, win,
333 efl_orientation_set(efl_added, EFL_ORIENT_DOWN), 333 efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
334 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0)); 334 efl_gfx_size_hint_weight_set(efl_added, 1.0, 1.0));
335 335
336 efl_content_set(win, box); 336 efl_content_set(win, box);
337 337
338 { 338 {
339 box2 = efl_add(EFL_UI_BOX_CLASS, win, 339 box2 = efl_add(EFL_UI_BOX_CLASS, win,
340 efl_orientation_set(efl_added, EFL_ORIENT_HORIZONTAL), 340 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
341 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 341 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
342 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.0)); 342 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.0));
343 efl_pack(box, box2); 343 efl_pack(box, box2);
@@ -374,7 +374,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
374 374
375 { 375 {
376 box2 = efl_add(EFL_UI_BOX_CLASS, win, 376 box2 = efl_add(EFL_UI_BOX_CLASS, win,
377 efl_orientation_set(efl_added, EFL_ORIENT_HORIZONTAL), 377 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
378 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 378 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
379 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5), 379 efl_gfx_size_hint_align_set(efl_added, -1.0, 0.5),
380 efl_pack_padding_set(efl_added, 5, 5, 1), 380 efl_pack_padding_set(efl_added, 5, 5, 1),
@@ -445,6 +445,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
445 efl_content_set(efl_part(split, "top"), flip); 445 efl_content_set(efl_part(split, "top"), flip);
446 446
447 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, 447 box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
448 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
448 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 449 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
449 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), 450 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
450 efl_pack_align_set(efl_added, 0.5, 0.5)); 451 efl_pack_align_set(efl_added, 0.5, 0.5));
@@ -460,6 +461,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve
460 efl_pack(box2, o); 461 efl_pack(box2, o);
461 462
462 o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win, 463 o = box2 = efl_add(EFL_UI_BOX_STACK_CLASS, win,
464 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
463 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0), 465 efl_gfx_size_hint_weight_set(efl_added, 1.0, 0.0),
464 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0), 466 efl_gfx_size_hint_align_set(efl_added, -1.0, -1.0),
465 efl_pack_align_set(efl_added, 0.5, 0.5)); 467 efl_pack_align_set(efl_added, 0.5, 0.5));
diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c
index f7c0827549..1fc2bf816b 100644
--- a/src/bin/elementary/test_photocam.c
+++ b/src/bin/elementary/test_photocam.c
@@ -811,7 +811,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE
811 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 811 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
812 812
813 bx = efl_add(EFL_UI_BOX_CLASS, win, 813 bx = efl_add(EFL_UI_BOX_CLASS, win,
814 efl_orientation_set(efl_added, EFL_ORIENT_DOWN), 814 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN),
815 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND), 815 efl_gfx_size_hint_weight_set(efl_added, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND),
816 efl_content_set(win, efl_added)); 816 efl_content_set(win, efl_added));
817 817
diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c
index b005dbce00..517450fd93 100644
--- a/src/bin/elementary/test_ui_box.c
+++ b/src/bin/elementary/test_ui_box.c
@@ -132,7 +132,8 @@ flow_check_cb(void *data, const Efl_Event *event)
132 efl_pack_unpack_all(box); 132 efl_pack_unpack_all(box);
133 efl_del(box); 133 efl_del(box);
134 134
135 box = efl_add(chk ? EFL_UI_BOX_FLOW_CLASS : EFL_UI_BOX_CLASS, win); 135 box = efl_add(chk ? EFL_UI_BOX_FLOW_CLASS : EFL_UI_BOX_CLASS, win,
136 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
136 efl_content_set(parent, box); 137 efl_content_set(parent, box);
137 efl_key_wref_set(win, "box", box); 138 efl_key_wref_set(win, "box", box);
138 139
@@ -145,7 +146,7 @@ horiz_check_cb(void *data, const Efl_Event *event)
145{ 146{
146 Eina_Bool chk = elm_check_selected_get(event->object); 147 Eina_Bool chk = elm_check_selected_get(event->object);
147 Eo *box = efl_key_wref_get(data, "box"); 148 Eo *box = efl_key_wref_get(data, "box");
148 efl_orientation_set(box, chk ? EFL_ORIENT_HORIZONTAL : EFL_ORIENT_VERTICAL); 149 efl_ui_direction_set(box, chk ? EFL_UI_DIR_HORIZONTAL : EFL_UI_DIR_VERTICAL);
149} 150}
150 151
151static void 152static void
@@ -221,9 +222,9 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
221 elm_win_autodel_set(win, EINA_TRUE); 222 elm_win_autodel_set(win, EINA_TRUE);
222 efl_gfx_size_set(win, 600, 400); 223 efl_gfx_size_set(win, 600, 400);
223 224
224 vbox = efl_add(EFL_UI_BOX_CLASS, win); 225 vbox = efl_add(EFL_UI_BOX_CLASS, win,
226 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
225 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE); 227 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
226 efl_orientation_set(vbox, EFL_ORIENT_DOWN);
227 efl_gfx_size_hint_weight_set(vbox, 1, 1); 228 efl_gfx_size_hint_weight_set(vbox, 1, 1);
228 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); 229 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
229 elm_win_resize_object_add(win, vbox); 230 elm_win_resize_object_add(win, vbox);
@@ -237,14 +238,15 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
237 efl_pack(vbox, f); 238 efl_pack(vbox, f);
238 efl_gfx_visible_set(f, 1); 239 efl_gfx_visible_set(f, 1);
239 240
240 hbox = efl_add(EFL_UI_BOX_CLASS, win); 241 hbox = efl_add(EFL_UI_BOX_CLASS, win,
242 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
241 elm_object_content_set(f, hbox); 243 elm_object_content_set(f, hbox);
242 efl_pack_padding_set(hbox, 10, 0, EINA_TRUE); 244 efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
243 245
244 246
245 /* weights radio group */ 247 /* weights radio group */
246 bx = efl_add(EFL_UI_BOX_CLASS, win, 248 bx = efl_add(EFL_UI_BOX_CLASS, win,
247 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 249 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
248 efl_gfx_size_hint_align_set(bx, 0, -1); 250 efl_gfx_size_hint_align_set(bx, 0, -1);
249 efl_pack(hbox, bx); 251 efl_pack(hbox, bx);
250 252
@@ -297,7 +299,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
297 299
298 /* misc */ 300 /* misc */
299 bx = efl_add(EFL_UI_BOX_CLASS, win, 301 bx = efl_add(EFL_UI_BOX_CLASS, win,
300 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 302 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
301 efl_gfx_size_hint_align_set(bx, 0, -1); 303 efl_gfx_size_hint_align_set(bx, 0, -1);
302 efl_gfx_size_hint_weight_set(bx, 0, 1); 304 efl_gfx_size_hint_weight_set(bx, 0, 1);
303 efl_pack(hbox, bx); 305 efl_pack(hbox, bx);
@@ -351,7 +353,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
351 353
352 /* user min size setter */ 354 /* user min size setter */
353 bx = efl_add(EFL_UI_BOX_CLASS, win, 355 bx = efl_add(EFL_UI_BOX_CLASS, win,
354 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 356 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
355 efl_gfx_size_hint_align_set(bx, 0, -1); 357 efl_gfx_size_hint_align_set(bx, 0, -1);
356 efl_gfx_size_hint_weight_set(bx, 0, 1); 358 efl_gfx_size_hint_weight_set(bx, 0, 1);
357 efl_pack(hbox, bx); 359 efl_pack(hbox, bx);
@@ -377,7 +379,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
377 379
378 /* inner box padding */ 380 /* inner box padding */
379 bx = efl_add(EFL_UI_BOX_CLASS, win, 381 bx = efl_add(EFL_UI_BOX_CLASS, win,
380 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 382 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
381 efl_gfx_size_hint_align_set(bx, 0, -1); 383 efl_gfx_size_hint_align_set(bx, 0, -1);
382 efl_gfx_size_hint_weight_set(bx, 0, 1); 384 efl_gfx_size_hint_weight_set(bx, 0, 1);
383 efl_pack(hbox, bx); 385 efl_pack(hbox, bx);
@@ -403,7 +405,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
403 405
404 /* outer margin */ 406 /* outer margin */
405 bx = efl_add(EFL_UI_BOX_CLASS, win, 407 bx = efl_add(EFL_UI_BOX_CLASS, win,
406 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 408 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
407 efl_gfx_size_hint_align_set(bx, 0, -1); 409 efl_gfx_size_hint_align_set(bx, 0, -1);
408 efl_gfx_size_hint_weight_set(bx, 0, 1); 410 efl_gfx_size_hint_weight_set(bx, 0, 1);
409 efl_pack(hbox, bx); 411 efl_pack(hbox, bx);
@@ -429,7 +431,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
429 431
430 /* Box align */ 432 /* Box align */
431 bx = efl_add(EFL_UI_BOX_CLASS, win, 433 bx = efl_add(EFL_UI_BOX_CLASS, win,
432 efl_orientation_set(efl_added, EFL_ORIENT_DOWN)); 434 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
433 efl_gfx_size_hint_align_set(bx, 0, -1); 435 efl_gfx_size_hint_align_set(bx, 0, -1);
434 efl_gfx_size_hint_weight_set(bx, 1, 1); 436 efl_gfx_size_hint_weight_set(bx, 1, 1);
435 efl_pack(hbox, bx); 437 efl_pack(hbox, bx);
@@ -475,7 +477,8 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
475 efl_pack(vbox, f); 477 efl_pack(vbox, f);
476 efl_gfx_visible_set(f, 1); 478 efl_gfx_visible_set(f, 1);
477 479
478 bx = efl_add(EFL_UI_BOX_CLASS, win); 480 bx = efl_add(EFL_UI_BOX_CLASS, win,
481 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
479 efl_key_wref_set(win, "box", bx); 482 efl_key_wref_set(win, "box", bx);
480 efl_pack_padding_set(bx, 10, 10, EINA_TRUE); 483 efl_pack_padding_set(bx, 10, 10, EINA_TRUE);
481 efl_gfx_size_hint_align_set(bx, 0.5, 0.5); 484 efl_gfx_size_hint_align_set(bx, 0.5, 0.5);
diff --git a/src/bin/elementary/test_ui_grid.c b/src/bin/elementary/test_ui_grid.c
index c9d91a60b6..a293566ea1 100644
--- a/src/bin/elementary/test_ui_grid.c
+++ b/src/bin/elementary/test_ui_grid.c
@@ -177,9 +177,9 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
177 elm_win_autodel_set(win, EINA_TRUE); 177 elm_win_autodel_set(win, EINA_TRUE);
178 efl_gfx_size_set(win, 600, 400); 178 efl_gfx_size_set(win, 600, 400);
179 179
180 vbox = efl_add(EFL_UI_BOX_CLASS, win); 180 vbox = efl_add(EFL_UI_BOX_CLASS, win,
181 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
181 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE); 182 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
182 efl_orientation_set(vbox, EFL_ORIENT_DOWN);
183 efl_gfx_size_hint_weight_set(vbox, 1, 1); 183 efl_gfx_size_hint_weight_set(vbox, 1, 1);
184 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); 184 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
185 elm_win_resize_object_add(win, vbox); 185 elm_win_resize_object_add(win, vbox);
@@ -197,7 +197,8 @@ test_ui_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
197 efl_pack(vbox, f); 197 efl_pack(vbox, f);
198 efl_gfx_visible_set(f, 1); 198 efl_gfx_visible_set(f, 1);
199 199
200 hbox = efl_add(EFL_UI_BOX_CLASS, win); 200 hbox = efl_add(EFL_UI_BOX_CLASS, win,
201 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
201 elm_object_content_set(f, hbox); 202 elm_object_content_set(f, hbox);
202 efl_pack_padding_set(hbox, 10, 0, EINA_TRUE); 203 efl_pack_padding_set(hbox, 10, 0, EINA_TRUE);
203 204
@@ -502,9 +503,9 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
502 elm_win_autodel_set(win, EINA_TRUE); 503 elm_win_autodel_set(win, EINA_TRUE);
503 efl_gfx_size_set(win, 600, 400); 504 efl_gfx_size_set(win, 600, 400);
504 505
505 vbox = efl_add(EFL_UI_BOX_CLASS, win); 506 vbox = efl_add(EFL_UI_BOX_CLASS, win,
507 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
506 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE); 508 efl_pack_padding_set(vbox, 10, 10, EINA_TRUE);
507 efl_orientation_set(vbox, EFL_ORIENT_DOWN);
508 efl_gfx_size_hint_weight_set(vbox, 1, 1); 509 efl_gfx_size_hint_weight_set(vbox, 1, 1);
509 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5); 510 efl_gfx_size_hint_margin_set(vbox, 5, 5, 5, 5);
510 elm_win_resize_object_add(win, vbox); 511 elm_win_resize_object_add(win, vbox);
@@ -523,7 +524,8 @@ test_ui_grid_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
523 efl_pack(vbox, f); 524 efl_pack(vbox, f);
524 efl_gfx_visible_set(f, 1); 525 efl_gfx_visible_set(f, 1);
525 526
526 hbox = efl_add(EFL_UI_BOX_CLASS, win); 527 hbox = efl_add(EFL_UI_BOX_CLASS, win,
528 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
527 elm_object_content_set(f, hbox); 529 elm_object_content_set(f, hbox);
528 efl_pack_padding_set(hbox, 5, 0, EINA_TRUE); 530 efl_pack_padding_set(hbox, 5, 0, EINA_TRUE);
529 efl_gfx_visible_set(hbox, 1); 531 efl_gfx_visible_set(hbox, 1);
diff --git a/src/bin/elementary/test_win_inline.c b/src/bin/elementary/test_win_inline.c
index 058c4cbc10..c290c87d56 100644
--- a/src/bin/elementary/test_win_inline.c
+++ b/src/bin/elementary/test_win_inline.c
@@ -225,7 +225,8 @@ test_win_inline(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *even
225 elm_win_resize_object_add(win, bg); 225 elm_win_resize_object_add(win, bg);
226 evas_object_show(bg); 226 evas_object_show(bg);
227 227
228 box = efl_add(EFL_UI_BOX_CLASS, win); 228 box = efl_add(EFL_UI_BOX_CLASS, win,
229 efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL));
229 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 230 evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
230 elm_win_resize_object_add(win, box); 231 elm_win_resize_object_add(win, box);
231 232
diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c
index e18a706c52..07e3a1bd81 100644
--- a/src/lib/elementary/efl_ui_box.c
+++ b/src/lib/elementary/efl_ui_box.c
@@ -232,7 +232,6 @@ _efl_ui_box_efl_object_constructor(Eo *obj, Efl_Ui_Box_Data *pd)
232 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 232 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
233 elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_FILLER); 233 elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_FILLER);
234 234
235 pd->orient = EFL_ORIENT_RIGHT;
236 pd->align.h = 0.5; 235 pd->align.h = 0.5;
237 pd->align.v = 0.5; 236 pd->align.v = 0.5;
238 237
@@ -532,29 +531,34 @@ _efl_ui_box_efl_container_content_iterate(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUS
532} 531}
533 532
534EOLIAN static void 533EOLIAN static void
535_efl_ui_box_efl_orientation_orientation_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Orient dir) 534_efl_ui_box_efl_ui_direction_direction_set(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Ui_Dir dir)
536{ 535{
537 switch (dir) 536 switch (dir)
538 { 537 {
539 case EFL_ORIENT_UP: 538 case EFL_UI_DIR_RTL:
540 case EFL_ORIENT_DOWN: 539 // FIXME: Should be inverted!
541 pd->orient = EFL_ORIENT_DOWN; 540 case EFL_UI_DIR_HORIZONTAL:
541 case EFL_UI_DIR_LTR:
542 pd->dir = EFL_UI_DIR_HORIZONTAL;
542 break; 543 break;
543 544
544 case EFL_ORIENT_RIGHT: 545 case EFL_UI_DIR_UP:
545 case EFL_ORIENT_LEFT: 546 // FIXME: Should be inverted!
547 case EFL_UI_DIR_DOWN:
548 case EFL_UI_DIR_VERTICAL:
549 case EFL_UI_DIR_DEFAULT:
546 default: 550 default:
547 pd->orient = EFL_ORIENT_RIGHT; 551 pd->dir = EFL_UI_DIR_VERTICAL;
548 break; 552 break;
549 } 553 }
550 554
551 efl_pack_layout_request(obj); 555 efl_pack_layout_request(obj);
552} 556}
553 557
554EOLIAN static Efl_Orient 558EOLIAN static Efl_Ui_Dir
555_efl_ui_box_efl_orientation_orientation_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd) 559_efl_ui_box_efl_ui_direction_direction_get(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd)
556{ 560{
557 return pd->orient; 561 return pd->dir;
558} 562}
559 563
560EOLIAN static void 564EOLIAN static void
diff --git a/src/lib/elementary/efl_ui_box.eo b/src/lib/elementary/efl_ui_box.eo
index 71d963af3a..b3440ac86e 100644
--- a/src/lib/elementary/efl_ui_box.eo
+++ b/src/lib/elementary/efl_ui_box.eo
@@ -1,7 +1,20 @@
1class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout, 1class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
2 Efl.Orientation) 2 Efl.Ui.Direction)
3{ 3{
4 [[Efl UI box class]] 4 [[The box widget.
5
6 A box arranges objects in a linear fashion, governed by a layout function
7 that defines the details of this arrangement.
8
9 By default, the box will use an internal function to set the layout to
10 a single row, either vertical or horizontal. This layout is affected
11 by a number of parameters. The values given by @Efl.Pack.pack_padding.set
12 and @Efl.Pack.pack_align.set and the hints set to each object in the box.
13
14 FIXME:
15 THIS CLASS NEEDS GOOD UP TO DATE DOCUMENTATION. LEGACY BOX AND UI BOX
16 BEHAVE SLIGHTLY DIFFERENTLY AND USE VASTLY DIFFERENT APIS.
17 ]]
5 implements { 18 implements {
6 Efl.Object.constructor; 19 Efl.Object.constructor;
7 Efl.Canvas.Group.group_calculate; 20 Efl.Canvas.Group.group_calculate;
@@ -11,7 +24,7 @@ class Efl.Ui.Box (Elm.Widget, Efl.Pack.Linear, Efl.Pack.Layout,
11 Elm.Widget.focus_next; 24 Elm.Widget.focus_next;
12 Efl.Container.content_iterate; 25 Efl.Container.content_iterate;
13 Efl.Container.content_count; 26 Efl.Container.content_count;
14 Efl.Orientation.orientation { get; set; } 27 Efl.Ui.Direction.direction { get; set; }
15 Efl.Pack.pack_clear; 28 Efl.Pack.pack_clear;
16 Efl.Pack.unpack_all; 29 Efl.Pack.unpack_all;
17 Efl.Pack.unpack; 30 Efl.Pack.unpack;
diff --git a/src/lib/elementary/efl_ui_box_flow.c b/src/lib/elementary/efl_ui_box_flow.c
index 5e38119390..4f69a3d290 100644
--- a/src/lib/elementary/efl_ui_box_flow.c
+++ b/src/lib/elementary/efl_ui_box_flow.c
@@ -48,7 +48,8 @@ _efl_ui_box_flow_efl_pack_layout_layout_update(Eo *obj, Efl_Ui_Box_Flow_Data *pd
48 homo = pd->homogenous; 48 homo = pd->homogenous;
49 maxsize = pd->max_size; 49 maxsize = pd->max_size;
50 50
51 if (_horiz(efl_orientation_get(obj))) 51 // This makes it horizontal by default, as opposed to the standard box.
52 if (efl_ui_dir_is_horizontal(efl_ui_direction_get(obj), EINA_TRUE))
52 { 53 {
53 if (homo) 54 if (homo)
54 { 55 {
diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c
index bb41a8d268..aa0e5e5c69 100644
--- a/src/lib/elementary/efl_ui_box_layout.c
+++ b/src/lib/elementary/efl_ui_box_layout.c
@@ -28,7 +28,8 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd)
28 int wantw = 0, wanth = 0; // requested size 28 int wantw = 0, wanth = 0; // requested size
29 int boxx, boxy, boxw, boxh; 29 int boxx, boxy, boxw, boxh;
30 Item_Calc *items, *item; 30 Item_Calc *items, *item;
31 Eina_Bool horiz = _horiz(pd->orient), zeroweight = EINA_FALSE; 31 Eina_Bool horiz = efl_ui_dir_is_horizontal(pd->dir, EINA_FALSE);
32 Eina_Bool zeroweight = EINA_FALSE;
32 int id = 0, count, boxl = 0, boxr = 0, boxt = 0, boxb = 0; 33 int id = 0, count, boxl = 0, boxr = 0, boxt = 0, boxb = 0;
33 int length, want, pad, extra = 0, rounding = 0; 34 int length, want, pad, extra = 0, rounding = 0;
34 double cur_pos = 0, weight[2] = { 0, 0 }, scale; 35 double cur_pos = 0, weight[2] = { 0, 0 }, scale;
diff --git a/src/lib/elementary/efl_ui_box_private.h b/src/lib/elementary/efl_ui_box_private.h
index 57acf1a3e9..2bd12c9fe8 100644
--- a/src/lib/elementary/efl_ui_box_private.h
+++ b/src/lib/elementary/efl_ui_box_private.h
@@ -21,7 +21,7 @@ typedef struct _Box_Item_Iterator Box_Item_Iterator;
21 21
22struct _Efl_Ui_Box_Data 22struct _Efl_Ui_Box_Data
23{ 23{
24 Efl_Orient orient; 24 Efl_Ui_Dir dir;
25 Eina_Bool homogeneous : 1; 25 Eina_Bool homogeneous : 1;
26 Eina_Bool delete_me : 1; 26 Eina_Bool delete_me : 1;
27 Eina_Bool recalc : 1; 27 Eina_Bool recalc : 1;
@@ -44,10 +44,4 @@ struct _Box_Item_Iterator
44 Efl_Ui_Box *object; 44 Efl_Ui_Box *object;
45}; 45};
46 46
47static inline Eina_Bool
48_horiz(Efl_Orient dir)
49{
50 return dir % 180 == EFL_ORIENT_RIGHT;
51}
52
53#endif 47#endif
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 763b2ba8c5..09cb28533f 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -641,6 +641,21 @@ const Elm_Layout_Part_Alias_Description *elm_layout_text_aliases_get(const Eo *o
641#define ELM_LAYOUT_SIZING_EVAL_OPS(_pfx) \ 641#define ELM_LAYOUT_SIZING_EVAL_OPS(_pfx) \
642 EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _##_pfx##_elm_layout_sizing_eval) 642 EFL_OBJECT_OP_FUNC(elm_layout_sizing_eval, _##_pfx##_elm_layout_sizing_eval)
643 643
644static inline Eina_Bool
645efl_ui_dir_is_horizontal(Efl_Ui_Dir dir, Eina_Bool def_val)
646{
647 switch (dir)
648 {
649 case EFL_UI_DIR_DEFAULT: return !!def_val;
650 case EFL_UI_DIR_HORIZONTAL: return EINA_TRUE;
651 case EFL_UI_DIR_VERTICAL: return EINA_FALSE;
652 case EFL_UI_DIR_LTR: return EINA_TRUE;
653 case EFL_UI_DIR_RTL: return EINA_TRUE;
654 case EFL_UI_DIR_DOWN: return EINA_FALSE;
655 case EFL_UI_DIR_UP: return EINA_FALSE;
656 }
657}
658
644#undef EAPI 659#undef EAPI
645#define EAPI 660#define EAPI
646 661