summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-10-24 18:34:36 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-21 14:01:48 +0900
commit47c306a58b7670a00b2e7cb59427a9cdbf7aa1d6 (patch)
tree1ec87c3acdd7608391ada876c2d652a3375ab3b8
parent9e9f04bad30fba8bc66c92f8cb1f8e898a386ea0 (diff)
efl_ui_popup: Code refactoring to replace legacy APIs
-rw-r--r--src/lib/elementary/efl_ui_popup.c139
-rw-r--r--src/lib/elementary/efl_ui_popup.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.c73
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.c87
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll_private.h13
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.c31
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text_private.h6
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.c251
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor_private.h2
-rw-r--r--src/lib/elementary/efl_ui_popup_private.h10
14 files changed, 285 insertions, 332 deletions
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index dc23b28b6a..6f225da034 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -11,16 +11,15 @@
11 11
12#define MY_CLASS EFL_UI_POPUP_CLASS 12#define MY_CLASS EFL_UI_POPUP_CLASS
13#define MY_CLASS_NAME "Efl.Ui.Popup" 13#define MY_CLASS_NAME "Efl.Ui.Popup"
14#define MY_CLASS_NAME_LEGACY "elm_popup"
15 14
16static void 15static void
17_bg_clicked_cb(void *data, 16_bg_clicked_cb(void *data,
18 Evas_Object *o EINA_UNUSED, 17 Eo *o EINA_UNUSED,
19 const char *emission EINA_UNUSED, 18 const char *emission EINA_UNUSED,
20 const char *source EINA_UNUSED) 19 const char *source EINA_UNUSED)
21{ 20{
22 Evas_Object *obj = data; 21 Eo *obj = data;
23 efl_event_callback_legacy_call(obj, EFL_UI_POPUP_EVENT_BG_CLICKED, NULL); 22 efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BG_CLICKED, NULL);
24} 23}
25 24
26EOLIAN static void 25EOLIAN static void
@@ -31,41 +30,44 @@ _efl_ui_popup_efl_gfx_position_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, E
31} 30}
32 31
33static void 32static void
34_calc_align(Evas_Object *obj) 33_calc_align(Eo *obj)
35{ 34{
36 Efl_Ui_Popup_Data *pd = efl_data_scope_get(obj, MY_CLASS); 35 Efl_Ui_Popup_Data *pd = efl_data_scope_get(obj, MY_CLASS);
37 36
38 Evas_Coord x, y, w, h; 37 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
39 evas_object_geometry_get(pd->win_parent, &x, &y, &w, &h);
40 38
41 x = 0; 39 efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(0, 0));
42 y = 0; 40 efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h));
43 41
44 evas_object_move(pd->event_bg, x, y); 42 Eina_Rect o_geom = efl_gfx_geometry_get(obj);
45 evas_object_resize(pd->event_bg, w, h);
46 43
47 Evas_Coord pw, ph; 44 Evas_Coord pw, ph;
48 evas_object_geometry_get(obj, NULL, NULL, &pw, &ph); 45 pw = p_geom.w;
46 ph = p_geom.h;
47
48 Evas_Coord ow, oh;
49 ow = o_geom.w;
50 oh = o_geom.h;
49 51
50 switch (pd->align) 52 switch (pd->align)
51 { 53 {
52 case EFL_UI_POPUP_ALIGN_CENTER: 54 case EFL_UI_POPUP_ALIGN_CENTER:
53 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw ) / 2), y + ((h - ph) / 2))); 55 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow ) / 2, (ph - oh) / 2));
54 break; 56 break;
55 case EFL_UI_POPUP_ALIGN_LEFT: 57 case EFL_UI_POPUP_ALIGN_LEFT:
56 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x, y + ((h - ph) / 2))); 58 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(0, (ph - oh) / 2));
57 break; 59 break;
58 case EFL_UI_POPUP_ALIGN_RIGHT: 60 case EFL_UI_POPUP_ALIGN_RIGHT:
59 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + (w - pw), ((h - ph) / 2))); 61 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(pw - ow, (ph - oh) / 2));
60 break; 62 break;
61 case EFL_UI_POPUP_ALIGN_TOP: 63 case EFL_UI_POPUP_ALIGN_TOP:
62 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw) / 2), y)); 64 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, 0));
63 break; 65 break;
64 case EFL_UI_POPUP_ALIGN_BOTTOM: 66 case EFL_UI_POPUP_ALIGN_BOTTOM:
65 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D(x + ((w - pw) / 2), y + (h - ph))); 67 efl_gfx_position_set(efl_super(obj, MY_CLASS), EINA_POSITION2D((pw - ow) / 2, ph - oh));
66 break; 68 break;
67 default: 69 default:
68 break; 70 break;
69 } 71 }
70} 72}
71 73
@@ -76,9 +78,8 @@ _parent_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED)
76} 78}
77 79
78EOLIAN static void 80EOLIAN static void
79_efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Evas_Object *parent EINA_UNUSED) 81_efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent EINA_UNUSED)
80{ 82{
81 Evas_Coord x, y, w, h;
82 pd->win_parent = efl_provider_find(obj, EFL_UI_WIN_CLASS); 83 pd->win_parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
83 if (!pd->win_parent) 84 if (!pd->win_parent)
84 { 85 {
@@ -86,27 +87,28 @@ _efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_U
86 return; 87 return;
87 } 88 }
88 89
89 evas_object_geometry_get(pd->win_parent, &x, &y, &w, &h); 90 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
90 evas_object_move(pd->event_bg, x, y); 91
91 evas_object_resize(pd->event_bg, w, h); 92 efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(p_geom.x, p_geom.y));
93 efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h));
92 94
93 efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj); 95 efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
94 efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj); 96 efl_event_callback_add(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
95} 97}
96 98
97EOLIAN static Eina_Bool 99EOLIAN static Eina_Bool
98_efl_ui_popup_efl_container_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Evas_Object *content) 100_efl_ui_popup_efl_container_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *content)
99{ 101{
100 return efl_content_set(efl_part(obj, "elm.swallow.content"), content); 102 return efl_content_set(efl_part(obj, "elm.swallow.content"), content);
101} 103}
102 104
103EOLIAN static Evas_Object* 105EOLIAN static Eo*
104_efl_ui_popup_efl_container_content_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED) 106_efl_ui_popup_efl_container_content_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
105{ 107{
106 return efl_content_get(efl_part(obj, "elm.swallow.content")); 108 return efl_content_get(efl_part(obj, "elm.swallow.content"));
107} 109}
108 110
109EOLIAN static Evas_Object* 111EOLIAN static Eo*
110_efl_ui_popup_efl_container_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED) 112_efl_ui_popup_efl_container_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
111{ 113{
112 return efl_content_unset(efl_part(obj, "elm.swallow.content")); 114 return efl_content_unset(efl_part(obj, "elm.swallow.content"));
@@ -128,8 +130,8 @@ _efl_ui_popup_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
128static Eina_Bool 130static Eina_Bool
129_timer_cb(void *data) 131_timer_cb(void *data)
130{ 132{
131 Evas_Object *popup = data; 133 Eo *popup = data;
132 evas_object_del(popup); 134 efl_del(popup);
133 135
134 return ECORE_CALLBACK_CANCEL; 136 return ECORE_CALLBACK_CANCEL;
135} 137}
@@ -210,7 +212,7 @@ _efl_ui_popup_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Data *pd)
210EOLIAN static void 212EOLIAN static void
211_efl_ui_popup_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Data *pd) 213_efl_ui_popup_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Data *pd)
212{ 214{
213 ELM_SAFE_FREE(pd->event_bg, evas_object_del); 215 ELM_SAFE_DEL(pd->event_bg);
214 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj); 216 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
215 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj); 217 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
216 218
@@ -225,38 +227,35 @@ _efl_ui_popup_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
225 227
226 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 228 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
227 edje_object_size_min_restricted_calc 229 edje_object_size_min_restricted_calc
228 (wd->resize_obj, &minw, &minh, minw, minh); 230 (wd->resize_obj, &minw, &minh, minw, minh);
229 evas_object_size_hint_min_set(obj, minw, minh); 231 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
230 232
231 Evas_Coord w, h; 233 Eina_Size2D size = efl_gfx_size_get(obj);
232 evas_object_geometry_get(obj, NULL, NULL, &w, &h); 234
233 235 Eina_Size2D new_size;
234 if ((minw > w) && (minh < h)) 236 new_size.w = (minw > size.w ? minw : size.w);
235 evas_object_resize(obj, minw, h); 237 new_size.h = (minh > size.h ? minh : size.h);
236 else if ((minw < w) && (minh > h)) 238 efl_gfx_size_set(obj, new_size);
237 evas_object_resize(obj, w, minh);
238 else if ((minw >= w) && (minh >= h))
239 evas_object_resize(obj, minw, minh);
240} 239}
241 240
242EOLIAN static void 241EOLIAN static void
243_efl_ui_popup_bg_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const char* group) 242_efl_ui_popup_bg_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const char* group)
244{ 243{
245 Evas_Object *prev_obj = edje_object_part_swallow_get(pd->event_bg, "elm.swallow.image"); 244 Eo *prev_obj = edje_object_part_swallow_get(pd->event_bg, "elm.swallow.image");
246 if (prev_obj) 245 if (prev_obj)
247 { 246 {
248 edje_object_part_unswallow(pd->event_bg, prev_obj); 247 edje_object_part_unswallow(pd->event_bg, prev_obj);
249 evas_object_del(prev_obj); 248 efl_del(prev_obj);
250 } 249 }
251 250
252 Evas_Object *image = elm_image_add(obj); 251 Eo *image = elm_image_add(obj);
253 Eina_Bool ret = elm_image_file_set(image, file, group); 252 Eina_Bool ret = elm_image_file_set(image, file, group);
254 if (!ret) 253 if (!ret)
255 { 254 {
256 edje_object_signal_emit(pd->event_bg, "elm,state,image,hidden", "elm"); 255 edje_object_signal_emit(pd->event_bg, "elm,state,image,hidden", "elm");
257 evas_object_del(image); 256 efl_del(image);
258 return; 257 return;
259 } 258 }
260 edje_object_part_swallow(pd->event_bg, "elm.swallow.image", image); 259 edje_object_part_swallow(pd->event_bg, "elm.swallow.image", image);
261 edje_object_signal_emit(pd->event_bg, "elm,state,image,visible", "elm"); 260 edje_object_signal_emit(pd->event_bg, "elm,state,image,visible", "elm");
262} 261}
@@ -266,19 +265,13 @@ _efl_ui_popup_bg_repeat_events_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, E
266{ 265{
267 pd->bg_repeat_events = repeat; 266 pd->bg_repeat_events = repeat;
268 267
269 evas_object_repeat_events_set(pd->event_bg, repeat); 268 efl_canvas_object_repeat_events_set(pd->event_bg, repeat);
270} 269}
271 270
272EOLIAN static Eina_Bool 271EOLIAN static Eina_Bool
273_efl_ui_popup_bg_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd) 272_efl_ui_popup_bg_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
274{ 273{
275 return pd->bg_repeat_events; 274 return pd->bg_repeat_events;
276}
277
278EOLIAN static void
279_efl_ui_popup_class_constructor(Efl_Class *klass)
280{
281 evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
282} 275}
283 276
284/* Internal EO APIs and hidden overrides */ 277/* Internal EO APIs and hidden overrides */
diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo
index 7af22ae33f..cf70162e84 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -57,7 +57,6 @@ class Efl.Ui.Popup(Efl.Ui.Layout)
57 } 57 }
58 } 58 }
59 implements { 59 implements {
60 class.constructor;
61 Efl.Gfx.position { set; } 60 Efl.Gfx.position { set; }
62 Efl.Gfx.visible { set; } 61 Efl.Gfx.visible { set; }
63 Elm.Widget.widget_parent { set; } 62 Elm.Widget.widget_parent { set; }
diff --git a/src/lib/elementary/efl_ui_popup_alert.c b/src/lib/elementary/efl_ui_popup_alert.c
index 2b38d34ba3..64d1ff6b92 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -22,11 +22,8 @@ _efl_ui_popup_alert_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Data *pd
22 22
23 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 23 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
24 edje_object_size_min_restricted_calc 24 edje_object_size_min_restricted_calc
25 (wd->resize_obj, &minw, &minh, minw, minh); 25 (wd->resize_obj, &minw, &minh, minw, minh);
26 evas_object_size_hint_min_set(obj, minw, minh); 26 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
27
28 Evas_Coord w, h;
29 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
30} 27}
31 28
32static Eina_Bool 29static Eina_Bool
@@ -69,33 +66,33 @@ _efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, c
69} 66}
70 67
71static Eina_Bool 68static Eina_Bool
72_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part, Evas_Object *content) 69_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part, Eo *content)
73{ 70{
74 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content); 71 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
75} 72}
76 73
77Evas_Object * 74Eo *
78_efl_ui_popup_alert_content_get(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part) 75_efl_ui_popup_alert_content_get(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
79{ 76{
80 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part)); 77 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
81} 78}
82 79
83static Evas_Object * 80static Eo *
84_efl_ui_popup_alert_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part) 81_efl_ui_popup_alert_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
85{ 82{
86 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part)); 83 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
87} 84}
88 85
89static void 86static void
90_positive_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, 87_positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
91 void *event_info EINA_UNUSED) 88 void *event_info EINA_UNUSED)
92{ 89{
93 Eo *popup_obj = data; 90 Eo *popup_obj = data;
94 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE); 91 efl_event_callback_call(popup_obj, EFL_UI_POPUP_ALERT_EVENT_CLICKED, (void *)(uintptr_t)EFL_UI_POPUP_ALERT_BUTTON_POSITIVE);
95} 92}
96 93
97static void 94static void
98_negative_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, 95_negative_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
99 void *event_info EINA_UNUSED) 96 void *event_info EINA_UNUSED)
100{ 97{
101 Eo *popup_obj = data; 98 Eo *popup_obj = data;
@@ -103,7 +100,7 @@ _negative_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED,
103} 100}
104 101
105static void 102static void
106_user_button_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, 103_user_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
107 void *event_info EINA_UNUSED) 104 void *event_info EINA_UNUSED)
108{ 105{
109 Eo *popup_obj = data; 106 Eo *popup_obj = data;
@@ -115,7 +112,7 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
115{ 112{
116 if (pd->button[type]) 113 if (pd->button[type])
117 { 114 {
118 evas_object_del(pd->button[type]); 115 efl_del(pd->button[type]);
119 pd->button[type] = NULL; 116 pd->button[type] = NULL;
120 } 117 }
121 pd->button[type] = elm_button_add(obj); 118 pd->button[type] = elm_button_add(obj);
@@ -123,32 +120,32 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
123 120
124 switch (type) 121 switch (type)
125 { 122 {
126 case EFL_UI_POPUP_ALERT_BUTTON_POSITIVE: 123 case EFL_UI_POPUP_ALERT_BUTTON_POSITIVE:
127 evas_object_smart_callback_add(pd->button[type], "clicked", 124 evas_object_smart_callback_add(pd->button[type], "clicked",
128 _positive_button_clicked_cb, 125 _positive_button_clicked_cb,
129 obj); 126 obj);
130 break; 127 break;
131 case EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE: 128 case EFL_UI_POPUP_ALERT_BUTTON_NEGATIVE:
132 evas_object_smart_callback_add(pd->button[type], "clicked", 129 evas_object_smart_callback_add(pd->button[type], "clicked",
133 _negative_button_clicked_cb, 130 _negative_button_clicked_cb,
134 obj); 131 obj);
135 break; 132 break;
136 case EFL_UI_POPUP_ALERT_BUTTON_USER: 133 case EFL_UI_POPUP_ALERT_BUTTON_USER:
137 evas_object_smart_callback_add(pd->button[type], "clicked", 134 evas_object_smart_callback_add(pd->button[type], "clicked",
138 _user_button_clicked_cb, 135 _user_button_clicked_cb,
139 obj); 136 obj);
140 break; 137 break;
141 default: 138 default:
142 break; 139 break;
143 } 140 }
144 141
145 Evas_Object * cur_content = efl_content_unset(efl_part(obj, "buttons")); 142 Eo *cur_content = efl_content_unset(efl_part(obj, "buttons"));
146 if (cur_content) 143 if (cur_content)
147 { 144 {
148 efl_content_unset(efl_part(cur_content, "elm.swallow.button1")); 145 efl_content_unset(efl_part(cur_content, "elm.swallow.button1"));
149 efl_content_unset(efl_part(cur_content, "elm.swallow.button2")); 146 efl_content_unset(efl_part(cur_content, "elm.swallow.button2"));
150 efl_content_unset(efl_part(cur_content, "elm.swallow.button3")); 147 efl_content_unset(efl_part(cur_content, "elm.swallow.button3"));
151 evas_object_del(cur_content); 148 efl_del(cur_content);
152 } 149 }
153 150
154 if (pd->button[EFL_UI_POPUP_ALERT_BUTTON_POSITIVE] 151 if (pd->button[EFL_UI_POPUP_ALERT_BUTTON_POSITIVE]
@@ -211,8 +208,8 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
211 efl_content_set(efl_part(obj, "buttons"), pd->button_layout[EFL_UI_POPUP_ALERT_BUTTON_1]); 208 efl_content_set(efl_part(obj, "buttons"), pd->button_layout[EFL_UI_POPUP_ALERT_BUTTON_1]);
212 } 209 }
213 210
214 elm_layout_signal_emit(obj, "elm,buttons,show", "elm"); 211 elm_layout_signal_emit(obj, "elm,buttons,show", "elm");
215 elm_layout_sizing_eval(obj); 212 elm_layout_sizing_eval(obj);
216} 213}
217 214
218EOLIAN static void 215EOLIAN static void
@@ -238,12 +235,6 @@ _efl_ui_popup_alert_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_Data
238 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 235 efl_canvas_group_del(efl_super(obj, MY_CLASS));
239} 236}
240 237
241EOLIAN static void
242_efl_ui_popup_alert_class_constructor(Efl_Class *klass)
243{
244 evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
245}
246
247/* Efl.Part begin */ 238/* Efl.Part begin */
248 239
249ELM_PART_OVERRIDE(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data) 240ELM_PART_OVERRIDE(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
diff --git a/src/lib/elementary/efl_ui_popup_alert.eo b/src/lib/elementary/efl_ui_popup_alert.eo
index 27c9cc3828..8929e1729d 100644
--- a/src/lib/elementary/efl_ui_popup_alert.eo
+++ b/src/lib/elementary/efl_ui_popup_alert.eo
@@ -21,7 +21,6 @@ class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
21 } 21 }
22 } 22 }
23 implements { 23 implements {
24 class.constructor;
25 Efl.Part.part; 24 Efl.Part.part;
26 } 25 }
27 events { 26 events {
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index 290fc0fda2..7dc388bd97 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -13,53 +13,52 @@
13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll" 13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert.Scroll"
14 14
15static void 15static void
16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Evas_Coord minw, Evas_Coord minh) 16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D min)
17{ 17{
18 Evas_Coord w, h; 18 Eina_Rect geom = efl_gfx_geometry_get(obj);
19 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
20 19
21 pd->is_sizing_eval = EINA_TRUE; 20 pd->is_sizing_eval = EINA_TRUE;
22 21
23 if (pd->is_expandable_w && !pd->is_expandable_h) 22 if (pd->is_expandable_w && !pd->is_expandable_h)
24 { 23 {
25 if ((pd->max_scroll_w > -1) && (minw > pd->max_scroll_w)) 24 if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
26 { 25 {
27 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); 26 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
28 evas_object_resize(obj, pd->max_scroll_w, h); 27 efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
29 } 28 }
30 } 29 }
31 else if (!pd->is_expandable_w && pd->is_expandable_h) 30 else if (!pd->is_expandable_w && pd->is_expandable_h)
32 { 31 {
33 if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h)) 32 if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
34 { 33 {
35 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); 34 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
36 evas_object_resize(obj, w, pd->max_scroll_h); 35 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
37 } 36 }
38 } 37 }
39 else if (pd->is_expandable_w && pd->is_expandable_h) 38 else if (pd->is_expandable_w && pd->is_expandable_h)
40 { 39 {
41 Eina_Bool wdir, hdir; 40 Eina_Bool wdir, hdir;
42 wdir = hdir = EINA_FALSE; 41 wdir = hdir = EINA_FALSE;
43 42
44 if ((pd->max_scroll_w > -1) && (minw > pd->max_scroll_w)) 43 if ((pd->max_scroll.w > -1) && (min.w > pd->max_scroll.w))
45 wdir = 1; 44 wdir = 1;
46 if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h)) 45 if ((pd->max_scroll.h > -1) && (min.h > pd->max_scroll.h))
47 hdir = 1; 46 hdir = 1;
48 if (wdir && !hdir) 47 if (wdir && !hdir)
49 { 48 {
50 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE); 49 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_TRUE);
51 evas_object_resize(obj, pd->max_scroll_w, h); 50 efl_gfx_size_set(obj, EINA_SIZE2D(pd->max_scroll.w, geom.h));
52 } 51 }
53 else if (!wdir && hdir) 52 else if (!wdir && hdir)
54 { 53 {
55 elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE); 54 elm_scroller_content_min_limit(pd->scroller, EINA_TRUE, EINA_FALSE);
56 evas_object_resize(obj, w, pd->max_scroll_h); 55 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll.h));
57 } 56 }
58 else if(wdir && hdir) 57 else if(wdir && hdir)
59 { 58 {
60 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); 59 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
61 evas_object_resize(obj, pd->max_scroll_w, pd->max_scroll_h); 60 efl_gfx_size_set(obj, pd->max_scroll);
62 } 61 }
63 } 62 }
64 63
65 pd->is_sizing_eval = EINA_FALSE; 64 pd->is_sizing_eval = EINA_FALSE;
@@ -77,14 +76,14 @@ _efl_ui_popup_alert_scroll_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Sc
77 76
78 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 77 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
79 edje_object_size_min_restricted_calc 78 edje_object_size_min_restricted_calc
80 (wd->resize_obj, &minw, &minh, minw, minh); 79 (wd->resize_obj, &minw, &minh, minw, minh);
81 evas_object_size_hint_min_set(obj, minw, minh); 80 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
82 81
83 _scroller_sizing_eval(obj, pd, minw, minh); 82 _scroller_sizing_eval(obj, pd, EINA_SIZE2D(minw, minh));
84} 83}
85 84
86static Eina_Bool 85static Eina_Bool
87_efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part, Evas_Object *content) 86_efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part, Eo *content)
88{ 87{
89 //For efl_content_set() 88 //For efl_content_set()
90 if (part && !strcmp(part, "elm.swallow.content")) 89 if (part && !strcmp(part, "elm.swallow.content"))
@@ -92,8 +91,8 @@ _efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *
92 pd->content = content; 91 pd->content = content;
93 92
94 //Content should have expand propeties since the scroller is not layout layer 93 //Content should have expand propeties since the scroller is not layout layer
95 evas_object_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 94 efl_gfx_size_hint_weight_set(pd->content, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
96 evas_object_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL); 95 efl_gfx_size_hint_align_set(pd->content, EVAS_HINT_FILL, EVAS_HINT_FILL);
97 96
98 efl_content_set(efl_part(pd->scroller, "default"), pd->content); 97 efl_content_set(efl_part(pd->scroller, "default"), pd->content);
99 } 98 }
@@ -105,7 +104,7 @@ _efl_ui_popup_alert_scroll_content_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *
105 return EINA_TRUE; 104 return EINA_TRUE;
106} 105}
107 106
108Evas_Object * 107Eo *
109_efl_ui_popup_alert_scroll_content_get(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part) 108_efl_ui_popup_alert_scroll_content_get(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
110{ 109{
111 //For efl_content_set() 110 //For efl_content_set()
@@ -115,13 +114,13 @@ _efl_ui_popup_alert_scroll_content_get(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *
115 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part)); 114 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
116} 115}
117 116
118static Evas_Object * 117static Eo *
119_efl_ui_popup_alert_scroll_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part) 118_efl_ui_popup_alert_scroll_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, const char *part)
120{ 119{
121 //For efl_content_set() 120 //For efl_content_set()
122 if (part && !strcmp(part, "elm.swallow.content")) 121 if (part && !strcmp(part, "elm.swallow.content"))
123 { 122 {
124 Evas_Object *content = pd->content; 123 Eo *content = pd->content;
125 if (!content) return content; 124 if (!content) return content;
126 125
127 pd->content = NULL; 126 pd->content = NULL;
@@ -179,8 +178,7 @@ static void
179_efl_ui_popup_alert_scroll_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D size) 178_efl_ui_popup_alert_scroll_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd, Eina_Size2D size)
180{ 179{
181 efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), size); 180 efl_gfx_size_hint_max_set(efl_super(obj, MY_CLASS), size);
182 pd->max_scroll_w = size.w; 181 pd->max_scroll = size;
183 pd->max_scroll_h = size.h;
184 elm_layout_sizing_eval(obj); 182 elm_layout_sizing_eval(obj);
185} 183}
186 184
@@ -198,8 +196,7 @@ _efl_ui_popup_alert_scroll_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Aler
198 196
199 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), pd->scroller); 197 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), pd->scroller);
200 198
201 pd->max_scroll_w = -1; 199 pd->max_scroll = EINA_SIZE2D(-1, -1);
202 pd->max_scroll_h = -1;
203} 200}
204 201
205EOLIAN static void 202EOLIAN static void
@@ -208,12 +205,6 @@ _efl_ui_popup_alert_scroll_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Aler
208 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 205 efl_canvas_group_del(efl_super(obj, MY_CLASS));
209} 206}
210 207
211EOLIAN static void
212_efl_ui_popup_alert_scroll_class_constructor(Efl_Class *klass)
213{
214 evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
215}
216
217/* Efl.Part begin */ 208/* Efl.Part begin */
218 209
219ELM_PART_OVERRIDE(efl_ui_popup_alert_scroll, EFL_UI_POPUP_ALERT_SCROLL, Efl_Ui_Popup_Alert_Scroll_Data) 210ELM_PART_OVERRIDE(efl_ui_popup_alert_scroll, EFL_UI_POPUP_ALERT_SCROLL, Efl_Ui_Popup_Alert_Scroll_Data)
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.eo b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
index 00dadb3b54..69d3bbb9fe 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
@@ -17,7 +17,6 @@ class Efl.Ui.Popup.Alert.Scroll(Efl.Ui.Popup.Alert)
17 } 17 }
18 } 18 }
19 implements { 19 implements {
20 class.constructor;
21 Efl.Gfx.Size.Hint.hint_max { set; } 20 Efl.Gfx.Size.Hint.hint_max { set; }
22 Efl.Part.part; 21 Efl.Part.part;
23 } 22 }
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll_private.h b/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
index 3eb4005b97..99a000146a 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll_private.h
@@ -6,13 +6,12 @@
6typedef struct _Efl_Ui_Popup_Alert_Scroll_Data Efl_Ui_Popup_Alert_Scroll_Data; 6typedef struct _Efl_Ui_Popup_Alert_Scroll_Data Efl_Ui_Popup_Alert_Scroll_Data;
7struct _Efl_Ui_Popup_Alert_Scroll_Data 7struct _Efl_Ui_Popup_Alert_Scroll_Data
8{ 8{
9 Evas_Object *scroller; 9 Eo *scroller;
10 Evas_Object *content; 10 Eo *content;
11 Evas_Coord max_scroll_w; 11 Eina_Size2D max_scroll;
12 Evas_Coord max_scroll_h; 12 Eina_Bool is_expandable_w : 1;
13 Eina_Bool is_expandable_w; 13 Eina_Bool is_expandable_h : 1;
14 Eina_Bool is_expandable_h; 14 Eina_Bool is_sizing_eval : 1;
15 Eina_Bool is_sizing_eval;
16}; 15};
17 16
18#endif 17#endif
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.c b/src/lib/elementary/efl_ui_popup_alert_text.c
index 808aa7a8cb..e3acce5fbd 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.c
+++ b/src/lib/elementary/efl_ui_popup_alert_text.c
@@ -15,16 +15,15 @@
15static void 15static void
16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Evas_Coord minh) 16_scroller_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, Evas_Coord minh)
17{ 17{
18 Evas_Coord w, h; 18 Eina_Rect geom = efl_gfx_geometry_get(obj);
19 evas_object_geometry_get(obj, NULL, NULL, &w, &h);
20 19
21 if (pd->is_expandable_h) 20 if (pd->is_expandable_h)
22 { 21 {
23 if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h)) 22 if ((pd->max_scroll_h > -1) && (minh > pd->max_scroll_h))
24 { 23 {
25 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE); 24 elm_scroller_content_min_limit(pd->scroller, EINA_FALSE, EINA_FALSE);
26 evas_object_resize(obj, w, pd->max_scroll_h); 25 efl_gfx_size_set(obj, EINA_SIZE2D(geom.w, pd->max_scroll_h));
27 } 26 }
28 } 27 }
29} 28}
30 29
@@ -38,24 +37,24 @@ _efl_ui_popup_alert_text_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Text
38 37
39 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 38 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
40 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, minw, minh); 39 edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, minw, minh);
41 evas_object_size_hint_min_set(obj, minw, minh); 40 efl_gfx_size_hint_min_set(obj, EINA_SIZE2D(minw, minh));
42 41
43 _scroller_sizing_eval(obj, pd, minh); 42 _scroller_sizing_eval(obj, pd, minh);
44} 43}
45 44
46static Eina_Bool 45static Eina_Bool
47_efl_ui_popup_alert_text_content_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part, Evas_Object *content) 46_efl_ui_popup_alert_text_content_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part, Eo *content)
48{ 47{
49 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content); 48 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
50} 49}
51 50
52Evas_Object * 51Eo *
53_efl_ui_popup_alert_text_content_get(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part) 52_efl_ui_popup_alert_text_content_get(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part)
54{ 53{
55 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part)); 54 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
56} 55}
57 56
58static Evas_Object * 57static Eo *
59_efl_ui_popup_alert_text_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part) 58_efl_ui_popup_alert_text_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED, const char *part)
60{ 59{
61 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part)); 60 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
@@ -70,8 +69,8 @@ _efl_ui_popup_alert_text_text_set(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd, con
70 { 69 {
71 pd->message = elm_label_add(obj); 70 pd->message = elm_label_add(obj);
72 elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED); 71 elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED);
73 evas_object_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND, 72 efl_gfx_size_hint_weight_set(pd->message, EVAS_HINT_EXPAND,
74 EVAS_HINT_EXPAND); 73 EVAS_HINT_EXPAND);
75 efl_content_set(efl_part(pd->scroller, "default"), pd->message); 74 efl_content_set(efl_part(pd->scroller, "default"), pd->message);
76 } 75 }
77 elm_object_text_set(pd->message, label); 76 elm_object_text_set(pd->message, label);
@@ -155,12 +154,6 @@ _efl_ui_popup_alert_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_
155 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 154 efl_canvas_group_del(efl_super(obj, MY_CLASS));
156} 155}
157 156
158EOLIAN static void
159_efl_ui_popup_alert_text_class_constructor(Efl_Class *klass)
160{
161 evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
162}
163
164/* Efl.Part begin */ 157/* Efl.Part begin */
165 158
166ELM_PART_OVERRIDE(efl_ui_popup_alert_text, EFL_UI_POPUP_ALERT_TEXT, Efl_Ui_Popup_Alert_Text_Data) 159ELM_PART_OVERRIDE(efl_ui_popup_alert_text, EFL_UI_POPUP_ALERT_TEXT, Efl_Ui_Popup_Alert_Text_Data)
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.eo b/src/lib/elementary/efl_ui_popup_alert_text.eo
index 5c2539f8b1..988c727680 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_text.eo
@@ -16,7 +16,6 @@ class Efl.Ui.Popup.Alert.Text(Efl.Ui.Popup.Alert, Efl.Text)
16 } 16 }
17 } 17 }
18 implements { 18 implements {
19 class.constructor;
20 Efl.Gfx.Size.Hint.hint_max { set;} 19 Efl.Gfx.Size.Hint.hint_max { set;}
21 Efl.Text.text { get; set; } 20 Efl.Text.text { get; set; }
22 Efl.Part.part; 21 Efl.Part.part;
diff --git a/src/lib/elementary/efl_ui_popup_alert_text_private.h b/src/lib/elementary/efl_ui_popup_alert_text_private.h
index d15f1b8e2d..b911199b5d 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text_private.h
+++ b/src/lib/elementary/efl_ui_popup_alert_text_private.h
@@ -6,10 +6,10 @@
6typedef struct _Efl_Ui_Popup_Alert_Text_Data Efl_Ui_Popup_Alert_Text_Data; 6typedef struct _Efl_Ui_Popup_Alert_Text_Data Efl_Ui_Popup_Alert_Text_Data;
7struct _Efl_Ui_Popup_Alert_Text_Data 7struct _Efl_Ui_Popup_Alert_Text_Data
8{ 8{
9 Evas_Object *scroller; 9 Eo *scroller;
10 Evas_Object *message; 10 Eo *message;
11 Evas_Coord max_scroll_h; 11 Evas_Coord max_scroll_h;
12 Eina_Bool is_expandable_h; 12 Eina_Bool is_expandable_h : 1;
13}; 13};
14 14
15#endif 15#endif
diff --git a/src/lib/elementary/efl_ui_popup_anchor.c b/src/lib/elementary/efl_ui_popup_anchor.c
index 20ff3d80fa..e9a79b8380 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.c
+++ b/src/lib/elementary/efl_ui_popup_anchor.c
@@ -14,26 +14,23 @@
14#define MY_CLASS_NAME "Efl.Ui.Popup.Anchor" 14#define MY_CLASS_NAME "Efl.Ui.Popup.Anchor"
15 15
16static void 16static void
17_anchor_calc(Evas_Object *obj) 17_anchor_calc(Eo *obj)
18{ 18{
19 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 19 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
20 EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd); 20 EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd);
21 21
22 Evas_Coord_Rectangle anchor_geom = {0, 0, 0, 0};
23 Evas_Coord_Size popup_size = {0, 0};
24 Evas_Coord_Size parent_size = {0, 0};
25 Eina_Position2D pos = {0, 0}; 22 Eina_Position2D pos = {0, 0};
26 23
27 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS); 24 Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
28 if (!parent) 25 if (!parent)
29 { 26 {
30 ERR("Cannot find window parent"); 27 ERR("Cannot find window parent");
31 return; 28 return;
32 } 29 }
33 30
34 evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h); 31 Eina_Rect a_geom = efl_gfx_geometry_get(sd->anchor);
35 evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h); 32 Eina_Rect o_geom = efl_gfx_geometry_get(obj);
36 evas_object_geometry_get(parent, NULL, NULL, &parent_size.w, &parent_size.h); 33 Eina_Rect p_geom = efl_gfx_geometry_get(parent);
37 34
38 sd->used_align = EFL_UI_POPUP_ALIGN_NONE; 35 sd->used_align = EFL_UI_POPUP_ALIGN_NONE;
39 36
@@ -58,56 +55,56 @@ _anchor_calc(Evas_Object *obj)
58 55
59 switch(cur_align) 56 switch(cur_align)
60 { 57 {
61 case EFL_UI_POPUP_ALIGN_TOP: 58 case EFL_UI_POPUP_ALIGN_TOP:
62 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 59 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
63 pos.y = (anchor_geom.y - popup_size.h); 60 pos.y = (a_geom.y - o_geom.h);
64 61
65 if ((pos.y < 0) || 62 if ((pos.y < 0) ||
66 ((pos.y + popup_size.h) > parent_size.h) || 63 ((pos.y + o_geom.h) > p_geom.h) ||
67 (popup_size.w > parent_size.w)) 64 (o_geom.w > p_geom.w))
68 continue; 65 continue;
69 break; 66 break;
70 67
71 case EFL_UI_POPUP_ALIGN_LEFT: 68 case EFL_UI_POPUP_ALIGN_LEFT:
72 pos.x = (anchor_geom.x - popup_size.w); 69 pos.x = (a_geom.x - o_geom.w);
73 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 70 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
74 71
75 if ((pos.x < 0) || 72 if ((pos.x < 0) ||
76 ((pos.x + popup_size.w) > parent_size.w) || 73 ((pos.x + o_geom.w) > p_geom.w) ||
77 (popup_size.h > parent_size.h)) 74 (o_geom.h > p_geom.h))
78 continue; 75 continue;
79 break; 76 break;
80 77
81 case EFL_UI_POPUP_ALIGN_RIGHT: 78 case EFL_UI_POPUP_ALIGN_RIGHT:
82 pos.x = (anchor_geom.x + anchor_geom.w); 79 pos.x = (a_geom.x + a_geom.w);
83 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 80 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
84 81
85 if ((pos.x < 0) || 82 if ((pos.x < 0) ||
86 ((pos.x + popup_size.w) > parent_size.w) || 83 ((pos.x + o_geom.w) > p_geom.w) ||
87 (popup_size.h > parent_size.h)) 84 (o_geom.h > p_geom.h))
88 continue; 85 continue;
89 break; 86 break;
90 87
91 case EFL_UI_POPUP_ALIGN_BOTTOM: 88 case EFL_UI_POPUP_ALIGN_BOTTOM:
92 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 89 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
93 pos.y = (anchor_geom.y + anchor_geom.h); 90 pos.y = (a_geom.y + a_geom.h);
94 91
95 if ((pos.y < 0) || 92 if ((pos.y < 0) ||
96 ((pos.y + popup_size.h) > parent_size.h) || 93 ((pos.y + o_geom.h) > p_geom.h) ||
97 (popup_size.w > parent_size.w)) 94 (o_geom.w > p_geom.w))
98 continue; 95 continue;
99 break; 96 break;
100 97
101 case EFL_UI_POPUP_ALIGN_CENTER: 98 case EFL_UI_POPUP_ALIGN_CENTER:
102 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 99 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
103 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 100 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
104 101
105 if (popup_size.w > parent_size.w || popup_size.h > parent_size.h) 102 if ((o_geom.w > p_geom.w) || (o_geom.h > p_geom.h))
106 continue; 103 continue;
107 break; 104 break;
108 105
109 default: 106 default:
110 continue; 107 continue;
111 } 108 }
112 109
113 if ((cur_align == EFL_UI_POPUP_ALIGN_TOP) || 110 if ((cur_align == EFL_UI_POPUP_ALIGN_TOP) ||
@@ -116,11 +113,11 @@ _anchor_calc(Evas_Object *obj)
116 { 113 {
117 if (pos.x < 0) 114 if (pos.x < 0)
118 pos.x = 0; 115 pos.x = 0;
119 if ((pos.x + popup_size.w) > parent_size.w) 116 if ((pos.x + o_geom.w) > p_geom.w)
120 pos.x = parent_size.w - popup_size.w; 117 pos.x = p_geom.w - o_geom.w;
121 118
122 if ((pos.x > (anchor_geom.x + anchor_geom.w)) || 119 if ((pos.x > (a_geom.x + a_geom.w)) ||
123 ((pos.x + popup_size.w) < anchor_geom.x)) 120 ((pos.x + o_geom.w) < a_geom.x))
124 continue; 121 continue;
125 } 122 }
126 123
@@ -130,11 +127,11 @@ _anchor_calc(Evas_Object *obj)
130 { 127 {
131 if (pos.y < 0) 128 if (pos.y < 0)
132 pos.y = 0; 129 pos.y = 0;
133 if ((pos.y + popup_size.h) > parent_size.h) 130 if ((pos.y + o_geom.h) > p_geom.h)
134 pos.y = parent_size.h - popup_size.h; 131 pos.y = p_geom.h - o_geom.h;
135 132
136 if ((pos.y > (anchor_geom.y + anchor_geom.h)) || 133 if ((pos.y > (a_geom.y + a_geom.h)) ||
137 ((pos.y + popup_size.h) < anchor_geom.y)) 134 ((pos.y + o_geom.h) < a_geom.y))
138 continue; 135 continue;
139 } 136 }
140 137
@@ -146,56 +143,56 @@ _anchor_calc(Evas_Object *obj)
146 143
147 for (int idx = 0; idx < 6; idx++) 144 for (int idx = 0; idx < 6; idx++)
148 { 145 {
149 Efl_Ui_Popup_Align cur_align; 146 Efl_Ui_Popup_Align cur_align;
150 147
151 if (idx == 0) 148 if (idx == 0)
152 cur_align = sd->align; 149 cur_align = sd->align;
153 else 150 else
154 cur_align = sd->priority[idx - 1]; 151 cur_align = sd->priority[idx - 1];
155 152
156 if (cur_align == EFL_UI_POPUP_ALIGN_NONE) 153 if (cur_align == EFL_UI_POPUP_ALIGN_NONE)
157 continue; 154 continue;
158 155
159 switch(cur_align) 156 switch(cur_align)
160 { 157 {
161 case EFL_UI_POPUP_ALIGN_TOP: 158 case EFL_UI_POPUP_ALIGN_TOP:
162 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 159 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
163 pos.y = (anchor_geom.y - popup_size.h); 160 pos.y = (a_geom.y - o_geom.h);
164 sd->used_align = cur_align; 161 sd->used_align = cur_align;
165 goto end; 162 goto end;
166 break; 163 break;
167 164
168 case EFL_UI_POPUP_ALIGN_LEFT: 165 case EFL_UI_POPUP_ALIGN_LEFT:
169 pos.x = (anchor_geom.x - popup_size.w); 166 pos.x = (a_geom.x - o_geom.w);
170 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 167 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
171 sd->used_align = cur_align; 168 sd->used_align = cur_align;
172 goto end; 169 goto end;
173 break; 170 break;
174 171
175 case EFL_UI_POPUP_ALIGN_RIGHT: 172 case EFL_UI_POPUP_ALIGN_RIGHT:
176 pos.x = (anchor_geom.x + anchor_geom.w); 173 pos.x = (a_geom.x + a_geom.w);
177 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 174 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
178 sd->used_align = cur_align; 175 sd->used_align = cur_align;
179 goto end; 176 goto end;
180 break; 177 break;
181 178
182 case EFL_UI_POPUP_ALIGN_BOTTOM: 179 case EFL_UI_POPUP_ALIGN_BOTTOM:
183 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 180 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
184 pos.y = (anchor_geom.y + anchor_geom.h); 181 pos.y = (a_geom.y + a_geom.h);
185 sd->used_align = cur_align; 182 sd->used_align = cur_align;
186 goto end; 183 goto end;
187 break; 184 break;
188 185
189 case EFL_UI_POPUP_ALIGN_CENTER: 186 case EFL_UI_POPUP_ALIGN_CENTER:
190 pos.x = anchor_geom.x + ((anchor_geom.w - popup_size.w) / 2); 187 pos.x = a_geom.x + ((a_geom.w - o_geom.w) / 2);
191 pos.y = anchor_geom.y + ((anchor_geom.h - popup_size.h) / 2); 188 pos.y = a_geom.y + ((a_geom.h - o_geom.h) / 2);
192 sd->used_align = cur_align; 189 sd->used_align = cur_align;
193 goto end; 190 goto end;
194 break; 191 break;
195 192
196 default: 193 default:
197 break; 194 break;
198 } 195 }
199 } 196 }
200 197
201end: 198end:
@@ -214,7 +211,7 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
214{ 211{
215 EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd); 212 EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd);
216 213
217 Evas_Object *parent = efl_provider_find(data, EFL_UI_WIN_CLASS); 214 Eo *parent = efl_provider_find(data, EFL_UI_WIN_CLASS);
218 if (!parent) 215 if (!parent)
219 { 216 {
220 ERR("Cannot find window parent"); 217 ERR("Cannot find window parent");
@@ -228,13 +225,13 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
228} 225}
229 226
230static void 227static void
231_anchor_detach(Evas_Object *obj) 228_anchor_detach(Eo *obj)
232{ 229{
233 EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd); 230 EFL_UI_POPUP_ANCHOR_DATA_GET(obj, sd);
234 231
235 if (sd->anchor == NULL) return; 232 if (sd->anchor == NULL) return;
236 233
237 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS); 234 Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
238 if (!parent) 235 if (!parent)
239 { 236 {
240 ERR("Cannot find window parent"); 237 ERR("Cannot find window parent");
@@ -248,20 +245,20 @@ _anchor_detach(Evas_Object *obj)
248} 245}
249 246
250EOLIAN static void 247EOLIAN static void
251_efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Evas_Object *anchor) 248_efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Eo *anchor)
252{ 249{
253 _anchor_detach(obj); 250 _anchor_detach(obj);
254 pd->anchor = anchor; 251 pd->anchor = anchor;
255 252
256 if (anchor == NULL) 253 if (anchor == NULL)
257 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), pd->align); 254 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), pd->align);
258 else 255 else
259 { 256 {
260 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), EFL_UI_POPUP_ALIGN_NONE); 257 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), EFL_UI_POPUP_ALIGN_NONE);
261 258
262 _anchor_calc(obj); 259 _anchor_calc(obj);
263 260
264 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS); 261 Eo *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
265 if (!parent) 262 if (!parent)
266 { 263 {
267 ERR("Cannot find window parent"); 264 ERR("Cannot find window parent");
@@ -338,9 +335,9 @@ _efl_ui_popup_anchor_efl_ui_popup_align_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *p
338{ 335{
339 pd->align = type; 336 pd->align = type;
340 if (pd->anchor == NULL) 337 if (pd->anchor == NULL)
341 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), type); 338 efl_ui_popup_align_set(efl_super(obj, MY_CLASS), type);
342 else 339 else
343 _anchor_calc(obj); 340 _anchor_calc(obj);
344} 341}
345 342
346EOLIAN static Efl_Ui_Popup_Align 343EOLIAN static Efl_Ui_Popup_Align
@@ -370,12 +367,6 @@ _efl_ui_popup_anchor_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Anchor_Dat
370 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 367 efl_canvas_group_del(efl_super(obj, MY_CLASS));
371} 368}
372 369
373EOLIAN static void
374_efl_ui_popup_anchor_class_constructor(Efl_Class *klass)
375{
376 evas_smart_legacy_type_register(MY_CLASS_NAME, klass);
377}
378
379#define EFL_UI_POPUP_ANCHOR_EXTRA_OPS \ 370#define EFL_UI_POPUP_ANCHOR_EXTRA_OPS \
380 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_anchor), \ 371 EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_anchor), \
381 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_anchor) 372 ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_anchor)
diff --git a/src/lib/elementary/efl_ui_popup_anchor.eo b/src/lib/elementary/efl_ui_popup_anchor.eo
index 1dc422dba0..f3957d098c 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.eo
+++ b/src/lib/elementary/efl_ui_popup_anchor.eo
@@ -33,7 +33,6 @@ class Efl.Ui.Popup.Anchor(Efl.Ui.Popup)
33 } 33 }
34 } 34 }
35 implements { 35 implements {
36 class.constructor;
37 Efl.Gfx.position { set; } 36 Efl.Gfx.position { set; }
38 Efl.Ui.Popup.align { set; get; } 37 Efl.Ui.Popup.align { set; get; }
39 } 38 }
diff --git a/src/lib/elementary/efl_ui_popup_anchor_private.h b/src/lib/elementary/efl_ui_popup_anchor_private.h
index e99094c591..81e0c60364 100644
--- a/src/lib/elementary/efl_ui_popup_anchor_private.h
+++ b/src/lib/elementary/efl_ui_popup_anchor_private.h
@@ -6,7 +6,7 @@
6typedef struct _Efl_Ui_Popup_Anchor_Data Efl_Ui_Popup_Anchor_Data; 6typedef struct _Efl_Ui_Popup_Anchor_Data Efl_Ui_Popup_Anchor_Data;
7struct _Efl_Ui_Popup_Anchor_Data 7struct _Efl_Ui_Popup_Anchor_Data
8{ 8{
9 Evas_Object *anchor; 9 Eo *anchor;
10 Efl_Ui_Popup_Align align; 10 Efl_Ui_Popup_Align align;
11 Efl_Ui_Popup_Align priority[5]; 11 Efl_Ui_Popup_Align priority[5];
12 Efl_Ui_Popup_Align used_align; 12 Efl_Ui_Popup_Align used_align;
diff --git a/src/lib/elementary/efl_ui_popup_private.h b/src/lib/elementary/efl_ui_popup_private.h
index 8256ec5fce..a36eea4905 100644
--- a/src/lib/elementary/efl_ui_popup_private.h
+++ b/src/lib/elementary/efl_ui_popup_private.h
@@ -4,12 +4,12 @@
4typedef struct _Efl_Ui_Popup_Data Efl_Ui_Popup_Data; 4typedef struct _Efl_Ui_Popup_Data Efl_Ui_Popup_Data;
5struct _Efl_Ui_Popup_Data 5struct _Efl_Ui_Popup_Data
6{ 6{
7 Evas_Object *win_parent; 7 Eo *win_parent;
8 Evas_Object *event_bg; 8 Eo *event_bg;
9 Efl_Ui_Popup_Align align; 9 Efl_Ui_Popup_Align align;
10 Ecore_Timer *timer; 10 Ecore_Timer *timer;
11 double timeout; 11 double timeout;
12 Eina_Bool bg_repeat_events : 1; 12 Eina_Bool bg_repeat_events : 1;
13}; 13};
14 14
15#endif 15#endif