summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2018-11-28 14:32:39 +0900
committer김호상/Tizen Platform Lab(SR)/Engineer/삼성전자 <CORP\hosang12.kim@hosang.tn.corp.samsungelectronics.net>2018-11-28 14:34:28 +0900
commitc4ae2be68588c58459d7eb9b0435ab2f02550575 (patch)
tree323bd043580357605f330d537adbef7c765f3977 /src/lib/elementary
parentbf70b32f049583fc0bf7542af7d89d4ef5d50c55 (diff)
efl_ui_scrollable: implement efl_ui_scrollable_content_pos_get method.
Summary: Applications want to know current position on scroller. Also, it is necessary when calculate position of focusable object. Reviewers: herdsman, akanad, YOhoho, bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7251
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c1
-rw-r--r--src/lib/elementary/efl_ui_list.c90
-rw-r--r--src/lib/elementary/efl_ui_list.eo7
-rw-r--r--src/lib/elementary/efl_ui_list_view.c28
-rw-r--r--src/lib/elementary/efl_ui_list_view.eo3
-rw-r--r--src/lib/elementary/efl_ui_scroller.c90
-rw-r--r--src/lib/elementary/efl_ui_scroller.eo7
-rw-r--r--src/lib/elementary/efl_ui_widget.c16
8 files changed, 17 insertions, 225 deletions
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 2a565067fd..2a46ddb29b 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -1847,6 +1847,7 @@ _efl_ui_image_zoomable_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Zoomable
1847 elm_widget_can_focus_set(obj, EINA_TRUE); 1847 elm_widget_can_focus_set(obj, EINA_TRUE);
1848 1848
1849 priv->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); 1849 priv->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
1850 efl_composite_attach(obj, priv->smanager);
1850 1851
1851 efl_ui_mirrored_set(priv->smanager, efl_ui_mirrored_get(obj)); 1852 efl_ui_mirrored_set(priv->smanager, efl_ui_mirrored_get(obj));
1852 efl_ui_scrollable_bounce_enabled_set(priv->smanager, bounce, bounce); 1853 efl_ui_scrollable_bounce_enabled_set(priv->smanager, bounce, bounce);
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 0184234724..045346ceee 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -433,6 +433,7 @@ _efl_ui_list_efl_object_finalize(Eo *obj,
433 433
434 pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); 434 pd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
435 efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj)); 435 efl_ui_mirrored_set(pd->smanager, efl_ui_mirrored_get(obj));
436 efl_composite_attach(obj, pd->smanager);
436 437
437 pd->pan = efl_add(EFL_UI_PAN_CLASS, obj); 438 pd->pan = efl_add(EFL_UI_PAN_CLASS, obj);
438 439
@@ -914,68 +915,6 @@ _efl_ui_list_efl_pack_pack_padding_get(const Eo *obj EINA_UNUSED,
914 */ 915 */
915 916
916/* Scroll APIs */ 917/* Scroll APIs */
917EOLIAN static Eina_Size2D
918_efl_ui_list_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED,
919 Efl_Ui_List_Data *pd)
920{
921 return efl_ui_scrollable_content_size_get(pd->smanager);
922}
923
924EOLIAN static Eina_Rect
925_efl_ui_list_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED,
926 Efl_Ui_List_Data *pd)
927{
928 return efl_ui_scrollable_viewport_geometry_get(pd->smanager);
929}
930
931EOLIAN static void
932_efl_ui_list_efl_ui_scrollable_interactive_bounce_enabled_set(Eo *obj EINA_UNUSED,
933 Efl_Ui_List_Data *pd,
934 Eina_Bool horiz,
935 Eina_Bool vert)
936{
937 efl_ui_scrollable_bounce_enabled_set(pd->smanager, horiz, vert);
938}
939
940EOLIAN static void
941_efl_ui_list_efl_ui_scrollable_interactive_bounce_enabled_get(const Eo *obj EINA_UNUSED,
942 Efl_Ui_List_Data *pd,
943 Eina_Bool *horiz,
944 Eina_Bool *vert)
945{
946 efl_ui_scrollable_bounce_enabled_get(pd->smanager, horiz, vert);
947}
948
949EOLIAN static Eina_Bool
950_efl_ui_list_efl_ui_scrollable_interactive_scroll_hold_get(const Eo *obj EINA_UNUSED,
951 Efl_Ui_List_Data *pd)
952{
953 return efl_ui_scrollable_scroll_hold_get(pd->smanager);
954}
955
956EOLIAN static void
957_efl_ui_list_efl_ui_scrollable_interactive_scroll_hold_set(Eo *obj EINA_UNUSED,
958 Efl_Ui_List_Data *pd,
959 Eina_Bool hold)
960{
961 efl_ui_scrollable_scroll_hold_set(pd->smanager, hold);
962}
963
964EOLIAN static Eina_Bool
965_efl_ui_list_efl_ui_scrollable_interactive_scroll_freeze_get(const Eo *obj EINA_UNUSED,
966 Efl_Ui_List_Data *pd)
967{
968 return efl_ui_scrollable_scroll_freeze_get(pd->smanager);
969}
970
971EOLIAN static void
972_efl_ui_list_efl_ui_scrollable_interactive_scroll_freeze_set(Eo *obj EINA_UNUSED,
973 Efl_Ui_List_Data *pd,
974 Eina_Bool freeze)
975{
976 efl_ui_scrollable_scroll_freeze_set(pd->smanager, freeze);
977}
978
979EOLIAN static void 918EOLIAN static void
980_efl_ui_list_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED, 919_efl_ui_list_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED,
981 Efl_Ui_List_Data *pd, 920 Efl_Ui_List_Data *pd,
@@ -991,33 +930,6 @@ _efl_ui_list_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED
991} 930}
992 931
993EOLIAN static void 932EOLIAN static void
994_efl_ui_list_efl_ui_scrollbar_bar_mode_set(Eo *obj EINA_UNUSED,
995 Efl_Ui_List_Data *pd,
996 Efl_Ui_Scrollbar_Mode hmode,
997 Efl_Ui_Scrollbar_Mode vmode)
998{
999 efl_ui_scrollbar_bar_mode_set(pd->smanager, hmode, vmode);
1000}
1001
1002EOLIAN static void
1003_efl_ui_list_efl_ui_scrollbar_bar_mode_get(const Eo *obj EINA_UNUSED,
1004 Efl_Ui_List_Data *pd,
1005 Efl_Ui_Scrollbar_Mode *hmode,
1006 Efl_Ui_Scrollbar_Mode *vmode)
1007{
1008 efl_ui_scrollbar_bar_mode_get(pd->smanager, hmode, vmode);
1009}
1010
1011EOLIAN static void
1012_efl_ui_list_efl_ui_scrollable_interactive_scroll(Eo *obj EINA_UNUSED,
1013 Efl_Ui_List_Data *pd,
1014 Eina_Rect rc,
1015 Eina_Bool animation)
1016{
1017 efl_ui_scrollable_scroll(pd->smanager, rc, animation);
1018}
1019
1020EOLIAN static void
1021_efl_ui_list_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, 933_efl_ui_list_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED,
1022 Efl_Ui_List_Data *pd, 934 Efl_Ui_List_Data *pd,
1023 Efl_Ui_Select_Mode mode) 935 Efl_Ui_Select_Mode mode)
diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo
index f6fb19cef6..00e60d6f69 100644
--- a/src/lib/elementary/efl_ui_list.eo
+++ b/src/lib/elementary/efl_ui_list.eo
@@ -78,14 +78,7 @@ class Efl.Ui.List (Efl.Ui.Layout,
78 //Efl.Pack.pack_align { get; set; } 78 //Efl.Pack.pack_align { get; set; }
79 79
80 //Efl.Ui.Scrollable 80 //Efl.Ui.Scrollable
81 Efl.Ui.Scrollable_Interactive.scroll;
82 Efl.Ui.Scrollable_Interactive.content_size{ get; }
83 Efl.Ui.Scrollable_Interactive.viewport_geometry{ get; }
84 Efl.Ui.Scrollable_Interactive.bounce_enabled { set; get; }
85 Efl.Ui.Scrollable_Interactive.scroll_freeze { get; set; }
86 Efl.Ui.Scrollable_Interactive.scroll_hold { get; set; }
87 Efl.Ui.Scrollable_Interactive.match_content { set; } 81 Efl.Ui.Scrollable_Interactive.match_content { set; }
88 Efl.Ui.Scrollbar.bar_mode { get; set; }
89 82
90 //Efl.Ui.Multi_Selectable 83 //Efl.Ui.Multi_Selectable
91 Efl.Ui.Multi_Selectable.select_mode {get; set;} 84 Efl.Ui.Multi_Selectable.select_mode {get; set;}
diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c
index 690ac43960..94e9fdbf94 100644
--- a/src/lib/elementary/efl_ui_list_view.c
+++ b/src/lib/elementary/efl_ui_list_view.c
@@ -111,33 +111,6 @@ _efl_ui_list_view_pan_efl_object_destructor(Eo *obj, Efl_Ui_List_View_Pan_Data *
111 111
112#include "efl_ui_list_view_pan.eo.c" 112#include "efl_ui_list_view_pan.eo.c"
113 113
114EOLIAN static void
115_efl_ui_list_view_efl_ui_scrollable_interactive_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *psd, Eina_Position2D pos)
116{
117 efl_ui_scrollable_content_pos_set(psd->scrl_mgr, pos);
118}
119
120EOLIAN static Eina_Position2D
121_efl_ui_list_view_efl_ui_scrollable_interactive_content_pos_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *psd)
122{
123 Eina_Position2D pos = efl_ui_scrollable_content_pos_get(psd->scrl_mgr);
124 return pos;
125}
126
127EOLIAN static Eina_Size2D
128_efl_ui_list_view_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *psd)
129{
130 Eina_Size2D size = efl_ui_scrollable_content_size_get(psd->scrl_mgr);
131 return size;
132}
133
134EOLIAN static Eina_Rect
135_efl_ui_list_view_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED, Efl_Ui_List_View_Data *psd)
136{
137 Eina_Rect gmt = efl_ui_scrollable_viewport_geometry_get(psd->scrl_mgr);
138 return gmt;
139}
140
141static Eina_Bool 114static Eina_Bool
142_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind) 115_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind)
143{ 116{
@@ -610,6 +583,7 @@ _efl_ui_list_view_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_View_Data *pd)
610 583
611 pd->scrl_mgr = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj, 584 pd->scrl_mgr = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj,
612 efl_ui_mirrored_set(efl_added, efl_ui_mirrored_get(obj))); 585 efl_ui_mirrored_set(efl_added, efl_ui_mirrored_get(obj)));
586 efl_composite_attach(obj, pd->scrl_mgr);
613 pd->pan_obj = efl_add(MY_PAN_CLASS, obj); 587 pd->pan_obj = efl_add(MY_PAN_CLASS, obj);
614 pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS); 588 pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS);
615 pan_data->wobj = obj; 589 pan_data->wobj = obj;
diff --git a/src/lib/elementary/efl_ui_list_view.eo b/src/lib/elementary/efl_ui_list_view.eo
index aec3a58b51..971a0187c8 100644
--- a/src/lib/elementary/efl_ui_list_view.eo
+++ b/src/lib/elementary/efl_ui_list_view.eo
@@ -83,9 +83,6 @@ class Efl.Ui.List_View (Efl.Ui.Layout, Efl.Ui.Scrollable_Interactive, Efl.Ui.Scr
83 Efl.Ui.Focus.Composition.prepare; 83 Efl.Ui.Focus.Composition.prepare;
84 Efl.Ui.View.model { get; set; } 84 Efl.Ui.View.model { get; set; }
85 85
86 Efl.Ui.Scrollable_Interactive.viewport_geometry { get; }
87 Efl.Ui.Scrollable_Interactive.content_pos { get; set; }
88 Efl.Ui.Scrollable_Interactive.content_size { get; }
89// Efl.Ui.Scrollable_Interactive.scroll; 86// Efl.Ui.Scrollable_Interactive.scroll;
90 Efl.Layout.Signal.signal_callback_add; 87 Efl.Layout.Signal.signal_callback_add;
91 Efl.Layout.Signal.signal_callback_del; 88 Efl.Layout.Signal.signal_callback_del;
diff --git a/src/lib/elementary/efl_ui_scroller.c b/src/lib/elementary/efl_ui_scroller.c
index 8ad0466f08..0c750ef301 100644
--- a/src/lib/elementary/efl_ui_scroller.c
+++ b/src/lib/elementary/efl_ui_scroller.c
@@ -406,6 +406,7 @@ _efl_ui_scroller_efl_object_finalize(Eo *obj,
406 406
407 sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj); 407 sd->smanager = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj);
408 efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj)); 408 efl_ui_mirrored_set(sd->smanager, efl_ui_mirrored_get(obj));
409 efl_composite_attach(obj, sd->smanager);
409 410
410 sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj); 411 sd->pan_obj = efl_add(EFL_UI_PAN_CLASS, obj);
411 412
@@ -527,68 +528,6 @@ _efl_ui_scroller_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Scroller_Data *sd)
527 return int_ret; 528 return int_ret;
528} 529}
529 530
530EOLIAN static Eina_Size2D
531_efl_ui_scroller_efl_ui_scrollable_interactive_content_size_get(const Eo *obj EINA_UNUSED,
532 Efl_Ui_Scroller_Data *sd)
533{
534 return efl_ui_scrollable_content_size_get(sd->smanager);
535}
536
537EOLIAN static Eina_Rect
538_efl_ui_scroller_efl_ui_scrollable_interactive_viewport_geometry_get(const Eo *obj EINA_UNUSED,
539 Efl_Ui_Scroller_Data *sd)
540{
541 return efl_ui_scrollable_viewport_geometry_get(sd->smanager);
542}
543
544EOLIAN static void
545_efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_set(Eo *obj EINA_UNUSED,
546 Efl_Ui_Scroller_Data *sd,
547 Eina_Bool horiz,
548 Eina_Bool vert)
549{
550 efl_ui_scrollable_bounce_enabled_set(sd->smanager, horiz, vert);
551}
552
553EOLIAN static void
554_efl_ui_scroller_efl_ui_scrollable_interactive_bounce_enabled_get(const Eo *obj EINA_UNUSED,
555 Efl_Ui_Scroller_Data *sd,
556 Eina_Bool *horiz,
557 Eina_Bool *vert)
558{
559 efl_ui_scrollable_bounce_enabled_get(sd->smanager, horiz, vert);
560}
561
562EOLIAN static Eina_Bool
563_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_hold_get(const Eo *obj EINA_UNUSED,
564 Efl_Ui_Scroller_Data *sd)
565{
566 return efl_ui_scrollable_scroll_hold_get(sd->smanager);
567}
568
569EOLIAN static void
570_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_hold_set(Eo *obj EINA_UNUSED,
571 Efl_Ui_Scroller_Data *sd,
572 Eina_Bool hold)
573{
574 efl_ui_scrollable_scroll_hold_set(sd->smanager, hold);
575}
576
577EOLIAN static Eina_Bool
578_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_freeze_get(const Eo *obj EINA_UNUSED,
579 Efl_Ui_Scroller_Data *sd)
580{
581 return efl_ui_scrollable_scroll_freeze_get(sd->smanager);
582}
583
584EOLIAN static void
585_efl_ui_scroller_efl_ui_scrollable_interactive_scroll_freeze_set(Eo *obj EINA_UNUSED,
586 Efl_Ui_Scroller_Data *sd,
587 Eina_Bool freeze)
588{
589 efl_ui_scrollable_scroll_freeze_set(sd->smanager, freeze);
590}
591
592EOLIAN static void 531EOLIAN static void
593_efl_ui_scroller_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED, 532_efl_ui_scroller_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED,
594 Efl_Ui_Scroller_Data *sd, 533 Efl_Ui_Scroller_Data *sd,
@@ -603,33 +542,6 @@ _efl_ui_scroller_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UN
603 elm_layout_sizing_eval(obj); 542 elm_layout_sizing_eval(obj);
604} 543}
605 544
606EOLIAN static void
607_efl_ui_scroller_efl_ui_scrollbar_bar_mode_set(Eo *obj EINA_UNUSED,
608 Efl_Ui_Scroller_Data *sd,
609 Efl_Ui_Scrollbar_Mode hmode,
610 Efl_Ui_Scrollbar_Mode vmode)
611{
612 efl_ui_scrollbar_bar_mode_set(sd->smanager, hmode, vmode);
613}
614
615EOLIAN static void
616_efl_ui_scroller_efl_ui_scrollbar_bar_mode_get(const Eo *obj EINA_UNUSED,
617 Efl_Ui_Scroller_Data *sd,
618 Efl_Ui_Scrollbar_Mode *hmode,
619 Efl_Ui_Scrollbar_Mode *vmode)
620{
621 efl_ui_scrollbar_bar_mode_get(sd->smanager, hmode, vmode);
622}
623
624EOLIAN static void
625_efl_ui_scroller_efl_ui_scrollable_interactive_scroll(Eo *obj EINA_UNUSED,
626 Efl_Ui_Scroller_Data *sd,
627 Eina_Rect rc,
628 Eina_Bool animation)
629{
630 efl_ui_scrollable_scroll(sd->smanager, rc, animation);
631}
632
633/* Internal EO APIs and hidden overrides */ 545/* Internal EO APIs and hidden overrides */
634 546
635#define EFL_UI_SCROLLER_EXTRA_OPS \ 547#define EFL_UI_SCROLLER_EXTRA_OPS \
diff --git a/src/lib/elementary/efl_ui_scroller.eo b/src/lib/elementary/efl_ui_scroller.eo
index 8444294757..c037fe787e 100644
--- a/src/lib/elementary/efl_ui_scroller.eo
+++ b/src/lib/elementary/efl_ui_scroller.eo
@@ -10,13 +10,6 @@ class Efl.Ui.Scroller (Efl.Ui.Layout,
10 Efl.Object.destructor; 10 Efl.Object.destructor;
11 Efl.Content.content { set; } 11 Efl.Content.content { set; }
12 Efl.Ui.Widget.theme_apply; 12 Efl.Ui.Widget.theme_apply;
13 Efl.Ui.Scrollable_Interactive.content_size{ get; }
14 Efl.Ui.Scrollable_Interactive.viewport_geometry{ get; }
15 Efl.Ui.Scrollable_Interactive.bounce_enabled { set; get; }
16 Efl.Ui.Scrollable_Interactive.scroll_freeze { get; set; }
17 Efl.Ui.Scrollable_Interactive.scroll_hold { get; set; }
18 Efl.Ui.Scrollable_Interactive.match_content { set; } 13 Efl.Ui.Scrollable_Interactive.match_content { set; }
19 Efl.Ui.Scrollbar.bar_mode { get; set; }
20 Efl.Ui.Scrollable_Interactive.scroll;
21 } 14 }
22} 15}
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index d4a253191d..ecc9b5f2c0 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -2547,9 +2547,19 @@ _efl_ui_widget_show_region_set(Eo *obj, Elm_Widget_Smart_Data *sd, Eina_Rect sr,
2547 2547
2548 if (_elm_scrollable_is(obj)) 2548 if (_elm_scrollable_is(obj))
2549 { 2549 {
2550 elm_interface_scrollable_content_pos_get(obj, &nx, &ny); 2550 if (elm_widget_is_legacy(obj))
2551 sr.x -= nx; 2551 {
2552 sr.y -= ny; 2552 elm_interface_scrollable_content_pos_get(obj, &nx, &ny);
2553 sr.x -= nx;
2554 sr.y -= ny;
2555 }
2556 else
2557 {
2558 Eina_Position2D pos;
2559 pos = efl_ui_scrollable_content_pos_get(obj);
2560 sr.x -= pos.x;
2561 sr.y -= pos.y;
2562 }
2553 } 2563 }
2554 } 2564 }
2555 2565