summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_dayselector.c
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-05-24 20:40:18 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-05-26 19:55:50 +0900
commit99924852abf4e92db329d2f9f89a43a3143eea0d (patch)
treef5d949063b037dcd130de9f5f96547ef31cf2c88 /src/lib/elementary/elm_dayselector.c
parent56a7a66e97e231e8b9a7c3917055993fe36b4c30 (diff)
Efl: Remove part name in Efl.Container (use Efl.Part)
This touches Edje and also Elementary where part names are used. This commit blew up in size since now all content part APIs (get, set, unset) require to use Efl.Part instead. This is a big refactoring commit, but no logic should have been changed. Fingers crossed.
Diffstat (limited to 'src/lib/elementary/elm_dayselector.c')
-rw-r--r--src/lib/elementary/elm_dayselector.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c
index f97381a..500db01 100644
--- a/src/lib/elementary/elm_dayselector.c
+++ b/src/lib/elementary/elm_dayselector.c
@@ -9,6 +9,9 @@
9#include "elm_widget_dayselector.h" 9#include "elm_widget_dayselector.h"
10#include "elm_widget_container.h" 10#include "elm_widget_container.h"
11 11
12#include "elm_dayselector_internal_part.eo.h"
13#include "elm_part_helper.h"
14
12#define MY_CLASS ELM_DAYSELECTOR_CLASS 15#define MY_CLASS ELM_DAYSELECTOR_CLASS
13 16
14#define MY_CLASS_NAME "Elm_Dayselector" 17#define MY_CLASS_NAME "Elm_Dayselector"
@@ -216,8 +219,8 @@ _item_find(const Evas_Object *obj,
216 return NULL; 219 return NULL;
217} 220}
218 221
219EOLIAN static Eina_Bool 222static Eina_Bool
220_elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item, Evas_Object *content) 223_elm_dayselector_content_set(Eo *obj, Elm_Dayselector_Data *sd, const char *item, Evas_Object *content)
221{ 224{
222 Eina_Bool int_ret = EINA_FALSE; 225 Eina_Bool int_ret = EINA_FALSE;
223 226
@@ -239,7 +242,7 @@ _elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
239 { 242 {
240 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); 243 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
241 244
242 int_ret = efl_content_set(eo_super(obj, MY_CLASS), buf, content); 245 int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), buf), content);
243 if (!int_ret) return EINA_FALSE; 246 if (!int_ret) return EINA_FALSE;
244 247
245 if (!content) return EINA_TRUE; /* item deletion already handled */ 248 if (!content) return EINA_TRUE; /* item deletion already handled */
@@ -255,7 +258,7 @@ _elm_dayselector_efl_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
255 258
256 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); 259 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it));
257 260
258 int_ret = efl_content_set(eo_super(obj, MY_CLASS), buf, content); 261 int_ret = efl_content_set(efl_part(eo_super(obj, MY_CLASS), buf), content);
259 if (!int_ret) 262 if (!int_ret)
260 { 263 {
261 eo_unref(eo_it); 264 eo_unref(eo_it);
@@ -298,8 +301,8 @@ _elm_dayselector_item_eo_base_constructor(Eo *eo_item, Elm_Dayselector_Item_Data
298 return eo_item; 301 return eo_item;
299} 302}
300 303
301EOLIAN static Evas_Object* 304static Evas_Object*
302_elm_dayselector_efl_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item) 305_elm_dayselector_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item)
303{ 306{
304 int day; 307 int day;
305 char buf[1024]; 308 char buf[1024];
@@ -314,7 +317,7 @@ _elm_dayselector_efl_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd,
314 317
315 content = VIEW(it); 318 content = VIEW(it);
316 319
317 content = efl_content_unset(eo_super(obj, MY_CLASS), buf); 320 content = efl_content_unset(efl_part(eo_super(obj, MY_CLASS), buf));
318 if (!content) return NULL; 321 if (!content) return NULL;
319 322
320 sd->items = eina_list_remove(sd->items, it); 323 sd->items = eina_list_remove(sd->items, it);
@@ -612,6 +615,15 @@ _elm_dayselector_class_constructor(Eo_Class *klass)
612 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); 615 evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
613} 616}
614 617
618/* Efl.Part begin */
619
620ELM_PART_OVERRIDE(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
621ELM_PART_OVERRIDE_CONTENT_SET(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
622ELM_PART_OVERRIDE_CONTENT_UNSET(elm_dayselector, ELM_DAYSELECTOR, ELM_LAYOUT, Elm_Dayselector_Data, Elm_Part_Data)
623#include "elm_dayselector_internal_part.eo.c"
624
625/* Efl.Part end */
626
615#include "elm_dayselector.eo.c" 627#include "elm_dayselector.eo.c"
616#include "elm_dayselector_item.eo.c" 628#include "elm_dayselector_item.eo.c"
617 629