summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangHyeon Jade Lee <dltkdgus1764@gmail.com>2017-11-21 14:00:47 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-21 14:00:47 +0900
commit7262a681c8148c8ec414f33503d656052abfe257 (patch)
tree570b5ddc964b8c9b07ffb7e041f0e14725742f04
parent0886ce0ab0f3ddc1d54351c90ea9f6965ca8cbff (diff)
efl_ui_list : applying new interface efl_ui_scroll
Summary: Applying new interface efl_ui_scroll into efl_ui_list. This patch is upon the efl_ui_scroll patch in D5222. Test Plan: test by exapmple in src/examples/elementary Reviewers: felipealmeida, jpeg, eagleeye, woohyun, akanad, cedric Subscribers: jenkins, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D5492
-rw-r--r--src/lib/elementary/efl_ui_list.c608
-rw-r--r--src/lib/elementary/efl_ui_list.eo10
-rw-r--r--src/lib/elementary/efl_ui_list_pan.eo10
-rw-r--r--src/lib/elementary/efl_ui_list_precise_layouter.c41
-rw-r--r--src/lib/elementary/efl_ui_list_private.h10
5 files changed, 497 insertions, 182 deletions
diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c
index 4151a36ca7..17ea2aede1 100644
--- a/src/lib/elementary/efl_ui_list.c
+++ b/src/lib/elementary/efl_ui_list.c
@@ -1,7 +1,6 @@
1#ifdef HAVE_CONFIG_H 1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4#define ELM_INTERFACE_ATSPI_ACCESSIBLE_PROTECTED
5#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED 4#define ELM_INTERFACE_ATSPI_WIDGET_ACTION_PROTECTED
6#define EFL_ACCESS_SELECTION_PROTECTED 5#define EFL_ACCESS_SELECTION_PROTECTED
7 6
@@ -59,25 +58,36 @@ _horiz(Efl_Orient dir)
59{ 58{
60 return dir % 180 == EFL_ORIENT_RIGHT; 59 return dir % 180 == EFL_ORIENT_RIGHT;
61} 60}
61EOLIAN static void
62_efl_ui_list_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_Pan_Data *psd)
63{
64 efl_canvas_group_add(efl_super(obj, MY_CLASS));
65 //return obj;
66}
67EOLIAN static void
68_efl_ui_list_efl_canvas_group_group_del(Eo *obj, Efl_Ui_List_Pan_Data *psd)
69{
70 efl_canvas_group_del(efl_super(obj, MY_CLASS));
71}
62 72
63EOLIAN static void 73EOLIAN static void
64_efl_ui_list_pan_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Pan_Data *psd) 74_efl_ui_list_pan_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Pan_Data *psd)
65{ 75{
66 //DBG(""); 76 EFL_UI_LIST_DATA_GET(psd->wobj, pd);
77 DBG("group calc start");
67 /* if (pd->recalc) return; */ 78 /* if (pd->recalc) return; */
68 79
69 /* _efl_ui_list_custom_layout(obj); */ 80 /* _efl_ui_list_custom_layout(obj); */
81 _layout(pd);
70 evas_object_smart_changed(psd->wobj); 82 evas_object_smart_changed(psd->wobj);
71} 83}
72 84
73 85
74EOLIAN static void 86EOLIAN static void
75_efl_ui_list_pan_elm_pan_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Evas_Coord x, Evas_Coord y) 87_efl_ui_list_pan_efl_ui_pan_position_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Eina_Position2D pos)
76{ 88{
77 Evas_Coord ox, oy, ow, oh, cw;
78
79 //DBG("x: %d y: %d", (int)x, (int)y); 89 //DBG("x: %d y: %d", (int)x, (int)y);
80 if ((x == psd->x) && (y == psd->y)) return; 90 if ((pos.x == psd->gmt.x) && (pos.y == psd->gmt.y)) return;
81 91
82// evas_object_geometry_get(pd->obj, &ox, &oy, &ow, &oh); 92// evas_object_geometry_get(pd->obj, &ox, &oy, &ow, &oh);
83// if (_horiz(pd->orient)) 93// if (_horiz(pd->orient))
@@ -91,8 +101,9 @@ _efl_ui_list_pan_elm_pan_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd,
91// cw = oh / 4; 101// cw = oh / 4;
92// } 102// }
93 103
94 psd->x = x; 104 psd->gmt.x = pos.x;
95 psd->y = y; 105 psd->gmt.y = pos.y;
106 DBG("pos : %d, %d", pos.x, pos.y);
96 107
97// if (abs(pd->pan.move_diff) > cw) 108// if (abs(pd->pan.move_diff) > cw)
98// { 109// {
@@ -108,48 +119,46 @@ _efl_ui_list_pan_elm_pan_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd,
108 evas_object_smart_changed(psd->wobj); 119 evas_object_smart_changed(psd->wobj);
109} 120}
110 121
111EOLIAN static void 122EOLIAN static Eina_Position2D
112_efl_ui_list_pan_elm_pan_pos_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y) 123_efl_ui_list_pan_efl_ui_pan_position_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
113{ 124{
114 if (x) *x = psd->x; 125 DBG("pos : %d, %d", psd->gmt.x, psd->gmt.y);
115 if (y) *y = psd->y; 126 return psd->gmt.pos;
116} 127}
117 128
118EOLIAN static void 129EOLIAN static Eina_Position2D
119_efl_ui_list_pan_elm_pan_pos_max_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Evas_Coord *x, Evas_Coord *y) 130_efl_ui_list_pan_efl_ui_pan_position_max_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
120{ 131{
121 Evas_Coord ow, oh; 132 EFL_UI_LIST_DATA_GET(psd->wobj, pd);
122 Eina_Size2D min; 133 Eina_Rect vgmt = {};
123 134 Eina_Size2D min = {};
124 elm_interface_scrollable_content_viewport_geometry_get
125 (psd->wobj, NULL, NULL, &ow, &oh);
126 135
136 vgmt = efl_ui_scrollable_viewport_geometry_get(pd->scrl_mgr);
127 min = efl_ui_list_model_min_size_get(psd->wobj); 137 min = efl_ui_list_model_min_size_get(psd->wobj);
128 ow = min.w - ow;
129 if (ow < 0) ow = 0;
130 oh = min.h - oh;
131 if (oh < 0) oh = 0;
132 138
133 if (x) *x = ow; 139 //DBG("x %d, %d, y %d, %d", vgmt.w, min.w, vgmt.h, min.h);
134 if (y) *y = oh; 140
141 min.w = min.w - vgmt.w;
142 if (min.w < 0) min.w = 0;
143 min.h = min.h - vgmt.h;
144 if (min.h < 0) min.h = 0;
145
146 return EINA_POSITION2D(min.w, min.h);
135} 147}
136 148
137EOLIAN static void 149EOLIAN static Eina_Position2D
138_efl_ui_list_pan_elm_pan_pos_min_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd EINA_UNUSED, Evas_Coord *x, Evas_Coord *y) 150_efl_ui_list_pan_efl_ui_pan_position_min_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd EINA_UNUSED)
139{ 151{
140 if (x) *x = 0; 152 return EINA_POSITION2D(0, 0);
141 if (y) *y = 0;
142} 153}
143 154
144EOLIAN static void 155EOLIAN static Eina_Size2D
145_efl_ui_list_pan_elm_pan_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd, Evas_Coord *w, Evas_Coord *h) 156_efl_ui_list_pan_efl_ui_pan_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Pan_Data *psd)
146{ 157{
147 Eina_Size2D min; 158 Eina_Size2D min = {};
148 min = efl_ui_list_model_min_size_get(psd->wobj); 159 min = efl_ui_list_model_min_size_get(psd->wobj);
149 160
150 if (w) *w = min.w; 161 return min;
151 if (h) *h = min.h;
152
153 //DBG("w: %d h: %d", *w, *h); 162 //DBG("w: %d h: %d", *w, *h);
154} 163}
155 164
@@ -161,6 +170,33 @@ _efl_ui_list_pan_efl_object_destructor(Eo *obj, Efl_Ui_List_Pan_Data *psd)
161 170
162#include "efl_ui_list_pan.eo.c" 171#include "efl_ui_list_pan.eo.c"
163 172
173EOLIAN static void
174_efl_ui_list_efl_ui_scrollable_interactive_content_pos_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd, Eina_Position2D pos)
175{
176 efl_ui_scrollable_content_pos_set(psd->scrl_mgr, pos);
177}
178
179EOLIAN static Eina_Position2D
180_efl_ui_list_efl_ui_scrollable_interactive_content_pos_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
181{
182 Eina_Position2D pos = efl_ui_scrollable_content_pos_get(psd->scrl_mgr);
183 return pos;
184}
185
186EOLIAN static Eina_Size2D
187_efl_ui_list_efl_ui_scrollable_interactive_content_size_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
188{
189 Eina_Size2D size = efl_ui_scrollable_content_size_get(psd->scrl_mgr);
190 return size;
191}
192
193EOLIAN static Eina_Rect
194_efl_ui_list_efl_ui_scrollable_interactive_viewport_geometry_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *psd)
195{
196 Eina_Rect gmt = efl_ui_scrollable_viewport_geometry_get(psd->scrl_mgr);
197 return gmt;
198}
199
164static Eina_Bool 200static Eina_Bool
165_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind) 201_efl_model_properties_has(Efl_Model *model, Eina_Stringshare *propfind)
166{ 202{
@@ -793,9 +829,9 @@ static void
793_show_region_hook(void *data EINA_UNUSED, Evas_Object *obj) 829_show_region_hook(void *data EINA_UNUSED, Evas_Object *obj)
794{ 830{
795 EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd); 831 EFL_UI_LIST_DATA_GET_OR_RETURN(obj, pd);
796 Eina_Rect r = elm_obj_widget_show_region_get(obj); 832 Eina_Rect r = efl_ui_widget_show_region_get(obj);
797 elm_pan_pos_get(pd->pan_obj, &r.x, &r.y); 833 r.pos = efl_ui_pan_position_get(pd->pan_obj);
798 elm_interface_scrollable_content_region_show(obj, r.x, r.y, r.w, r.h); 834 efl_ui_scrollable_show(pd->scrl_mgr, r);
799} 835}
800 836
801EOLIAN static void 837EOLIAN static void
@@ -813,7 +849,7 @@ _efl_ui_list_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd, Elm_Obje
813 /* EINA_ARRAY_ITER_NEXT(pd->items.array, i, item, iterator) */ 849 /* EINA_ARRAY_ITER_NEXT(pd->items.array, i, item, iterator) */
814 /* { */ 850 /* { */
815 /* if (item->selected) */ 851 /* if (item->selected) */
816 /* elm_layout_signal_emit(item->layout, "elm,state,selected", "elm"); */ 852 /* elm_layout_emit(item->layout, "elm,state,selected", "elm"); */
817 853
818 /* efl_ui_model_connect(item->layout, "signal/elm,state,%v", "selected"); */ 854 /* efl_ui_model_connect(item->layout, "signal/elm,state,%v", "selected"); */
819 /* } */ 855 /* } */
@@ -865,40 +901,28 @@ _efl_ui_list_homogeneous_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
865EOLIAN static Efl_Ui_Theme_Apply 901EOLIAN static Efl_Ui_Theme_Apply
866_efl_ui_list_elm_widget_theme_apply(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED) 902_efl_ui_list_elm_widget_theme_apply(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED)
867{ 903{
868 return elm_obj_widget_theme_apply(efl_super(obj, MY_CLASS)); 904 return efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
869} 905}
870 906
871EOLIAN static void 907EOLIAN static void
872_efl_ui_list_efl_gfx_position_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Position2D p) 908_efl_ui_list_efl_gfx_position_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Position2D pos)
873{ 909{
874 int pan_x, pan_y; 910 Eina_Position2D pan_pos = {};
875 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, p.x, p.y)) 911 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_MOVE, 0, pos.x, pos.y))
876 return; 912 return;
877 913
878 efl_gfx_position_set(efl_super(obj, MY_CLASS), p); 914 efl_gfx_position_set(efl_super(obj, MY_CLASS), pos);
879 915
880 elm_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
881 evas_object_move(pd->hit_rect, p.x, p.y);
882 evas_object_move(pd->pan_obj, p.x - pan_x, p.y - pan_y);
883 evas_object_smart_changed(pd->obj); 916 evas_object_smart_changed(pd->obj);
884} 917}
885 918
886EOLIAN static void 919EOLIAN static void
887_efl_ui_list_elm_interface_scrollable_region_bring_in(Eo *obj, Efl_Ui_List_Data *pd, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h)
888{
889 int pan_x, pan_y;
890 elm_pan_pos_get(pd->pan_obj, &pan_x, &pan_y);
891 elm_interface_scrollable_region_bring_in(efl_super(obj, MY_CLASS), x + pan_x, y + pan_y, w, h);
892}
893
894EOLIAN static void
895_efl_ui_list_efl_gfx_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D size) 920_efl_ui_list_efl_gfx_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D size)
896{ 921{
897 DBG("w: %d h: %d", size.w, size.h); 922 DBG("w: %d h: %d", size.w, size.h);
898 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h)) 923 if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_RESIZE, 0, size.w, size.h))
899 return; 924 return;
900 925
901 evas_object_resize(pd->hit_rect, size.w, size.h);
902 efl_gfx_size_set(efl_super(obj, MY_CLASS), size); 926 efl_gfx_size_set(efl_super(obj, MY_CLASS), size);
903 927
904 evas_object_smart_changed(pd->obj); 928 evas_object_smart_changed(pd->obj);
@@ -907,7 +931,6 @@ _efl_ui_list_efl_gfx_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_Size2D size)
907EOLIAN static void 931EOLIAN static void
908_efl_ui_list_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Data *pd) 932_efl_ui_list_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Data *pd)
909{ 933{
910 DBG("");
911 /* if (pd->recalc) return; */ 934 /* if (pd->recalc) return; */
912 935
913 _layout(pd); 936 _layout(pd);
@@ -918,9 +941,6 @@ EOLIAN static void
918_efl_ui_list_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_List_Data *pd, Evas_Object *member) 941_efl_ui_list_efl_canvas_group_group_member_add(Eo *obj, Efl_Ui_List_Data *pd, Evas_Object *member)
919{ 942{
920 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member); 943 efl_canvas_group_member_add(efl_super(obj, MY_CLASS), member);
921
922 if (pd->hit_rect)
923 evas_object_raise(pd->hit_rect);
924} 944}
925 945
926EOLIAN static void 946EOLIAN static void
@@ -947,61 +967,327 @@ _efl_ui_list_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED)
947 evas_object_size_hint_max_set(obj, max.w, max.h); 967 evas_object_size_hint_max_set(obj, max.w, max.h);
948} 968}
949 969
950EOLIAN static void 970//Scrollable Implement
951_efl_ui_list_efl_canvas_group_group_add(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED) 971static void
972_efl_ui_list_bar_read_and_update(Eo *obj)
952{ 973{
953 Efl_Ui_List_Pan_Data *pan_data; 974 EFL_UI_LIST_DATA_GET(obj, pd);
954 Evas_Coord minw, minh; 975 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
976 double vx, vy;
977
978 edje_object_part_drag_value_get
979 (wd->resize_obj, "elm.dragable.vbar", NULL, &vy);
980 edje_object_part_drag_value_get
981 (wd->resize_obj, "elm.dragable.hbar", &vx, NULL);
982 DBG("pos %lf, %lf", vx, vy);
983 efl_ui_scrollbar_position_set(pd->scrl_mgr, vx, vy);
984
985 efl_canvas_group_change(pd->pan_obj);
986}
987
988static void
989_efl_ui_list_reload_cb(void *data,
990 Evas_Object *obj EINA_UNUSED,
991 const char *emission EINA_UNUSED,
992 const char *source EINA_UNUSED)
993{
994 EFL_UI_LIST_DATA_GET(data, pd);
995
996 efl_ui_scrollbar_visibility_update(pd->scrl_mgr);
997}
998
999static void
1000_efl_ui_list_vbar_drag_cb(void *data,
1001 Evas_Object *obj EINA_UNUSED,
1002 const char *emission EINA_UNUSED,
1003 const char *source EINA_UNUSED)
1004{
1005 _efl_ui_list_bar_read_and_update(data);
1006
1007 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
1008 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type);
1009}
1010
1011static void
1012_efl_ui_list_vbar_press_cb(void *data,
1013 Evas_Object *obj EINA_UNUSED,
1014 const char *emission EINA_UNUSED,
1015 const char *source EINA_UNUSED)
1016{
1017 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
1018 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
1019}
1020
1021static void
1022_efl_ui_list_vbar_unpress_cb(void *data,
1023 Evas_Object *obj EINA_UNUSED,
1024 const char *emission EINA_UNUSED,
1025 const char *source EINA_UNUSED)
1026{
1027 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_VERTICAL;
1028 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
1029}
1030
1031static void
1032_efl_ui_list_edje_drag_start_cb(void *data,
1033 Evas_Object *obj EINA_UNUSED,
1034 const char *emission EINA_UNUSED,
1035 const char *source EINA_UNUSED)
1036{
1037 EFL_UI_LIST_DATA_GET(data, pd);
1038
1039 _efl_ui_list_bar_read_and_update(data);
1040
1041 pd->freeze_want = efl_ui_scrollable_freeze_get(pd->scrl_mgr);
1042 efl_ui_scrollable_freeze_set(pd->scrl_mgr, EINA_TRUE);
1043 efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_START, NULL);
1044}
1045
1046static void
1047_efl_ui_list_edje_drag_stop_cb(void *data,
1048 Evas_Object *obj EINA_UNUSED,
1049 const char *emission EINA_UNUSED,
1050 const char *source EINA_UNUSED)
1051{
1052 EFL_UI_LIST_DATA_GET(data, pd);
1053
1054 _efl_ui_list_bar_read_and_update(data);
1055
1056 efl_ui_scrollable_freeze_set(pd->scrl_mgr, pd->freeze_want);
1057 efl_event_callback_call(data, EFL_UI_EVENT_SCROLL_DRAG_STOP, NULL);
1058}
1059
1060static void
1061_efl_ui_list_edje_drag_cb(void *data,
1062 Evas_Object *obj EINA_UNUSED,
1063 const char *emission EINA_UNUSED,
1064 const char *source EINA_UNUSED)
1065{
1066 _efl_ui_list_bar_read_and_update(data);
1067}
1068
1069static void
1070_efl_ui_list_hbar_drag_cb(void *data,
1071 Evas_Object *obj EINA_UNUSED,
1072 const char *emission EINA_UNUSED,
1073 const char *source EINA_UNUSED)
1074{
1075 _efl_ui_list_bar_read_and_update(data);
1076
1077 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
1078 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_DRAG, &type);
1079}
1080
1081static void
1082_efl_ui_list_hbar_press_cb(void *data,
1083 Evas_Object *obj EINA_UNUSED,
1084 const char *emission EINA_UNUSED,
1085 const char *source EINA_UNUSED)
1086{
1087 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
1088 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_PRESS, &type);
1089}
1090
1091static void
1092_efl_ui_list_hbar_unpress_cb(void *data,
1093 Evas_Object *obj EINA_UNUSED,
1094 const char *emission EINA_UNUSED,
1095 const char *source EINA_UNUSED)
1096{
1097 Efl_Ui_Scrollbar_Direction type = EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL;
1098 efl_event_callback_call(data, EFL_UI_SCROLLBAR_EVENT_BAR_UNPRESS, &type);
1099}
1100
1101static void
1102_scroll_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
1103{
1104 //scroll cb
1105}
955 1106
1107static void
1108_efl_ui_list_bar_size_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
1109{
1110 Eo *obj = data;
1111 EFL_UI_LIST_DATA_GET(obj, pd);
956 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 1112 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
957 1113
958 efl_canvas_group_add(efl_super(obj, MY_CLASS)); 1114 double width = 0.0, height = 0.0;
959 elm_widget_sub_object_parent_add(obj);
960 1115
961 elm_widget_can_focus_set(obj, EINA_TRUE); 1116 efl_ui_scrollbar_size_get(pd->scrl_mgr, &width, &height);
1117 edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.hbar", width, 1.0);
1118 edje_object_part_drag_size_set(wd->resize_obj, "elm.dragable.vbar", 1.0, height);
1119}
962 1120
963 pd->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); 1121static void
964 evas_object_data_set(pd->hit_rect, "_elm_leaveme", obj); 1122_efl_ui_list_bar_pos_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
965 evas_object_smart_member_add(pd->hit_rect, obj); 1123{
966 elm_widget_sub_object_add(obj, pd->hit_rect); 1124 Eo *obj = data;
1125 EFL_UI_LIST_DATA_GET(obj, pd);
1126 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
967 1127
968 /* common scroller hit rectangle setup */ 1128 double posx = 0.0, posy = 0.0;
969 evas_object_color_set(pd->hit_rect, 0, 0, 0, 0);
970 evas_object_show(pd->hit_rect);
971 evas_object_repeat_events_set(pd->hit_rect, EINA_TRUE);
972 1129
973 elm_widget_on_show_region_hook_set(obj, NULL, _show_region_hook, NULL); 1130 efl_ui_scrollbar_position_get(pd->scrl_mgr, &posx, &posy);
1131 edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.hbar", posx, 0.0);
1132 edje_object_part_drag_value_set(wd->resize_obj, "elm.dragable.vbar", 0.0, posy);
1133}
974 1134
975 if (!elm_layout_theme_set(obj, "list", "base", elm_widget_style_get(obj))) 1135static void
976 CRI("Failed to set layout!"); 1136_efl_ui_list_bar_show_cb(void *data, const Efl_Event *event)
1137{
1138 Eo *obj = data;
1139 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1140 Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
977 1141
978 elm_interface_scrollable_objects_set(obj, wd->resize_obj, pd->hit_rect); 1142 if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
979 elm_interface_scrollable_bounce_allow_set 1143 edje_object_signal_emit(wd->resize_obj, "elm,action,show,hbar", "elm");
980 (obj, EINA_FALSE, _elm_config->thumbscroll_bounce_enable); 1144 else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
1145 edje_object_signal_emit(wd->resize_obj, "elm,action,show,vbar", "elm");
1146}
981 1147
982 pd->mode = ELM_LIST_COMPRESS; 1148static void
1149_efl_ui_list_bar_hide_cb(void *data, const Efl_Event *event)
1150{
1151 Eo *obj = data;
1152 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1153 Efl_Ui_Scrollbar_Direction type = *(Efl_Ui_Scrollbar_Direction *)(event->info);
983 1154
984 elm_interface_atspi_accessible_type_set(obj, ELM_ATSPI_TYPE_DISABLED); 1155 if (type == EFL_UI_SCROLLBAR_DIRECTION_HORIZONTAL)
985 pd->pan_obj = efl_add(MY_PAN_CLASS, evas_object_evas_get(obj)); 1156 edje_object_signal_emit(wd->resize_obj, "elm,action,hide,hbar", "elm");
986 pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS); 1157 else if (type == EFL_UI_SCROLLBAR_DIRECTION_VERTICAL)
987 pan_data->wobj = obj; 1158 edje_object_signal_emit(wd->resize_obj, "elm,action,hide,vbar", "elm");
1159}
988 1160
989 elm_interface_scrollable_extern_pan_set(obj, pd->pan_obj); 1161EOLIAN static Eina_Bool
990 evas_object_show(pd->pan_obj); 1162_efl_ui_list_efl_canvas_layout_signal_signal_callback_add(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
1163{
1164 Eina_Bool ok;
1165 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
991 1166
992 edje_object_size_min_calc(wd->resize_obj, &minw, &minh); 1167 ok = efl_canvas_layout_signal_callback_add(wd->resize_obj, emission, source, func_cb, data);
993 evas_object_size_hint_min_set(obj, minw, minh);
994 1168
995 elm_layout_sizing_eval(obj); 1169 return ok;
996} 1170}
997 1171
998EOLIAN static void 1172EOLIAN static Eina_Bool
999_efl_ui_list_efl_canvas_group_group_del(Eo *obj, Efl_Ui_List_Data *pd) 1173_efl_ui_list_efl_canvas_layout_signal_signal_callback_del(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *sd EINA_UNUSED, const char *emission, const char *source, Edje_Signal_Cb func_cb, void *data)
1000{ 1174{
1001 //_efl_ui_list_children_free(obj, pd); 1175 Eina_Bool ok;
1176 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1002 1177
1003 ELM_SAFE_FREE(pd->pan_obj, evas_object_del); 1178 ok = efl_canvas_layout_signal_callback_del(wd->resize_obj, emission, source, func_cb, data);
1004 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 1179
1180 return ok;
1181}
1182
1183static void
1184_efl_ui_list_edje_object_attach(Eo *obj)
1185{
1186 efl_canvas_layout_signal_callback_add
1187 (obj, "reload", "elm", _efl_ui_list_reload_cb, obj);
1188 efl_canvas_layout_signal_callback_add
1189 (obj, "drag", "elm.dragable.vbar", _efl_ui_list_vbar_drag_cb,
1190 obj);
1191 efl_canvas_layout_signal_callback_add
1192 (obj, "drag,set", "elm.dragable.vbar",
1193 _efl_ui_list_edje_drag_cb, obj);
1194 efl_canvas_layout_signal_callback_add
1195 (obj, "drag,start", "elm.dragable.vbar",
1196 _efl_ui_list_edje_drag_start_cb, obj);
1197 efl_canvas_layout_signal_callback_add
1198 (obj, "drag,stop", "elm.dragable.vbar",
1199 _efl_ui_list_edje_drag_stop_cb, obj);
1200 efl_canvas_layout_signal_callback_add
1201 (obj, "drag,step", "elm.dragable.vbar",
1202 _efl_ui_list_edje_drag_cb, obj);
1203 efl_canvas_layout_signal_callback_add
1204 (obj, "drag,page", "elm.dragable.vbar",
1205 _efl_ui_list_edje_drag_cb, obj);
1206 efl_canvas_layout_signal_callback_add
1207 (obj, "elm,vbar,press", "elm",
1208 _efl_ui_list_vbar_press_cb, obj);
1209 efl_canvas_layout_signal_callback_add
1210 (obj, "elm,vbar,unpress", "elm",
1211 _efl_ui_list_vbar_unpress_cb, obj);
1212 efl_canvas_layout_signal_callback_add
1213 (obj, "drag", "elm.dragable.hbar", _efl_ui_list_hbar_drag_cb,
1214 obj);
1215 efl_canvas_layout_signal_callback_add
1216 (obj, "drag,set", "elm.dragable.hbar",
1217 _efl_ui_list_edje_drag_cb, obj);
1218 efl_canvas_layout_signal_callback_add
1219 (obj, "drag,start", "elm.dragable.hbar",
1220 _efl_ui_list_edje_drag_start_cb, obj);
1221 efl_canvas_layout_signal_callback_add
1222 (obj, "drag,stop", "elm.dragable.hbar",
1223 _efl_ui_list_edje_drag_stop_cb, obj);
1224 efl_canvas_layout_signal_callback_add
1225 (obj, "drag,step", "elm.dragable.hbar",
1226 _efl_ui_list_edje_drag_cb, obj);
1227 efl_canvas_layout_signal_callback_add
1228 (obj, "drag,page", "elm.dragable.hbar",
1229 _efl_ui_list_edje_drag_cb, obj);
1230 efl_canvas_layout_signal_callback_add
1231 (obj, "elm,hbar,press", "elm",
1232 _efl_ui_list_hbar_press_cb, obj);
1233 efl_canvas_layout_signal_callback_add
1234 (obj, "elm,hbar,unpress", "elm",
1235 _efl_ui_list_hbar_unpress_cb, obj);
1236}
1237
1238static void
1239_efl_ui_list_edje_object_detach(Evas_Object *obj)
1240{
1241 efl_canvas_layout_signal_callback_del
1242 (obj, "reload", "elm", _efl_ui_list_reload_cb, obj);
1243 efl_canvas_layout_signal_callback_del
1244 (obj, "drag", "elm.dragable.vbar", _efl_ui_list_vbar_drag_cb,
1245 obj);
1246 efl_canvas_layout_signal_callback_del
1247 (obj, "drag,set", "elm.dragable.vbar",
1248 _efl_ui_list_edje_drag_cb, obj);
1249 efl_canvas_layout_signal_callback_del
1250 (obj, "drag,start", "elm.dragable.vbar",
1251 _efl_ui_list_edje_drag_start_cb, obj);
1252 efl_canvas_layout_signal_callback_del
1253 (obj, "drag,stop", "elm.dragable.vbar",
1254 _efl_ui_list_edje_drag_stop_cb, obj);
1255 efl_canvas_layout_signal_callback_del
1256 (obj, "drag,step", "elm.dragable.vbar",
1257 _efl_ui_list_edje_drag_cb, obj);
1258 efl_canvas_layout_signal_callback_del
1259 (obj, "drag,page", "elm.dragable.vbar",
1260 _efl_ui_list_edje_drag_cb, obj);
1261 efl_canvas_layout_signal_callback_del
1262 (obj, "elm,vbar,press", "elm",
1263 _efl_ui_list_vbar_press_cb, obj);
1264 efl_canvas_layout_signal_callback_del
1265 (obj, "elm,vbar,unpress", "elm",
1266 _efl_ui_list_vbar_unpress_cb, obj);
1267 efl_canvas_layout_signal_callback_del
1268 (obj, "drag", "elm.dragable.hbar", _efl_ui_list_hbar_drag_cb,
1269 obj);
1270 efl_canvas_layout_signal_callback_del
1271 (obj, "drag,set", "elm.dragable.hbar",
1272 _efl_ui_list_edje_drag_cb, obj);
1273 efl_canvas_layout_signal_callback_del
1274 (obj, "drag,start", "elm.dragable.hbar",
1275 _efl_ui_list_edje_drag_start_cb, obj);
1276 efl_canvas_layout_signal_callback_del
1277 (obj, "drag,stop", "elm.dragable.hbar",
1278 _efl_ui_list_edje_drag_stop_cb, obj);
1279 efl_canvas_layout_signal_callback_del
1280 (obj, "drag,step", "elm.dragable.hbar",
1281 _efl_ui_list_edje_drag_cb, obj);
1282 efl_canvas_layout_signal_callback_del
1283 (obj, "drag,page", "elm.dragable.hbar",
1284 _efl_ui_list_edje_drag_cb, obj);
1285 efl_canvas_layout_signal_callback_del
1286 (obj, "elm,hbar,press", "elm",
1287 _efl_ui_list_hbar_press_cb, obj);
1288 efl_canvas_layout_signal_callback_del
1289 (obj, "elm,hbar,unpress", "elm",
1290 _efl_ui_list_hbar_unpress_cb, obj);
1005} 1291}
1006 1292
1007EOLIAN static Efl_Ui_Focus_Manager* 1293EOLIAN static Efl_Ui_Focus_Manager*
@@ -1014,14 +1300,67 @@ _efl_ui_list_elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Efl_Ui_List_Da
1014 return pd->manager; 1300 return pd->manager;
1015} 1301}
1016 1302
1303
1304
1017EOLIAN static Eo * 1305EOLIAN static Eo *
1018_efl_ui_list_efl_object_finalize(Eo *obj, Efl_Ui_List_Data *pd) 1306_efl_ui_list_efl_object_finalize(Eo *obj, Efl_Ui_List_Data *pd)
1019{ 1307{
1308 Efl_Ui_List_Pan_Data *pan_data;
1309 Eina_Size2D min = {};
1310 Eina_Bool bounce = _elm_config->thumbscroll_bounce_enable;
1311
1312 obj = efl_finalize(efl_super(obj, MY_CLASS));
1313
1314 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1315 elm_widget_sub_object_parent_add(obj);
1316
1317 elm_widget_can_focus_set(obj, EINA_TRUE);
1318 elm_widget_on_show_region_hook_set(obj, NULL, _show_region_hook, NULL);
1319
1320 if (!elm_layout_theme_set(obj, "list", "base", elm_widget_style_get(obj)))
1321 CRI("Failed to set layout!");
1322
1323 pd->scrl_mgr = efl_add(EFL_UI_SCROLL_MANAGER_CLASS, obj,
1324 efl_ui_scroll_manager_mirrored_set(efl_added, efl_ui_mirrored_get(obj)));
1325 pd->pan_obj = efl_add(MY_PAN_CLASS, obj);
1326 pan_data = efl_data_scope_get(pd->pan_obj, MY_PAN_CLASS);
1327 pan_data->wobj = obj;
1328
1329 efl_ui_scroll_manager_pan_set(pd->scrl_mgr, pd->pan_obj);
1330 efl_ui_scrollable_bounce_enabled_set(pd->scrl_mgr, bounce, bounce);
1331
1332 edje_object_part_swallow(wd->resize_obj, "elm.swallow.content", pd->pan_obj);
1333 efl_gfx_stack_raise(edje_object_part_object_get(wd->resize_obj, "elm.dragable.vbar"));
1334 //efl_gfx_stack_raise(edje_object_part_object_get(wd->resize_obj, "elm.dragable.hbar"));
1335
1336 //pd->EFL_UI_LIST_COMPRESS_ITEM;
1337 //pd->mode = ELM_LIST_COMPRESS;
1338
1339 efl_gfx_visible_set(pd->pan_obj, EINA_TRUE);
1340
1341 edje_object_size_min_calc(wd->resize_obj, &min.w, &min.h);
1342 efl_gfx_size_hint_restricted_min_set(obj, min);
1343
1344 efl_event_callback_add(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
1345 efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SIZE_CHANGED,
1346 _efl_ui_list_bar_size_changed_cb, obj);
1347 efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_POS_CHANGED,
1348 _efl_ui_list_bar_pos_changed_cb, obj);
1349 efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_SHOW,
1350 _efl_ui_list_bar_show_cb, obj);
1351 efl_event_callback_add(obj, EFL_UI_SCROLLBAR_EVENT_BAR_HIDE,
1352 _efl_ui_list_bar_hide_cb, obj);
1353
1354 _efl_ui_list_edje_object_attach(obj);
1355
1356 elm_layout_sizing_eval(obj);
1357
1020 if(!pd->relayout) 1358 if(!pd->relayout)
1021 { 1359 {
1022 pd->relayout = efl_add(EFL_UI_LIST_PRECISE_LAYOUTER_CLASS, obj); 1360 pd->relayout = efl_add(EFL_UI_LIST_PRECISE_LAYOUTER_CLASS, obj);
1023 efl_ui_list_relayout_model_set(pd->relayout, pd->model); 1361 efl_ui_list_relayout_model_set(pd->relayout, pd->model);
1024 } 1362 }
1363
1025 return obj; 1364 return obj;
1026} 1365}
1027 1366
@@ -1034,11 +1373,11 @@ _efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd)
1034 pd->obj = obj; 1373 pd->obj = obj;
1035 efl_canvas_object_type_set(obj, MY_CLASS_NAME); 1374 efl_canvas_object_type_set(obj, MY_CLASS_NAME);
1036 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); 1375 evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks);
1037 elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_LIST); 1376 //elm_interface_atspi_accessible_role_set(obj, ELM_ATSPI_ROLE_LIST);
1038 1377
1039 efl_ui_list_segarray_setup(&pd->segarray, 32); 1378 efl_ui_list_segarray_setup(&pd->segarray, 32);
1040 1379
1041 manager = elm_obj_widget_focus_manager_create(obj, obj); 1380 manager = efl_ui_widget_focus_manager_create(obj, obj);
1042 efl_composite_attach(obj, manager); 1381 efl_composite_attach(obj, manager);
1043 _efl_ui_focus_manager_redirect_events_add(manager, obj); 1382 _efl_ui_focus_manager_redirect_events_add(manager, obj);
1044 1383
@@ -1060,6 +1399,13 @@ _efl_ui_list_efl_object_destructor(Eo *obj, Efl_Ui_List_Data *pd)
1060 efl_unref(pd->model); 1399 efl_unref(pd->model);
1061 eina_stringshare_del(pd->style); 1400 eina_stringshare_del(pd->style);
1062 1401
1402 //_efl_ui_list_children_free(obj, pd);
1403 efl_event_callback_del(obj, EFL_UI_EVENT_SCROLL, _scroll_cb, obj);
1404 _efl_ui_list_edje_object_detach(obj);
1405
1406 ELM_SAFE_FREE(pd->pan_obj, evas_object_del);
1407 efl_canvas_group_del(efl_super(obj, MY_CLASS));
1408
1063 efl_destructor(efl_super(obj, MY_CLASS)); 1409 efl_destructor(efl_super(obj, MY_CLASS));
1064} 1410}
1065 1411
@@ -1141,18 +1487,17 @@ _efl_ui_list_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNUS
1141 return &atspi_actions[0]; 1487 return &atspi_actions[0];
1142} 1488}
1143 1489
1490/*
1144EOLIAN Eina_List* 1491EOLIAN Eina_List*
1145_efl_ui_list_elm_interface_atspi_accessible_children_get(Eo *obj, Efl_Ui_List_Data *pd) 1492_efl_ui_list_elm_interface_atspi_accessible_children_get(Eo *obj, Efl_Ui_List_Data *pd)
1146{ 1493{
1147 Efl_Ui_List_Item **litem; 1494 Efl_Ui_List_Item **litem;
1148 Eina_List *ret = NULL, *ret2 = NULL; 1495 Eina_List *ret = NULL, *ret2 = NULL;
1149 1496
1150 /* EINA_INARRAY_FOREACH(&pd->items.array, litem) */
1151 /* ret = eina_list_append(ret, (*litem)->layout); */
1152
1153 ret2 = elm_interface_atspi_accessible_children_get(efl_super(obj, MY_CLASS)); 1497 ret2 = elm_interface_atspi_accessible_children_get(efl_super(obj, MY_CLASS));
1154 return eina_list_merge(ret, ret2); 1498 return eina_list_merge(ret, ret2);
1155} 1499}
1500*/
1156 1501
1157EOLIAN int 1502EOLIAN int
1158_efl_ui_list_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd) 1503_efl_ui_list_efl_access_selection_selected_children_count_get(Eo *obj EINA_UNUSED, Efl_Ui_List_Data *pd)
@@ -1255,13 +1600,11 @@ _key_action_move(Evas_Object *obj, const char *params)
1255 EFL_UI_LIST_DATA_GET_OR_RETURN_VAL(obj, pd, EINA_FALSE); 1600 EFL_UI_LIST_DATA_GET_OR_RETURN_VAL(obj, pd, EINA_FALSE);
1256 const char *dir = params; 1601 const char *dir = params;
1257 1602
1258 Evas_Coord page_x, page_y; 1603 Eina_Position2D pos = {};
1259 Evas_Coord v_w, v_h; 1604 Eina_Rect vgmt = {};
1260 Evas_Coord x, y;
1261 1605
1262 elm_interface_scrollable_content_pos_get(obj, &x, &y); 1606 pos = efl_ui_scrollable_content_pos_get(pd->scrl_mgr);
1263 elm_interface_scrollable_page_size_get(obj, &page_x, &page_y); 1607 vgmt = efl_ui_scrollable_viewport_geometry_get(pd->scrl_mgr);
1264 elm_interface_scrollable_content_viewport_geometry_get(obj, NULL, NULL, &v_w, &v_h);
1265 1608
1266/* 1609/*
1267 Efl_Ui_List_Item *item = NULL; 1610 Efl_Ui_List_Item *item = NULL;
@@ -1280,53 +1623,18 @@ _key_action_move(Evas_Object *obj, const char *params)
1280 else if (!strcmp(dir, "first")) 1623 else if (!strcmp(dir, "first"))
1281 { 1624 {
1282 item = eina_list_data_get(pd->items); 1625 item = eina_list_data_get(pd->items);
1283 x = 0; 1626 pos.x = 0;
1284 y = 0; 1627 pos.y = 0;
1285 elm_widget_focus_next_object_set(obj, item->layout, ELM_FOCUS_UP); 1628 elm_widget_focus_next_object_set(obj, item->layout, ELM_FOCUS_UP);
1286 } 1629 }
1287 else if (!strcmp(dir, "last")) 1630 else if (!strcmp(dir, "last"))
1288 { 1631 {
1289 item = eina_list_data_get(eina_list_last(pd->items)); 1632 item = eina_list_data_get(eina_list_last(pd->items));
1290 elm_obj_pan_pos_max_get(pd->pan.obj, &x, &y); 1633 //elm_obj_pan_pos_max_get(pd->pan.obj, &pos.x, &y);
1291 }
1292 else */
1293 if (!strcmp(dir, "prior"))
1294 {
1295 if (_horiz(pd->orient))
1296 {
1297 if (page_x < 0)
1298 x -= -(page_x * v_w) / 100;
1299 else
1300 x -= page_x;
1301 }
1302 else
1303 {
1304 if (page_y < 0)
1305 y -= -(page_y * v_h) / 100;
1306 else
1307 y -= page_y;
1308 }
1309 }
1310 else if (!strcmp(dir, "next"))
1311 {
1312 if (_horiz(pd->orient))
1313 {
1314 if (page_x < 0)
1315 x += -(page_x * v_w) / 100;
1316 else
1317 x += page_x;
1318 }
1319 else
1320 {
1321 if (page_y < 0)
1322 y += -(page_y * v_h) / 100;
1323 else
1324 y += page_y;
1325 }
1326 } 1634 }
1327 else return EINA_FALSE; 1635 else */return EINA_FALSE;
1328 1636
1329 elm_interface_scrollable_content_pos_set(obj, x, y, EINA_TRUE); 1637 efl_ui_scrollable_content_pos_set(pd->scrl_mgr, pos);
1330 return EINA_TRUE; 1638 return EINA_TRUE;
1331} 1639}
1332 1640
@@ -1467,7 +1775,7 @@ _efl_ui_list_efl_ui_list_model_min_size_set(Eo *obj, Efl_Ui_List_Data *pd, Eina_
1467 pd->min.h = min.h; 1775 pd->min.h = min.h;
1468 1776
1469 evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h); 1777 evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h);
1470 efl_event_callback_legacy_call(pd->pan_obj, ELM_PAN_EVENT_CHANGED, NULL); 1778 efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL);
1471} 1779}
1472 1780
1473EOLIAN static Efl_Ui_List_LayoutItem * 1781EOLIAN static Efl_Ui_List_LayoutItem *
@@ -1626,7 +1934,7 @@ _efl_ui_list_efl_ui_list_model_size_get(Eo *obj, Efl_Ui_List_Data *pd)
1626 1934
1627/* count = eina_inarray_count(&pd->items.array); */ 1935/* count = eina_inarray_count(&pd->items.array); */
1628 1936
1629/* elm_interface_scrollable_content_viewport_geometry_get */ 1937/* efl_ui_scrollable_content_viewport_geometry_get */
1630/* (ui_list, NULL, NULL, &ow, &oh); */ 1938/* (ui_list, NULL, NULL, &ow, &oh); */
1631/* // box outer margin */ 1939/* // box outer margin */
1632/* boxw -= boxl + boxr; */ 1940/* boxw -= boxl + boxr; */
@@ -1677,7 +1985,7 @@ _efl_ui_list_efl_ui_list_model_size_get(Eo *obj, Efl_Ui_List_Data *pd)
1677/* pd->minw = minw; */ 1985/* pd->minw = minw; */
1678/* pd->minh = minh; */ 1986/* pd->minh = minh; */
1679 1987
1680/* efl_event_callback_legacy_call(pd->pan.obj, ELM_PAN_EVENT_CHANGED, NULL); */ 1988/* efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_CONTENT_CHANGED, NULL);*/
1681/* } */ 1989/* } */
1682 1990
1683/* evas_object_size_hint_min_set(wd->resize_obj, pd->minw, pd->minh); */ 1991/* evas_object_size_hint_min_set(wd->resize_obj, pd->minw, pd->minh); */
diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo
index 776d36717f..32cd7830aa 100644
--- a/src/lib/elementary/efl_ui_list.eo
+++ b/src/lib/elementary/efl_ui_list.eo
@@ -5,7 +5,7 @@ struct Efl.Ui.List.Item_Event
5 index: int; 5 index: int;
6} 6}
7 7
8class Efl.Ui.List (Efl.Ui.Layout, Efl.Ui.View, Elm.Interface_Scrollable, 8class Efl.Ui.List (Efl.Ui.Layout, Efl.Ui.View, Efl.Ui.Scrollable.Interactive, Efl.Ui.Scrollbar,
9 Elm.Interface.Atspi_Widget_Action, Efl.Access.Selection, 9 Elm.Interface.Atspi_Widget_Action, Efl.Access.Selection,
10 Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.List.Model) 10 Efl.Ui.Clickable, Efl.Ui.Selectable, Efl.Ui.List.Model)
11{ 11{
@@ -91,8 +91,12 @@ class Efl.Ui.List (Efl.Ui.Layout, Efl.Ui.View, Elm.Interface_Scrollable,
91 //Efl.Ui.Layout.sizing_eval; 91 //Efl.Ui.Layout.sizing_eval;
92 Efl.Ui.View.model { get; set; } 92 Efl.Ui.View.model { get; set; }
93 93
94 Elm.Interface_Scrollable.region_bring_in; 94 Efl.Ui.Scrollable.Interactive.viewport_geometry { get; }
95 Elm.Interface.Atspi_Accessible.children { get; } 95 Efl.Ui.Scrollable.Interactive.content_pos { get; set; }
96 Efl.Ui.Scrollable.Interactive.content_size { get; }
97 //Efl.Ui.Scrollable.Interactive.scroll;
98 Efl.Canvas.Layout_Signal.signal_callback_add;
99 Efl.Canvas.Layout_Signal.signal_callback_del;
96 Elm.Interface.Atspi_Widget_Action.elm_actions { get; } 100 Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
97 Efl.Access.Selection.selected_children_count { get; } 101 Efl.Access.Selection.selected_children_count { get; }
98 Efl.Access.Selection.selected_child { get; } 102 Efl.Access.Selection.selected_child { get; }
diff --git a/src/lib/elementary/efl_ui_list_pan.eo b/src/lib/elementary/efl_ui_list_pan.eo
index 7bbb176666..eccc974222 100644
--- a/src/lib/elementary/efl_ui_list_pan.eo
+++ b/src/lib/elementary/efl_ui_list_pan.eo
@@ -1,12 +1,12 @@
1class Efl.Ui.List.Pan (Elm.Pan) 1class Efl.Ui.List.Pan (Efl.Ui.Pan)
2{ 2{
3 [[Elementary Efl_Ui_List pan class]] 3 [[Elementary Efl_Ui_List pan class]]
4 implements { 4 implements {
5 Efl.Object.destructor; 5 Efl.Object.destructor;
6 Elm.Pan.content_size { get; } 6 Efl.Ui.Pan.content_size { get; }
7 Elm.Pan.pos { get; set; } 7 Efl.Ui.Pan.position { get; set; }
8 Elm.Pan.pos_min { get; } 8 Efl.Ui.Pan.position_min { get; }
9 Elm.Pan.pos_max { get; } 9 Efl.Ui.Pan.position_max { get; }
10 Efl.Canvas.Group.group_calculate; 10 Efl.Canvas.Group.group_calculate;
11 } 11 }
12 events { 12 events {
diff --git a/src/lib/elementary/efl_ui_list_precise_layouter.c b/src/lib/elementary/efl_ui_list_precise_layouter.c
index 53d5b1bba6..a7cbf15da6 100644
--- a/src/lib/elementary/efl_ui_list_precise_layouter.c
+++ b/src/lib/elementary/efl_ui_list_precise_layouter.c
@@ -273,24 +273,25 @@ static void
273_calc_range(Efl_Ui_List_Precise_Layouter_Data *pd) 273_calc_range(Efl_Ui_List_Precise_Layouter_Data *pd)
274{ 274{
275 Efl_Ui_List_SegArray_Node *node; 275 Efl_Ui_List_SegArray_Node *node;
276 Evas_Coord ow, oh, scr_x, scr_y, ch; 276 Evas_Coord ch;
277 Eina_Rect vgmt;
278 Eina_Position2D spos;
277 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata; 279 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata;
278 int i; 280 int i;
279 281
280 elm_interface_scrollable_content_viewport_geometry_get 282 vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
281 (pd->modeler, NULL, NULL, &ow, &oh); 283 spos = efl_ui_scrollable_content_pos_get(pd->modeler);
282 elm_interface_scrollable_content_pos_get(pd->modeler, &scr_x, &scr_y);
283 284
284 ch = 0; 285 ch = 0;
285 Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray); 286 Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
286 EINA_ACCESSOR_FOREACH(nodes, i, node) 287 EINA_ACCESSOR_FOREACH(nodes, i, node)
287 { 288 {
288 nodedata = node->layout_data; 289 nodedata = node->layout_data;
289// DBG("node %d h:%d ch:%d scr_y:%d oh:%d", node->first, nodedata->min.h, ch, scr_y, oh); 290// DBG("node %d h:%d ch:%d spos.y:%d vgmt.h:%d", node->first, nodedata->min.h, ch, spos.y, vgmt.h);
290 if (!nodedata || !nodedata->min.h) 291 if (!nodedata || !nodedata->min.h)
291 continue; 292 continue;
292 293
293 if ((ch >= scr_y || nodedata->min.h + ch >= scr_y) && (ch <= (scr_y + oh) || nodedata->min.h + ch <= scr_y + oh)) 294 if ((ch >= spos.y || nodedata->min.h + ch >= spos.y) && (ch <= (spos.y + vgmt.h) || nodedata->min.h + ch <= spos.y + vgmt.h))
294 _node_realize(pd, node); 295 _node_realize(pd, node);
295 else 296 else
296 _node_unrealize(pd, node); 297 _node_unrealize(pd, node);
@@ -413,7 +414,9 @@ static void
413_efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd) 414_efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
414{ 415{
415 Eina_Bool horiz = EINA_FALSE/*_horiz(pd->orient)*/, zeroweight = EINA_FALSE; 416 Eina_Bool horiz = EINA_FALSE/*_horiz(pd->orient)*/, zeroweight = EINA_FALSE;
416 Evas_Coord ow, oh, want, scr_x, scr_y; 417 Evas_Coord want;
418 Eina_Rect vgmt;
419 Eina_Position2D spos;
417 int boxx, boxy, boxw, boxh, length, pad, extra = 0, rounding = 0; 420 int boxx, boxy, boxw, boxh, length, pad, extra = 0, rounding = 0;
418 int boxl = 0, boxr = 0, boxt = 0, boxb = 0; 421 int boxl = 0, boxr = 0, boxt = 0, boxb = 0;
419 double cur_pos = 0, scale, box_align[2], weight[2] = { 0, 0 }; 422 double cur_pos = 0, scale, box_align[2], weight[2] = { 0, 0 };
@@ -492,19 +495,17 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
492 weight[!horiz] = pd->count; 495 weight[!horiz] = pd->count;
493 } 496 }
494 497
495 elm_interface_scrollable_content_viewport_geometry_get 498 vgmt = efl_ui_scrollable_viewport_geometry_get(pd->modeler);
496 (pd->modeler, NULL, NULL, &ow, &oh); 499 spos = efl_ui_scrollable_content_pos_get(pd->modeler);
497 500
498 elm_interface_scrollable_content_pos_get(pd->modeler, &scr_x, &scr_y); 501 DBG("spos.x: %d, spos.y: %d\n", (int)spos.x, (int)spos.y);
499 502
500 DBG("scr_x: %d, scr_y: %d\n", (int)scr_x, (int)scr_y);
501
502 // scan all items, get their properties, calculate total weight & min size 503 // scan all items, get their properties, calculate total weight & min size
503 // cache size of new items 504 // cache size of new items
504 Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray); 505 Eina_Accessor *nodes = efl_ui_list_segarray_node_accessor_get(pd->segarray);
505 506
506 /* int sum_node_top = 0; */ 507 /* int sum_node_top = 0; */
507 508
508 EINA_ACCESSOR_FOREACH(nodes, i, items_node) 509 EINA_ACCESSOR_FOREACH(nodes, i, items_node)
509 { 510 {
510 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = items_node->layout_data; 511 Efl_Ui_List_Precise_Layouter_Node_Data *nodedata = items_node->layout_data;
@@ -517,12 +518,12 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
517 /* int start_pos = ; */ 518 /* int start_pos = ; */
518 /* if(start_pos < 0) */ 519 /* if(start_pos < 0) */
519 /* start_pos = 0; */ 520 /* start_pos = 0; */
520 if(scr_y < cur_pos + nodedata->min.h + boxh 521 if(spos.y < cur_pos + nodedata->min.h + boxh
521 && scr_y + boxh + boxh > cur_pos) // start in this node 522 && spos.y + boxh + boxh > cur_pos) // start in this node
522 { 523 {
523 DBG("cur_pos: %d\n", (int)cur_pos); 524 DBG("cur_pos: %d\n", (int)cur_pos);
524 525
525 for(j = 0; j != items_node->length && scr_y + boxh + boxh > cur_pos;++j) 526 for(j = 0; j != items_node->length && spos.y + boxh + boxh > cur_pos;++j)
526 { 527 {
527 DBG("cur_pos item by item: %d\n", (int)cur_pos); 528 DBG("cur_pos item by item: %d\n", (int)cur_pos);
528 layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[j]; 529 layout_item = (Efl_Ui_List_LayoutItem *)items_node->pointers[j];
@@ -629,19 +630,19 @@ _efl_ui_list_relayout_layout_do(Efl_Ui_List_Precise_Layouter_Data *pd)
629 if (horiz) 630 if (horiz)
630 { 631 {
631 if (h < pd->min.h) h = pd->min.h; 632 if (h < pd->min.h) h = pd->min.h;
632 if (h > oh) h = oh; 633 if (h > vgmt.h) h = vgmt.h;
633 } 634 }
634 else 635 else
635 { 636 {
636 if (w < pd->min.w) w = pd->min.w; 637 if (w < pd->min.w) w = pd->min.w;
637 if (w > ow) w = ow; 638 if (w > vgmt.w) w = vgmt.w;
638 } 639 }
639 640
640 // DBG("------- x=%0.f, y=%0.f, w=%0.f, h=%0.f --- ", x, y, w, h); 641 // DBG("------- x=%0.f, y=%0.f, w=%0.f, h=%0.f --- ", x, y, w, h);
641 evas_object_geometry_set(layout_item->layout, (x + 0 - scr_x), (y + 0 - scr_y), w, h); 642 evas_object_geometry_set(layout_item->layout, (x + 0 - spos.x), (y + 0 - spos.y), w, h);
642 643
643 // layout_item->x = x; 644 // layout_item->x = x;
644 // layout_item->y = y; 645 // layout_item->y = y;
645 646
646 } /* if (size) end */ 647 } /* if (size) end */
647 } 648 }
diff --git a/src/lib/elementary/efl_ui_list_private.h b/src/lib/elementary/efl_ui_list_private.h
index 7c4d2541ea..dc1f7fdd7b 100644
--- a/src/lib/elementary/efl_ui_list_private.h
+++ b/src/lib/elementary/efl_ui_list_private.h
@@ -36,7 +36,8 @@ typedef struct _Efl_Ui_List_Data Efl_Ui_List_Data;
36struct _Efl_Ui_List_Data 36struct _Efl_Ui_List_Data
37{ 37{
38 Eo *obj; 38 Eo *obj;
39 Evas_Object *hit_rect; 39 Eo *scrl_mgr;
40 Efl_Ui_List_Pan *pan_obj;
40 Efl_Model *model; 41 Efl_Model *model;
41 42
42 Efl_Orient orient; 43 Efl_Orient orient;
@@ -63,8 +64,6 @@ struct _Efl_Ui_List_Data
63 int segarray_first; 64 int segarray_first;
64 Efl_Ui_List_SegArray segarray; 65 Efl_Ui_List_SegArray segarray;
65 66
66 Evas_Object *pan_obj;
67
68 Efl_Ui_Layout_Factory *factory; 67 Efl_Ui_Layout_Factory *factory;
69 Eina_List *selected_items; 68 Eina_List *selected_items;
70 // struct { 69 // struct {
@@ -75,6 +74,7 @@ struct _Efl_Ui_List_Data
75 Elm_List_Mode mode; 74 Elm_List_Mode mode;
76 75
77 Efl_Ui_Focus_Manager *manager; 76 Efl_Ui_Focus_Manager *manager;
77 Eina_Rect gmt;
78 Eina_Size2D min; 78 Eina_Size2D min;
79 int /*average_item_size, avsom, */item_count; 79 int /*average_item_size, avsom, */item_count;
80 Efl_Future *slice_future; 80 Efl_Future *slice_future;
@@ -88,6 +88,7 @@ struct _Efl_Ui_List_Data
88 Eina_Bool homogeneous : 1; 88 Eina_Bool homogeneous : 1;
89 Eina_Bool recalc : 1; 89 Eina_Bool recalc : 1;
90 Eina_Bool on_hold : 1; 90 Eina_Bool on_hold : 1;
91 Eina_Bool freeze_want : 1;
91}; 92};
92 93
93typedef struct _Efl_Ui_List_Pan_Data Efl_Ui_List_Pan_Data; 94typedef struct _Efl_Ui_List_Pan_Data Efl_Ui_List_Pan_Data;
@@ -95,7 +96,8 @@ typedef struct _Efl_Ui_List_Pan_Data Efl_Ui_List_Pan_Data;
95struct _Efl_Ui_List_Pan_Data 96struct _Efl_Ui_List_Pan_Data
96{ 97{
97 Eo *wobj; 98 Eo *wobj;
98 Evas_Coord x, y, move_diff; 99 Eina_Rect gmt;
100 Evas_Coord move_diff;
99 101
100 Ecore_Job *resize_job; 102 Ecore_Job *resize_job;
101}; 103};