summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'legacy')
-rw-r--r--legacy/elementary/doc/examples.dox2
-rw-r--r--legacy/elementary/doc/widgets/widget_preview_conformant.c2
-rw-r--r--legacy/elementary/src/bin/test_conform.c6
-rw-r--r--legacy/elementary/src/examples/conformant_example_02.c2
-rw-r--r--legacy/elementary/src/lib/Elementary.h.in24
-rw-r--r--legacy/elementary/src/lib/elm_conform.c96
6 files changed, 81 insertions, 51 deletions
diff --git a/legacy/elementary/doc/examples.dox b/legacy/elementary/doc/examples.dox
index 705efd4acf..cf183ab82e 100644
--- a/legacy/elementary/doc/examples.dox
+++ b/legacy/elementary/doc/examples.dox
@@ -3690,7 +3690,7 @@
3690 * @until evas_object_show 3690 * @until evas_object_show
3691 * 3691 *
3692 * Finally, we'll set the box as conformant's content, just like this: 3692 * Finally, we'll set the box as conformant's content, just like this:
3693 * @skipline elm_conformant_content_set 3693 * @skipline elm_object_content_set
3694 * 3694 *
3695 * Compare both examples code: 3695 * Compare both examples code:
3696 * @ref conformant_example_01.c "conformant_example_01.c" 3696 * @ref conformant_example_01.c "conformant_example_01.c"
diff --git a/legacy/elementary/doc/widgets/widget_preview_conformant.c b/legacy/elementary/doc/widgets/widget_preview_conformant.c
index b5b9a054fc..904047bc23 100644
--- a/legacy/elementary/doc/widgets/widget_preview_conformant.c
+++ b/legacy/elementary/doc/widgets/widget_preview_conformant.c
@@ -37,6 +37,6 @@ evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
37evas_object_show(en); 37evas_object_show(en);
38elm_box_pack_end(bx, en); 38elm_box_pack_end(bx, en);
39 39
40elm_conformant_content_set(conform, bx); 40elm_object_content_set(conform, bx);
41 41
42#include "widget_preview_tmpl_foot.c" 42#include "widget_preview_tmpl_foot.c"
diff --git a/legacy/elementary/src/bin/test_conform.c b/legacy/elementary/src/bin/test_conform.c
index 689d16c5d4..fc2ef1737d 100644
--- a/legacy/elementary/src/bin/test_conform.c
+++ b/legacy/elementary/src/bin/test_conform.c
@@ -80,7 +80,7 @@ test_conformant(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
80 evas_object_show(en); 80 evas_object_show(en);
81 elm_box_pack_end(bx, en); 81 elm_box_pack_end(bx, en);
82 82
83 elm_conformant_content_set(conform, bx); 83 elm_object_content_set(conform, bx);
84 evas_object_show(bx); 84 evas_object_show(bx);
85 85
86 evas_object_resize(win, 240, 240); 86 evas_object_resize(win, 240, 240);
@@ -169,7 +169,7 @@ test_conformant2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
169 169
170 evas_object_smart_callback_add(btn, "clicked", popobj, pg); 170 evas_object_smart_callback_add(btn, "clicked", popobj, pg);
171 171
172 elm_conformant_content_set(conform, bx); 172 elm_object_content_set(conform, bx);
173 evas_object_show(bx); 173 evas_object_show(bx);
174 174
175 conform = elm_conformant_add(win); 175 conform = elm_conformant_add(win);
@@ -201,7 +201,7 @@ test_conformant2(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event
201 201
202 evas_object_smart_callback_add(btn, "clicked", popobj, pg); 202 evas_object_smart_callback_add(btn, "clicked", popobj, pg);
203 203
204 elm_conformant_content_set(conform, bx); 204 elm_object_content_set(conform, bx);
205 evas_object_show(bx); 205 evas_object_show(bx);
206 206
207 evas_object_resize(win, 240, 480); 207 evas_object_resize(win, 240, 480);
diff --git a/legacy/elementary/src/examples/conformant_example_02.c b/legacy/elementary/src/examples/conformant_example_02.c
index 3e04e8d102..80d401ad36 100644
--- a/legacy/elementary/src/examples/conformant_example_02.c
+++ b/legacy/elementary/src/examples/conformant_example_02.c
@@ -73,7 +73,7 @@ elm_main(int argc __UNUSED__, char **argv __UNUSED__)
73 elm_box_pack_end(bx, btn); 73 elm_box_pack_end(bx, btn);
74 evas_object_show(btn); 74 evas_object_show(btn);
75 75
76 elm_conformant_content_set(conform, bx); 76 elm_object_content_set(conform, bx);
77 evas_object_show(bx); 77 evas_object_show(bx);
78 78
79 evas_object_resize(win, 240, 480); 79 evas_object_resize(win, 240, 480);
diff --git a/legacy/elementary/src/lib/Elementary.h.in b/legacy/elementary/src/lib/Elementary.h.in
index 8897d55f22..7e61eb0eda 100644
--- a/legacy/elementary/src/lib/Elementary.h.in
+++ b/legacy/elementary/src/lib/Elementary.h.in
@@ -24349,6 +24349,10 @@ extern "C" {
24349 * Available styles for it: 24349 * Available styles for it:
24350 * - @c "default" 24350 * - @c "default"
24351 * 24351 *
24352 * Default contents parts of the conformant widget that you can use for are:
24353 *
24354 * @li "elm.swallow.content" - A content of the conformant
24355 *
24352 * See how to use this widget in this example: 24356 * See how to use this widget in this example:
24353 * @ref conformant_example 24357 * @ref conformant_example
24354 */ 24358 */
@@ -24384,14 +24388,14 @@ extern "C" {
24384 * 24388 *
24385 * Once the content object is set, a previously set one will be deleted. 24389 * Once the content object is set, a previously set one will be deleted.
24386 * If you want to keep that old content object, use the 24390 * If you want to keep that old content object, use the
24387 * elm_conformat_content_unset() function. 24391 * elm_object_content_unset() function.
24388 * 24392 *
24389 * @see elm_conformant_content_unset() 24393 * @see elm_object_content_unset()
24390 * @see elm_conformant_content_get() 24394 * @see elm_object_content_get()
24391 * 24395 *
24392 * @ingroup Conformant 24396 * @ingroup Conformant
24393 */ 24397 */
24394 EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1); 24398 EINA_DEPRECATED EAPI void elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) EINA_ARG_NONNULL(1);
24395 24399
24396 /** 24400 /**
24397 * Get the content of the conformant widget. 24401 * Get the content of the conformant widget.
@@ -24401,14 +24405,14 @@ extern "C" {
24401 * 24405 *
24402 * Return the content object which is set for this widget. 24406 * Return the content object which is set for this widget.
24403 * It won't be unparent from conformant. For that, use 24407 * It won't be unparent from conformant. For that, use
24404 * elm_conformant_content_unset(). 24408 * elm_object_content_unset().
24405 * 24409 *
24406 * @see elm_conformant_content_set() for more details. 24410 * @see elm_object_content_set().
24407 * @see elm_conformant_content_unset() 24411 * @see elm_object_content_unset()
24408 * 24412 *
24409 * @ingroup Conformant 24413 * @ingroup Conformant
24410 */ 24414 */
24411 EAPI Evas_Object *elm_conformant_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); 24415 EINA_DEPRECATED EAPI Evas_Object *elm_conformant_content_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
24412 24416
24413 /** 24417 /**
24414 * Unset the content of the conformant widget. 24418 * Unset the content of the conformant widget.
@@ -24418,11 +24422,11 @@ extern "C" {
24418 * 24422 *
24419 * Unparent and return the content object which was set for this widget. 24423 * Unparent and return the content object which was set for this widget.
24420 * 24424 *
24421 * @see elm_conformant_content_set() for more details. 24425 * @see elm_object_content_set().
24422 * 24426 *
24423 * @ingroup Conformant 24427 * @ingroup Conformant
24424 */ 24428 */
24425 EAPI Evas_Object *elm_conformant_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1); 24429 EINA_DEPRECATED EAPI Evas_Object *elm_conformant_content_unset(Evas_Object *obj) EINA_ARG_NONNULL(1);
24426 24430
24427 /** 24431 /**
24428 * Returns the Evas_Object that represents the content area. 24432 * Returns the Evas_Object that represents the content area.
diff --git a/legacy/elementary/src/lib/elm_conform.c b/legacy/elementary/src/lib/elm_conform.c
index b6321756ea..620b79ed4f 100644
--- a/legacy/elementary/src/lib/elm_conform.c
+++ b/legacy/elementary/src/lib/elm_conform.c
@@ -47,6 +47,12 @@ static void _del_pre_hook(Evas_Object *obj);
47static void _del_hook(Evas_Object *obj); 47static void _del_hook(Evas_Object *obj);
48static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl); 48static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
49static void _theme_hook(Evas_Object *obj); 49static void _theme_hook(Evas_Object *obj);
50static void _content_set_hook(Evas_Object *obj,
51 const char *part,
52 Evas_Object *content);
53static Evas_Object *_content_get_hook(const Evas_Object *obj,
54 const char *part);
55static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *part);
50static void _swallow_conformant_parts(Evas_Object *obj); 56static void _swallow_conformant_parts(Evas_Object *obj);
51static void _conformant_part_size_set(Evas_Object *obj, 57static void _conformant_part_size_set(Evas_Object *obj,
52 Evas_Object *sobj, 58 Evas_Object *sobj,
@@ -56,11 +62,15 @@ static void _conformant_part_size_set(Evas_Object *obj,
56 Evas_Coord sh); 62 Evas_Coord sh);
57static void _conformant_part_sizing_eval(Evas_Object *obj, 63static void _conformant_part_sizing_eval(Evas_Object *obj,
58 Conformant_Part_Type part_type); 64 Conformant_Part_Type part_type);
59static void 65static void _conformant_move_resize_event_cb(void *data,
60_conformant_move_resize_event_cb(void *data, Evas *e, Evas_Object *obj, 66 Evas *e,
61 void *event_info); 67 Evas_Object *obj,
68 void *event_info);
62static void _sizing_eval(Evas_Object *obj); 69static void _sizing_eval(Evas_Object *obj);
63static Eina_Bool _prop_change(void *data, int type, void *event); 70static Eina_Bool _prop_change(void *data, int type, void *event);
71static void _changed_size_hints(void *data, Evas *e,
72 Evas_Object *obj,
73 void *event_info);
64 74
65/* local functions */ 75/* local functions */
66static void 76static void
@@ -111,6 +121,51 @@ _theme_hook(Evas_Object *obj)
111} 121}
112 122
113static void 123static void
124_content_set_hook(Evas_Object *obj, const char *part __UNUSED__, Evas_Object *content)
125{
126 ELM_CHECK_WIDTYPE(obj, widtype);
127 Widget_Data *wd = elm_widget_data_get(obj);
128
129 if (!wd) return;
130 if (wd->content == content) return;
131 if (wd->content) evas_object_del(wd->content);
132 wd->content = content;
133 if (content)
134 {
135 elm_widget_sub_object_add(obj, content);
136 evas_object_event_callback_add(content,
137 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
138 _changed_size_hints, obj);
139 edje_object_part_swallow(wd->base, "elm.swallow.content", content);
140 }
141 _sizing_eval(obj);
142}
143
144static Evas_Object *
145_content_get_hook(const Evas_Object *obj, const char *part __UNUSED__)
146{
147 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
148 Widget_Data *wd = elm_widget_data_get(obj);
149 if (!wd) return NULL;
150 return wd->content;
151}
152
153static Evas_Object *
154_content_unset_hook(Evas_Object *obj, const char *part __UNUSED__)
155{
156 ELM_CHECK_WIDTYPE(obj, widtype) NULL;
157 Widget_Data *wd = elm_widget_data_get(obj);
158 Evas_Object *content;
159
160 if ((!wd) || (!wd->content)) return NULL;
161 content = wd->content;
162 elm_widget_sub_object_del(obj, wd->content);
163 edje_object_part_unswallow(wd->base, wd->content);
164 wd->content = NULL;
165 return content;
166}
167
168static void
114_sizing_eval(Evas_Object *obj) 169_sizing_eval(Evas_Object *obj)
115{ 170{
116 Widget_Data *wd = elm_widget_data_get(obj); 171 Widget_Data *wd = elm_widget_data_get(obj);
@@ -543,48 +598,19 @@ elm_conformant_add(Evas_Object *parent)
543EAPI void 598EAPI void
544elm_conformant_content_set(Evas_Object *obj, Evas_Object *content) 599elm_conformant_content_set(Evas_Object *obj, Evas_Object *content)
545{ 600{
546 ELM_CHECK_WIDTYPE(obj, widtype); 601 _content_set_hook(obj, NULL, content);
547 Widget_Data *wd = elm_widget_data_get(obj);
548
549 if (!wd) return;
550 if (wd->content == content) return;
551 if (wd->content) evas_object_del(wd->content);
552 wd->content = content;
553 if (content)
554 {
555 elm_widget_sub_object_add(obj, content);
556 evas_object_event_callback_add(content,
557 EVAS_CALLBACK_CHANGED_SIZE_HINTS,
558 _changed_size_hints, obj);
559 edje_object_part_swallow(wd->base, "elm.swallow.content", content);
560 }
561 _sizing_eval(obj);
562} 602}
563 603
564EAPI Evas_Object * 604EAPI Evas_Object *
565elm_conformant_content_get(const Evas_Object *obj) 605elm_conformant_content_get(const Evas_Object *obj)
566{ 606{
567 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 607 return _content_get_hook(obj, NULL);
568 Widget_Data *wd = elm_widget_data_get(obj);
569
570 if (!wd) return NULL;
571 return wd->content;
572} 608}
573 609
574EAPI Evas_Object * 610EAPI Evas_Object *
575elm_conformant_content_unset(Evas_Object *obj) 611elm_conformant_content_unset(Evas_Object *obj)
576{ 612{
577 ELM_CHECK_WIDTYPE(obj, widtype) NULL; 613 return _content_unset_hook(obj, NULL);
578 Widget_Data *wd = elm_widget_data_get(obj);
579 Evas_Object *content;
580
581 if (!wd) return NULL;
582 if (!wd->content) return NULL;
583 content = wd->content;
584 elm_widget_sub_object_del(obj, wd->content);
585 edje_object_part_unswallow(wd->base, wd->content);
586 wd->content = NULL;
587 return content;
588} 614}
589 615
590EAPI Evas_Object * 616EAPI Evas_Object *