summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-09-20 15:16:12 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-09-21 12:28:20 +0900
commit282928465c5b9ce04810d4e78e5c4fc97f6f8bb6 (patch)
tree568c617e6cbb64781eaaf93bb49f8bd482b311cb /src/lib/elementary
parent112edeeea807a5dc499d003729c4a8cad829c5a6 (diff)
elm: Resolve part alias in legacy APIs only
This fixes make check.
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_layout.c40
-rw-r--r--src/lib/elementary/elm_widget.c19
2 files changed, 32 insertions, 27 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index 71168666ce..4db5e363a4 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -956,9 +956,7 @@ _efl_ui_layout_efl_canvas_layout_signal_signal_callback_del(Eo *obj, Efl_Ui_Layo
956// and also message handler (not implemented yet as an EO interface!) 956// and also message handler (not implemented yet as an EO interface!)
957 957
958EAPI Eina_Bool 958EAPI Eina_Bool
959elm_layout_content_set(Evas_Object *obj, 959elm_layout_content_set(Evas_Object *obj, const char *swallow, Evas_Object *content)
960 const char *swallow,
961 Evas_Object *content)
962{ 960{
963 EFL_UI_LAYOUT_CHECK(obj) EINA_FALSE; 961 EFL_UI_LAYOUT_CHECK(obj) EINA_FALSE;
964 if (!swallow) 962 if (!swallow)
@@ -966,6 +964,9 @@ elm_layout_content_set(Evas_Object *obj,
966 swallow = elm_widget_default_content_part_get(obj); 964 swallow = elm_widget_default_content_part_get(obj);
967 if (!swallow) return EINA_FALSE; 965 if (!swallow) return EINA_FALSE;
968 } 966 }
967 else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
968 return EINA_FALSE;
969
969 return efl_content_set(efl_part(obj, swallow), content); 970 return efl_content_set(efl_part(obj, swallow), content);
970} 971}
971 972
@@ -977,9 +978,6 @@ _efl_ui_layout_content_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, Ev
977 978
978 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE); 979 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
979 980
980 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
981 return EINA_FALSE;
982
983 EINA_LIST_FOREACH(sd->subs, l, sub_d) 981 EINA_LIST_FOREACH(sd->subs, l, sub_d)
984 { 982 {
985 if (sub_d->type == SWALLOW) 983 if (sub_d->type == SWALLOW)
@@ -1052,6 +1050,7 @@ elm_layout_content_get(const Evas_Object *obj, const char *swallow)
1052 } 1050 }
1053 else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE)) 1051 else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
1054 return NULL; 1052 return NULL;
1053
1055 return efl_content_get(efl_part(obj, swallow)); 1054 return efl_content_get(efl_part(obj, swallow));
1056} 1055}
1057 1056
@@ -1061,9 +1060,6 @@ _efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
1061 const Eina_List *l; 1060 const Eina_List *l;
1062 Efl_Ui_Layout_Sub_Object_Data *sub_d; 1061 Efl_Ui_Layout_Sub_Object_Data *sub_d;
1063 1062
1064 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
1065 return NULL;
1066
1067 EINA_LIST_FOREACH(sd->subs, l, sub_d) 1063 EINA_LIST_FOREACH(sd->subs, l, sub_d)
1068 { 1064 {
1069 if ((sub_d->type != TEXT) && !strcmp(part, sub_d->part)) 1065 if ((sub_d->type != TEXT) && !strcmp(part, sub_d->part))
@@ -1078,10 +1074,17 @@ _efl_ui_layout_content_get(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
1078} 1074}
1079 1075
1080EAPI Evas_Object * 1076EAPI Evas_Object *
1081elm_layout_content_unset(Evas_Object *obj, 1077elm_layout_content_unset(Evas_Object *obj, const char *swallow)
1082 const char *swallow)
1083{ 1078{
1084 EFL_UI_LAYOUT_CHECK(obj) NULL; 1079 EFL_UI_LAYOUT_CHECK(obj) NULL;
1080 if (!swallow)
1081 {
1082 swallow = elm_widget_default_content_part_get(obj);
1083 if (!swallow) return NULL;
1084 }
1085 else if (!_elm_layout_part_aliasing_eval(obj, &swallow, EINA_FALSE))
1086 return NULL;
1087
1085 return efl_content_unset(efl_part(obj, swallow)); 1088 return efl_content_unset(efl_part(obj, swallow));
1086} 1089}
1087 1090
@@ -1093,9 +1096,6 @@ _efl_ui_layout_content_unset(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part)
1093 1096
1094 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 1097 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
1095 1098
1096 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_FALSE))
1097 return NULL;
1098
1099 EINA_LIST_FOREACH(sd->subs, l, sub_d) 1099 EINA_LIST_FOREACH(sd->subs, l, sub_d)
1100 { 1100 {
1101 if ((sub_d->type == SWALLOW) && (!strcmp(part, sub_d->part))) 1101 if ((sub_d->type == SWALLOW) && (!strcmp(part, sub_d->part)))
@@ -1254,9 +1254,6 @@ _efl_ui_layout_text_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *part, const
1254 Efl_Ui_Layout_Sub_Object_Data *sub_d = NULL; 1254 Efl_Ui_Layout_Sub_Object_Data *sub_d = NULL;
1255 Efl_Ui_Layout_Sub_Connect *sc; 1255 Efl_Ui_Layout_Sub_Connect *sc;
1256 1256
1257 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
1258 return EINA_FALSE;
1259
1260 EINA_LIST_FOREACH(sd->subs, l, sub_d) 1257 EINA_LIST_FOREACH(sd->subs, l, sub_d)
1261 { 1258 {
1262 if ((sub_d->type == TEXT) && (!strcmp(part, sub_d->part))) 1259 if ((sub_d->type == TEXT) && (!strcmp(part, sub_d->part)))
@@ -1325,9 +1322,6 @@ _efl_ui_layout_text_get(Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char
1325{ 1322{
1326 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); 1323 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
1327 1324
1328 if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
1329 return NULL;
1330
1331 return edje_object_part_text_get(wd->resize_obj, part); 1325 return edje_object_part_text_get(wd->resize_obj, part);
1332} 1326}
1333 1327
@@ -2285,6 +2279,9 @@ elm_layout_text_set(Eo *obj, const char *part, const char *text)
2285 part = elm_widget_default_text_part_get(obj); 2279 part = elm_widget_default_text_part_get(obj);
2286 if (!part) return EINA_FALSE; 2280 if (!part) return EINA_FALSE;
2287 } 2281 }
2282 else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
2283 return EINA_FALSE;
2284
2288 efl_text_set(efl_part(obj, part), text); 2285 efl_text_set(efl_part(obj, part), text);
2289 return EINA_TRUE; 2286 return EINA_TRUE;
2290} 2287}
@@ -2297,6 +2294,9 @@ elm_layout_text_get(const Eo *obj, const char *part)
2297 part = elm_widget_default_text_part_get(obj); 2294 part = elm_widget_default_text_part_get(obj);
2298 if (!part) return NULL; 2295 if (!part) return NULL;
2299 } 2296 }
2297 else if (!_elm_layout_part_aliasing_eval(obj, &part, EINA_TRUE))
2298 return NULL;
2299
2300 return efl_text_get(efl_part(obj, part)); 2300 return efl_text_get(efl_part(obj, part));
2301} 2301}
2302 2302
diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c
index 344da643cd..232bd20441 100644
--- a/src/lib/elementary/elm_widget.c
+++ b/src/lib/elementary/elm_widget.c
@@ -6543,11 +6543,14 @@ _elm_widget_focus_manager_create(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *pd
6543 * elm_object_widget_check() returns true. The below checks avoid printing out 6543 * elm_object_widget_check() returns true. The below checks avoid printing out
6544 * undesired ERR messages. */ 6544 * undesired ERR messages. */
6545EAPI void 6545EAPI void
6546elm_widget_content_part_set(Evas_Object *obj, 6546elm_widget_content_part_set(Evas_Object *obj, const char *part, Evas_Object *content)
6547 const char *part,
6548 Evas_Object *content)
6549{ 6547{
6550 ELM_WIDGET_CHECK(obj); 6548 ELM_WIDGET_CHECK(obj);
6549 if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
6550 {
6551 elm_layout_content_set(obj, part, content);
6552 return;
6553 }
6551 if (!efl_isa(obj, EFL_PART_INTERFACE)) return; 6554 if (!efl_isa(obj, EFL_PART_INTERFACE)) return;
6552 if (!part) 6555 if (!part)
6553 { 6556 {
@@ -6558,10 +6561,11 @@ elm_widget_content_part_set(Evas_Object *obj,
6558} 6561}
6559 6562
6560EAPI Evas_Object * 6563EAPI Evas_Object *
6561elm_widget_content_part_get(const Evas_Object *obj, 6564elm_widget_content_part_get(const Evas_Object *obj, const char *part)
6562 const char *part)
6563{ 6565{
6564 ELM_WIDGET_CHECK(obj) NULL; 6566 ELM_WIDGET_CHECK(obj) NULL;
6567 if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
6568 return elm_layout_content_get(obj, part);
6565 if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL; 6569 if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
6566 if (!part) 6570 if (!part)
6567 { 6571 {
@@ -6572,10 +6576,11 @@ elm_widget_content_part_get(const Evas_Object *obj,
6572} 6576}
6573 6577
6574EAPI Evas_Object * 6578EAPI Evas_Object *
6575elm_widget_content_part_unset(Evas_Object *obj, 6579elm_widget_content_part_unset(Evas_Object *obj, const char *part)
6576 const char *part)
6577{ 6580{
6578 ELM_WIDGET_CHECK(obj) NULL; 6581 ELM_WIDGET_CHECK(obj) NULL;
6582 if (efl_isa(obj, EFL_UI_LAYOUT_CLASS))
6583 return elm_layout_content_unset(obj, part);
6579 if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL; 6584 if (!efl_isa(obj, EFL_PART_INTERFACE)) return NULL;
6580 if (!part) 6585 if (!part)
6581 { 6586 {