summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2017-10-30 20:34:42 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2017-11-28 17:15:42 +0900
commit91df6723c929dc91ccf040ba5021c1142d1a6a17 (patch)
treefa6d14f5baed511863f36baec8bb827aee737f9b
parentf82779efc220faf2c382489dede0e3910c37ea77 (diff)
efl_ui_popup: Rename bg_set with backwall_set
Since "background" is used as a basic part property, "backwall" is used to indicate the area behind efl_ui_popup.
-rw-r--r--data/elementary/themes/edc/elm/popup.edc2
-rw-r--r--src/bin/elementary/test_ui_popup.c32
-rw-r--r--src/lib/elementary/efl_ui_popup.c54
-rw-r--r--src/lib/elementary/efl_ui_popup.eo8
-rw-r--r--src/lib/elementary/efl_ui_popup_private.h4
5 files changed, 50 insertions, 50 deletions
diff --git a/data/elementary/themes/edc/elm/popup.edc b/data/elementary/themes/edc/elm/popup.edc
index cb534a837a..e39b5cd5c3 100644
--- a/data/elementary/themes/edc/elm/popup.edc
+++ b/data/elementary/themes/edc/elm/popup.edc
@@ -626,7 +626,7 @@ group { "elm/popup/base/alert";
626 } 626 }
627} 627}
628 628
629group { "elm/popup/base/event_bg"; 629group { "elm/popup/base/backwall";
630 parts { 630 parts {
631 rect { "base"; 631 rect { "base";
632 desc { "default"; 632 desc { "default";
diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c
index 2c7075de32..b39113f23d 100644
--- a/src/bin/elementary/test_ui_popup.c
+++ b/src/bin/elementary/test_ui_popup.c
@@ -16,7 +16,7 @@ typedef struct
16} efl_ui_popup_data; 16} efl_ui_popup_data;
17 17
18static void 18static void
19_bg_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) 19_backwall_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED)
20{ 20{
21 printf("Popup's background is clicked.\n"); 21 printf("Popup's background is clicked.\n");
22} 22}
@@ -55,7 +55,7 @@ _create_popup(efl_ui_popup_data *p_data)
55 55
56 Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_CLASS, p_data->win); 56 Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_CLASS, p_data->win);
57 57
58 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_EVENT_BG_CLICKED, _bg_clicked, NULL); 58 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_EVENT_BACKWALL_CLICKED, _backwall_clicked, NULL);
59 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_EVENT_TIMEOUT, _timeout_cb, p_data); 59 efl_event_callback_add(efl_ui_popup, EFL_UI_POPUP_EVENT_TIMEOUT, _timeout_cb, p_data);
60 efl_gfx_size_set(efl_ui_popup, EINA_SIZE2D(160, 160)); 60 efl_gfx_size_set(efl_ui_popup, EINA_SIZE2D(160, 160));
61 61
@@ -75,7 +75,7 @@ _create_cb(void *data, const Efl_Event *ev EINA_UNUSED)
75} 75}
76 76
77static void 77static void
78_bg_cb(void *data EINA_UNUSED, const Efl_Event *ev) 78_backwall_cb(void *data EINA_UNUSED, const Efl_Event *ev)
79{ 79{
80 static int k = 0; 80 static int k = 0;
81 efl_ui_popup_data *p_data = data; 81 efl_ui_popup_data *p_data = data;
@@ -84,13 +84,13 @@ _bg_cb(void *data EINA_UNUSED, const Efl_Event *ev)
84 { 84 {
85 char buf[PATH_MAX]; 85 char buf[PATH_MAX];
86 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); 86 snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get());
87 efl_ui_popup_bg_set(p_data->efl_ui_popup, buf, NULL); 87 efl_ui_popup_backwall_set(p_data->efl_ui_popup, buf, NULL);
88 efl_text_set(ev->object, "Bg UnSet"); 88 efl_text_set(ev->object, "Backwall UnSet");
89 } 89 }
90 else 90 else
91 { 91 {
92 efl_ui_popup_bg_set(p_data->efl_ui_popup, NULL, NULL); 92 efl_ui_popup_backwall_set(p_data->efl_ui_popup, NULL, NULL);
93 efl_text_set(ev->object, "Bg Set"); 93 efl_text_set(ev->object, "Backwall Set");
94 } 94 }
95 k = !k; 95 k = !k;
96} 96}
@@ -100,14 +100,14 @@ _repeat_event_cb(void *data EINA_UNUSED, const Efl_Event *ev)
100{ 100{
101 efl_ui_popup_data *p_data = data; 101 efl_ui_popup_data *p_data = data;
102 if (!p_data->efl_ui_popup) return; 102 if (!p_data->efl_ui_popup) return;
103 if (!efl_ui_popup_bg_repeat_events_get(p_data->efl_ui_popup)) 103 if (!efl_ui_popup_backwall_repeat_events_get(p_data->efl_ui_popup))
104 { 104 {
105 efl_ui_popup_bg_repeat_events_set(p_data->efl_ui_popup, EINA_TRUE); 105 efl_ui_popup_backwall_repeat_events_set(p_data->efl_ui_popup, EINA_TRUE);
106 efl_text_set(ev->object, "Repeat Event UnSet"); 106 efl_text_set(ev->object, "Repeat Event UnSet");
107 } 107 }
108 else 108 else
109 { 109 {
110 efl_ui_popup_bg_repeat_events_set(p_data->efl_ui_popup, EINA_FALSE); 110 efl_ui_popup_backwall_repeat_events_set(p_data->efl_ui_popup, EINA_FALSE);
111 efl_text_set(ev->object, "Repeat Event Set"); 111 efl_text_set(ev->object, "Repeat Event Set");
112 } 112 }
113} 113}
@@ -265,11 +265,11 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_
265 efl_gfx_size_set(dummy_btn, EINA_SIZE2D(150, 50)); 265 efl_gfx_size_set(dummy_btn, EINA_SIZE2D(150, 50));
266 efl_event_callback_add(dummy_btn, EFL_UI_EVENT_CLICKED, _dummy_cb, p_data); 266 efl_event_callback_add(dummy_btn, EFL_UI_EVENT_CLICKED, _dummy_cb, p_data);
267 267
268 Eo *bg_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); 268 Eo *backwall_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
269 efl_gfx_position_set(bg_btn, EINA_POSITION2D(0, 100)); 269 efl_gfx_position_set(backwall_btn, EINA_POSITION2D(0, 100));
270 efl_gfx_size_set(bg_btn, EINA_SIZE2D(150, 50)); 270 efl_gfx_size_set(backwall_btn, EINA_SIZE2D(150, 50));
271 efl_text_set(bg_btn, "Bg Set"); 271 efl_text_set(backwall_btn, "Backwall Set");
272 efl_event_callback_add(bg_btn, EFL_UI_EVENT_CLICKED, _bg_cb, p_data); 272 efl_event_callback_add(backwall_btn, EFL_UI_EVENT_CLICKED, _backwall_cb, p_data);
273 273
274 Eo *timeout_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); 274 Eo *timeout_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win);
275 efl_text_set(timeout_btn, "Timeout Set"); 275 efl_text_set(timeout_btn, "Timeout Set");
@@ -453,7 +453,7 @@ test_ui_popup_anchor(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
453 453
454 Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_ANCHOR_CLASS, win); 454 Eo *efl_ui_popup = efl_add(EFL_UI_POPUP_ANCHOR_CLASS, win);
455 455
456 efl_ui_popup_bg_repeat_events_set(efl_ui_popup, EINA_TRUE); 456 efl_ui_popup_backwall_repeat_events_set(efl_ui_popup, EINA_TRUE);
457 457
458 //Default align priority order is top, left, right, bottom, center. 458 //Default align priority order is top, left, right, bottom, center.
459 efl_ui_popup_anchor_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP, 459 efl_ui_popup_anchor_align_priority_set(efl_ui_popup, EFL_UI_POPUP_ALIGN_TOP,
diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c
index 79468817fe..92eed8df8b 100644
--- a/src/lib/elementary/efl_ui_popup.c
+++ b/src/lib/elementary/efl_ui_popup.c
@@ -13,13 +13,13 @@
13#define MY_CLASS_NAME "Efl.Ui.Popup" 13#define MY_CLASS_NAME "Efl.Ui.Popup"
14 14
15static void 15static void
16_bg_clicked_cb(void *data, 16_backwall_clicked_cb(void *data,
17 Eo *o EINA_UNUSED, 17 Eo *o EINA_UNUSED,
18 const char *emission EINA_UNUSED, 18 const char *emission EINA_UNUSED,
19 const char *source EINA_UNUSED) 19 const char *source EINA_UNUSED)
20{ 20{
21 Eo *obj = data; 21 Eo *obj = data;
22 efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BG_CLICKED, NULL); 22 efl_event_callback_call(obj, EFL_UI_POPUP_EVENT_BACKWALL_CLICKED, NULL);
23} 23}
24 24
25EOLIAN static void 25EOLIAN static void
@@ -36,8 +36,8 @@ _calc_align(Eo *obj)
36 36
37 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent); 37 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
38 38
39 efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(0, 0)); 39 efl_gfx_position_set(pd->backwall, EINA_POSITION2D(0, 0));
40 efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h)); 40 efl_gfx_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
41 41
42 Eina_Rect o_geom = efl_gfx_geometry_get(obj); 42 Eina_Rect o_geom = efl_gfx_geometry_get(obj);
43 43
@@ -89,8 +89,8 @@ _efl_ui_popup_elm_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_U
89 89
90 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent); 90 Eina_Rect p_geom = efl_gfx_geometry_get(pd->win_parent);
91 91
92 efl_gfx_position_set(pd->event_bg, EINA_POSITION2D(p_geom.x, p_geom.y)); 92 efl_gfx_position_set(pd->backwall, EINA_POSITION2D(p_geom.x, p_geom.y));
93 efl_gfx_size_set(pd->event_bg, EINA_SIZE2D(p_geom.w, p_geom.h)); 93 efl_gfx_size_set(pd->backwall, EINA_SIZE2D(p_geom.w, p_geom.h));
94 94
95 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);
96 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);
@@ -202,13 +202,13 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
202 elm_widget_can_focus_set(obj, EINA_TRUE); 202 elm_widget_can_focus_set(obj, EINA_TRUE);
203 elm_layout_theme_set(obj, "popup", "base", "view"); 203 elm_layout_theme_set(obj, "popup", "base", "view");
204 204
205 pd->event_bg = edje_object_add(evas_object_evas_get(obj)); 205 pd->backwall = edje_object_add(evas_object_evas_get(obj));
206 elm_widget_theme_object_set(obj, pd->event_bg, "popup", "base", "event_bg"); 206 elm_widget_theme_object_set(obj, pd->backwall, "popup", "base", "backwall");
207 evas_object_smart_member_add(pd->event_bg, obj); 207 evas_object_smart_member_add(pd->backwall, obj);
208 evas_object_stack_below(pd->event_bg, wd->resize_obj); 208 evas_object_stack_below(pd->backwall, wd->resize_obj);
209 209
210 edje_object_signal_callback_add(pd->event_bg, "elm,action,clicked", "*", 210 edje_object_signal_callback_add(pd->backwall, "elm,action,clicked", "*",
211 _bg_clicked_cb, obj); 211 _backwall_clicked_cb, obj);
212 212
213 pd->align = EFL_UI_POPUP_ALIGN_CENTER; 213 pd->align = EFL_UI_POPUP_ALIGN_CENTER;
214 214
@@ -218,7 +218,7 @@ _efl_ui_popup_efl_object_constructor(Eo *obj, Efl_Ui_Popup_Data *pd)
218EOLIAN static void 218EOLIAN static void
219_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd) 219_efl_ui_popup_efl_object_destructor(Eo *obj, Efl_Ui_Popup_Data *pd)
220{ 220{
221 ELM_SAFE_DEL(pd->event_bg); 221 ELM_SAFE_DEL(pd->backwall);
222 222
223 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb, 223 efl_event_callback_del(pd->win_parent, EFL_GFX_EVENT_RESIZE, _parent_geom_cb,
224 obj); 224 obj);
@@ -250,12 +250,12 @@ _efl_ui_popup_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED)
250} 250}
251 251
252EOLIAN static void 252EOLIAN static void
253_efl_ui_popup_bg_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const char* group) 253_efl_ui_popup_backwall_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const char* group)
254{ 254{
255 Eo *prev_obj = edje_object_part_swallow_get(pd->event_bg, "elm.swallow.image"); 255 Eo *prev_obj = edje_object_part_swallow_get(pd->backwall, "elm.swallow.image");
256 if (prev_obj) 256 if (prev_obj)
257 { 257 {
258 edje_object_part_unswallow(pd->event_bg, prev_obj); 258 edje_object_part_unswallow(pd->backwall, prev_obj);
259 efl_del(prev_obj); 259 efl_del(prev_obj);
260 } 260 }
261 261
@@ -263,26 +263,26 @@ _efl_ui_popup_bg_set(Eo *obj, Efl_Ui_Popup_Data *pd, const char* file, const cha
263 Eina_Bool ret = elm_image_file_set(image, file, group); 263 Eina_Bool ret = elm_image_file_set(image, file, group);
264 if (!ret) 264 if (!ret)
265 { 265 {
266 edje_object_signal_emit(pd->event_bg, "elm,state,image,hidden", "elm"); 266 edje_object_signal_emit(pd->backwall, "elm,state,image,hidden", "elm");
267 efl_del(image); 267 efl_del(image);
268 return; 268 return;
269 } 269 }
270 edje_object_part_swallow(pd->event_bg, "elm.swallow.image", image); 270 edje_object_part_swallow(pd->backwall, "elm.swallow.image", image);
271 edje_object_signal_emit(pd->event_bg, "elm,state,image,visible", "elm"); 271 edje_object_signal_emit(pd->backwall, "elm,state,image,visible", "elm");
272} 272}
273 273
274EOLIAN static void 274EOLIAN static void
275_efl_ui_popup_bg_repeat_events_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Eina_Bool repeat) 275_efl_ui_popup_backwall_repeat_events_set(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd, Eina_Bool repeat)
276{ 276{
277 pd->bg_repeat_events = repeat; 277 pd->backwall_repeat_events = repeat;
278 278
279 efl_canvas_object_repeat_events_set(pd->event_bg, repeat); 279 efl_canvas_object_repeat_events_set(pd->backwall, repeat);
280} 280}
281 281
282EOLIAN static Eina_Bool 282EOLIAN static Eina_Bool
283_efl_ui_popup_bg_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd) 283_efl_ui_popup_backwall_repeat_events_get(Eo *obj EINA_UNUSED, Efl_Ui_Popup_Data *pd)
284{ 284{
285 return pd->bg_repeat_events; 285 return pd->backwall_repeat_events;
286} 286}
287 287
288/* Internal EO APIs and hidden overrides */ 288/* 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 39be8faec2..09871c407f 100644
--- a/src/lib/elementary/efl_ui_popup.eo
+++ b/src/lib/elementary/efl_ui_popup.eo
@@ -10,14 +10,14 @@ 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 bg_set { 13 backwall_set {
14 params { 14 params {
15 @in file: string; [[The image file path.]] 15 @in file: string; [[The image file path.]]
16 @in group: string; [[The image key in $file (if its an Eet one), or 16 @in group: string; [[The image key in $file (if its an Eet one), or
17 $null, otherwise.]] 17 $null, otherwise.]]
18 } 18 }
19 } 19 }
20 @property bg_repeat_events { 20 @property backwall_repeat_events {
21 set { 21 set {
22 [[Sets whether events should be passed to by a click outside. 22 [[Sets whether events should be passed to by a click outside.
23 23
@@ -25,7 +25,7 @@ class Efl.Ui.Popup(Efl.Ui.Layout)
25 ]] 25 ]]
26 } 26 }
27 get { 27 get {
28 [[Returns value indicating whether bg repeat events is enabled or not.]] 28 [[Returns value indicating whether backwall repeat events is enabled or not.]]
29 } 29 }
30 values { 30 values {
31 repeat: bool; [[If $true, events are passed to lower objects.]] 31 repeat: bool; [[If $true, events are passed to lower objects.]]
@@ -66,7 +66,7 @@ class Efl.Ui.Popup(Efl.Ui.Layout)
66 Efl.Container.content_unset; 66 Efl.Container.content_unset;
67 } 67 }
68 events { 68 events {
69 bg,clicked; [[This is called whenever the user click background of popup.]] 69 backwall,clicked; [[This is called whenever the user clicks back wall of popup.]]
70 timeout; [[This is called when popup times out.]] 70 timeout; [[This is called when popup times out.]]
71 } 71 }
72} 72}
diff --git a/src/lib/elementary/efl_ui_popup_private.h b/src/lib/elementary/efl_ui_popup_private.h
index a36eea4905..6a1f48b44d 100644
--- a/src/lib/elementary/efl_ui_popup_private.h
+++ b/src/lib/elementary/efl_ui_popup_private.h
@@ -5,11 +5,11 @@ typedef struct _Efl_Ui_Popup_Data Efl_Ui_Popup_Data;
5struct _Efl_Ui_Popup_Data 5struct _Efl_Ui_Popup_Data
6{ 6{
7 Eo *win_parent; 7 Eo *win_parent;
8 Eo *event_bg; 8 Eo *backwall;
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 backwall_repeat_events : 1;
13}; 13};
14 14
15#endif 15#endif