summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSungtaek Hong <sth253.hong@samsung.com>2017-11-30 18:15:11 +0900
committerSungtaek Hong <sth253.hong@samsung.com>2017-12-08 16:02:23 +0900
commitc12d947484513b6caad91c8e1945e2de3b115cd3 (patch)
treed963a6b89473e64bcf737f0a56d55799b8dda920 /src
parent1588b8be0a0a14daea5cbc0c113d2770b8cc6f25 (diff)
efl_ui_popup: remove unnecessary overides
Summary: efl_ui_popup parts overrides efl_content and efl_text which are sometimes not needed. Test Plan: Run elementary_test -> efl_ui_popup tests Reviewers: jpeg, cedric, woohyun, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: Jaehyun_Cho, Blackmole, herb Differential Revision: https://phab.enlightenment.org/D5556
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_popup.c24
-rw-r--r--src/lib/elementary/efl_ui_popup_alert.c37
-rw-r--r--src/lib/elementary/efl_ui_popup_alert_part.eo4
-rw-r--r--src/lib/elementary/efl_ui_popup_part.eo4
4 files changed, 13 insertions, 56 deletions
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index 34d6732595..9769605c18 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -241,35 +241,11 @@ _efl_ui_popup_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
241 _calc_align(obj); 241 _calc_align(obj);
242} 242}
243 243
244static Eina_Bool
245_efl_ui_popup_content_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const char *part, Eo *content)
246{
247 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
248}
249
250Eo *
251_efl_ui_popup_content_get(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const char *part)
252{
253 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
254}
255
256static Eo *
257_efl_ui_popup_content_unset(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, const char *part)
258{
259 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
260}
261
262/* Standard widget overrides */ 244/* Standard widget overrides */
263 245
264ELM_PART_CONTENT_DEFAULT_GET(efl_ui_popup, "elm.swallow.content") 246ELM_PART_CONTENT_DEFAULT_GET(efl_ui_popup, "elm.swallow.content")
265ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_popup, Efl_Ui_Popup_Data) 247ELM_PART_CONTENT_DEFAULT_IMPLEMENT(efl_ui_popup, Efl_Ui_Popup_Data)
266 248
267/* Efl.Part begin */
268
269ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
270ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
271ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_popup, EFL_UI_POPUP, Efl_Ui_Popup_Data)
272
273EOLIAN static Eo * 249EOLIAN static Eo *
274_efl_ui_popup_efl_part_part(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSED, const char *part) 250_efl_ui_popup_efl_part_part(const Eo *obj, Efl_Ui_Popup_Data *_pd EINA_UNUSED, const char *part)
275{ 251{
diff --git a/src/lib/elementary/efl_ui_popup_alert.c b/src/lib/elementary/efl_ui_popup_alert.c
index 9a23d23f49..0249977dea 100644
--- a/src/lib/elementary/efl_ui_popup_alert.c
+++ b/src/lib/elementary/efl_ui_popup_alert.c
@@ -12,6 +12,13 @@
12#define MY_CLASS EFL_UI_POPUP_ALERT_CLASS 12#define MY_CLASS EFL_UI_POPUP_ALERT_CLASS
13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert" 13#define MY_CLASS_NAME "Efl.Ui.Popup.Alert"
14 14
15static const Elm_Layout_Part_Alias_Description _text_aliases[] =
16{
17 {"title", "title"},
18 {"elm.text.title", "elm.text.title"},
19 {NULL, NULL}
20};
21
15static const char PART_NAME_BUTTON[] = "button"; 22static const char PART_NAME_BUTTON[] = "button";
16static const char PART_NAME_BUTTON_LAYOUT[EFL_UI_POPUP_ALERT_BUTTON_COUNT][15] = 23static const char PART_NAME_BUTTON_LAYOUT[EFL_UI_POPUP_ALERT_BUTTON_COUNT][15] =
17 {"button_layout1", 24 {"button_layout1",
@@ -35,7 +42,7 @@ _efl_ui_popup_alert_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Alert_Data *pd
35static Eina_Bool 42static Eina_Bool
36_efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *part, const char *label) 43_efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *part, const char *label)
37{ 44{
38 if (part && !strcmp(part, "title")) 45 if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
39 { 46 {
40 if (pd->title_text) 47 if (pd->title_text)
41 { 48 {
@@ -44,7 +51,7 @@ _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *p
44 } 51 }
45 52
46 pd->title_text = eina_stringshare_add(label); 53 pd->title_text = eina_stringshare_add(label);
47 elm_object_part_text_set(obj, "elm.text.title", label); 54 efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text.title"), label);
48 elm_layout_signal_emit(obj, "elm,title,show", "elm"); 55 elm_layout_signal_emit(obj, "elm,title,show", "elm");
49 56
50 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 57 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
@@ -60,7 +67,7 @@ _efl_ui_popup_alert_text_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd, const char *p
60const char * 67const char *
61_efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, const char *part) 68_efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, const char *part)
62{ 69{
63 if (part && !strcmp(part, "title")) 70 if (eina_streq(part, "title") || eina_streq(part, "elm.text.title"))
64 { 71 {
65 if (pd->title_text) 72 if (pd->title_text)
66 return pd->title_text; 73 return pd->title_text;
@@ -71,24 +78,6 @@ _efl_ui_popup_alert_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Alert_Data *pd, c
71 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part)); 78 return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
72} 79}
73 80
74static Eina_Bool
75_efl_ui_popup_alert_content_set(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part, Eo *content)
76{
77 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
78}
79
80Eo *
81_efl_ui_popup_alert_content_get(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
82{
83 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
84}
85
86static Eo *
87_efl_ui_popup_alert_content_unset(Eo *obj, Efl_Ui_Popup_Alert_Data *pd EINA_UNUSED, const char *part)
88{
89 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
90}
91
92static void 81static void
93_positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED, 82_positive_button_clicked_cb(void *data, Eo *obj EINA_UNUSED,
94 void *event_info EINA_UNUSED) 83 void *event_info EINA_UNUSED)
@@ -274,11 +263,7 @@ _efl_ui_popup_alert_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Alert_Data *pd)
274} 263}
275 264
276/* Efl.Part begin */ 265/* Efl.Part begin */
277 266ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data, _text_aliases)
278ELM_PART_OVERRIDE(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
279ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
280ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
281ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
282ELM_PART_OVERRIDE_TEXT_SET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data) 267ELM_PART_OVERRIDE_TEXT_SET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
283ELM_PART_OVERRIDE_TEXT_GET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data) 268ELM_PART_OVERRIDE_TEXT_GET(efl_ui_popup_alert, EFL_UI_POPUP_ALERT, Efl_Ui_Popup_Alert_Data)
284#include "efl_ui_popup_alert_part.eo.c" 269#include "efl_ui_popup_alert_part.eo.c"
diff --git a/src/lib/elementary/efl_ui_popup_alert_part.eo b/src/lib/elementary/efl_ui_popup_alert_part.eo
index fa9d04fffb..31e607023c 100644
--- a/src/lib/elementary/efl_ui_popup_alert_part.eo
+++ b/src/lib/elementary/efl_ui_popup_alert_part.eo
@@ -1,10 +1,8 @@
1class Efl.Ui.Popup.Alert.Part (Efl.Ui.Layout.Part_Content, Efl.Ui.Layout.Part_Text) 1class Efl.Ui.Popup.Alert.Part (Efl.Ui.Layout.Part_Text)
2{ 2{
3 [[Efl UI Popup Alert internal part class]] 3 [[Efl UI Popup Alert internal part class]]
4 data: null; 4 data: null;
5 implements { 5 implements {
6 Efl.Content.content { get; set; }
7 Efl.Content.content_unset;
8 Efl.Text.text { get; set; } 6 Efl.Text.text { get; set; }
9 } 7 }
10} 8}
diff --git a/src/lib/elementary/efl_ui_popup_part.eo b/src/lib/elementary/efl_ui_popup_part.eo
index 5cb6fdf7fb..2e4969826a 100644
--- a/src/lib/elementary/efl_ui_popup_part.eo
+++ b/src/lib/elementary/efl_ui_popup_part.eo
@@ -1,10 +1,8 @@
1class Efl.Ui.Popup.Part (Efl.Ui.Layout.Part_Content, Efl.Canvas.Object, Efl.File) 1class Efl.Ui.Popup.Part (Efl.Ui.Layout.Part, Efl.Canvas.Object, Efl.File)
2{ 2{
3 [[Efl UI Popup internal part class]] 3 [[Efl UI Popup internal part class]]
4 data: null; 4 data: null;
5 implements { 5 implements {
6 Efl.Content.content { get; set; }
7 Efl.Content.content_unset;
8 Efl.Canvas.Object.repeat_events { set; get; } 6 Efl.Canvas.Object.repeat_events { set; get; }
9 Efl.File.file { set; } 7 Efl.File.file { set; }
10 } 8 }