From 7c6243915c700dd1f598691b2250eb4f25e720dd Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Wed, 2 Oct 2019 12:04:12 +0200 Subject: [PATCH] efl_gfx_arrangement: change content_padding param type and remove scalable Summary: This change `content_padding` parameter type to int from double for consistency of size properties. `scalable` should be handled in more common size API. Co-authored-by: Mike Blumenkrantz ref T7864 Test Plan: ninja test Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7864 Differential Revision: https://phab.enlightenment.org/D10154 --- src/bin/elementary/test_evas_snapshot.c | 2 +- src/bin/elementary/test_gfx_filters.c | 2 +- src/bin/elementary/test_ui_box.c | 10 ++++---- src/bin/elementary/test_ui_pager.c | 10 ++++---- src/bin/elementary/test_ui_pager_scroll.c | 18 +++++++------- src/bin/elementary/test_ui_relative_layout.c | 14 +++++------ src/bin/elementary/test_ui_spotlight.c | 10 ++++---- src/bin/elementary/test_ui_tab_pager.c | 14 +++++------ src/bin/elementary/test_ui_table.c | 10 ++++---- src/examples/elementary/table_cxx_example_01.cc | 2 +- src/examples/elementary/table_cxx_example_02.cc | 2 +- src/lib/efl/interfaces/efl_gfx_arrangement.eo | 5 ++-- src/lib/elementary/efl_page_indicator_icon.c | 2 +- src/lib/elementary/efl_ui_box.c | 10 +++----- src/lib/elementary/efl_ui_box_private.h | 3 +-- src/lib/elementary/efl_ui_container_layout.c | 6 +---- src/lib/elementary/efl_ui_container_layout.h | 3 +-- .../elementary/efl_ui_spotlight_indicator_icon.c | 2 +- src/lib/elementary/efl_ui_table.c | 10 +++----- src/lib/elementary/efl_ui_table_private.h | 3 +-- src/lib/elementary/efl_ui_tags.c | 16 ++++++------- src/tests/elementary/efl_ui_test_box.c | 26 +++++++------------- src/tests/elementary/efl_ui_test_table.c | 28 ++++++++-------------- .../elementary/spec/efl_test_gfx_arrangement.c | 15 +++++------- 24 files changed, 94 insertions(+), 129 deletions(-) diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c index f1395f2..40513bb 100644 --- a/src/bin/elementary/test_evas_snapshot.c +++ b/src/bin/elementary/test_evas_snapshot.c @@ -129,7 +129,7 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_ui_win_autodel_set(efl_added, 1)); table = efl_add(EFL_UI_TABLE_CLASS, win, - efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1)); + efl_gfx_arrangement_content_padding_set(efl_added, 5, 5)); efl_content_set(win, table); // Objects below the snapshot diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index 4cd5214..35360b6 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -387,7 +387,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_gfx_arrangement_content_padding_set(efl_added, 5, 5, 1), + efl_gfx_arrangement_content_padding_set(efl_added, 5, 5), efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5), efl_gfx_arrangement_content_align_set(efl_added, 0, 0.5)); efl_pack(box, box2); diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c index 8b2e8ef..57dc98b 100644 --- a/src/bin/elementary/test_ui_box.c +++ b/src/bin/elementary/test_ui_box.c @@ -72,11 +72,11 @@ user_min_slider_cb(void *data EINA_UNUSED, const Efl_Event *event) static void padding_slider_cb(void *data, const Efl_Event *event) { - int val = elm_slider_value_get(event->object); + unsigned int val = lround(elm_slider_value_get(event->object)); Eo *win = data, *box; box = efl_key_wref_get(win, "box"); - efl_gfx_arrangement_content_padding_set(box, val, val, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(box, val, val); } static void @@ -240,7 +240,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in vbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL)); - efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(vbox, 10, 10); efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5); elm_win_resize_object_add(win, vbox); @@ -256,7 +256,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in hbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); efl_content_set(f, hbox); - efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(hbox, 10, 0); /* weights radio group */ @@ -533,7 +533,7 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in bx = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); efl_key_wref_set(win, "box", bx); - efl_gfx_arrangement_content_padding_set(bx, 10, 10, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(bx, 10, 10); efl_gfx_hint_align_set(bx, 0.5, 0.5); efl_gfx_hint_weight_set(bx, 1, 1); efl_content_set(f, bx); diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c index e0df202..34792f3 100644 --- a/src/bin/elementary/test_ui_pager.c +++ b/src/bin/elementary/test_ui_pager.c @@ -443,12 +443,12 @@ static void pack_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL)); in_box1 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1, @@ -458,7 +458,7 @@ static void pack_cb(void *data, efl_ui_pager_current_page_get(pager))); in_box2 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2); @@ -628,7 +628,7 @@ static void current_page_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Current Page", btn, NULL, efl_added, NULL)); @@ -674,7 +674,7 @@ static void indicator_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Indicator", btn, NULL, efl_added, NULL)); diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c index b6548a4..c60ac48 100644 --- a/src/bin/elementary/test_ui_pager_scroll.c +++ b/src/bin/elementary/test_ui_pager_scroll.c @@ -495,7 +495,7 @@ static void padding_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Padding Size", btn, NULL, efl_added, NULL)); @@ -522,7 +522,7 @@ static void side_page_num_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Side Page Num", btn, NULL, efl_added, NULL)); @@ -555,12 +555,12 @@ static void pack_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL)); in_box1 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1, @@ -570,7 +570,7 @@ static void pack_cb(void *data, efl_ui_pager_current_page_get(pager))); in_box2 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2); @@ -739,7 +739,7 @@ static void current_page_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Current Page", btn, NULL, efl_added, NULL)); @@ -787,7 +787,7 @@ static void scroll_block_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Scroll Block", btn, NULL, efl_added, NULL)); @@ -826,7 +826,7 @@ static void loop_cb(void *data EINA_UNUSED, back_btn_cb, navi)); box = efl_add(EFL_UI_RADIO_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Loop", btn, NULL, efl_added, NULL)); @@ -874,7 +874,7 @@ static void indicator_cb(void *data EINA_UNUSED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Indicator", btn, NULL, efl_added, NULL)); diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index ba79d77..7601fd9 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -150,7 +150,7 @@ _setter_add(Eo *vbox, Eo *btn, Options option) hbox = efl_add(EFL_UI_BOX_CLASS, vbox, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), - efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 2, 2), efl_pack(vbox, efl_added)); efl_add(EFL_UI_TEXT_CLASS, hbox, @@ -192,13 +192,13 @@ _button_frame_add(Eo *box, Eo *btn) vbox = efl_add(EFL_UI_BOX_CLASS, f, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), - efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 2, 2), 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_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), - efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 2, 2), efl_pack(vbox, efl_added)); efl_add(EFL_CANVAS_RECTANGLE_CLASS, hbox, @@ -231,7 +231,7 @@ _button_frame_add(Eo *box, Eo *btn) hbox = efl_add(EFL_UI_BOX_CLASS, vbox, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), - efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 2, 2), efl_pack(vbox, efl_added)); efl_add(EFL_UI_TEXT_CLASS, hbox, @@ -251,7 +251,7 @@ _button_frame_add(Eo *box, Eo *btn) hbox = efl_add(EFL_UI_BOX_CLASS, vbox, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), - efl_gfx_arrangement_content_padding_set(efl_added, 2, 2, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 2, 2), efl_pack(vbox, efl_added)); efl_add(EFL_UI_TEXT_CLASS, hbox, @@ -281,7 +281,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo vbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_gfx_hint_margin_set(efl_added, 5, 5, 5, 5), efl_content_set(win, efl_added)); @@ -293,7 +293,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo hbox = efl_add(EFL_UI_BOX_CLASS, f, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), - efl_gfx_arrangement_content_padding_set(efl_added, 10, 0, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 0), efl_content_set(f, efl_added)); /* contents */ diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c index 384da6e..a41ab69 100644 --- a/src/bin/elementary/test_ui_spotlight.c +++ b/src/bin/elementary/test_ui_spotlight.c @@ -594,12 +594,12 @@ pack_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL)); in_box1 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp1 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box1); @@ -611,7 +611,7 @@ pack_cb(void *data, efl_ui_range_value_set(sp1, num); in_box2 = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); sp2 = efl_add(EFL_UI_SPIN_BUTTON_CLASS, in_box2); @@ -781,7 +781,7 @@ active_index_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Active Index", btn, NULL, efl_added, NULL)); @@ -828,7 +828,7 @@ indicator_cb(void *data, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Indicator", btn, NULL, efl_added, NULL)); diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index ed73dae..0e5a989 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -201,7 +201,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Current", btn, NULL, efl_added, NULL)); sp = efl_add(EFL_UI_SPIN_BUTTON_CLASS, box, @@ -302,7 +302,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Pack", btn, NULL, efl_added, NULL)); /* Pack Begin */ @@ -330,7 +330,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_pack_end(box, efl_added)); in_box = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), efl_pack_end(box, efl_added)); @@ -407,7 +407,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Unpack", btn, NULL, efl_added, NULL)); /* Clear */ @@ -431,7 +431,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_pack_end(box, efl_added)); in_box = efl_add(EFL_UI_BOX_CLASS, box, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL), efl_pack_end(box, efl_added)); @@ -501,7 +501,7 @@ _tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Tab", btn, NULL, efl_added, NULL)); label_check = efl_add(EFL_UI_CHECK_CLASS, box); @@ -561,7 +561,7 @@ _transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, - efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), + efl_gfx_arrangement_content_padding_set(efl_added, 10, 10), elm_naviframe_item_push(navi, "Transition", btn, NULL, efl_added, NULL)); btn = efl_add(EFL_UI_BUTTON_CLASS, box, diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index 67f7067..bc448bf 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -79,7 +79,7 @@ static void padding_slider_cb(void *data, const Efl_Event *event) { int val = elm_slider_value_get(event->object); - efl_gfx_arrangement_content_padding_set(data, val, val, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(data, val, val); } static void @@ -201,7 +201,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ vbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL)); - efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(vbox, 10, 10); 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); @@ -222,7 +222,7 @@ test_ui_table(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ hbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); elm_object_content_set(f, hbox); - efl_gfx_arrangement_content_padding_set(hbox, 10, 0, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(hbox, 10, 0); /* weights radio group */ @@ -570,7 +570,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL)); - efl_gfx_arrangement_content_padding_set(vbox, 10, 10, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(vbox, 10, 10); efl_gfx_hint_margin_set(vbox, 5, 5, 5, 5); elm_win_resize_object_add(win, vbox); efl_gfx_entity_visible_set(vbox, 1); @@ -591,7 +591,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, hbox = efl_add(EFL_UI_BOX_CLASS, win, efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL)); elm_object_content_set(f, hbox); - efl_gfx_arrangement_content_padding_set(hbox, 5, 0, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(hbox, 5, 0); efl_gfx_entity_visible_set(hbox, 1); ico = elm_icon_add(win); diff --git a/src/examples/elementary/table_cxx_example_01.cc b/src/examples/elementary/table_cxx_example_01.cc index 11e97b5..f96bf82 100644 --- a/src/examples/elementary/table_cxx_example_01.cc +++ b/src/examples/elementary/table_cxx_example_01.cc @@ -15,7 +15,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Table table(instantiate, win); win.content_set(table); - table.content_padding_set(5, 5, true); + table.content_padding_set(5, 5); // FIXME // table.homogeneous_set(true); diff --git a/src/examples/elementary/table_cxx_example_02.cc b/src/examples/elementary/table_cxx_example_02.cc index f0ca35e..0fe8cf0 100644 --- a/src/examples/elementary/table_cxx_example_02.cc +++ b/src/examples/elementary/table_cxx_example_02.cc @@ -16,7 +16,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Table table(instantiate, win); win.content_set(table); - table.content_padding_set(5, 5, true); + table.content_padding_set(5, 5); efl::canvas::Rectangle rect(instantiate, win); rect.color_set(255, 0, 0, 255); diff --git a/src/lib/efl/interfaces/efl_gfx_arrangement.eo b/src/lib/efl/interfaces/efl_gfx_arrangement.eo index 00f3fe4..9a3cc4a 100644 --- a/src/lib/efl/interfaces/efl_gfx_arrangement.eo +++ b/src/lib/efl/interfaces/efl_gfx_arrangement.eo @@ -40,9 +40,8 @@ interface @beta Efl.Gfx.Arrangement set {} get {} values { - pad_horiz: double(0.0); [[Horizontal padding.]] - pad_vert: double(0.0); [[Vertical padding.]] - scalable: bool(false); [[$true if scalable.]] + pad_horiz: uint(0u); [[Horizontal padding.]] + pad_vert: uint(0u); [[Vertical padding.]] } } } diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c index 258b494..4a13db3 100644 --- a/src/lib/elementary/efl_page_indicator_icon.c +++ b/src/lib/elementary/efl_page_indicator_icon.c @@ -148,7 +148,7 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj, if (spd->pager.obj) { efl_ui_layout_orientation_set(spd->idbox, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); - efl_gfx_arrangement_content_padding_set(spd->idbox, 15, 15, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(spd->idbox, 15, 15); pd->v = eina_value_float_new(0.0); diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index 9687006..935b821 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -405,27 +405,23 @@ _efl_ui_box_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, } EOLIAN static void -_efl_ui_box_efl_gfx_arrangement_content_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, unsigned int h, unsigned int v) { - scalable = !!scalable; if (h < 0) h = 0; if (v < 0) v = 0; - if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v) && - (pd->pad.scalable == scalable)) + if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v)) return; pd->pad.h = h; pd->pad.v = v; - pd->pad.scalable = scalable; efl_pack_layout_request(obj); } EOLIAN static void -_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) +_efl_ui_box_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, unsigned int *h, unsigned int *v) { - if (scalable) *scalable = pd->pad.scalable; if (h) *h = pd->pad.h; if (v) *v = pd->pad.v; } diff --git a/src/lib/elementary/efl_ui_box_private.h b/src/lib/elementary/efl_ui_box_private.h index 4cb94c5..bc9fca1 100644 --- a/src/lib/elementary/efl_ui_box_private.h +++ b/src/lib/elementary/efl_ui_box_private.h @@ -19,8 +19,7 @@ struct _Efl_Ui_Box_Data Eina_List *children; struct { - double h, v; - Eina_Bool scalable: 1; + unsigned int h, v; } pad; struct { diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c index 34a8bbb..60bdaa8 100644 --- a/src/lib/elementary/efl_ui_container_layout.c +++ b/src/lib/elementary/efl_ui_container_layout.c @@ -111,16 +111,12 @@ void _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc) { Eina_Rect geom; - Eina_Bool pad_scalable; geom = efl_gfx_entity_geometry_get(obj); efl_gfx_hint_margin_get(obj, &calc[0].margin[0], &calc[0].margin[1], &calc[1].margin[0], &calc[1].margin[1]); - calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj); - 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; + efl_gfx_arrangement_content_padding_get(obj, &calc[0].pad, &calc[1].pad); // pack align is used if "no item has a weight" efl_gfx_arrangement_content_align_get(obj, &calc[0].align, &calc[1].align); diff --git a/src/lib/elementary/efl_ui_container_layout.h b/src/lib/elementary/efl_ui_container_layout.h index 097abee..031dd30 100644 --- a/src/lib/elementary/efl_ui_container_layout.h +++ b/src/lib/elementary/efl_ui_container_layout.h @@ -30,8 +30,7 @@ struct _Efl_Ui_Container_Layout_Calc int size; int margin[2]; double align; - double scale; - double pad; + unsigned int pad; Eina_Bool fill : 1; }; diff --git a/src/lib/elementary/efl_ui_spotlight_indicator_icon.c b/src/lib/elementary/efl_ui_spotlight_indicator_icon.c index 2165ec9..c7bc2a3 100644 --- a/src/lib/elementary/efl_ui_spotlight_indicator_icon.c +++ b/src/lib/elementary/efl_ui_spotlight_indicator_icon.c @@ -81,7 +81,7 @@ _efl_ui_spotlight_indicator_icon_efl_ui_spotlight_indicator_bind(Eo *obj, Efl_Ui efl_content_set(efl_part(pd->container, "efl.indicator"), pd->indicator); efl_gfx_entity_visible_set(pd->indicator, EINA_TRUE); efl_ui_layout_orientation_set(pd->indicator, EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); - efl_gfx_arrangement_content_padding_set(pd->indicator, 15, 15, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(pd->indicator, 15, 15); for (int i = 0; i < efl_content_count(pd->container); ++i) { diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 2c2f935..b56d445 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -267,27 +267,23 @@ _efl_ui_table_efl_object_invalidate(Eo *obj, Efl_Ui_Table_Data *pd) } EOLIAN static void -_efl_ui_table_efl_gfx_arrangement_content_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, unsigned int h, unsigned int v) { - scalable = !!scalable; if (h < 0) h = 0; if (v < 0) v = 0; - if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v) && - (pd->pad.scalable == scalable)) + if (EINA_DBL_EQ(pd->pad.h, h) && EINA_DBL_EQ(pd->pad.v, v)) return; pd->pad.h = h; pd->pad.v = v; - pd->pad.scalable = scalable; efl_pack_layout_request(obj); } EOLIAN static void -_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) +_efl_ui_table_efl_gfx_arrangement_content_padding_get(const Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, unsigned int *h, unsigned int *v) { - if (scalable) *scalable = pd->pad.scalable; if (h) *h = pd->pad.h; if (v) *v = pd->pad.v; } diff --git a/src/lib/elementary/efl_ui_table_private.h b/src/lib/elementary/efl_ui_table_private.h index 47d1cc4..5b24e04 100644 --- a/src/lib/elementary/efl_ui_table_private.h +++ b/src/lib/elementary/efl_ui_table_private.h @@ -38,8 +38,7 @@ struct _Efl_Ui_Table_Data int last_col, last_row; // only used by pack api Efl_Ui_Layout_Orientation fill_dir; // direction in which cells are added when using pack() struct { - double h, v; - Eina_Bool scalable: 1; + unsigned int h, v; } pad; struct { double h, v; diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index b06e4a5..2a8fb84 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -50,10 +50,10 @@ _shrink_mode_set(Eo *obj, if (shrink == EINA_TRUE) { Evas_Coord w = 0; - double box_inner_item_width_padding = 0; + unsigned int box_inner_item_width_padding = 0; Eina_Value val; - efl_gfx_arrangement_content_padding_get(sd->box, &box_inner_item_width_padding, NULL, NULL); + efl_gfx_arrangement_content_padding_get(sd->box, &box_inner_item_width_padding, NULL); // unpack all items and entry efl_pack_unpack_all(sd->box); EINA_LIST_FOREACH(sd->layouts, l, layout) @@ -69,7 +69,7 @@ _shrink_mode_set(Eo *obj, Eina_Size2D label_min = efl_gfx_hint_size_combined_min_get(sd->label); w -= label_min.w; - w -= box_inner_item_width_padding; + w -= (Evas_Coord)box_inner_item_width_padding; } layout = NULL; @@ -487,14 +487,14 @@ _box_resize_cb(void *data, Eina_Rect r; Eina_List *l; Eo *layout; - double hpad; + unsigned int hpad; Efl_Ui_Tags_Data *sd = efl_data_scope_get(data, EFL_UI_TAGS_CLASS); r = efl_gfx_entity_geometry_get(sd->box); if ((r.w <= elm_config_finger_size_get()) || (r.h <= elm_config_finger_size_get())) return; - efl_gfx_arrangement_content_padding_get(obj, &hpad, NULL, NULL); + efl_gfx_arrangement_content_padding_get(obj, &hpad, NULL); if (sd->h_box < r.h) efl_event_callback_call @@ -511,9 +511,9 @@ _box_resize_cb(void *data, min = efl_gfx_hint_size_combined_min_get(layout); - if (min.w > r.w - hpad) + if (min.w > r.w - (int)hpad) { - min.w = r.w - hpad; + min.w = r.w - (int)hpad; efl_gfx_hint_size_min_set(layout, EINA_SIZE2D(min.w, min.h)); efl_gfx_entity_size_set(layout, EINA_SIZE2D(min.w, min.h)); } @@ -746,7 +746,7 @@ _view_init(Evas_Object *obj, Efl_Ui_Tags_Data *sd) if (str) hpad = atoi(str); str = elm_layout_data_get(obj, "vertical_pad"); if (str) vpad = atoi(str); - efl_gfx_arrangement_content_padding_set(sd->box, hpad, vpad, EINA_TRUE); + efl_gfx_arrangement_content_padding_set(sd->box, hpad, vpad); efl_content_set(efl_part(obj, "efl.box"), sd->box); diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c index 63760b6..64133cd 100644 --- a/src/tests/elementary/efl_ui_test_box.c +++ b/src/tests/elementary/efl_ui_test_box.c @@ -504,7 +504,7 @@ EFL_END_TEST EFL_START_TEST (efl_ui_box_properties) { double h, v; - Eina_Bool b; + unsigned int ph, pv; //align test efl_gfx_arrangement_content_align_get(layout, &h, &v); @@ -522,22 +522,14 @@ EFL_START_TEST (efl_ui_box_properties) ck_assert(EINA_DBL_EQ(v, 1)); //padding test - 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_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_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); + efl_gfx_arrangement_content_padding_get(layout, &ph, &pv); + ck_assert_int_eq(ph, 0.0); + ck_assert_int_eq(pv, 0.0); + + efl_gfx_arrangement_content_padding_set(layout, 3, 8234); + efl_gfx_arrangement_content_padding_get(layout, &ph, &pv); + ck_assert_int_eq(ph, 3); + ck_assert_int_eq(pv, 8234); //direction test ck_assert_int_eq(efl_ui_layout_orientation_get(layout), EFL_UI_LAYOUT_ORIENTATION_VERTICAL); diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c index bafe072..0f7c236 100644 --- a/src/tests/elementary/efl_ui_test_table.c +++ b/src/tests/elementary/efl_ui_test_table.c @@ -332,7 +332,7 @@ EFL_START_TEST (efl_ui_table_layout_update_matrix) efl_gfx_hint_margin_set(layout, 10, 10, 20, 20); efl_ui_table_homogeneous_set(layout, 0, 1); - efl_gfx_arrangement_content_padding_set(layout, 10, 5, 0); + efl_gfx_arrangement_content_padding_set(layout, 10, 5); for (i = 0; i < 3; i++) { @@ -477,7 +477,7 @@ EFL_END_TEST EFL_START_TEST (efl_ui_table_properties) { double h, v; - Eina_Bool b; + unsigned int ph, pv; Eina_Bool homogeneoush, homogeneousv; //align test @@ -496,22 +496,14 @@ EFL_START_TEST (efl_ui_table_properties) ck_assert(EINA_DBL_EQ(v, 1)); //padding test - 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_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_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); + efl_gfx_arrangement_content_padding_get(layout, &ph, &pv); + ck_assert_int_eq(ph, 0); + ck_assert_int_eq(pv, 0); + + efl_gfx_arrangement_content_padding_set(layout, 3, 8234); + efl_gfx_arrangement_content_padding_get(layout, &ph, &pv); + ck_assert_int_eq(ph, 3); + ck_assert_int_eq(pv, 8234); //direction test ck_assert_int_eq(efl_ui_layout_orientation_get(layout), EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); diff --git a/src/tests/elementary/spec/efl_test_gfx_arrangement.c b/src/tests/elementary/spec/efl_test_gfx_arrangement.c index ba213a5..7c0367b 100644 --- a/src/tests/elementary/spec/efl_test_gfx_arrangement.c +++ b/src/tests/elementary/spec/efl_test_gfx_arrangement.c @@ -35,20 +35,17 @@ EFL_END_TEST EFL_START_TEST(pack_padding) { -#define TUPLE_CHECK(H, V, rh, rv, S, rs) \ +#define TUPLE_CHECK(H, V, rh, rv) \ 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); \ + unsigned int v, h; \ + efl_gfx_arrangement_content_padding_set(widget, H, V); \ + efl_gfx_arrangement_content_padding_get(widget, &h, &v); \ 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); + TUPLE_CHECK( 0, 0, 0, 0); + TUPLE_CHECK( 1, 123, 1, 123); #undef TUPLE_CHECK } EFL_END_TEST -- 2.7.4