summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJinYong Park <j4939.park@samsung.com>2017-10-24 20:13:21 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-21 14:01:48 +0900
commit9e9f04bad30fba8bc66c92f8cb1f8e898a386ea0 (patch)
treec0b4ec9cd5abb18067ba5b96950c027091f364d0
parent4cdcebd38fc4adc70068e33b636ecb33bc6ea191 (diff)
efl_ui_popup: remove parent_window_get method
Summary: remove Efl.Ui.Popup's internal method "parent_window_get" Test Plan: elementary_test -to efluipopup Reviewers: jpeg, Jaehyun_Cho, woohyun, herb Reviewed By: Jaehyun_Cho Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D5363
-rw-r--r--src/lib/elementary/efl_ui_popup.c6
-rw-r--r--src/lib/elementary/efl_ui_popup.eo8
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.c34
3 files changed, 30 insertions, 18 deletions
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index 344105436a..dc23b28b6a 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -112,12 +112,6 @@ _efl_ui_popup_efl_container_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UN
112 return efl_content_unset(efl_part(obj, "elm.swallow.content")); 112 return efl_content_unset(efl_part(obj, "elm.swallow.content"));
113} 113}
114 114
115EOLIAN static Efl_Canvas_Object *
116_efl_ui_popup_parent_window_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
117{
118 return pd->win_parent;
119}
120
121EOLIAN static void 115EOLIAN static void
122_efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup_Align type) 116_efl_ui_popup_align_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Efl_Ui_Popup_Align type)
123{ 117{
diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo
index 06aefd019c..7af22ae33f 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -10,14 +10,6 @@ enum Efl.Ui.Popup.Align {
10class Efl.Ui.Popup(Efl.Ui.Layout) 10class Efl.Ui.Popup(Efl.Ui.Layout)
11{ 11{
12 methods { 12 methods {
13 @property parent_window @protected {
14 get {
15 [[Get the parent window of Popup.]]
16 }
17 values {
18 window: Efl.Canvas.Object;
19 }
20 }
21 bg_set { 13 bg_set {
22 params { 14 params {
23 @in file: string; [[The image file path.]] 15 @in file: string; [[The image file path.]]
diff --git a/src/lib/elementary/efl_ui_popup_anchor.c b/src/lib/elementary/efl_ui_popup_anchor.c
index 8ec41bc991..20ff3d80fa 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.c
+++ b/src/lib/elementary/efl_ui_popup_anchor.c
@@ -24,7 +24,12 @@ _anchor_calc(Evas_Object *obj)
24 Evas_Coord_Size parent_size = {0, 0}; 24 Evas_Coord_Size parent_size = {0, 0};
25 Eina_Position2D pos = {0, 0}; 25 Eina_Position2D pos = {0, 0};
26 26
27 Evas_Object *parent = efl_ui_popup_parent_window_get(obj); 27 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
28 if (!parent)
29 {
30 ERR("Cannot find window parent");
31 return;
32 }
28 33
29 evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h); 34 evas_object_geometry_get(sd->anchor, &anchor_geom.x, &anchor_geom.y, &anchor_geom.w, &anchor_geom.h);
30 evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h); 35 evas_object_geometry_get(obj, NULL, NULL, &popup_size.w, &popup_size.h);
@@ -209,7 +214,14 @@ _anchor_del_cb(void *data, const Efl_Event *ev EINA_UNUSED)
209{ 214{
210 EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd); 215 EFL_UI_POPUP_ANCHOR_DATA_GET(data, sd);
211 216
212 efl_event_callback_del(efl_ui_popup_parent_window_get(data), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, data); 217 Evas_Object *parent = efl_provider_find(data, EFL_UI_WIN_CLASS);
218 if (!parent)
219 {
220 ERR("Cannot find window parent");
221 return;
222 }
223
224 efl_event_callback_del(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, data);
213 225
214 sd->anchor = NULL; 226 sd->anchor = NULL;
215 efl_ui_popup_align_set(efl_super(data, MY_CLASS), sd->align); 227 efl_ui_popup_align_set(efl_super(data, MY_CLASS), sd->align);
@@ -222,7 +234,14 @@ _anchor_detach(Evas_Object *obj)
222 234
223 if (sd->anchor == NULL) return; 235 if (sd->anchor == NULL) return;
224 236
225 efl_event_callback_del(efl_ui_popup_parent_window_get(obj), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj); 237 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
238 if (!parent)
239 {
240 ERR("Cannot find window parent");
241 return;
242 }
243
244 efl_event_callback_del(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
226 efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj); 245 efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
227 efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj); 246 efl_event_callback_del(sd->anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
228 efl_event_callback_del(sd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj); 247 efl_event_callback_del(sd->anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);
@@ -242,7 +261,14 @@ _efl_ui_popup_anchor_anchor_set(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd, Evas_Obje
242 261
243 _anchor_calc(obj); 262 _anchor_calc(obj);
244 263
245 efl_event_callback_add(efl_ui_popup_parent_window_get(obj), EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj); 264 Evas_Object *parent = efl_provider_find(obj, EFL_UI_WIN_CLASS);
265 if (!parent)
266 {
267 ERR("Cannot find window parent");
268 return;
269 }
270
271 efl_event_callback_add(parent, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
246 efl_event_callback_add(anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj); 272 efl_event_callback_add(anchor, EFL_GFX_EVENT_RESIZE, _anchor_geom_cb, obj);
247 efl_event_callback_add(anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj); 273 efl_event_callback_add(anchor, EFL_GFX_EVENT_MOVE, _anchor_geom_cb, obj);
248 efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj); 274 efl_event_callback_add(anchor, EFL_EVENT_DEL, _anchor_del_cb, obj);