summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2014-07-09 16:32:09 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2014-07-16 22:45:29 +0900
commit7f5a7329717bace0a851ed1d4f732a1aa9be7f27 (patch)
treeaa25a54171e4f80bc918f3c24d6af32d1be75844 /src/lib
parent27ec47c460a53629987b563dab451735971fd421 (diff)
popup: code refactoring
Popup has an abnormal parent-child tree as follows, and this patch fixes it. - when popup is created, it creates a notify as a child and the tree is [parent - popup - notify]. - when popup is visible, it is set as a content of notify and the tree is [parent - notify - popup]. - when popup is hidden, the tree is reverted. To fix this, I made an internal layout and set it as the content of notify so that the tree remains as [parent - popup - notify - layout] all the time.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elc_popup.c328
-rw-r--r--src/lib/elm_widget_popup.h1
2 files changed, 124 insertions, 205 deletions
diff --git a/src/lib/elc_popup.c b/src/lib/elc_popup.c
index a35cc2b0c..f307e9ab5 100644
--- a/src/lib/elc_popup.c
+++ b/src/lib/elc_popup.c
@@ -59,6 +59,7 @@ _elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd)
59 elm_widget_item_translate(it); 59 elm_widget_item_translate(it);
60 60
61 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate()); 61 eo_do_super(obj, MY_CLASS, elm_obj_widget_translate());
62 eo_do(sd->main_layout, elm_obj_widget_translate());
62 63
63 return EINA_TRUE; 64 return EINA_TRUE;
64} 65}
@@ -69,14 +70,14 @@ _visuals_set(Evas_Object *obj)
69 ELM_POPUP_DATA_GET(obj, sd); 70 ELM_POPUP_DATA_GET(obj, sd);
70 71
71 if (!sd->title_text && !sd->title_icon) 72 if (!sd->title_text && !sd->title_icon)
72 elm_layout_signal_emit(obj, "elm,state,title_area,hidden", "elm"); 73 elm_layout_signal_emit(sd->main_layout, "elm,state,title_area,hidden", "elm");
73 else 74 else
74 elm_layout_signal_emit(obj, "elm,state,title_area,visible", "elm"); 75 elm_layout_signal_emit(sd->main_layout, "elm,state,title_area,visible", "elm");
75 76
76 if (sd->action_area) 77 if (sd->action_area)
77 elm_layout_signal_emit(obj, "elm,state,action_area,visible", "elm"); 78 elm_layout_signal_emit(sd->main_layout, "elm,state,action_area,visible", "elm");
78 else 79 else
79 elm_layout_signal_emit(obj, "elm,state,action_area,hidden", "elm"); 80 elm_layout_signal_emit(sd->main_layout, "elm,state,action_area,hidden", "elm");
80} 81}
81 82
82static void 83static void
@@ -100,9 +101,10 @@ static Evas_Object *
100_access_object_get(const Evas_Object *obj, const char* part) 101_access_object_get(const Evas_Object *obj, const char* part)
101{ 102{
102 Evas_Object *po, *ao; 103 Evas_Object *po, *ao;
103 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 104 ELM_POPUP_DATA_GET(obj, sd);
104 105
105 po = (Evas_Object *)edje_object_part_object_get(wd->resize_obj, part); 106 po = (Evas_Object *)edje_object_part_object_get
107 (elm_layout_edje_get(sd->main_layout), part);
106 ao = evas_object_data_get(po, "_part_access_obj"); 108 ao = evas_object_data_get(po, "_part_access_obj");
107 109
108 return ao; 110 return ao;
@@ -114,42 +116,10 @@ _on_show(void *data EINA_UNUSED,
114 Evas_Object *obj, 116 Evas_Object *obj,
115 void *event_info EINA_UNUSED) 117 void *event_info EINA_UNUSED)
116{ 118{
117 ELM_POPUP_DATA_GET(obj, sd);
118
119 /* yeah, ugly, but again, this widget needs a rewrite */
120 if (elm_widget_parent_get(sd->notify) == obj)
121 elm_widget_sub_object_del(obj, sd->notify);
122
123/* FIXME: Should be rewritten popup. This code is for arranging child-parent relation well. Without this code, Popup't top parent will be notify. And there will be no parent for notify. Terrible! */
124 elm_widget_sub_object_add(elm_widget_parent_get(obj), sd->notify);
125
126 elm_object_content_set(sd->notify, obj);
127
128 evas_object_show(sd->notify);
129
130 elm_object_focus_set(obj, EINA_TRUE); 119 elm_object_focus_set(obj, EINA_TRUE);
131} 120}
132 121
133static void 122static void
134_on_hide(void *data EINA_UNUSED,
135 Evas *e EINA_UNUSED,
136 Evas_Object *obj,
137 void *event_info EINA_UNUSED)
138{
139 ELM_POPUP_DATA_GET(obj, sd);
140
141 //Revert the obj-tree again.
142 elm_object_content_unset(sd->notify);
143 elm_widget_sub_object_add(elm_widget_parent_get(sd->notify), obj);
144 elm_widget_sub_object_add(obj, sd->notify);
145
146 evas_object_hide(sd->notify);
147
148/* FIXME:elm_object_content_unset(notify) deletes callback to revert focus status. */
149 elm_object_focus_set(obj, EINA_FALSE);
150}
151
152static void
153_scroller_size_calc(Evas_Object *obj) 123_scroller_size_calc(Evas_Object *obj)
154{ 124{
155 Evas_Coord h; 125 Evas_Coord h;
@@ -158,7 +128,6 @@ _scroller_size_calc(Evas_Object *obj)
158 const char *action_area_height; 128 const char *action_area_height;
159 129
160 ELM_POPUP_DATA_GET(obj, sd); 130 ELM_POPUP_DATA_GET(obj, sd);
161 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
162 131
163 if (!sd->items) return; 132 if (!sd->items) return;
164 133
@@ -167,7 +136,7 @@ _scroller_size_calc(Evas_Object *obj)
167 sd->max_sc_w = -1; 136 sd->max_sc_w = -1;
168 evas_object_geometry_get(sd->notify, NULL, NULL, NULL, &h); 137 evas_object_geometry_get(sd->notify, NULL, NULL, NULL, &h);
169 if (sd->title_text || sd->title_icon) 138 if (sd->title_text || sd->title_icon)
170 edje_object_part_geometry_get(wd->resize_obj, 139 edje_object_part_geometry_get(elm_layout_edje_get(sd->main_layout),
171 "elm.bg.title", NULL, NULL, NULL, &h_title); 140 "elm.bg.title", NULL, NULL, NULL, &h_title);
172 if (sd->action_area) 141 if (sd->action_area)
173 { 142 {
@@ -248,6 +217,7 @@ _elm_popup_evas_object_smart_del(Eo *obj, Elm_Popup_Data *sd)
248 } 217 }
249 218
250 // XXX? delete other objects? just to be sure. 219 // XXX? delete other objects? just to be sure.
220 ELM_SAFE_FREE(sd->main_layout, evas_object_del);
251 ELM_SAFE_FREE(sd->notify, evas_object_del); 221 ELM_SAFE_FREE(sd->notify, evas_object_del);
252 ELM_SAFE_FREE(sd->title_icon, evas_object_del); 222 ELM_SAFE_FREE(sd->title_icon, evas_object_del);
253 ELM_SAFE_FREE(sd->content_area, evas_object_del); 223 ELM_SAFE_FREE(sd->content_area, evas_object_del);
@@ -278,14 +248,13 @@ _access_obj_process(Eo *obj, Eina_Bool is_access)
278 Evas_Object *ao; 248 Evas_Object *ao;
279 249
280 ELM_POPUP_DATA_GET(obj, sd); 250 ELM_POPUP_DATA_GET(obj, sd);
281 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
282 251
283 if (is_access) 252 if (is_access)
284 { 253 {
285 if (sd->title_text) 254 if (sd->title_text)
286 { 255 {
287 ao = _elm_access_edje_object_part_object_register 256 ao = _elm_access_edje_object_part_object_register
288 (obj, wd->resize_obj, ACCESS_TITLE_PART); 257 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
289 _elm_access_text_set(_elm_access_info_get(ao), 258 _elm_access_text_set(_elm_access_info_get(ao),
290 ELM_ACCESS_TYPE, E_("Popup Title")); 259 ELM_ACCESS_TYPE, E_("Popup Title"));
291 _elm_access_text_set(_elm_access_info_get(ao), 260 _elm_access_text_set(_elm_access_info_get(ao),
@@ -295,7 +264,7 @@ _access_obj_process(Eo *obj, Eina_Bool is_access)
295 if (sd->text_content_obj) 264 if (sd->text_content_obj)
296 { 265 {
297 ao = _elm_access_edje_object_part_object_register 266 ao = _elm_access_edje_object_part_object_register
298 (obj, wd->resize_obj, ACCESS_BODY_PART); 267 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_BODY_PART);
299 _elm_access_text_set(_elm_access_info_get(ao), 268 _elm_access_text_set(_elm_access_info_get(ao),
300 ELM_ACCESS_TYPE, E_("Popup Body Text")); 269 ELM_ACCESS_TYPE, E_("Popup Body Text"));
301 _elm_access_text_set(_elm_access_info_get(ao), 270 _elm_access_text_set(_elm_access_info_get(ao),
@@ -307,13 +276,13 @@ _access_obj_process(Eo *obj, Eina_Bool is_access)
307 if (sd->title_text) 276 if (sd->title_text)
308 { 277 {
309 _elm_access_edje_object_part_object_unregister 278 _elm_access_edje_object_part_object_unregister
310 (obj, wd->resize_obj, ACCESS_TITLE_PART); 279 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
311 } 280 }
312 281
313 if (sd->text_content_obj) 282 if (sd->text_content_obj)
314 { 283 {
315 _elm_access_edje_object_part_object_unregister 284 _elm_access_edje_object_part_object_unregister
316 (obj, wd->resize_obj, ACCESS_BODY_PART); 285 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_BODY_PART);
317 } 286 }
318 } 287 }
319} 288}
@@ -327,18 +296,15 @@ _elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
327 char buf[1024], style[1024]; 296 char buf[1024], style[1024];
328 Eina_Bool int_ret = EINA_FALSE; 297 Eina_Bool int_ret = EINA_FALSE;
329 298
330 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
331
332 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
333 if (!int_ret) return EINA_FALSE;
334
335 _mirrored_set(obj, elm_widget_mirrored_get(obj)); 299 _mirrored_set(obj, elm_widget_mirrored_get(obj));
336 300
337 //FIXME: theme set seems corrupted.
338 //if (elm_widget_parent_get(sd->notify) != obj)
339 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj)); 301 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj));
340 elm_widget_style_set(sd->notify, style); 302 elm_widget_style_set(sd->notify, style);
341 303
304 if (!elm_layout_theme_set(sd->main_layout, "popup", "base",
305 elm_widget_style_get(obj)))
306 CRI("Failed to set layout!");
307
342 if (sd->action_area) 308 if (sd->action_area)
343 { 309 {
344 snprintf(buf, sizeof(buf), "buttons%i", sd->last_button_number); 310 snprintf(buf, sizeof(buf), "buttons%i", sd->last_button_number);
@@ -385,15 +351,15 @@ _elm_popup_elm_widget_theme_apply(Eo *obj, Elm_Popup_Data *sd)
385 } 351 }
386 if (sd->title_text) 352 if (sd->title_text)
387 { 353 {
388 elm_layout_text_set(obj, "elm.text.title", sd->title_text); 354 elm_layout_text_set(sd->main_layout, "elm.text.title", sd->title_text);
389 elm_layout_signal_emit(obj, "elm,state,title,text,visible", "elm"); 355 elm_layout_signal_emit(sd->main_layout, "elm,state,title,text,visible", "elm");
390 } 356 }
391 if (sd->title_icon) 357 if (sd->title_icon)
392 elm_layout_signal_emit(obj, "elm,state,title,icon,visible", "elm"); 358 elm_layout_signal_emit(sd->main_layout, "elm,state,title,icon,visible", "elm");
393 359
394 _visuals_set(obj); 360 _visuals_set(obj);
395 edje_object_message_signal_process(wd->resize_obj); 361 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
396 elm_layout_sizing_eval(obj); 362 elm_layout_sizing_eval(sd->main_layout);
397 363
398 /* access */ 364 /* access */
399 if (_elm_config->access_mode) _access_obj_process(obj, EINA_TRUE); 365 if (_elm_config->access_mode) _access_obj_process(obj, EINA_TRUE);
@@ -421,8 +387,6 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
421 Evas_Coord h_box = 0, minh_box = 0; 387 Evas_Coord h_box = 0, minh_box = 0;
422 Evas_Coord minw = -1, minh = -1; 388 Evas_Coord minw = -1, minh = -1;
423 389
424 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
425
426 if (sd->items) 390 if (sd->items)
427 { 391 {
428 EINA_LIST_FOREACH(sd->items, elist, it) 392 EINA_LIST_FOREACH(sd->items, elist, it)
@@ -439,7 +403,7 @@ _elm_popup_elm_layout_sizing_eval(Eo *obj, Elm_Popup_Data *sd)
439 evas_object_size_hint_max_get(sd->scr, &minw, &minh); 403 evas_object_size_hint_max_get(sd->scr, &minw, &minh);
440 } 404 }
441 405
442 edje_object_size_min_calc(wd->resize_obj, &minw, &minh); 406 edje_object_size_min_calc(elm_layout_edje_get(sd->main_layout), &minw, &minh);
443 407
444 evas_object_size_hint_min_set(obj, minw, minh); 408 evas_object_size_hint_min_set(obj, minw, minh);
445 evas_object_size_hint_max_set(obj, -1, -1); 409 evas_object_size_hint_max_set(obj, -1, -1);
@@ -451,15 +415,13 @@ _elm_popup_elm_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *s
451 Elm_Popup_Item *it; 415 Elm_Popup_Item *it;
452 Eina_Bool int_ret = EINA_FALSE; 416 Eina_Bool int_ret = EINA_FALSE;
453 417
454 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
455
456 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj)); 418 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_sub_object_del(sobj));
457 if (!int_ret) return EINA_FALSE; 419 if (!int_ret) return EINA_FALSE;
458 420
459 if (sobj == sd->title_icon) 421 if (sobj == sd->title_icon)
460 { 422 {
461 elm_layout_signal_emit(obj, "elm,state,title,icon,hidden", "elm"); 423 elm_layout_signal_emit(sd->main_layout, "elm,state,title,icon,hidden", "elm");
462 edje_object_message_signal_process(wd->resize_obj); 424 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
463 sd->title_icon = NULL; 425 sd->title_icon = NULL;
464 } 426 }
465 else if ((it = 427 else if ((it =
@@ -467,7 +429,7 @@ _elm_popup_elm_widget_sub_object_del(Eo *obj, Elm_Popup_Data *sd, Evas_Object *s
467 { 429 {
468 if (sobj == it->icon) 430 if (sobj == it->icon)
469 { 431 {
470 elm_layout_content_unset(VIEW(it), CONTENT_PART); 432 eo_do(VIEW(it), elm_obj_container_content_unset(CONTENT_PART));
471 elm_layout_signal_emit(VIEW(it), 433 elm_layout_signal_emit(VIEW(it),
472 "elm,state,item,icon,hidden", "elm"); 434 "elm,state,item,icon,hidden", "elm");
473 it->icon = NULL; 435 it->icon = NULL;
@@ -486,7 +448,7 @@ _on_content_del(void *data,
486 ELM_POPUP_DATA_GET(data, sd); 448 ELM_POPUP_DATA_GET(data, sd);
487 449
488 sd->content = NULL; 450 sd->content = NULL;
489 elm_layout_sizing_eval(data); 451 elm_layout_sizing_eval(sd->main_layout);
490} 452}
491 453
492static void 454static void
@@ -498,7 +460,7 @@ _on_text_content_del(void *data,
498 ELM_POPUP_DATA_GET(data, sd); 460 ELM_POPUP_DATA_GET(data, sd);
499 461
500 sd->text_content_obj = NULL; 462 sd->text_content_obj = NULL;
501 elm_layout_sizing_eval(data); 463 elm_layout_sizing_eval(sd->main_layout);
502} 464}
503 465
504static void 466static void
@@ -513,7 +475,7 @@ _on_table_del(void *data,
513 sd->spacer = NULL; 475 sd->spacer = NULL;
514 sd->scr = NULL; 476 sd->scr = NULL;
515 sd->box = NULL; 477 sd->box = NULL;
516 elm_layout_sizing_eval(data); 478 elm_layout_sizing_eval(sd->main_layout);
517} 479}
518 480
519static void 481static void
@@ -546,7 +508,6 @@ _button_remove(Evas_Object *obj,
546 char buf[128]; 508 char buf[128];
547 509
548 ELM_POPUP_DATA_GET(obj, sd); 510 ELM_POPUP_DATA_GET(obj, sd);
549 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
550 511
551 if (!sd->last_button_number) return; 512 if (!sd->last_button_number) return;
552 513
@@ -579,7 +540,7 @@ _button_remove(Evas_Object *obj,
579 { 540 {
580 _visuals_set(obj); 541 _visuals_set(obj);
581 ELM_SAFE_FREE(sd->action_area, evas_object_del); 542 ELM_SAFE_FREE(sd->action_area, evas_object_del);
582 edje_object_message_signal_process(wd->resize_obj); 543 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
583 } 544 }
584 else 545 else
585 { 546 {
@@ -593,12 +554,12 @@ _button_remove(Evas_Object *obj,
593} 554}
594 555
595static void 556static void
596_layout_change_cb(void *data, 557_layout_change_cb(void *data EINA_UNUSED,
597 Evas_Object *obj EINA_UNUSED, 558 Evas_Object *obj,
598 const char *emission EINA_UNUSED, 559 const char *emission EINA_UNUSED,
599 const char *source EINA_UNUSED) 560 const char *source EINA_UNUSED)
600{ 561{
601 elm_layout_sizing_eval(data); 562 elm_layout_sizing_eval(obj);
602} 563}
603 564
604static void 565static void
@@ -609,7 +570,7 @@ _restack_cb(void *data EINA_UNUSED,
609{ 570{
610 ELM_POPUP_DATA_GET(obj, sd); 571 ELM_POPUP_DATA_GET(obj, sd);
611 572
612 evas_object_layer_set(sd->notify, evas_object_layer_get(obj)); 573 evas_object_raise(sd->notify);
613} 574}
614 575
615static void 576static void
@@ -618,13 +579,12 @@ _list_add(Evas_Object *obj)
618 char style[1024]; 579 char style[1024];
619 580
620 ELM_POPUP_DATA_GET(obj, sd); 581 ELM_POPUP_DATA_GET(obj, sd);
621 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
622 582
623 //Table 583 //Table
624 sd->tbl = elm_table_add(obj); 584 sd->tbl = elm_table_add(sd->main_layout);
625 evas_object_event_callback_add(sd->tbl, EVAS_CALLBACK_DEL, 585 evas_object_event_callback_add(sd->tbl, EVAS_CALLBACK_DEL,
626 _on_table_del, obj); 586 _on_table_del, obj);
627 edje_object_part_swallow(wd->resize_obj, CONTENT_PART, sd->tbl); 587 eo_do(sd->main_layout, elm_obj_container_content_set(CONTENT_PART, sd->tbl));
628 evas_object_show(sd->tbl); 588 evas_object_show(sd->tbl);
629 589
630 //Spacer 590 //Spacer
@@ -634,7 +594,7 @@ _list_add(Evas_Object *obj)
634 594
635 //Scroller 595 //Scroller
636 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj)); 596 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj));
637 sd->scr = elm_scroller_add(obj); 597 sd->scr = elm_scroller_add(sd->tbl);
638 elm_widget_style_set(sd->scr, style); 598 elm_widget_style_set(sd->scr, style);
639 elm_scroller_content_min_limit(sd->scr, EINA_TRUE, EINA_FALSE); 599 elm_scroller_content_min_limit(sd->scr, EINA_TRUE, EINA_FALSE);
640 elm_scroller_bounce_set(sd->scr, EINA_FALSE, EINA_TRUE); 600 elm_scroller_bounce_set(sd->scr, EINA_FALSE, EINA_TRUE);
@@ -642,12 +602,12 @@ _list_add(Evas_Object *obj)
642 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 602 EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
643 evas_object_size_hint_align_set(sd->scr, EVAS_HINT_FILL, EVAS_HINT_FILL); 603 evas_object_size_hint_align_set(sd->scr, EVAS_HINT_FILL, EVAS_HINT_FILL);
644 evas_object_event_callback_add(sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 604 evas_object_event_callback_add(sd->scr, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
645 _size_hints_changed_cb, obj); 605 _size_hints_changed_cb, sd->main_layout);
646 elm_table_pack(sd->tbl, sd->scr, 0, 0, 1, 1); 606 elm_table_pack(sd->tbl, sd->scr, 0, 0, 1, 1);
647 evas_object_show(sd->scr); 607 evas_object_show(sd->scr);
648 608
649 //Box 609 //Box
650 sd->box = elm_box_add(obj); 610 sd->box = elm_box_add(sd->scr);
651 evas_object_size_hint_weight_set(sd->box, EVAS_HINT_EXPAND, 0.0); 611 evas_object_size_hint_weight_set(sd->box, EVAS_HINT_EXPAND, 0.0);
652 evas_object_size_hint_align_set(sd->box, EVAS_HINT_FILL, 0.0); 612 evas_object_size_hint_align_set(sd->box, EVAS_HINT_FILL, 0.0);
653 elm_object_content_set(sd->scr, sd->box); 613 elm_object_content_set(sd->scr, sd->box);
@@ -731,7 +691,7 @@ _item_icon_set(Elm_Popup_Item *it,
731 { 691 {
732 elm_widget_sub_object_add(WIDGET(it), it->icon); 692 elm_widget_sub_object_add(WIDGET(it), it->icon);
733 evas_object_data_set(it->icon, "_popup_icon_parent_item", it); 693 evas_object_data_set(it->icon, "_popup_icon_parent_item", it);
734 elm_layout_content_set(VIEW(it), CONTENT_PART, it->icon); 694 eo_do(VIEW(it), elm_obj_container_content_set(CONTENT_PART, it->icon));
735 elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,visible", "elm"); 695 elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,visible", "elm");
736 } 696 }
737 else 697 else
@@ -779,7 +739,7 @@ _item_icon_unset(Elm_Popup_Item *it)
779 if (!it->icon) return NULL; 739 if (!it->icon) return NULL;
780 elm_widget_sub_object_del(WIDGET(it), icon); 740 elm_widget_sub_object_del(WIDGET(it), icon);
781 evas_object_data_del(icon, "_popup_icon_parent_item"); 741 evas_object_data_del(icon, "_popup_icon_parent_item");
782 elm_layout_content_unset(VIEW(it), CONTENT_PART); 742 eo_do(VIEW(it), elm_obj_container_content_unset(CONTENT_PART));
783 elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,hidden", "elm"); 743 elm_layout_signal_emit(VIEW(it), "elm,state,item,icon,hidden", "elm");
784 it->icon = NULL; 744 it->icon = NULL;
785 745
@@ -901,16 +861,13 @@ _title_text_set(Evas_Object *obj,
901 Eina_Bool title_visibility_old, title_visibility_current; 861 Eina_Bool title_visibility_old, title_visibility_current;
902 862
903 ELM_POPUP_DATA_GET(obj, sd); 863 ELM_POPUP_DATA_GET(obj, sd);
904 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
905 864
906 if (sd->title_text == text) return EINA_TRUE; 865 if (sd->title_text == text) return EINA_TRUE;
907 866
908 title_visibility_old = (sd->title_text) || (sd->title_icon); 867 title_visibility_old = (sd->title_text) || (sd->title_icon);
909 eina_stringshare_replace(&sd->title_text, text); 868 eina_stringshare_replace(&sd->title_text, text);
910 869
911 //bare edje here because we're inside the hook, already 870 elm_layout_text_set(sd->main_layout, "elm.text.title", text);
912 edje_object_part_text_escaped_set
913 (wd->resize_obj, "elm.text.title", text);
914 871
915 /* access */ 872 /* access */
916 if (_elm_config->access_mode) 873 if (_elm_config->access_mode)
@@ -919,7 +876,7 @@ _title_text_set(Evas_Object *obj,
919 if (!ao) 876 if (!ao)
920 { 877 {
921 ao = _elm_access_edje_object_part_object_register 878 ao = _elm_access_edje_object_part_object_register
922 (obj, wd->resize_obj, ACCESS_TITLE_PART); 879 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_TITLE_PART);
923 _elm_access_text_set(_elm_access_info_get(ao), 880 _elm_access_text_set(_elm_access_info_get(ao),
924 ELM_ACCESS_TYPE, E_("Popup Title")); 881 ELM_ACCESS_TYPE, E_("Popup Title"));
925 } 882 }
@@ -927,17 +884,17 @@ _title_text_set(Evas_Object *obj,
927 } 884 }
928 885
929 if (sd->title_text) 886 if (sd->title_text)
930 elm_layout_signal_emit(obj, "elm,state,title,text,visible", "elm"); 887 elm_layout_signal_emit(sd->main_layout, "elm,state,title,text,visible", "elm");
931 else 888 else
932 elm_layout_signal_emit(obj, "elm,state,title,text,hidden", "elm"); 889 elm_layout_signal_emit(sd->main_layout, "elm,state,title,text,hidden", "elm");
933 890
934 title_visibility_current = (sd->title_text) || (sd->title_icon); 891 title_visibility_current = (sd->title_text) || (sd->title_icon);
935 892
936 if (title_visibility_old != title_visibility_current) 893 if (title_visibility_old != title_visibility_current)
937 _visuals_set(obj); 894 _visuals_set(obj);
938 895
939 edje_object_message_signal_process(wd->resize_obj); 896 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
940 elm_layout_sizing_eval(obj); 897 elm_layout_sizing_eval(sd->main_layout);
941 898
942 return EINA_TRUE; 899 return EINA_TRUE;
943} 900}
@@ -950,18 +907,16 @@ _content_text_set(Evas_Object *obj,
950 char style[1024]; 907 char style[1024];
951 908
952 ELM_POPUP_DATA_GET(obj, sd); 909 ELM_POPUP_DATA_GET(obj, sd);
953 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
954 910
955 if (sd->items) 911 if (sd->items)
956 { 912 {
957 _items_remove(sd); 913 _items_remove(sd);
958 _list_del(sd); 914 _list_del(sd);
959 } 915 }
960 else edje_object_part_swallow(wd->resize_obj, CONTENT_PART, 916 else eo_do(sd->main_layout, elm_obj_container_content_set(CONTENT_PART, sd->content_area));
961 sd->content_area);
962 if (!text) goto end; 917 if (!text) goto end;
963 918
964 sd->text_content_obj = elm_label_add(obj); 919 sd->text_content_obj = elm_label_add(sd->content_area);
965 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj)); 920 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj));
966 elm_object_style_set(sd->text_content_obj, style); 921 elm_object_style_set(sd->text_content_obj, style);
967 922
@@ -974,8 +929,8 @@ _content_text_set(Evas_Object *obj,
974 (sd->text_content_obj, EVAS_HINT_EXPAND, 0.0); 929 (sd->text_content_obj, EVAS_HINT_EXPAND, 0.0);
975 evas_object_size_hint_align_set 930 evas_object_size_hint_align_set
976 (sd->text_content_obj, EVAS_HINT_FILL, EVAS_HINT_FILL); 931 (sd->text_content_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
977 elm_layout_content_set 932 eo_do(sd->content_area, elm_obj_container_content_set
978 (sd->content_area, CONTENT_PART, sd->text_content_obj); 933 (CONTENT_PART, sd->text_content_obj));
979 934
980 /* access */ 935 /* access */
981 if (_elm_config->access_mode) 936 if (_elm_config->access_mode)
@@ -987,7 +942,7 @@ _content_text_set(Evas_Object *obj,
987 if (!ao) 942 if (!ao)
988 { 943 {
989 ao = _elm_access_edje_object_part_object_register 944 ao = _elm_access_edje_object_part_object_register
990 (obj, wd->resize_obj, ACCESS_BODY_PART); 945 (obj, elm_layout_edje_get(sd->main_layout), ACCESS_BODY_PART);
991 _elm_access_text_set(_elm_access_info_get(ao), 946 _elm_access_text_set(_elm_access_info_get(ao),
992 ELM_ACCESS_TYPE, E_("Popup Body Text")); 947 ELM_ACCESS_TYPE, E_("Popup Body Text"));
993 } 948 }
@@ -995,13 +950,13 @@ _content_text_set(Evas_Object *obj,
995 } 950 }
996 951
997end: 952end:
998 elm_layout_sizing_eval(obj); 953 elm_layout_sizing_eval(sd->main_layout);
999 954
1000 return EINA_TRUE; 955 return EINA_TRUE;
1001} 956}
1002 957
1003EOLIAN static Eina_Bool 958EOLIAN static Eina_Bool
1004_elm_popup_elm_layout_text_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part, const char *label) 959_elm_popup_elm_layout_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, const char *label)
1005{ 960{
1006 Eina_Bool int_ret = EINA_FALSE; 961 Eina_Bool int_ret = EINA_FALSE;
1007 962
@@ -1010,26 +965,22 @@ _elm_popup_elm_layout_text_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const c
1010 else if (!strcmp(part, "title,text")) 965 else if (!strcmp(part, "title,text"))
1011 int_ret = _title_text_set(obj, label); 966 int_ret = _title_text_set(obj, label);
1012 else 967 else
1013 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_layout_text_set(part, label)); 968 int_ret = elm_layout_text_set(_pd->main_layout, part, label);
1014 969
1015 return int_ret; 970 return int_ret;
1016} 971}
1017 972
1018static const char * 973static const char *
1019_title_text_get(const Evas_Object *obj) 974_title_text_get(const Elm_Popup_Data *sd)
1020{ 975{
1021 ELM_POPUP_DATA_GET(obj, sd);
1022
1023 return sd->title_text; 976 return sd->title_text;
1024} 977}
1025 978
1026static const char * 979static const char *
1027_content_text_get(const Evas_Object *obj) 980_content_text_get(const Elm_Popup_Data *sd)
1028{ 981{
1029 const char *str = NULL; 982 const char *str = NULL;
1030 983
1031 ELM_POPUP_DATA_GET(obj, sd);
1032
1033 if (sd->text_content_obj) 984 if (sd->text_content_obj)
1034 str = elm_object_text_get(sd->text_content_obj); 985 str = elm_object_text_get(sd->text_content_obj);
1035 986
@@ -1037,16 +988,16 @@ _content_text_get(const Evas_Object *obj)
1037} 988}
1038 989
1039EOLIAN static const char* 990EOLIAN static const char*
1040_elm_popup_elm_layout_text_get(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part) 991_elm_popup_elm_layout_text_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part)
1041{ 992{
1042 const char *text = NULL; 993 const char *text = NULL;
1043 994
1044 if (!part || !strcmp(part, "default")) 995 if (!part || !strcmp(part, "default"))
1045 text = _content_text_get(obj); 996 text = _content_text_get(_pd);
1046 else if (!strcmp(part, "title,text")) 997 else if (!strcmp(part, "title,text"))
1047 text = _title_text_get(obj); 998 text = _title_text_get(_pd);
1048 else 999 else
1049 eo_do_super(obj, MY_CLASS, text = elm_obj_layout_text_get(part)); 1000 text = elm_layout_text_get(_pd->main_layout, part);
1050 1001
1051 return text; 1002 return text;
1052} 1003}
@@ -1058,7 +1009,6 @@ _title_icon_set(Evas_Object *obj,
1058 Eina_Bool title_visibility_old, title_visibility_current; 1009 Eina_Bool title_visibility_old, title_visibility_current;
1059 1010
1060 ELM_POPUP_DATA_GET(obj, sd); 1011 ELM_POPUP_DATA_GET(obj, sd);
1061 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1062 1012
1063 if (sd->title_icon == icon) return EINA_TRUE; 1013 if (sd->title_icon == icon) return EINA_TRUE;
1064 title_visibility_old = (sd->title_text) || (sd->title_icon); 1014 title_visibility_old = (sd->title_text) || (sd->title_icon);
@@ -1067,17 +1017,15 @@ _title_icon_set(Evas_Object *obj,
1067 sd->title_icon = icon; 1017 sd->title_icon = icon;
1068 title_visibility_current = (sd->title_text) || (sd->title_icon); 1018 title_visibility_current = (sd->title_text) || (sd->title_icon);
1069 1019
1070 //bare edje here because we're already in content_set virtual 1020 eo_do(sd->main_layout, elm_obj_container_content_set
1071 edje_object_part_swallow 1021 ("elm.swallow.title.icon", sd->title_icon));
1072 (wd->resize_obj, "elm.swallow.title.icon",
1073 sd->title_icon);
1074 1022
1075 if (sd->title_icon) 1023 if (sd->title_icon)
1076 elm_layout_signal_emit(obj, "elm,state,title,icon,visible", "elm"); 1024 elm_layout_signal_emit(sd->main_layout, "elm,state,title,icon,visible", "elm");
1077 if (title_visibility_old != title_visibility_current) _visuals_set(obj); 1025 if (title_visibility_old != title_visibility_current) _visuals_set(obj);
1078 1026
1079 edje_object_message_signal_process(wd->resize_obj); 1027 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
1080 elm_layout_sizing_eval(obj); 1028 elm_layout_sizing_eval(sd->main_layout);
1081 1029
1082 return EINA_TRUE; 1030 return EINA_TRUE;
1083} 1031}
@@ -1087,7 +1035,6 @@ _content_set(Evas_Object *obj,
1087 Evas_Object *content) 1035 Evas_Object *content)
1088{ 1036{
1089 ELM_POPUP_DATA_GET(obj, sd); 1037 ELM_POPUP_DATA_GET(obj, sd);
1090 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
1091 1038
1092 if (sd->content && sd->content == content) return EINA_TRUE; 1039 if (sd->content && sd->content == content) return EINA_TRUE;
1093 if (sd->items) 1040 if (sd->items)
@@ -1099,19 +1046,17 @@ _content_set(Evas_Object *obj,
1099 sd->content = content; 1046 sd->content = content;
1100 if (content) 1047 if (content)
1101 { 1048 {
1102 //bare edje as to avoid loop 1049 eo_do(sd->main_layout, elm_obj_container_content_set
1103 edje_object_part_swallow 1050 (CONTENT_PART, sd->content_area));
1104 (wd->resize_obj, CONTENT_PART,
1105 sd->content_area);
1106 1051
1107 elm_layout_content_set 1052 eo_do(sd->content_area, elm_obj_container_content_set
1108 (sd->content_area, CONTENT_PART, content); 1053 (CONTENT_PART, content));
1109 evas_object_show(content); 1054 evas_object_show(content);
1110 1055
1111 evas_object_event_callback_add 1056 evas_object_event_callback_add
1112 (content, EVAS_CALLBACK_DEL, _on_content_del, obj); 1057 (content, EVAS_CALLBACK_DEL, _on_content_del, obj);
1113 } 1058 }
1114 elm_layout_sizing_eval(obj); 1059 elm_layout_sizing_eval(sd->main_layout);
1115 1060
1116 return EINA_TRUE; 1061 return EINA_TRUE;
1117} 1062}
@@ -1124,7 +1069,6 @@ _action_button_set(Evas_Object *obj,
1124 char buf[128], style[1024]; 1069 char buf[128], style[1024];
1125 1070
1126 ELM_POPUP_DATA_GET(obj, sd); 1071 ELM_POPUP_DATA_GET(obj, sd);
1127 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1128 1072
1129 if (idx >= ELM_POPUP_ACTION_BUTTON_MAX) return; 1073 if (idx >= ELM_POPUP_ACTION_BUTTON_MAX) return;
1130 1074
@@ -1159,12 +1103,12 @@ _action_button_set(Evas_Object *obj,
1159 snprintf(buf, sizeof(buf), "buttons%i", sd->last_button_number); 1103 snprintf(buf, sizeof(buf), "buttons%i", sd->last_button_number);
1160 if (!sd->action_area) 1104 if (!sd->action_area)
1161 { 1105 {
1162 sd->action_area = elm_layout_add(obj); 1106 sd->action_area = elm_layout_add(sd->main_layout);
1163 evas_object_event_callback_add 1107 evas_object_event_callback_add
1164 (sd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 1108 (sd->action_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1165 _size_hints_changed_cb, obj); 1109 _size_hints_changed_cb, sd->main_layout);
1166 edje_object_part_swallow 1110 eo_do(sd->main_layout, elm_obj_container_content_set
1167 (wd->resize_obj, "elm.swallow.action_area", sd->action_area); 1111 ("elm.swallow.action_area", sd->action_area));
1168 1112
1169 _visuals_set(obj); 1113 _visuals_set(obj);
1170 } 1114 }
@@ -1177,10 +1121,10 @@ _action_button_set(Evas_Object *obj,
1177 elm_object_part_content_set 1121 elm_object_part_content_set
1178 (sd->action_area, buf, sd->buttons[idx]->btn); 1122 (sd->action_area, buf, sd->buttons[idx]->btn);
1179 1123
1180 edje_object_message_signal_process(wd->resize_obj); 1124 edje_object_message_signal_process(elm_layout_edje_get(sd->main_layout));
1181 if (sd->items) _scroller_size_calc(obj); 1125 if (sd->items) _scroller_size_calc(obj);
1182 1126
1183 elm_layout_sizing_eval(obj); 1127 elm_layout_sizing_eval(sd->main_layout);
1184} 1128}
1185 1129
1186EOLIAN static Eina_Bool 1130EOLIAN static Eina_Bool
@@ -1205,29 +1149,20 @@ _elm_popup_elm_container_content_set(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, c
1205 _action_button_set(obj, content, i); 1149 _action_button_set(obj, content, i);
1206 } 1150 }
1207 else 1151 else
1208 { 1152 return eo_do(_pd->main_layout, elm_obj_container_content_set(part, content));
1209 Eina_Bool int_ret = EINA_FALSE;
1210 eo_do_super(obj, MY_CLASS,
1211 int_ret = elm_obj_container_content_set(part, content));
1212 return int_ret;
1213 }
1214 1153
1215 return EINA_TRUE; 1154 return EINA_TRUE;
1216} 1155}
1217 1156
1218static Evas_Object * 1157static Evas_Object *
1219_title_icon_get(const Evas_Object *obj) 1158_title_icon_get(const Elm_Popup_Data *sd)
1220{ 1159{
1221 ELM_POPUP_DATA_GET(obj, sd);
1222
1223 return sd->title_icon; 1160 return sd->title_icon;
1224} 1161}
1225 1162
1226static Evas_Object * 1163static Evas_Object *
1227_content_get(const Evas_Object *obj) 1164_content_get(const Elm_Popup_Data *sd)
1228{ 1165{
1229 ELM_POPUP_DATA_GET(obj, sd);
1230
1231 return sd->content; 1166 return sd->content;
1232} 1167}
1233 1168
@@ -1247,15 +1182,15 @@ _action_button_get(const Evas_Object *obj,
1247} 1182}
1248 1183
1249EOLIAN static Evas_Object* 1184EOLIAN static Evas_Object*
1250_elm_popup_elm_container_content_get(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, const char *part) 1185_elm_popup_elm_container_content_get(Eo *obj, Elm_Popup_Data *_pd, const char *part)
1251{ 1186{
1252 Evas_Object *content = NULL; 1187 Evas_Object *content = NULL;
1253 unsigned int i; 1188 unsigned int i;
1254 1189
1255 if (!part || !strcmp(part, "default")) 1190 if (!part || !strcmp(part, "default"))
1256 content = _content_get(obj); 1191 content = _content_get(_pd);
1257 else if (!strcmp(part, "title,text")) 1192 else if (!strcmp(part, "title,text"))
1258 content = _title_icon_get(obj); 1193 content = _title_icon_get(_pd);
1259 else if (!strncmp(part, "button", 6)) 1194 else if (!strncmp(part, "button", 6))
1260 { 1195 {
1261 i = atoi(part + 6) - 1; 1196 i = atoi(part + 6) - 1;
@@ -1266,10 +1201,7 @@ _elm_popup_elm_container_content_get(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, c
1266 content = _action_button_get(obj, i); 1201 content = _action_button_get(obj, i);
1267 } 1202 }
1268 else 1203 else
1269 { 1204 content = eo_do(_pd->main_layout, elm_obj_container_content_get(part));
1270 eo_do_super(obj, MY_CLASS,
1271 content = elm_obj_container_content_get(part));
1272 }
1273 1205
1274 if (!content) 1206 if (!content)
1275 goto err; 1207 goto err;
@@ -1293,10 +1225,10 @@ _content_unset(Evas_Object *obj)
1293 evas_object_event_callback_del 1225 evas_object_event_callback_del
1294 (sd->content, EVAS_CALLBACK_DEL, _on_content_del); 1226 (sd->content, EVAS_CALLBACK_DEL, _on_content_del);
1295 1227
1296 content = elm_layout_content_unset(sd->content_area, CONTENT_PART); 1228 content = eo_do(sd->content_area, elm_obj_container_content_unset(CONTENT_PART));
1297 sd->content = NULL; 1229 sd->content = NULL;
1298 1230
1299 elm_layout_sizing_eval(obj); 1231 elm_layout_sizing_eval(sd->main_layout);
1300 1232
1301 return content; 1233 return content;
1302} 1234}
@@ -1307,12 +1239,11 @@ _title_icon_unset(Evas_Object *obj)
1307 Evas_Object *icon; 1239 Evas_Object *icon;
1308 1240
1309 ELM_POPUP_DATA_GET(obj, sd); 1241 ELM_POPUP_DATA_GET(obj, sd);
1310 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
1311 1242
1312 if (!sd->title_icon) return NULL; 1243 if (!sd->title_icon) return NULL;
1313 1244
1314 icon = sd->title_icon; 1245 icon = sd->title_icon;
1315 edje_object_part_unswallow(wd->resize_obj, sd->title_icon); 1246 eo_do(sd->main_layout, elm_obj_container_content_unset("elm.swallow.title.icon"));
1316 sd->title_icon = NULL; 1247 sd->title_icon = NULL;
1317 1248
1318 return icon; 1249 return icon;
@@ -1374,22 +1305,12 @@ _elm_popup_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, Elm_Fo
1374 if (ao) items = eina_list_append(items, ao); 1305 if (ao) items = eina_list_append(items, ao);
1375 } 1306 }
1376 1307
1377 /* content area */ 1308 eo_do(sd->main_layout, base_items = elm_obj_container_content_swallow_list_get());
1378 if (sd->content) items = eina_list_append(items, sd->content_area);
1379
1380 /* items */
1381 if (sd->box) items = eina_list_append(items, sd->box);
1382
1383 /* action area */
1384 if (sd->action_area) items = eina_list_append(items, sd->action_area);
1385
1386 /* base */
1387 eo_do_super(obj, MY_CLASS, base_items = elm_obj_container_content_swallow_list_get());
1388 1309
1389 items = eina_list_merge(items, base_items); 1310 items = eina_list_merge(items, base_items);
1390 1311
1391 if (!elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next)) 1312 if (!elm_widget_focus_list_next_get(sd->main_layout, items, eina_list_data_get, dir, next))
1392 *next = obj; 1313 *next = sd->main_layout;
1393 eina_list_free(items); 1314 eina_list_free(items);
1394 1315
1395 return EINA_TRUE; 1316 return EINA_TRUE;
@@ -1421,22 +1342,12 @@ _elm_popup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, c
1421 if (ao) items = eina_list_append(items, ao); 1342 if (ao) items = eina_list_append(items, ao);
1422 } 1343 }
1423 1344
1424 /* content area */ 1345 eo_do(sd->main_layout, base_items = elm_obj_container_content_swallow_list_get());
1425 if (sd->content) items = eina_list_append(items, sd->content_area);
1426
1427 /* items */
1428 if (sd->box) items = eina_list_append(items, sd->box);
1429
1430 /* action area */
1431 if (sd->action_area) items = eina_list_append(items, sd->action_area);
1432
1433 /* base*/
1434 eo_do_super(obj, MY_CLASS, base_items = elm_obj_container_content_swallow_list_get());
1435 1346
1436 items = eina_list_merge(items, base_items); 1347 items = eina_list_merge(items, base_items);
1437 1348
1438 elm_widget_focus_list_direction_get 1349 elm_widget_focus_list_direction_get
1439 (obj, base, items, eina_list_data_get, degree, direction, weight); 1350 (sd->main_layout, base, items, eina_list_data_get, degree, direction, weight);
1440 eina_list_free(items); 1351 eina_list_free(items);
1441 1352
1442 return EINA_TRUE; 1353 return EINA_TRUE;
@@ -1484,22 +1395,12 @@ _elm_popup_elm_widget_event(Eo *obj, Elm_Popup_Data *_pd EINA_UNUSED, Evas_Objec
1484EOLIAN static void 1395EOLIAN static void
1485_elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv) 1396_elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
1486{ 1397{
1487 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
1488 char style[1024]; 1398 char style[1024];
1489 1399
1490 eo_do_super(obj, MY_CLASS, evas_obj_smart_add()); 1400 eo_do_super(obj, MY_CLASS, evas_obj_smart_add());
1491 elm_widget_sub_object_parent_add(obj); 1401 elm_widget_sub_object_parent_add(obj);
1492 1402
1493 evas_object_size_hint_weight_set 1403 snprintf(style, sizeof(style), "popup/%s", elm_widget_style_get(obj));
1494 (wd->resize_obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1495 evas_object_size_hint_align_set
1496 (wd->resize_obj, EVAS_HINT_FILL, EVAS_HINT_FILL);
1497
1498 snprintf(style, sizeof(style), "%s", "default");
1499 if (!elm_layout_theme_set(obj, "popup", "base", style))
1500 CRI("Failed to set layout!");
1501
1502 snprintf(style, sizeof(style), "popup/%s", "default");
1503 1404
1504 priv->notify = elm_notify_add(obj); 1405 priv->notify = elm_notify_add(obj);
1505 elm_object_style_set(priv->notify, style); 1406 elm_object_style_set(priv->notify, style);
@@ -1509,29 +1410,36 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
1509 (priv->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); 1410 (priv->notify, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1510 evas_object_size_hint_align_set 1411 evas_object_size_hint_align_set
1511 (priv->notify, EVAS_HINT_FILL, EVAS_HINT_FILL); 1412 (priv->notify, EVAS_HINT_FILL, EVAS_HINT_FILL);
1413 evas_object_smart_member_add(priv->notify, obj);
1414
1415 priv->main_layout = elm_layout_add(obj);
1416 if (!elm_layout_theme_set(priv->main_layout, "popup", "base",
1417 elm_widget_style_get(obj)))
1418 CRI("Failed to set layout!");
1419
1420 elm_object_content_set(priv->notify, priv->main_layout);
1512 1421
1513 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL); 1422 evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, NULL);
1514 evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE, _on_hide, NULL);
1515 1423
1516 evas_object_event_callback_add 1424 evas_object_event_callback_add
1517 (obj, EVAS_CALLBACK_RESTACK, _restack_cb, NULL); 1425 (obj, EVAS_CALLBACK_RESTACK, _restack_cb, NULL);
1518 1426
1519 elm_layout_signal_callback_add 1427 elm_layout_signal_callback_add
1520 (obj, "elm,state,title_area,visible", "elm", _layout_change_cb, obj); 1428 (priv->main_layout, "elm,state,title_area,visible", "elm", _layout_change_cb, NULL);
1521 elm_layout_signal_callback_add 1429 elm_layout_signal_callback_add
1522 (obj, "elm,state,title_area,hidden", "elm", _layout_change_cb, obj); 1430 (priv->main_layout, "elm,state,title_area,hidden", "elm", _layout_change_cb, NULL);
1523 elm_layout_signal_callback_add 1431 elm_layout_signal_callback_add
1524 (obj, "elm,state,action_area,visible", "elm", _layout_change_cb, obj); 1432 (priv->main_layout, "elm,state,action_area,visible", "elm", _layout_change_cb, NULL);
1525 elm_layout_signal_callback_add 1433 elm_layout_signal_callback_add
1526 (obj, "elm,state,action_area,hidden", "elm", _layout_change_cb, obj); 1434 (priv->main_layout, "elm,state,action_area,hidden", "elm", _layout_change_cb, NULL);
1527 1435
1528 priv->content_area = elm_layout_add(obj); 1436 priv->content_area = elm_layout_add(priv->main_layout);
1529 if (!elm_layout_theme_set(priv->content_area, "popup", "content", style)) 1437 if (!elm_layout_theme_set(priv->content_area, "popup", "content", style))
1530 CRI("Failed to set layout!"); 1438 CRI("Failed to set layout!");
1531 else 1439 else
1532 evas_object_event_callback_add 1440 evas_object_event_callback_add
1533 (priv->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS, 1441 (priv->content_area, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
1534 _size_hints_changed_cb, obj); 1442 _size_hints_changed_cb, priv->main_layout);
1535 1443
1536 priv->content_text_wrap_type = ELM_WRAP_MIXED; 1444 priv->content_text_wrap_type = ELM_WRAP_MIXED;
1537 evas_object_smart_callback_add 1445 evas_object_smart_callback_add
@@ -1540,15 +1448,25 @@ _elm_popup_evas_object_smart_add(Eo *obj, Elm_Popup_Data *priv)
1540 evas_object_smart_callback_add(priv->notify, "timeout", _timeout_cb, obj); 1448 evas_object_smart_callback_add(priv->notify, "timeout", _timeout_cb, obj);
1541 1449
1542 elm_widget_can_focus_set(obj, EINA_TRUE); 1450 elm_widget_can_focus_set(obj, EINA_TRUE);
1451 elm_widget_can_focus_set(priv->main_layout, EINA_TRUE);
1543 1452
1544 _visuals_set(obj); 1453 _visuals_set(obj);
1545 edje_object_message_signal_process(wd->resize_obj); 1454 edje_object_message_signal_process(elm_layout_edje_get(priv->main_layout));
1546} 1455}
1547 1456
1548EOLIAN static void 1457EOLIAN static void
1549_elm_popup_elm_widget_parent_set(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd, Evas_Object *parent) 1458_elm_popup_elm_widget_parent_set(Eo *obj, Elm_Popup_Data *sd EINA_UNUSED, Evas_Object *parent)
1550{ 1459{
1551 elm_notify_parent_set(sd->notify, parent); 1460 Evas_Coord x, y, w, h;
1461 evas_object_geometry_get(parent, &x, &y, &w, &h);
1462
1463 if (eo_isa(parent, ELM_WIN_CLASS))
1464 {
1465 x = 0;
1466 y = 0;
1467 }
1468 evas_object_move(obj, x, y);
1469 evas_object_resize(obj, w, h);
1552} 1470}
1553 1471
1554EOLIAN static void 1472EOLIAN static void
@@ -1744,8 +1662,8 @@ _elm_popup_item_append(Eo *obj, Elm_Popup_Data *sd, const char *label, Evas_Obje
1744 if (!it) return NULL; 1662 if (!it) return NULL;
1745 if (sd->content || sd->text_content_obj) 1663 if (sd->content || sd->text_content_obj)
1746 { 1664 {
1747 prev_content = elm_layout_content_get 1665 prev_content = eo_do(sd->content_area,
1748 (sd->content_area, CONTENT_PART); 1666 elm_obj_container_content_get(CONTENT_PART));
1749 evas_object_del(prev_content); 1667 evas_object_del(prev_content);
1750 } 1668 }
1751 1669
diff --git a/src/lib/elm_widget_popup.h b/src/lib/elm_widget_popup.h
index ebc51e040..59c5efae9 100644
--- a/src/lib/elm_widget_popup.h
+++ b/src/lib/elm_widget_popup.h
@@ -26,6 +26,7 @@ typedef struct _Elm_Popup_Data Elm_Popup_Data;
26struct _Elm_Popup_Data 26struct _Elm_Popup_Data
27{ 27{
28 Evas_Object *notify; 28 Evas_Object *notify;
29 Evas_Object *main_layout;
29 Evas_Object *title_icon; 30 Evas_Object *title_icon;
30 Evas_Object *content_area; 31 Evas_Object *content_area;
31 Evas_Object *text_content_obj; 32 Evas_Object *text_content_obj;