summaryrefslogtreecommitdiff
path: root/src/bin/elementary/test_ui_pager_scroll.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-29 20:06:25 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-20 16:02:02 +0200
commit89102ecbd3bb99c996d7b34fbbb55900686200bc (patch)
tree9dfb0db1da14ca205c2772372ad23a6d922c6023 /src/bin/elementary/test_ui_pager_scroll.c
parent8cc340e8b2016bab13872e19abcde6a0b438b4db (diff)
efl_ui_radio: cleanup API
This is a bit of a giant commit. However, the problem here is that cleaning up the API went hand in hand with rewriting most of the usages. In the process of renewing and removing old API the following was done: - Legacy API testcases have been ported back to smart callbacks - EO-API testcases have been ported to efl_add syntax - weird event #defines have been removed - Wrong constructor usage has been removed - Ported to the new box object introduced before - removed legacy API from efl_ui_radio -> no more ptr(int) q66 will do jumps of happiness -> no more ununderstandable group_add methods -> Seperated code in blocks only for legacy, and blocks only for non-legacy To verify this commit, you can check all the tests that have been touched here. Additionally, the cxx example has been adjusted ref T7867 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9060
Diffstat (limited to 'src/bin/elementary/test_ui_pager_scroll.c')
-rw-r--r--src/bin/elementary/test_ui_pager_scroll.c81
1 files changed, 40 insertions, 41 deletions
diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c
index 9d1857e..6e6c7d1 100644
--- a/src/bin/elementary/test_ui_pager_scroll.c
+++ b/src/bin/elementary/test_ui_pager_scroll.c
@@ -359,7 +359,7 @@ static void next_block_check_cb(void *data, const Efl_Event *ev)
359static void loop_radio_cb(void *data, const Efl_Event *ev) 359static void loop_radio_cb(void *data, const Efl_Event *ev)
360{ 360{
361 Eo *pager = data; 361 Eo *pager = data;
362 int state = efl_ui_radio_group_value_get(ev->object); 362 int state = efl_ui_radio_group_selected_value_get(efl_ui_widget_parent_get(ev->object));
363 363
364 efl_ui_pager_loop_mode_set(pager, state); 364 efl_ui_pager_loop_mode_set(pager, state);
365} 365}
@@ -409,8 +409,8 @@ static void page_size_cb(void *data,
409 inbox = efl_add(EFL_UI_BOX_CLASS, fr, 409 inbox = efl_add(EFL_UI_BOX_CLASS, fr,
410 efl_content_set(fr, efl_added)); 410 efl_content_set(fr, efl_added));
411 411
412 ck = elm_check_add(inbox); 412 ck = efl_add(EFL_UI_CHECK_CLASS, inbox);
413 elm_object_text_set(ck, "Fill"); 413 efl_text_set(ck, "Fill");
414 efl_pack_end(inbox, ck); 414 efl_pack_end(inbox, ck);
415 efl_gfx_entity_visible_set(ck, 1); 415 efl_gfx_entity_visible_set(ck, 1);
416 416
@@ -429,7 +429,7 @@ static void page_size_cb(void *data,
429 size_params->pager = params->pager; 429 size_params->pager = params->pager;
430 size_params->params = params; 430 size_params->params = params;
431 431
432 efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, width_check_cb, 432 efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_SELECTED_CHANGED, width_check_cb,
433 size_params); 433 size_params);
434 efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); 434 efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
435 435
@@ -450,8 +450,8 @@ static void page_size_cb(void *data,
450 inbox = efl_add(EFL_UI_BOX_CLASS, fr, 450 inbox = efl_add(EFL_UI_BOX_CLASS, fr,
451 efl_content_set(fr, efl_added)); 451 efl_content_set(fr, efl_added));
452 452
453 ck = elm_check_add(inbox); 453 ck = efl_add(EFL_UI_CHECK_CLASS, inbox);
454 elm_object_text_set(ck, "Fill"); 454 efl_text_set(ck, "Fill");
455 efl_pack_end(inbox, ck); 455 efl_pack_end(inbox, ck);
456 efl_gfx_entity_visible_set(ck, 1); 456 efl_gfx_entity_visible_set(ck, 1);
457 457
@@ -470,7 +470,7 @@ static void page_size_cb(void *data,
470 size_params->pager = params->pager; 470 size_params->pager = params->pager;
471 size_params->params = params; 471 size_params->params = params;
472 472
473 efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_CHANGED, height_check_cb, 473 efl_event_callback_add(ck, EFL_UI_CHECK_EVENT_SELECTED_CHANGED, height_check_cb,
474 size_params); 474 size_params);
475 efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params); 475 efl_event_callback_add(ck, EFL_EVENT_DEL, check_del_cb, size_params);
476 476
@@ -778,7 +778,7 @@ static void scroll_block_cb(void *data,
778 Params *params = (Params *)data; 778 Params *params = (Params *)data;
779 Evas_Object *navi = params->navi; 779 Evas_Object *navi = params->navi;
780 Eo *pager = params->pager; 780 Eo *pager = params->pager;
781 Eo *btn, *box; 781 Eo *btn, *box, *c;
782 Eina_Bool prev, next; 782 Eina_Bool prev, next;
783 783
784 btn = efl_add(EFL_UI_BUTTON_CLASS, navi, 784 btn = efl_add(EFL_UI_BUTTON_CLASS, navi,
@@ -793,21 +793,21 @@ static void scroll_block_cb(void *data,
793 793
794 efl_ui_pager_scroll_block_get(pager, &prev, &next); 794 efl_ui_pager_scroll_block_get(pager, &prev, &next);
795 795
796 efl_add(EFL_UI_CHECK_CLASS, box, 796 c = efl_add(EFL_UI_CHECK_CLASS, box);
797 efl_ui_widget_style_set(efl_added, "toggle"), 797 efl_ui_widget_style_set(c, "toggle");
798 efl_text_set(efl_added, "Prev Block"), 798 efl_text_set(c, "Prev Block");
799 efl_ui_check_selected_set(efl_added, prev), 799 efl_ui_check_selected_set(c, prev);
800 efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, 800 efl_event_callback_add(c, EFL_UI_CHECK_EVENT_SELECTED_CHANGED,
801 prev_block_check_cb, pager), 801 prev_block_check_cb, pager);
802 efl_pack_end(box, efl_added)); 802 efl_pack_end(box, c);
803 803
804 efl_add(EFL_UI_CHECK_CLASS, box, 804 c = efl_add(EFL_UI_CHECK_CLASS, box);
805 efl_ui_widget_style_set(efl_added, "toggle"), 805 efl_ui_widget_style_set(c, "toggle");
806 efl_text_set(efl_added, "Next Block"), 806 efl_text_set(c, "Next Block");
807 efl_ui_check_selected_set(efl_added, next), 807 efl_ui_check_selected_set(c, next);
808 efl_event_callback_add(efl_added, EFL_UI_CHECK_EVENT_CHANGED, 808 efl_event_callback_add(c, EFL_UI_CHECK_EVENT_SELECTED_CHANGED,
809 next_block_check_cb, pager), 809 next_block_check_cb, pager);
810 efl_pack_end(box, efl_added)); 810 efl_pack_end(box, c);
811} 811}
812 812
813static void loop_cb(void *data EINA_UNUSED, 813static void loop_cb(void *data EINA_UNUSED,
@@ -825,31 +825,30 @@ static void loop_cb(void *data EINA_UNUSED,
825 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, 825 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED,
826 back_btn_cb, navi)); 826 back_btn_cb, navi));
827 827
828 box = efl_add(EFL_UI_BOX_CLASS, navi, 828 box = efl_add(EFL_UI_RADIO_BOX_CLASS, navi,
829 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), 829 efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE),
830 elm_naviframe_item_push(navi, "Loop", btn, NULL, 830 elm_naviframe_item_push(navi, "Loop", btn, NULL,
831 efl_added, NULL)); 831 efl_added, NULL));
832 832
833 rd = efl_add(EFL_UI_RADIO_CLASS, box, 833 rd = efl_add(EFL_UI_RADIO_CLASS, box);
834 efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_DISABLED), 834 efl_ui_radio_state_value_set(rd, EFL_UI_PAGER_LOOP_DISABLED);
835 efl_text_set(efl_added, "Disabled"), 835 efl_text_set(rd, "Disabled");
836 efl_gfx_hint_weight_set(efl_added, 1, 0), 836 efl_gfx_hint_weight_set(rd, 1, 0);
837 efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, 837 efl_event_callback_add(rd, EFL_UI_CHECK_EVENT_SELECTED_CHANGED,
838 loop_radio_cb, pager), 838 loop_radio_cb, pager);
839 efl_pack(box, efl_added)); 839 efl_pack(box, rd);
840 840
841 rd = efl_add(EFL_UI_RADIO_CLASS, box, 841 rd = efl_add(EFL_UI_RADIO_CLASS, box);
842 efl_ui_radio_state_value_set(efl_added, EFL_UI_PAGER_LOOP_ENABLED), 842 efl_ui_radio_state_value_set(rd, EFL_UI_PAGER_LOOP_ENABLED);
843 efl_ui_radio_group_add(efl_added, rd), 843 efl_text_set(rd, "Enabled");
844 efl_text_set(efl_added, "Enabled"), 844 efl_gfx_hint_weight_set(rd, 1, 0);
845 efl_gfx_hint_weight_set(efl_added, 1, 0), 845 efl_event_callback_add(rd, EFL_UI_CHECK_EVENT_SELECTED_CHANGED,
846 efl_event_callback_add(efl_added, EFL_UI_RADIO_EVENT_CHANGED, 846 loop_radio_cb, pager);
847 loop_radio_cb, pager), 847 efl_pack(box, rd);
848 efl_pack(box, efl_added));
849 848
850 loop = efl_ui_pager_loop_mode_get(pager); 849 loop = efl_ui_pager_loop_mode_get(pager);
851 850
852 efl_ui_radio_group_value_set(rd, loop); 851 efl_ui_radio_group_selected_value_set(efl_ui_radio_box_group_get(box), loop);
853 852
854 if (loop == EFL_UI_PAGER_LOOP_DISABLED) 853 if (loop == EFL_UI_PAGER_LOOP_DISABLED)
855 { 854 {