summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-06-12 17:52:33 +0300
committerYossi Kantor <yossi.kantor@samsung.com>2014-08-03 14:49:46 +0300
commit4a67429167c9ae5003af50ba1101471081b1287e (patch)
treef64e4d5a90920fe32377637f43b1713b757c1243
parent5e20b13e270a92c3b078147f47d7918763cd00a7 (diff)
Integration of Dayselector
-rw-r--r--src/lib/Makefile.am9
-rw-r--r--src/lib/elm_dayselector.c141
-rw-r--r--src/lib/elm_dayselector_item.eo8
-rw-r--r--src/lib/elm_widget_dayselector.h12
4 files changed, 107 insertions, 63 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 83f9a31e0..4b13b957d 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -778,7 +778,9 @@ BUILT_SOURCES = \
778 elm_widget_item.eo.c \ 778 elm_widget_item.eo.c \
779 elm_widget_item.eo.h \ 779 elm_widget_item.eo.h \
780 elm_color_item.eo.c \ 780 elm_color_item.eo.c \
781 elm_color_item.eo.h 781 elm_color_item.eo.h \
782 elm_dayselector_item.eo.c \
783 elm_dayselector_item.eo.h
782 784
783elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 785elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
784elementaryeolianfiles_DATA = \ 786elementaryeolianfiles_DATA = \
@@ -872,7 +874,8 @@ elementaryeolianfiles_DATA = \
872 elm_web.eo \ 874 elm_web.eo \
873 elm_win.eo \ 875 elm_win.eo \
874 elm_widget_item.eo \ 876 elm_widget_item.eo \
875 elm_color_item.eo 877 elm_color_item.eo \
878 elm_dayselector_item.eo
876 879
877EXTRA_DIST += \ 880EXTRA_DIST += \
878 ${elementaryeolianfiles_DATA} 881 ${elementaryeolianfiles_DATA}
@@ -1029,4 +1032,4 @@ nodist_includesunstable_HEADERS = \
1029 elm_toolbar.eo.legacy.h \ 1032 elm_toolbar.eo.legacy.h \
1030 elm_video.eo.legacy.h \ 1033 elm_video.eo.legacy.h \
1031 elm_web.eo.legacy.h \ 1034 elm_web.eo.legacy.h \
1032 elm_win.eo.legacy.h \ No newline at end of file 1035 elm_win.eo.legacy.h
diff --git a/src/lib/elm_dayselector.c b/src/lib/elm_dayselector.c
index 7698a6478..ced7ca10d 100644
--- a/src/lib/elm_dayselector.c
+++ b/src/lib/elm_dayselector.c
@@ -58,15 +58,16 @@ _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data
58 Eina_List *l; 58 Eina_List *l;
59 char buf[1024]; 59 char buf[1024];
60 struct tm time_daysel; 60 struct tm time_daysel;
61 Elm_Dayselector_Item *it; 61 Elm_Widobj_Item *eo_item;
62 62
63 if (sd->weekdays_names_set) 63 if (sd->weekdays_names_set)
64 return EINA_TRUE; 64 return EINA_TRUE;
65 65
66 t = time(NULL); 66 t = time(NULL);
67 localtime_r(&t, &time_daysel); 67 localtime_r(&t, &time_daysel);
68 EINA_LIST_FOREACH(sd->items, l, it) 68 EINA_LIST_FOREACH(sd->items, l, eo_item)
69 { 69 {
70 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
70 time_daysel.tm_wday = it->day; 71 time_daysel.tm_wday = it->day;
71 strftime(buf, sizeof(buf), "%a", &time_daysel); 72 strftime(buf, sizeof(buf), "%a", &time_daysel);
72 elm_object_text_set(VIEW(it), buf); 73 elm_object_text_set(VIEW(it), buf);
@@ -83,7 +84,7 @@ _update_items(Evas_Object *obj)
83 Eina_List *l; 84 Eina_List *l;
84 Eina_Bool rtl; 85 Eina_Bool rtl;
85 unsigned int last_day; 86 unsigned int last_day;
86 Elm_Dayselector_Item *it; 87 Elm_Widobj_Item *eo_item;
87 88
88 ELM_DAYSELECTOR_DATA_GET(obj, sd); 89 ELM_DAYSELECTOR_DATA_GET(obj, sd);
89 90
@@ -92,8 +93,9 @@ _update_items(Evas_Object *obj)
92 last_day = last_day % ELM_DAYSELECTOR_MAX; 93 last_day = last_day % ELM_DAYSELECTOR_MAX;
93 94
94 rtl = elm_widget_mirrored_get(obj); 95 rtl = elm_widget_mirrored_get(obj);
95 EINA_LIST_FOREACH(sd->items, l, it) 96 EINA_LIST_FOREACH(sd->items, l, eo_item)
96 { 97 {
98 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
97 elm_object_signal_emit(VIEW(it), it->day_style, ""); // XXX: compat 99 elm_object_signal_emit(VIEW(it), it->day_style, ""); // XXX: compat
98 elm_object_signal_emit(VIEW(it), it->day_style, "elm"); 100 elm_object_signal_emit(VIEW(it), it->day_style, "elm");
99 if (it->day == sd->week_start) 101 if (it->day == sd->week_start)
@@ -113,8 +115,9 @@ _update_items(Evas_Object *obj)
113 115
114static inline unsigned int 116static inline unsigned int
115_item_location_get(Elm_Dayselector_Data *sd, 117_item_location_get(Elm_Dayselector_Data *sd,
116 Elm_Dayselector_Item *it) 118 Elm_Widobj_Item *eo_item)
117{ 119{
120 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
118 return (ELM_DAYSELECTOR_MAX - sd->week_start + it->day) % 121 return (ELM_DAYSELECTOR_MAX - sd->week_start + it->day) %
119 ELM_DAYSELECTOR_MAX; 122 ELM_DAYSELECTOR_MAX;
120} 123}
@@ -126,19 +129,20 @@ _elm_dayselector_elm_widget_theme_apply(Eo *obj, Elm_Dayselector_Data *sd)
126 129
127 Eina_List *l; 130 Eina_List *l;
128 char buf[1024]; 131 char buf[1024];
129 Elm_Dayselector_Item *it; 132 Elm_Widobj_Item *eo_item;
130 133
131 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply()); 134 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_theme_apply());
132 if (!int_ret) return EINA_FALSE; 135 if (!int_ret) return EINA_FALSE;
133 136
134 EINA_LIST_FOREACH(sd->items, l, it) 137 EINA_LIST_FOREACH(sd->items, l, eo_item)
135 { 138 {
139 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
136 snprintf 140 snprintf
137 (buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj)); 141 (buf, sizeof(buf), "dayselector/%s", elm_object_style_get(obj));
138 elm_object_style_set(VIEW(it), buf); 142 elm_object_style_set(VIEW(it), buf);
139 143
140 snprintf 144 snprintf
141 (buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it)); 145 (buf, sizeof(buf), "day%d,visible", _item_location_get(sd, eo_item));
142 elm_layout_signal_emit(obj, buf, "elm"); 146 elm_layout_signal_emit(obj, buf, "elm");
143 } 147 }
144 148
@@ -156,22 +160,23 @@ _item_del_cb(void *data,
156{ 160{
157 Eina_List *l; 161 Eina_List *l;
158 char buf[1024]; 162 char buf[1024];
159 Elm_Dayselector_Item *it; 163 Elm_Widobj_Item *eo_item;
160 164
161 ELM_DAYSELECTOR_DATA_GET(data, sd); 165 ELM_DAYSELECTOR_DATA_GET(data, sd);
162 166
163 EINA_LIST_FOREACH(sd->items, l, it) 167 EINA_LIST_FOREACH(sd->items, l, eo_item)
164 { 168 {
169 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
165 if (obj == VIEW(it)) 170 if (obj == VIEW(it))
166 { 171 {
167 sd->items = eina_list_remove(sd->items, it); 172 sd->items = eina_list_remove(sd->items, eo_item);
168 eina_stringshare_del(it->day_style); 173 eina_stringshare_del(it->day_style);
169 snprintf(buf, sizeof(buf), "day%d,default", 174 snprintf(buf, sizeof(buf), "day%d,default",
170 _item_location_get(sd, it)); 175 _item_location_get(sd, eo_item));
171 elm_layout_signal_emit(obj, buf, "elm"); 176 elm_layout_signal_emit(obj, buf, "elm");
172 177
173 VIEW(it) = NULL; 178 VIEW(it) = NULL;
174 elm_widget_item_free(it); 179 eo_del(eo_item);
175 180
176 elm_layout_sizing_eval(obj); 181 elm_layout_sizing_eval(obj);
177 break; 182 break;
@@ -185,8 +190,8 @@ _item_signal_emit_cb(void *data,
185 const char *emission, 190 const char *emission,
186 const char *source EINA_UNUSED) 191 const char *source EINA_UNUSED)
187{ 192{
188 Elm_Dayselector_Item *it = data; 193 Elm_Widobj_Item *eo_item = data;
189 194 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
190 eina_stringshare_replace(&it->day_style, emission); 195 eina_stringshare_replace(&it->day_style, emission);
191} 196}
192 197
@@ -195,23 +200,25 @@ _item_clicked_cb(void *data,
195 Evas_Object *obj EINA_UNUSED, 200 Evas_Object *obj EINA_UNUSED,
196 void *event_info EINA_UNUSED) 201 void *event_info EINA_UNUSED)
197{ 202{
198 Elm_Dayselector_Item *it = data; 203 Elm_Widobj_Item *eo_item = data;
199 204 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
200 evas_object_smart_callback_call(WIDGET(it), SIG_CHANGED, (void *)it->day); 205 evas_object_smart_callback_call(WIDGET(it), SIG_CHANGED, (void *)it->day);
201} 206}
202 207
203static Elm_Dayselector_Item * 208static Elm_Widobj_Item *
204_item_find(const Evas_Object *obj, 209_item_find(const Evas_Object *obj,
205 Elm_Dayselector_Day day) 210 Elm_Dayselector_Day day)
206{ 211{
207 Eina_List *l; 212 Eina_List *l;
208 Elm_Dayselector_Item *it; 213 Elm_Widobj_Item *eo_item;
209 214
210 ELM_DAYSELECTOR_DATA_GET(obj, sd); 215 ELM_DAYSELECTOR_DATA_GET(obj, sd);
211 216
212 EINA_LIST_FOREACH(sd->items, l, it) 217 EINA_LIST_FOREACH(sd->items, l, eo_item)
213 if (day == it->day) return it; 218 {
214 219 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
220 if (day == it->day) return eo_item;
221 }
215 return NULL; 222 return NULL;
216} 223}
217 224
@@ -222,7 +229,7 @@ _elm_dayselector_elm_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
222 229
223 int day; 230 int day;
224 char buf[1024]; 231 char buf[1024];
225 Elm_Dayselector_Item *it = NULL; 232 Elm_Widobj_Item *eo_item = NULL;
226 233
227 if (strcmp(elm_object_widget_type_get(content), "Elm_Check")) 234 if (strcmp(elm_object_widget_type_get(content), "Elm_Check"))
228 return EINA_FALSE; 235 return EINA_FALSE;
@@ -232,10 +239,11 @@ _elm_dayselector_elm_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
232 day = atoi(item + (strlen(item) - 1)); 239 day = atoi(item + (strlen(item) - 1));
233 if (day < 0 || day > ELM_DAYSELECTOR_MAX) return EINA_FALSE; 240 if (day < 0 || day > ELM_DAYSELECTOR_MAX) return EINA_FALSE;
234 241
235 it = _item_find(obj, day); 242 eo_item = _item_find(obj, day);
236 if (it) 243 if (eo_item)
237 { 244 {
238 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); 245 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
246 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, eo_item));
239 247
240 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(buf, content)); 248 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(buf, content));
241 if (!int_ret) return EINA_FALSE; 249 if (!int_ret) return EINA_FALSE;
@@ -247,37 +255,39 @@ _elm_dayselector_elm_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
247 } 255 }
248 else 256 else
249 { 257 {
250 it = elm_widget_item_new(obj, Elm_Dayselector_Item); 258 eo_item = eo_add(ELM_DAYSELECTOR_ITEM_CLASS, obj);
259 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
251 it->day = day; 260 it->day = day;
252 261
253 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); 262 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, eo_item));
254 263
255 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(buf, content)); 264 eo_do_super(obj, MY_CLASS, int_ret = elm_obj_container_content_set(buf, content));
256 if (!int_ret) 265 if (!int_ret)
257 { 266 {
258 elm_widget_item_free(it); 267 eo_del(eo_item);
259 return EINA_FALSE; 268 return EINA_FALSE;
260 } 269 }
261 270
262 sd->items = eina_list_append(sd->items, it); 271 sd->items = eina_list_append(sd->items, eo_item);
263 VIEW(it) = content; 272 VIEW(it) = content;
264 } 273 }
265 274
266 snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, it)); 275 snprintf(buf, sizeof(buf), "day%d,visible", _item_location_get(sd, eo_item));
267 elm_layout_signal_emit(obj, buf, "elm"); 276 elm_layout_signal_emit(obj, buf, "elm");
268 277
269 evas_object_smart_callback_add(VIEW(it), "changed", _item_clicked_cb, it); 278 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
279 evas_object_smart_callback_add(VIEW(it), "changed", _item_clicked_cb, eo_item);
270 evas_object_event_callback_add 280 evas_object_event_callback_add
271 (VIEW(it), EVAS_CALLBACK_DEL, _item_del_cb, obj); 281 (VIEW(it), EVAS_CALLBACK_DEL, _item_del_cb, obj);
272 282
273 elm_object_signal_callback_add 283 elm_object_signal_callback_add
274 (VIEW(it), ITEM_TYPE_WEEKDAY_DEFAULT, "*", _item_signal_emit_cb, it); 284 (VIEW(it), ITEM_TYPE_WEEKDAY_DEFAULT, "*", _item_signal_emit_cb, eo_item);
275 elm_object_signal_callback_add 285 elm_object_signal_callback_add
276 (VIEW(it), ITEM_TYPE_WEEKDAY_STYLE1, "*", _item_signal_emit_cb, it); 286 (VIEW(it), ITEM_TYPE_WEEKDAY_STYLE1, "*", _item_signal_emit_cb, eo_item);
277 elm_object_signal_callback_add 287 elm_object_signal_callback_add
278 (VIEW(it), ITEM_TYPE_WEEKEND_DEFAULT, "*", _item_signal_emit_cb, it); 288 (VIEW(it), ITEM_TYPE_WEEKEND_DEFAULT, "*", _item_signal_emit_cb, eo_item);
279 elm_object_signal_callback_add 289 elm_object_signal_callback_add
280 (VIEW(it), ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb, it); 290 (VIEW(it), ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb, eo_item);
281 291
282 elm_layout_sizing_eval(obj); 292 elm_layout_sizing_eval(obj);
283 _update_items(obj); 293 _update_items(obj);
@@ -285,26 +295,34 @@ _elm_dayselector_elm_container_content_set(Eo *obj, Elm_Dayselector_Data *sd, co
285 return EINA_TRUE; 295 return EINA_TRUE;
286} 296}
287 297
298EOLIAN static void
299_elm_dayselector_item_eo_base_constructor(Eo *obj, Elm_Dayselector_Item_Data *it)
300{
301 eo_do_super(obj, ELM_DAYSELECTOR_ITEM_CLASS, eo_constructor());
302 it->base = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
303}
304
288EOLIAN static Evas_Object* 305EOLIAN static Evas_Object*
289_elm_dayselector_elm_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item) 306_elm_dayselector_elm_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd, const char *item)
290{ 307{
291 int day; 308 int day;
292 char buf[1024]; 309 char buf[1024];
293 Evas_Object *content; 310 Evas_Object *content;
294 Elm_Dayselector_Item *it = NULL; 311 Elm_Widobj_Item *eo_item = NULL;
295 312
296 day = atoi(item + (strlen(item) - 1)); 313 day = atoi(item + (strlen(item) - 1));
297 if (day < 0 || day > ELM_DAYSELECTOR_MAX) return NULL; 314 if (day < 0 || day > ELM_DAYSELECTOR_MAX) return NULL;
298 315
299 it = _item_find(obj, day); 316 eo_item = _item_find(obj, day);
300 if (!it) return NULL; 317 if (!eo_item) return NULL;
301 318
319 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
302 content = VIEW(it); 320 content = VIEW(it);
303 321
304 eo_do_super(obj, MY_CLASS, content = elm_obj_container_content_unset(buf)); 322 eo_do_super(obj, MY_CLASS, content = elm_obj_container_content_unset(buf));
305 if (!content) return NULL; 323 if (!content) return NULL;
306 324
307 sd->items = eina_list_remove(sd->items, it); 325 sd->items = eina_list_remove(sd->items, eo_item);
308 evas_object_smart_callback_del(content, "changed", _item_clicked_cb); 326 evas_object_smart_callback_del(content, "changed", _item_clicked_cb);
309 evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _item_del_cb); 327 evas_object_event_callback_del(content, EVAS_CALLBACK_DEL, _item_del_cb);
310 328
@@ -317,11 +335,11 @@ _elm_dayselector_elm_container_content_unset(Eo *obj, Elm_Dayselector_Data *sd,
317 elm_object_signal_callback_del 335 elm_object_signal_callback_del
318 (content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb); 336 (content, ITEM_TYPE_WEEKEND_STYLE1, "*", _item_signal_emit_cb);
319 337
320 snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, it)); 338 snprintf(buf, sizeof(buf), "day%d,default", _item_location_get(sd, eo_item));
321 elm_layout_signal_emit(obj, buf, "elm"); 339 elm_layout_signal_emit(obj, buf, "elm");
322 340
323 VIEW(it) = NULL; 341 VIEW(it) = NULL;
324 elm_widget_item_free(it); 342 eo_del(eo_item);
325 343
326 elm_layout_sizing_eval(obj); 344 elm_layout_sizing_eval(obj);
327 345
@@ -332,7 +350,7 @@ static void
332_items_style_set(Evas_Object *obj) 350_items_style_set(Evas_Object *obj)
333{ 351{
334 Eina_List *l; 352 Eina_List *l;
335 Elm_Dayselector_Item *it; 353 Elm_Widobj_Item *eo_item;
336 unsigned int weekend_last; 354 unsigned int weekend_last;
337 355
338 ELM_DAYSELECTOR_DATA_GET(obj, sd); 356 ELM_DAYSELECTOR_DATA_GET(obj, sd);
@@ -341,8 +359,9 @@ _items_style_set(Evas_Object *obj)
341 if (weekend_last >= ELM_DAYSELECTOR_MAX) 359 if (weekend_last >= ELM_DAYSELECTOR_MAX)
342 weekend_last = weekend_last % ELM_DAYSELECTOR_MAX; 360 weekend_last = weekend_last % ELM_DAYSELECTOR_MAX;
343 361
344 EINA_LIST_FOREACH(sd->items, l, it) 362 EINA_LIST_FOREACH(sd->items, l, eo_item)
345 { 363 {
364 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
346 if (weekend_last >= sd->weekend_start) 365 if (weekend_last >= sd->weekend_start)
347 { 366 {
348 if ((it->day >= sd->weekend_start) && (it->day <= weekend_last)) 367 if ((it->day >= sd->weekend_start) && (it->day <= weekend_last))
@@ -422,13 +441,14 @@ _elm_dayselector_evas_object_smart_add(Eo *obj, Elm_Dayselector_Data *priv)
422EOLIAN static void 441EOLIAN static void
423_elm_dayselector_evas_object_smart_del(Eo *obj, Elm_Dayselector_Data *sd) 442_elm_dayselector_evas_object_smart_del(Eo *obj, Elm_Dayselector_Data *sd)
424{ 443{
425 Elm_Dayselector_Item *it; 444 Elm_Widobj_Item *eo_item;
426 445
427 EINA_LIST_FREE(sd->items, it) 446 EINA_LIST_FREE(sd->items, eo_item)
428 { 447 {
429 sd->items = eina_list_remove(sd->items, it); 448 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
449 sd->items = eina_list_remove(sd->items, eo_item);
430 eina_stringshare_del(it->day_style); 450 eina_stringshare_del(it->day_style);
431 elm_widget_item_free(it); 451 eo_del(eo_item);
432 } 452 }
433 453
434 /* handles freeing sd */ 454 /* handles freeing sd */
@@ -456,13 +476,15 @@ _elm_dayselector_eo_base_constructor(Eo *obj, Elm_Dayselector_Data *_pd EINA_UNU
456EOLIAN static void 476EOLIAN static void
457_elm_dayselector_day_selected_set(Eo *obj, Elm_Dayselector_Data *_pd EINA_UNUSED, Elm_Dayselector_Day day, Eina_Bool selected) 477_elm_dayselector_day_selected_set(Eo *obj, Elm_Dayselector_Data *_pd EINA_UNUSED, Elm_Dayselector_Day day, Eina_Bool selected)
458{ 478{
459 elm_check_state_set(VIEW(_item_find(obj, day)), selected); 479 ELM_DAYSELECTOR_ITEM_DATA_GET((_item_find(obj, day)), it);
480 elm_check_state_set(VIEW(it), selected);
460} 481}
461 482
462EOLIAN static Eina_Bool 483EOLIAN static Eina_Bool
463_elm_dayselector_day_selected_get(Eo *obj, Elm_Dayselector_Data *_pd EINA_UNUSED, Elm_Dayselector_Day day) 484_elm_dayselector_day_selected_get(Eo *obj, Elm_Dayselector_Data *_pd EINA_UNUSED, Elm_Dayselector_Day day)
464{ 485{
465 return elm_check_state_get(VIEW(_item_find(obj, day))); 486 ELM_DAYSELECTOR_ITEM_DATA_GET((_item_find(obj, day)), it);
487 return elm_check_state_get(VIEW(it));
466} 488}
467 489
468EOLIAN static void 490EOLIAN static void
@@ -471,13 +493,14 @@ _elm_dayselector_week_start_set(Eo *obj, Elm_Dayselector_Data *sd, Elm_Dayselect
471 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 493 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
472 Eina_List *l; 494 Eina_List *l;
473 char buf[1024]; 495 char buf[1024];
474 Elm_Dayselector_Item *it; 496 Elm_Widobj_Item *eo_item;
475 497
476 /* just shuffling items, so swalling them directly */ 498 /* just shuffling items, so swalling them directly */
477 sd->week_start = day; 499 sd->week_start = day;
478 EINA_LIST_FOREACH(sd->items, l, it) 500 EINA_LIST_FOREACH(sd->items, l, eo_item)
479 { 501 {
480 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, it)); 502 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
503 snprintf(buf, sizeof(buf), "day%d", _item_location_get(sd, eo_item));
481 edje_object_part_swallow 504 edje_object_part_swallow
482 (wd->resize_obj, buf, VIEW(it)); 505 (wd->resize_obj, buf, VIEW(it));
483 } 506 }
@@ -527,7 +550,7 @@ _elm_dayselector_weekdays_names_set(Eo *obj, Elm_Dayselector_Data *sd, const cha
527 int idx; 550 int idx;
528 time_t now; 551 time_t now;
529 struct tm time_daysel; 552 struct tm time_daysel;
530 Elm_Dayselector_Item *it; 553 Elm_Widobj_Item *eo_item;
531 char buf[1024]; 554 char buf[1024];
532 555
533 if (weekdays) 556 if (weekdays)
@@ -541,7 +564,8 @@ _elm_dayselector_weekdays_names_set(Eo *obj, Elm_Dayselector_Data *sd, const cha
541 564
542 for (idx = 0; idx < ELM_DAYSELECTOR_MAX; idx++) 565 for (idx = 0; idx < ELM_DAYSELECTOR_MAX; idx++)
543 { 566 {
544 it = _item_find(obj, idx); 567 eo_item = _item_find(obj, idx);
568 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
545 569
546 if (sd->weekdays_names_set) 570 if (sd->weekdays_names_set)
547 elm_object_text_set(VIEW(it), weekdays[idx]); 571 elm_object_text_set(VIEW(it), weekdays[idx]);
@@ -559,12 +583,13 @@ _elm_dayselector_weekdays_names_get(Eo *obj, Elm_Dayselector_Data *sd EINA_UNUSE
559{ 583{
560 int idx; 584 int idx;
561 const char *weekday; 585 const char *weekday;
562 Elm_Dayselector_Item *it; 586 Elm_Widobj_Item *eo_item;
563 Eina_List *weekdays = NULL; 587 Eina_List *weekdays = NULL;
564 588
565 for (idx = 0; idx < ELM_DAYSELECTOR_MAX; idx++) 589 for (idx = 0; idx < ELM_DAYSELECTOR_MAX; idx++)
566 { 590 {
567 it = _item_find(obj, idx); 591 eo_item = _item_find(obj, idx);
592 ELM_DAYSELECTOR_ITEM_DATA_GET(eo_item, it);
568 weekday = elm_object_text_get(VIEW(it)); 593 weekday = elm_object_text_get(VIEW(it));
569 weekdays = eina_list_append(weekdays, eina_stringshare_add(weekday)); 594 weekdays = eina_list_append(weekdays, eina_stringshare_add(weekday));
570 } 595 }
@@ -584,3 +609,5 @@ _elm_dayselector_class_constructor(Eo_Class *klass)
584} 609}
585 610
586#include "elm_dayselector.eo.c" 611#include "elm_dayselector.eo.c"
612#include "elm_dayselector_item.eo.c"
613
diff --git a/src/lib/elm_dayselector_item.eo b/src/lib/elm_dayselector_item.eo
new file mode 100644
index 000000000..0d9179e2e
--- /dev/null
+++ b/src/lib/elm_dayselector_item.eo
@@ -0,0 +1,8 @@
1class Elm_Dayselector_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_dayselector_item;
5 implements {
6 Eo_Base::constructor;
7 }
8} \ No newline at end of file
diff --git a/src/lib/elm_widget_dayselector.h b/src/lib/elm_widget_dayselector.h
index 792e9dc24..3880db676 100644
--- a/src/lib/elm_widget_dayselector.h
+++ b/src/lib/elm_widget_dayselector.h
@@ -2,6 +2,9 @@
2#define ELM_WIDGET_DAYSELECTOR_H 2#define ELM_WIDGET_DAYSELECTOR_H
3 3
4#include "Elementary.h" 4#include "Elementary.h"
5#include "elm_dayselector_item.eo.h"
6
7#include "elm_object_item_migration_temp.h"
5 8
6/** 9/**
7 * @addtogroup Widget 10 * @addtogroup Widget
@@ -27,10 +30,10 @@ struct _Elm_Dayselector_Data
27 Eina_Bool weekdays_names_set : 1; 30 Eina_Bool weekdays_names_set : 1;
28}; 31};
29 32
30typedef struct _Elm_Dayselector_Item Elm_Dayselector_Item; 33typedef struct _Elm_Dayselector_Item_Data Elm_Dayselector_Item_Data;
31struct _Elm_Dayselector_Item 34struct _Elm_Dayselector_Item_Data
32{ 35{
33 ELM_WIDGET_ITEM; 36 Elm_Widget_Item_Data *base;
34 Elm_Dayselector_Day day; 37 Elm_Dayselector_Day day;
35 const char *day_style; 38 const char *day_style;
36}; 39};
@@ -64,4 +67,7 @@ struct _Elm_Dayselector_Item
64 if (EINA_UNLIKELY(!eo_isa((obj), ELM_DAYSELECTOR_CLASS))) \ 67 if (EINA_UNLIKELY(!eo_isa((obj), ELM_DAYSELECTOR_CLASS))) \
65 return 68 return
66 69
70#define ELM_DAYSELECTOR_ITEM_DATA_GET(o, sd) \
71 Elm_Dayselector_Item_Data * sd = eo_data_scope_get(o, ELM_DAYSELECTOR_ITEM_CLASS)
72
67#endif 73#endif