summaryrefslogtreecommitdiff
path: root/src/edje_externals
diff options
context:
space:
mode:
authorJee-Yong Um <conr2d@gmail.com>2016-02-05 08:13:11 +0100
committerCedric BAIL <cedric@osg.samsung.com>2016-02-05 08:45:19 +0100
commitfe4a4693bd1a15f0dca048e295fa68ca3d407175 (patch)
treef4c62a9e69d5d3d0e1c63bfa2d51d73a092ebd9f /src/edje_externals
parentb7bdec74f753ffb6fc54328c6adf58401f562842 (diff)
elm: add Elm.Layout as edje externals' contents instead of Edje.Object
Summary: When edje external parts add its content, edje object is added, but it breaks elementary widget hierarchy. In Elementary, edje external can use Elm.Layout to add its content. Reviewers: cedric Reviewed By: cedric Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D3655 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/edje_externals')
-rw-r--r--src/edje_externals/elm.c24
-rw-r--r--src/edje_externals/elm_bubble.c4
-rw-r--r--src/edje_externals/elm_frame.c4
-rw-r--r--src/edje_externals/elm_notify.c4
-rw-r--r--src/edje_externals/elm_panes.c8
-rw-r--r--src/edje_externals/elm_scroller.c4
-rw-r--r--src/edje_externals/private.h2
7 files changed, 27 insertions, 23 deletions
diff --git a/src/edje_externals/elm.c b/src/edje_externals/elm.c
index 9f6b87284..744d2891c 100644
--- a/src/edje_externals/elm.c
+++ b/src/edje_externals/elm.c
@@ -270,8 +270,8 @@ external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj,
270} 270}
271 271
272Evas_Object * 272Evas_Object *
273external_common_param_edje_object_get(Evas_Object *obj, 273external_common_param_elm_layout_get(Evas_Object *obj,
274 const Edje_External_Param *p) 274 const Edje_External_Param *p)
275{ 275{
276 Evas_Object *edje, *parent_widget, *ret; 276 Evas_Object *edje, *parent_widget, *ret;
277 const char *file; 277 const char *file;
@@ -283,14 +283,18 @@ external_common_param_edje_object_get(Evas_Object *obj,
283 edje_object_file_get(edje, &file, NULL); 283 edje_object_file_get(edje, &file, NULL);
284 284
285 parent_widget = elm_widget_parent_widget_get(obj); 285 parent_widget = elm_widget_parent_widget_get(obj);
286 if (!parent_widget) 286 if (parent_widget)
287 parent_widget = edje; 287 {
288 288 ret = elm_layout_add(parent_widget);
289 ret = edje_object_add(evas_object_evas_get(parent_widget)); 289 if (elm_layout_file_set(ret, file, p->s))
290 290 return ret;
291 if (edje_object_file_set(ret, file, p->s)) 291 }
292 return ret; 292 else
293 293 {
294 ret = edje_object_add(evas_object_evas_get(edje));
295 if (edje_object_file_set(ret, file, p->s))
296 return ret;
297 }
294 evas_object_del(ret); 298 evas_object_del(ret);
295 return NULL; 299 return NULL;
296} 300}
diff --git a/src/edje_externals/elm_bubble.c b/src/edje_externals/elm_bubble.c
index 5ae04bc65..686dea3df 100644
--- a/src/edje_externals/elm_bubble.c
+++ b/src/edje_externals/elm_bubble.c
@@ -62,7 +62,7 @@ external_bubble_param_set(void *data EINA_UNUSED, Evas_Object *obj,
62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 62 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
63 { 63 {
64 Evas_Object *content = \ 64 Evas_Object *content = \
65 external_common_param_edje_object_get(obj, param); 65 external_common_param_elm_layout_get(obj, param);
66 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE; 66 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
67 elm_object_content_set(obj, content); 67 elm_object_content_set(obj, content);
68 return EINA_TRUE; 68 return EINA_TRUE;
@@ -131,7 +131,7 @@ external_bubble_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
131 if (!strcmp(param->name, "info")) 131 if (!strcmp(param->name, "info"))
132 mem->info = eina_stringshare_add(param->s); 132 mem->info = eina_stringshare_add(param->s);
133 else if (!strcmp(param->name, "content")) 133 else if (!strcmp(param->name, "content"))
134 mem->content = external_common_param_edje_object_get(obj, param); 134 mem->content = external_common_param_elm_layout_get(obj, param);
135 else if (!strcmp(param->name, "label")) 135 else if (!strcmp(param->name, "label"))
136 mem->label = eina_stringshare_add(param->s); 136 mem->label = eina_stringshare_add(param->s);
137 } 137 }
diff --git a/src/edje_externals/elm_frame.c b/src/edje_externals/elm_frame.c
index f725da655..a59bfae53 100644
--- a/src/edje_externals/elm_frame.c
+++ b/src/edje_externals/elm_frame.c
@@ -39,7 +39,7 @@ external_frame_param_set(void *data EINA_UNUSED, Evas_Object *obj,
39 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 39 if (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
40 { 40 {
41 Evas_Object *content = 41 Evas_Object *content =
42 external_common_param_edje_object_get(obj,param); 42 external_common_param_elm_layout_get(obj,param);
43 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE; 43 if ((strcmp(param->s, "")) && (!content)) return EINA_FALSE;
44 elm_object_content_set(obj, content); 44 elm_object_content_set(obj, content);
45 return EINA_TRUE; 45 return EINA_TRUE;
@@ -91,7 +91,7 @@ external_frame_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
91 EINA_LIST_FOREACH(params, l, param) 91 EINA_LIST_FOREACH(params, l, param)
92 { 92 {
93 if (!strcmp(param->name, "content")) 93 if (!strcmp(param->name, "content"))
94 mem->content = external_common_param_edje_object_get(obj, param); 94 mem->content = external_common_param_elm_layout_get(obj, param);
95 else if (!strcmp(param->name, "label")) 95 else if (!strcmp(param->name, "label"))
96 mem->label = eina_stringshare_add(param->s); 96 mem->label = eina_stringshare_add(param->s);
97 } 97 }
diff --git a/src/edje_externals/elm_notify.c b/src/edje_externals/elm_notify.c
index 06c7aef8c..801bfe473 100644
--- a/src/edje_externals/elm_notify.c
+++ b/src/edje_externals/elm_notify.c
@@ -163,7 +163,7 @@ external_notify_param_set(void *data EINA_UNUSED,
163 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) 163 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
164 { 164 {
165 Evas_Object *content = 165 Evas_Object *content =
166 external_common_param_edje_object_get(obj, param); 166 external_common_param_elm_layout_get(obj, param);
167 if ((strcmp(param->s, "")) && (!content)) 167 if ((strcmp(param->s, "")) && (!content))
168 return EINA_FALSE; 168 return EINA_FALSE;
169 elm_object_content_set(obj, content); 169 elm_object_content_set(obj, content);
@@ -247,7 +247,7 @@ external_notify_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
247 EINA_LIST_FOREACH(params, l, param) 247 EINA_LIST_FOREACH(params, l, param)
248 { 248 {
249 if (!strcmp(param->name, "content")) 249 if (!strcmp(param->name, "content"))
250 mem->content = external_common_param_edje_object_get(obj, param); 250 mem->content = external_common_param_elm_layout_get(obj, param);
251 else if (!strcmp(param->name, "timeout")) 251 else if (!strcmp(param->name, "timeout"))
252 { 252 {
253 mem->timeout = param->d; 253 mem->timeout = param->d;
diff --git a/src/edje_externals/elm_panes.c b/src/edje_externals/elm_panes.c
index 153117cca..5780aee13 100644
--- a/src/edje_externals/elm_panes.c
+++ b/src/edje_externals/elm_panes.c
@@ -47,7 +47,7 @@ static Eina_Bool external_panes_param_set(void *data EINA_UNUSED,
47 if ((!strcmp(param->name, "content left")) 47 if ((!strcmp(param->name, "content left"))
48 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) 48 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
49 { 49 {
50 Evas_Object *content = external_common_param_edje_object_get(obj, param); 50 Evas_Object *content = external_common_param_elm_layout_get(obj, param);
51 if ((strcmp(param->s, "")) && (!content)) 51 if ((strcmp(param->s, "")) && (!content))
52 return EINA_FALSE; 52 return EINA_FALSE;
53 elm_object_part_content_set(obj, "left", content); 53 elm_object_part_content_set(obj, "left", content);
@@ -56,7 +56,7 @@ static Eina_Bool external_panes_param_set(void *data EINA_UNUSED,
56 else if ((!strcmp(param->name, "content right")) 56 else if ((!strcmp(param->name, "content right"))
57 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)) 57 && (param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING))
58 { 58 {
59 Evas_Object *content = external_common_param_edje_object_get(obj, param); 59 Evas_Object *content = external_common_param_elm_layout_get(obj, param);
60 if ((strcmp(param->s, "")) && (!content)) 60 if ((strcmp(param->s, "")) && (!content))
61 return EINA_FALSE; 61 return EINA_FALSE;
62 elm_object_part_content_set(obj, "right", content); 62 elm_object_part_content_set(obj, "right", content);
@@ -141,9 +141,9 @@ external_panes_params_parse(void *data EINA_UNUSED, Evas_Object *obj,
141 EINA_LIST_FOREACH(params, l, param) 141 EINA_LIST_FOREACH(params, l, param)
142 { 142 {
143 if (!strcmp(param->name, "content left")) 143 if (!strcmp(param->name, "content left"))
144 mem->content_left = external_common_param_edje_object_get(obj, param); 144 mem->content_left = external_common_param_elm_layout_get(obj, param);
145 else if (!strcmp(param->name, "content right")) 145 else if (!strcmp(param->name, "content right"))
146 mem->content_right = external_common_param_edje_object_get(obj, param); 146 mem->content_right = external_common_param_elm_layout_get(obj, param);
147 else if (!strcmp(param->name, "horizontal")) 147 else if (!strcmp(param->name, "horizontal"))
148 { 148 {
149 mem->is_horizontal = EINA_TRUE; 149 mem->is_horizontal = EINA_TRUE;
diff --git a/src/edje_externals/elm_scroller.c b/src/edje_externals/elm_scroller.c
index 81c5f3090..2cfebe7a9 100644
--- a/src/edje_externals/elm_scroller.c
+++ b/src/edje_externals/elm_scroller.c
@@ -32,7 +32,7 @@ static Eina_Bool external_scroller_param_set(void *data EINA_UNUSED,
32 if (!strcmp(param->name, "content") 32 if (!strcmp(param->name, "content")
33 && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING) 33 && param->type == EDJE_EXTERNAL_PARAM_TYPE_STRING)
34 { 34 {
35 Evas_Object *content = external_common_param_edje_object_get(obj, param); 35 Evas_Object *content = external_common_param_elm_layout_get(obj, param);
36 if ((strcmp(param->s, "")) && (!content)) 36 if ((strcmp(param->s, "")) && (!content))
37 return EINA_FALSE; 37 return EINA_FALSE;
38 elm_object_content_set(obj, content); 38 elm_object_content_set(obj, content);
@@ -76,7 +76,7 @@ static void * external_scroller_params_parse(void *data EINA_UNUSED,
76 EINA_LIST_FOREACH(params, l, param) 76 EINA_LIST_FOREACH(params, l, param)
77 { 77 {
78 if (!strcmp(param->name, "content")) 78 if (!strcmp(param->name, "content"))
79 mem->content = external_common_param_edje_object_get(obj, param); 79 mem->content = external_common_param_elm_layout_get(obj, param);
80 } 80 }
81 81
82 return mem; 82 return mem;
diff --git a/src/edje_externals/private.h b/src/edje_externals/private.h
index 22b863f13..2f2d3efeb 100644
--- a/src/edje_externals/private.h
+++ b/src/edje_externals/private.h
@@ -31,7 +31,7 @@ const char *external_translate(void *data, const char *orig);
31void external_common_params_free(void *params); 31void external_common_params_free(void *params);
32void *external_common_params_parse_internal(size_t params_size, void *data, Evas_Object *obj, const Eina_List *params); 32void *external_common_params_parse_internal(size_t params_size, void *data, Evas_Object *obj, const Eina_List *params);
33Evas_Object *external_common_param_icon_get(Evas_Object *obj, const Edje_External_Param *param); 33Evas_Object *external_common_param_icon_get(Evas_Object *obj, const Edje_External_Param *param);
34Evas_Object *external_common_param_edje_object_get(Evas_Object *obj, const Edje_External_Param *p); 34Evas_Object *external_common_param_elm_layout_get(Evas_Object *obj, const Edje_External_Param *p);
35void external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj, const Eina_List *params); 35void external_common_icon_param_parse(Evas_Object **icon, Evas_Object *obj, const Eina_List *params);
36Eina_Bool external_common_param_get(void *data, const Evas_Object *obj, Edje_External_Param *param); 36Eina_Bool external_common_param_get(void *data, const Evas_Object *obj, Edje_External_Param *param);
37Eina_Bool external_common_param_set(void *data, Evas_Object *obj, const Edje_External_Param *param); 37Eina_Bool external_common_param_set(void *data, Evas_Object *obj, const Edje_External_Param *param);