elm_dayselector: fix improperly named API theme parts
authorMike Blumenkrantz <zmike@samsung.com>
Tue, 19 Jun 2018 17:28:15 +0000 (13:28 -0400)
committerJongmin Lee <jm105.lee@samsung.com>
Tue, 19 Jun 2018 21:44:56 +0000 (06:44 +0900)
Summary:
API parts require namespacing, these parts have been namespaced with
compatibility code added to handle legacy naming
Depends on D6210

Reviewers: cedric

Reviewed By: cedric

Subscribers: #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6211

data/elementary/themes/edc/elm/dayselector.edc
src/lib/elementary/elm_dayselector.c

index 8c83ae5..98ffd03 100644 (file)
@@ -9,8 +9,9 @@
 #define DAYSELECOR_DAY_STATE_SELECTED 3
 
 #define DAYSELECTOR_DAY(_pos, _after)\
+   alias: "day"#_pos "elm.swallow.day"#_pos; \
    part {\
-      name: "day"#_pos;\
+      name: "elm.swallow.day"#_pos;\
       type: SWALLOW;\
       scale: 1;\
       clip_to: "clipper";\
          fixed: 1 0;\
          rel1 {\
             relative: 1.0 0.0;\
-            to: "day"#_after;\
+            to: "elm.swallow.day"#_after;\
             offset: 0 0;\
          }\
          rel2 {\
             relative: 1.0 1.0;\
-            to: "day"#_after;\
+            to: "elm.swallow.day"#_after;\
          }\
       }\
       description { state: "visible" 0.0;\
    programs{\
       program {\
          name: "day"#_pos"visible";\
-         signal: "day"#_pos",visible";\
+         signal: "elm,day"#_pos",visible";\
          source: "elm";\
          action: STATE_SET "visible" 0.0;\
-         target: "day"#_pos;\
+         target: "elm.swallow.day"#_pos;\
       }\
       program {\
          name: "day"#_pos"notvisible";\
-         signal: "day"#_pos",default";\
+         signal: "elm,day"#_pos",default";\
          source: "elm";\
          action: STATE_SET "default" 0.0;\
-         target: "day"#_pos;\
+         target: "elm.swallow.day"#_pos;\
       }\
    }
 
 group { name: "elm/dayselector/base/default";
    parts {
       part {
-         name: "day0";
+         name: "elm.swallow.day0";
          type: SWALLOW;
          scale: 1;
          clip_to: "clipper";
@@ -82,8 +83,8 @@ group { name: "elm/dayselector/base/default";
          type: RECT;
          description {
             state: "default" 0.0;
-            rel1.to: "day0";
-            rel2.to: "day6";
+            rel1.to: "elm.swallow.day0";
+            rel2.to: "elm.swallow.day6";
          }
          description {
             state: "visible" 0.0;
@@ -125,17 +126,17 @@ group { name: "elm/dayselector/base/default";
       }
       program {
          name: "day0_visible";
-         signal: "day0,visible";
+         signal: "elm,day0,visible";
          source: "elm";
          action: STATE_SET "visible" 0.0;
-         target: "day0";
+         target: "elm.swallow.day0";
       }
       program {
          name: "day0_default";
-         signal: "day0,default";
+         signal: "elm,day0,default";
          source: "elm";
          action: STATE_SET "default" 0.0;
-         target: "day0";
+         target: "elm.swallow.day0";
       }
    }
 }
index 6816ca7..8f70994 100644 (file)
@@ -141,9 +141,14 @@ _elm_dayselector_efl_ui_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
           (buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj));
         elm_object_style_set(VIEW(it), buf);
 
+        /* XXX kept for legacy compatibility, remove eventually */
         snprintf
           (buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
         elm_layout_signal_emit(obj, buf, "elm");
+        /* XXX */
+        snprintf
+          (buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
+        elm_layout_signal_emit(obj, buf, "elm");
      }
 
    _update_items(obj);
@@ -170,9 +175,14 @@ _item_del_cb(void *data,
           {
              sd->items = eina_list_remove(sd->items, it);
              eina_stringshare_del(it->day_style);
+             /* XXX kept for legacy compatibility, remove eventually */
              snprintf(buf, sizeof(buf), "day%d,default",
                       _item_location_get(sd, it));
              elm_layout_signal_emit(obj, buf, "elm");
+             /* XXX */
+             snprintf(buf, sizeof(buf), "elm,day%d,default",
+                      _item_location_get(sd, it));
+             elm_layout_signal_emit(obj, buf, "elm");
 
              // The object is already being deleted, there is no point in calling efl_del on it nore setting it to NULL.
 
@@ -234,9 +244,17 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
    it = _item_find(obj, day);
    if (it)
      {
-        snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+        snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
 
         int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+        if (!int_ret)
+          {
+             /* XXX kept for legacy compatibility, remove eventually */
+             snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+
+             int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+             /* XXX */
+          }
         if (!int_ret) return EINA_FALSE;
 
         if (!content) return EINA_TRUE; /* item deletion already handled */
@@ -250,11 +268,19 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
         it = efl_data_scope_get(eo_it, ELM_DAYSELECTOR_ITEM_CLASS);
         it->day = day;
 
-        snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+        snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
 
         int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
         if (!int_ret)
           {
+             /* XXX kept for legacy compatibility, remove eventually */
+             snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+
+             int_ret = efl_content_set(efl_part(efl_super(obj, MY_CLASS), buf), content);
+             /* XXX */
+          }
+        if (!int_ret)
+          {
              efl_del(eo_it);
              return EINA_FALSE;
           }
@@ -263,6 +289,9 @@ _elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item
         VIEW_SET(it, content);
      }
 
+   snprintf(buf, sizeof(buf), "elm,day%d,visible", _item_location_get(sd, it));
+   elm_layout_signal_emit(obj, buf, "elm");
+   /* XXX kept for legacy compatibility, remove eventually */
    snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it));
    elm_layout_signal_emit(obj, buf, "elm");
 
@@ -325,6 +354,9 @@ _elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *it
    elm_object_signal_callback_del
      (content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb);
 
+   snprintf(buf, sizeof(buf), "elm,day%d,default", _item_location_get(sd, it));
+   elm_layout_signal_emit(obj, buf, "elm");
+   /* XXX kept for legacy compatibility, remove eventually */
    snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it));
    elm_layout_signal_emit(obj, buf, "elm");
 
@@ -393,8 +425,12 @@ _items_create(Evas_Object *obj)
         strftime(buf, sizeof(buf), "%a", &time_daysel);
         elm_object_text_set(chk, buf);
 
-        snprintf(buf, sizeof(buf), "day%u", idx);
-        elm_layout_content_set(obj, buf, chk);
+        snprintf(buf, sizeof(buf), "elm.swallow.day%u", idx);
+        if (!elm_layout_content_set(obj, buf, chk))
+          {
+             snprintf(buf, sizeof(buf), "day%u", idx);
+             elm_layout_content_set(obj, buf, chk);
+          }
 
         // XXX: ACCESS
         _elm_access_text_set(_elm_access_info_get(chk),
@@ -496,9 +532,12 @@ _elm_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Data *sd, Elm_Dayselect
    sd->week_start = day;
    EINA_LIST_FOREACH(sd->items, l, it)
      {
-        snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
-        edje_object_part_swallow
-          (wd->resize_obj, buf, VIEW(it));
+        snprintf(buf, sizeof(buf), "elm.swallow.day%d", _item_location_get(sd, it));
+        if (!edje_object_part_swallow(wd->resize_obj, buf, VIEW(it)))
+          {
+             snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
+             edje_object_part_swallow(wd->resize_obj, buf, VIEW(it));
+          }
      }
 
    _update_items(obj);