aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-10-24 21:29:15 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-21 14:01:48 +0900
commit45f505bd4d77b5fbf4e18434d661b81d8bd184b4 (patch)
tree5d4db4555666a251e396f696e52abdaf0aa62114
parentefl_ui_popup: Code refactoring to replace legacy APIs (diff)
downloadefl-45f505bd4d77b5fbf4e18434d661b81d8bd184b4.tar.gz
efl_ui_popup: Replace group_add/del with constructor/destructor
-rw-r--r--src/lib/elementary/efl_ui_popup.c27
-rw-r--r--src/lib/elementary/efl_ui_popup.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.c18
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.eo2
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.c24
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_scroll.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.c24
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_text.eo1
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.c18
-rw-r--r--src/lib/elementary/efl_ui_popup_anchor.eo1
10 files changed, 67 insertions, 51 deletions
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index 6f225da034..7d59be8a7c 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -188,12 +188,14 @@ _efl_ui_popup_timeout_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
return pd->timeout;
}
-EOLIAN static void
-_efl_ui_popup_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Data *pd)
+EOLIAN static Eo *
+_efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
elm_widget_can_focus_set(obj, EINA_TRUE);
@@ -204,19 +206,25 @@ _efl_ui_popup_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Data *pd)
evas_object_smart_member_add(pd->event_bg, obj);
evas_object_stack_below(pd->event_bg, wd->resize_obj);
- edje_object_signal_callback_add(pd->event_bg, "elm,action,clicked", "*", _bg_clicked_cb, obj);
+ edje_object_signal_callback_add(pd->event_bg, "elm,action,clicked", "*",
+ _bg_clicked_cb, obj);
pd->align = EFL_UI_POPUP_ALIGN_CENTER;
+
+ return obj;
}
EOLIAN static void
-_efl_ui_popup_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Data *pd)
+_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd)
{
ELM_SAFE_DEL(pd->event_bg);
- efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, obj);
- efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb, obj);
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb,
+ obj);
+ efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_MOVE, _parent_geom_cb,
+ obj);
+
+ efl_destructor(efl_super(obj, MY_CLASS));
}
EOLIAN static void
@@ -277,7 +285,6 @@ _efl_ui_popup_bg_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
/* Internal EO APIs and hidden overrides */
#define EFL_UI_POPUP_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup)
#include "efl_ui_popup.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup.eo b/src/lib/elementary/efl_ui_popup.eo
index cf70162e84..8f2a23778d 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -57,6 +57,8 @@ class Efl.Ui.Popup(Efl.Ui.Layout)
}
}
implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.Gfx.position { set; }
Efl.Gfx.visible { set; }
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 64d1ff6b92..bfb2c3d4e2 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -212,19 +212,24 @@ _efl_ui_popup_alert_button_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, Efl_Ui_Popu
elm_layout_sizing_eval(obj);
}
-EOLIAN static void
-_efl_ui_popup_alert_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED)
+EOLIAN static Eo *
+_efl_ui_popup_alert_efl_object_constructor(Eo *obj,
+ Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
elm_layout_theme_set(efl_super(obj, MY_CLASS), "popup", "base", "alert");
+
+ return obj;
}
EOLIAN static void
-_efl_ui_popup_alert_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_Data *pd)
+_efl_ui_popup_alert_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Alert_Data *pd)
{
if (pd->title_text)
{
@@ -232,7 +237,7 @@ _efl_ui_popup_alert_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_Data
pd->title_text = NULL;
}
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ efl_destructor(efl_super(obj, MY_CLASS));
}
/* Efl.Part begin */
@@ -248,7 +253,6 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_
/* Efl.Part end */
#define EFL_UI_POPUP_ALERT_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_alert), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_alert)
#include "efl_ui_popup_alert.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup_alert.eo b/src/lib/elementary/efl_ui_popup_alert.eo
index 8929e1729d..42c55a47f5 100644
--- a/src/lib/elementary/efl_ui_popup_alert.eo
+++ b/src/lib/elementary/efl_ui_popup_alert.eo
@@ -21,6 +21,8 @@ class Efl.Ui.Popup.Alert(Efl.Ui.Popup)
}
}
implements {
+ Efl.Object.constructor;
+ Efl.Object.destructor;
Efl.Part.part;
}
events {
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.c b/src/lib/elementary/efl_ui_popup_alert_scroll.c
index 7dc388bd97..ac57b3d6b4 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.c
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.c
@@ -182,27 +182,28 @@ _efl_ui_popup_alert_scroll_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_
elm_layout_sizing_eval(obj);
}
-EOLIAN static void
-_efl_ui_popup_alert_scroll_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd)
+EOLIAN static Eo *
+_efl_ui_popup_alert_scroll_efl_object_constructor(Eo *obj,
+ Efl_Ui_Popup_Alert_Scroll_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
pd->scroller = elm_scroller_add(obj);
elm_object_style_set(pd->scroller, "popup/no_inset_shadow");
- elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO, ELM_SCROLLER_POLICY_AUTO);
+ elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_AUTO,
+ ELM_SCROLLER_POLICY_AUTO);
- efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), pd->scroller);
+ efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
+ pd->scroller);
pd->max_scroll = EINA_SIZE2D(-1, -1);
-}
-EOLIAN static void
-_efl_ui_popup_alert_scroll_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_Scroll_Data *pd EINA_UNUSED)
-{
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ return obj;
}
/* Efl.Part begin */
@@ -220,7 +221,6 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_popup_alert_scroll, EFL_UI_POPUP_ALERT_SCROLL,
/* Internal EO APIs and hidden overrides */
#define EFL_UI_POPUP_ALERT_SCROLL_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_alert_scroll), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_alert_scroll)
#include "efl_ui_popup_alert_scroll.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup_alert_scroll.eo b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
index 69d3bbb9fe..b680f7644c 100644
--- a/src/lib/elementary/efl_ui_popup_alert_scroll.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_scroll.eo
@@ -17,6 +17,7 @@ class Efl.Ui.Popup.Alert.Scroll(Efl.Ui.Popup.Alert)
}
}
implements {
+ Efl.Object.constructor;
Efl.Gfx.Size.Hint.hint_max { set; }
Efl.Part.part;
}
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.c b/src/lib/elementary/efl_ui_popup_alert_text.c
index e3acce5fbd..9bf90f121d 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.c
+++ b/src/lib/elementary/efl_ui_popup_alert_text.c
@@ -131,27 +131,28 @@ _efl_ui_popup_alert_text_efl_gfx_size_hint_hint_max_set(Eo *obj, Efl_Ui_Popup_Al
elm_layout_sizing_eval(obj);
}
-EOLIAN static void
-_efl_ui_popup_alert_text_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd)
+EOLIAN static Eo *
+_efl_ui_popup_alert_text_efl_object_constructor(Eo *obj,
+ Efl_Ui_Popup_Alert_Text_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
pd->scroller = elm_scroller_add(obj);
elm_object_style_set(pd->scroller, "popup/no_inset_shadow");
- elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_AUTO);
+ elm_scroller_policy_set(pd->scroller, ELM_SCROLLER_POLICY_OFF,
+ ELM_SCROLLER_POLICY_AUTO);
- efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"), pd->scroller);
+ efl_content_set(efl_part(efl_super(obj, MY_CLASS), "elm.swallow.content"),
+ pd->scroller);
pd->max_scroll_h = -1;
-}
-EOLIAN static void
-_efl_ui_popup_alert_text_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Alert_Text_Data *pd EINA_UNUSED)
-{
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ return obj;
}
/* Efl.Part begin */
@@ -169,7 +170,6 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_popup_alert_text, EFL_UI_POPUP_ALERT_TEXT, Efl
/* Internal EO APIs and hidden overrides */
#define EFL_UI_POPUP_ALERT_TEXT_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_alert_text), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_alert_text)
#include "efl_ui_popup_alert_text.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup_alert_text.eo b/src/lib/elementary/efl_ui_popup_alert_text.eo
index 988c727680..d26ac90749 100644
--- a/src/lib/elementary/efl_ui_popup_alert_text.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_text.eo
@@ -16,6 +16,7 @@ class Efl.Ui.Popup.Alert.Text(Efl.Ui.Popup.Alert, Efl.Text)
}
}
implements {
+ Efl.Object.constructor;
Efl.Gfx.Size.Hint.hint_max { set;}
Efl.Text.text { get; set; }
Efl.Part.part;
diff --git a/src/lib/elementary/efl_ui_popup_anchor.c b/src/lib/elementary/efl_ui_popup_anchor.c
index e9a79b8380..d1b5672743 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.c
+++ b/src/lib/elementary/efl_ui_popup_anchor.c
@@ -346,12 +346,15 @@ _efl_ui_popup_anchor_efl_ui_popup_align_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_An
return pd->align;
}
-EOLIAN static void
-_efl_ui_popup_anchor_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd EINA_UNUSED)
+EOLIAN static Eo *
+_efl_ui_popup_anchor_efl_object_constructor(Eo *obj,
+ Efl_Ui_Popup_Anchor_Data *pd)
{
- ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
+ ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
+
+ obj = efl_constructor(efl_super(obj, MY_CLASS));
+ efl_canvas_object_type_set(obj, MY_CLASS_NAME);
- efl_canvas_group_add(efl_super(obj, MY_CLASS));
elm_widget_sub_object_parent_add(obj);
pd->priority[0] = EFL_UI_POPUP_ALIGN_TOP;
@@ -359,16 +362,11 @@ _efl_ui_popup_anchor_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Popup_Anchor_Dat
pd->priority[2] = EFL_UI_POPUP_ALIGN_RIGHT;
pd->priority[3] = EFL_UI_POPUP_ALIGN_BOTTOM;
pd->priority[4] = EFL_UI_POPUP_ALIGN_CENTER;
-}
-EOLIAN static void
-_efl_ui_popup_anchor_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Popup_Anchor_Data *pd EINA_UNUSED)
-{
- efl_canvas_group_del(efl_super(obj, MY_CLASS));
+ return obj;
}
#define EFL_UI_POPUP_ANCHOR_EXTRA_OPS \
- EFL_CANVAS_GROUP_ADD_DEL_OPS(efl_ui_popup_anchor), \
ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_popup_anchor)
#include "efl_ui_popup_anchor.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup_anchor.eo b/src/lib/elementary/efl_ui_popup_anchor.eo
index f3957d098c..656f48c45b 100644
--- a/src/lib/elementary/efl_ui_popup_anchor.eo
+++ b/src/lib/elementary/efl_ui_popup_anchor.eo
@@ -33,6 +33,7 @@ class Efl.Ui.Popup.Anchor(Efl.Ui.Popup)
}
}
implements {
+ Efl.Object.constructor;
Efl.Gfx.position { set; }
Efl.Ui.Popup.align { set; get; }
}