summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Kantor <yossi.kantor@samsung.com>2014-06-23 15:42:46 +0300
committerDaniel Zaoui <daniel.zaoui@samsung.com>2014-09-17 15:08:41 +0300
commit07f1a677b51e475b681a17b8b1b04791f84fecec (patch)
tree20c60e80cce72abaeb9631e228d62b9150bd89a2
parentd344d99974c724b5a849d2668479fef96b27b6a0 (diff)
Porting to Eo: Elm Slideshow Item
-rw-r--r--src/lib/Makefile.am12
-rw-r--r--src/lib/elm_slideshow.c124
-rw-r--r--src/lib/elm_slideshow_common.h31
-rw-r--r--src/lib/elm_slideshow_item.eo42
-rw-r--r--src/lib/elm_widget_slideshow.h28
5 files changed, 141 insertions, 96 deletions
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 95647172e..b22072d43 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -853,7 +853,9 @@ BUILT_SOURCES = \
853 elm_hoversel_item.eo.c \ 853 elm_hoversel_item.eo.c \
854 elm_hoversel_item.eo.h \ 854 elm_hoversel_item.eo.h \
855 elm_segment_control_item.eo.c \ 855 elm_segment_control_item.eo.c \
856 elm_segment_control_item.eo.h 856 elm_segment_control_item.eo.h \
857 elm_slideshow_item.eo.c \
858 elm_slideshow_item.eo.h
857 859
858elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@ 860elementaryeolianfilesdir = $(datadir)/eolian/include/elementary-@VMAJ@
859elementaryeolianfiles_DATA = \ 861elementaryeolianfiles_DATA = \
@@ -952,8 +954,8 @@ elementaryeolianfiles_DATA = \
952 elm_color_item.eo \ 954 elm_color_item.eo \
953 elm_dayselector_item.eo \ 955 elm_dayselector_item.eo \
954 elm_hoversel_item.eo \ 956 elm_hoversel_item.eo \
955 elm_segment_control_item.eo 957 elm_segment_control_item.eo \
956 958 elm_slideshow_item.eo
957 959
958EXTRA_DIST += ${elementaryeolianfiles_DATA} 960EXTRA_DIST += ${elementaryeolianfiles_DATA}
959 961
@@ -1054,6 +1056,7 @@ nodist_includesunstable_HEADERS = \
1054 elm_dayselector_item.eo.h \ 1056 elm_dayselector_item.eo.h \
1055 elm_hoversel_item.eo.h \ 1057 elm_hoversel_item.eo.h \
1056 elm_segment_control_item.eo.h \ 1058 elm_segment_control_item.eo.h \
1059 elm_slideshow_item.eo.h \
1057 elm_layout.eo.legacy.h \ 1060 elm_layout.eo.legacy.h \
1058 elm_frame.eo.legacy.h \ 1061 elm_frame.eo.legacy.h \
1059 elm_hover.eo.legacy.h \ 1062 elm_hover.eo.legacy.h \
@@ -1121,7 +1124,8 @@ nodist_includesunstable_HEADERS = \
1121 elm_color_item.eo.legacy.h \ 1124 elm_color_item.eo.legacy.h \
1122 elm_dayselector_item.eo.legacy.h \ 1125 elm_dayselector_item.eo.legacy.h \
1123 elm_hoversel_item.eo.legacy.h \ 1126 elm_hoversel_item.eo.legacy.h \
1124 elm_segment_control_item.eo.legacy.h 1127 elm_segment_control_item.eo.legacy.h \
1128 elm_slideshow_item.eo.legacy.h
1125 1129
1126if HAVE_CXX11 1130if HAVE_CXX11
1127 1131
diff --git a/src/lib/elm_slideshow.c b/src/lib/elm_slideshow.c
index 890d2280b..951ee0e65 100644
--- a/src/lib/elm_slideshow.c
+++ b/src/lib/elm_slideshow.c
@@ -2,6 +2,7 @@
2# include "elementary_config.h" 2# include "elementary_config.h"
3#endif 3#endif
4 4
5#define ELM_WIDGET_ITEM_PROTECTED
5#include <Elementary.h> 6#include <Elementary.h>
6 7
7#include "elm_priv.h" 8#include "elm_priv.h"
@@ -102,27 +103,29 @@ _elm_slideshow_elm_layout_sizing_eval(Eo *obj, Elm_Slideshow_Data *_pd EINA_UNUS
102 evas_object_size_hint_max_set(obj, minw, minh); 103 evas_object_size_hint_max_set(obj, minw, minh);
103} 104}
104 105
105static Elm_Slideshow_Item * 106static Elm_Slideshow_Item_Data *
106_item_prev_get(Elm_Slideshow_Item *item) 107_item_prev_get(Elm_Slideshow_Item_Data *item)
107{ 108{
108 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd); 109 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd);
109 Elm_Slideshow_Item *prev = eina_list_data_get(eina_list_prev(item->l)); 110 Elm_Object_Item *eo_prev = eina_list_data_get(eina_list_prev(item->l));
110 111
111 if ((!prev) && (sd->loop)) 112 if ((!eo_prev) && (sd->loop))
112 prev = eina_list_data_get(eina_list_last(item->l)); 113 eo_prev = eina_list_data_get(eina_list_last(item->l));
113 114
115 ELM_SLIDESHOW_ITEM_DATA_GET(eo_prev, prev);
114 return prev; 116 return prev;
115} 117}
116 118
117static Elm_Slideshow_Item * 119static Elm_Slideshow_Item_Data *
118_item_next_get(Elm_Slideshow_Item *item) 120_item_next_get(Elm_Slideshow_Item_Data *item)
119{ 121{
120 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd); 122 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd);
121 Elm_Slideshow_Item *next = eina_list_data_get(eina_list_next(item->l)); 123 Elm_Object_Item *eo_next = eina_list_data_get(eina_list_next(item->l));
122 124
123 if ((!next) && (sd->loop)) 125 if ((!eo_next) && (sd->loop))
124 next = eina_list_data_get(sd->items); 126 eo_next = eina_list_data_get(sd->items);
125 127
128 ELM_SLIDESHOW_ITEM_DATA_GET(eo_next, next);
126 return next; 129 return next;
127} 130}
128 131
@@ -136,9 +139,9 @@ _on_size_hints_changed(void *data,
136} 139}
137 140
138static void 141static void
139_item_realize(Elm_Slideshow_Item *item) 142_item_realize(Elm_Slideshow_Item_Data *item)
140{ 143{
141 Elm_Slideshow_Item *_item_prev, *_item_next; 144 Elm_Slideshow_Item_Data *_item_prev, *_item_next;
142 Evas_Object *obj = WIDGET(item); 145 Evas_Object *obj = WIDGET(item);
143 int ac, bc, lc, ic = 0; 146 int ac, bc, lc, ic = 0;
144 147
@@ -146,7 +149,7 @@ _item_realize(Elm_Slideshow_Item *item)
146 149
147 if ((!VIEW(item)) && (item->itc->func.get)) 150 if ((!VIEW(item)) && (item->itc->func.get))
148 { 151 {
149 VIEW(item) = item->itc->func.get(elm_widget_item_data_get(item), obj); 152 VIEW(item) = item->itc->func.get(elm_object_item_data_get(EO_OBJ(item)), obj);
150 item->l_built = eina_list_append(NULL, item); 153 item->l_built = eina_list_append(NULL, item);
151 sd->items_built = eina_list_merge(sd->items_built, item->l_built); 154 sd->items_built = eina_list_merge(sd->items_built, item->l_built);
152 //FIXME: item could be shown by obj 155 //FIXME: item could be shown by obj
@@ -178,7 +181,7 @@ _item_realize(Elm_Slideshow_Item *item)
178 ic++; 181 ic++;
179 VIEW(_item_next) = 182 VIEW(_item_next) =
180 _item_next->itc->func.get( 183 _item_next->itc->func.get(
181 elm_widget_item_data_get(_item_next), obj); 184 elm_object_item_data_get(EO_OBJ(_item_next)), obj);
182 _item_next->l_built = 185 _item_next->l_built =
183 eina_list_append(NULL, _item_next); 186 eina_list_append(NULL, _item_next);
184 sd->items_built = eina_list_merge 187 sd->items_built = eina_list_merge
@@ -210,7 +213,7 @@ _item_realize(Elm_Slideshow_Item *item)
210 ic++; 213 ic++;
211 VIEW(_item_prev) = 214 VIEW(_item_prev) =
212 _item_prev->itc->func.get( 215 _item_prev->itc->func.get(
213 elm_widget_item_data_get(_item_prev), obj); 216 elm_object_item_data_get(EO_OBJ(_item_prev)), obj);
214 _item_prev->l_built = 217 _item_prev->l_built =
215 eina_list_append(NULL, _item_prev); 218 eina_list_append(NULL, _item_prev);
216 sd->items_built = eina_list_merge 219 sd->items_built = eina_list_merge
@@ -238,7 +241,7 @@ _item_realize(Elm_Slideshow_Item *item)
238 sd->items_built = eina_list_remove_list 241 sd->items_built = eina_list_remove_list
239 (sd->items_built, sd->items_built); 242 (sd->items_built, sd->items_built);
240 if (item->itc->func.del) 243 if (item->itc->func.del)
241 item->itc->func.del(elm_widget_item_data_get(item), VIEW(item)); 244 item->itc->func.del(elm_object_item_data_get(EO_OBJ(item)), VIEW(item));
242 ELM_SAFE_FREE(VIEW(item), evas_object_del); 245 ELM_SAFE_FREE(VIEW(item), evas_object_del);
243 } 246 }
244} 247}
@@ -249,7 +252,7 @@ _on_slideshow_end(void *data,
249 const char *emission, 252 const char *emission,
250 const char *source EINA_UNUSED) 253 const char *source EINA_UNUSED)
251{ 254{
252 Elm_Slideshow_Item *item; 255 Elm_Slideshow_Item_Data *item;
253 ELM_SLIDESHOW_DATA_GET(data, sd); 256 ELM_SLIDESHOW_DATA_GET(data, sd);
254 257
255 item = sd->previous; 258 item = sd->previous;
@@ -287,16 +290,15 @@ _timer_cb(void *data)
287 return ECORE_CALLBACK_CANCEL; 290 return ECORE_CALLBACK_CANCEL;
288} 291}
289 292
290static Eina_Bool 293EOLIAN static Eina_Bool
291_item_del_pre_hook(Elm_Object_Item *it) 294_elm_slideshow_item_elm_widget_item_del_pre(Eo *eo_item, Elm_Slideshow_Item_Data *item)
292{ 295{
293 Elm_Slideshow_Item *item = (Elm_Slideshow_Item *)it;
294 ELM_SLIDESHOW_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE); 296 ELM_SLIDESHOW_DATA_GET_OR_RETURN_VAL(WIDGET(item), sd, EINA_FALSE);
295 297
296 if (sd->previous == item) sd->previous = NULL; 298 if (sd->previous == item) sd->previous = NULL;
297 if (sd->current == item) 299 if (sd->current == item)
298 { 300 {
299 Eina_List *l = eina_list_data_find_list(sd->items, item); 301 Eina_List *l = eina_list_data_find_list(sd->items, eo_item);
300 Eina_List *l2 = eina_list_next(l); 302 Eina_List *l2 = eina_list_next(l);
301 sd->current = NULL; 303 sd->current = NULL;
302 if (!l2) 304 if (!l2)
@@ -313,7 +315,7 @@ _item_del_pre_hook(Elm_Object_Item *it)
313 sd->items_built = eina_list_remove_list(sd->items_built, item->l_built); 315 sd->items_built = eina_list_remove_list(sd->items_built, item->l_built);
314 316
315 if ((VIEW(item)) && (item->itc->func.del)) 317 if ((VIEW(item)) && (item->itc->func.del))
316 item->itc->func.del(elm_widget_item_data_get(item), VIEW(item)); 318 item->itc->func.del(elm_object_item_data_get((Elm_Object_Item *)eo_item), VIEW(item));
317 319
318 return EINA_TRUE; 320 return EINA_TRUE;
319} 321}
@@ -396,55 +398,67 @@ _elm_slideshow_eo_base_constructor(Eo *obj, Elm_Slideshow_Data *_pd EINA_UNUSED)
396 elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION)); 398 elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION));
397} 399}
398 400
401EOLIAN static void
402_elm_slideshow_item_eo_base_constructor(Eo *obj, Elm_Slideshow_Item_Data *it)
403{
404 eo_do_super(obj, ELM_SLIDESHOW_ITEM_CLASS, eo_constructor());
405 it->base = eo_data_scope_get(obj, ELM_WIDGET_ITEM_CLASS);
406}
407
399EOLIAN static Elm_Object_Item* 408EOLIAN static Elm_Object_Item*
400_elm_slideshow_item_add(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Slideshow_Item_Class *itc, const void *data) 409_elm_slideshow_item_add(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Slideshow_Item_Class *itc, const void *data)
401{ 410{
402 Elm_Slideshow_Item *item; 411 Eo *eo_item;
403 412
404 item = elm_widget_item_new(obj, Elm_Slideshow_Item); 413 eo_item = eo_add(ELM_SLIDESHOW_ITEM_CLASS, obj);
405 if (!item) return NULL; 414 if (!eo_item) return NULL;
415
416 ELM_SLIDESHOW_ITEM_DATA_GET(eo_item, item);
406 417
407 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
408 item->itc = itc; 418 item->itc = itc;
409 item->l = eina_list_append(item->l, item); 419 item->l = eina_list_append(item->l, eo_item);
410 elm_widget_item_data_set(item, data); 420 eo_do(eo_item, elm_wdg_item_data_set(data));
411 421
412 sd->items = eina_list_merge(sd->items, item->l); 422 sd->items = eina_list_merge(sd->items, item->l);
413 423
414 if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)item); 424 if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)eo_item);
415 425
416 return (Elm_Object_Item *)item; 426 return (Elm_Object_Item *)eo_item;
417} 427}
418 428
419EOLIAN static Elm_Object_Item* 429EOLIAN static Elm_Object_Item*
420_elm_slideshow_item_sorted_insert(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) 430_elm_slideshow_item_sorted_insert(Eo *obj, Elm_Slideshow_Data *sd, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func)
421{ 431{
422 Elm_Slideshow_Item *item; 432 Eo *eo_item;
433
434 eo_item = eo_add(ELM_SLIDESHOW_ITEM_CLASS, obj);
435 if (!eo_item) return NULL;
423 436
424 item = elm_widget_item_new(obj, Elm_Slideshow_Item); 437 ELM_SLIDESHOW_ITEM_DATA_GET(eo_item, item);
425 if (!item) return NULL;
426 438
427 elm_widget_item_del_pre_hook_set(item, _item_del_pre_hook);
428 item->itc = itc; 439 item->itc = itc;
429 item->l = eina_list_append(item->l, item); 440 item->l = eina_list_append(item->l, eo_item);
430 elm_widget_item_data_set(item, data); 441 eo_do(eo_item, elm_wdg_item_data_set(data));
431 442
432 sd->items = eina_list_sorted_merge(sd->items, item->l, func); 443 sd->items = eina_list_sorted_merge(sd->items, item->l, func);
433 444
434 if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)item); 445 if (!sd->current) elm_slideshow_item_show((Elm_Object_Item *)eo_item);
435 446
436 return (Elm_Object_Item *)item; 447 return (Elm_Object_Item *)eo_item;
437} 448}
438 449
439EAPI void 450EAPI void
440elm_slideshow_item_show(Elm_Object_Item *it) 451elm_slideshow_item_show(Elm_Object_Item *it)
441{ 452{
442 char buf[1024]; 453 eo_do((Eo*)it, elm_obj_slideshow_item_show());
443 Elm_Slideshow_Item *item, *next = NULL; 454}
444 455
445 ELM_SLIDESHOW_ITEM_CHECK(it); 456EOLIAN static void
457_elm_slideshow_item_show(Eo *eo_item EINA_UNUSED, Elm_Slideshow_Item_Data *item)
458{
459 char buf[1024];
460 Elm_Slideshow_Item_Data *next = NULL;
446 461
447 item = (Elm_Slideshow_Item *)it;
448 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd); 462 ELM_SLIDESHOW_DATA_GET(WIDGET(item), sd);
449 463
450 if (item == sd->current) return; 464 if (item == sd->current) return;
@@ -480,7 +494,7 @@ EOLIAN static void
480_elm_slideshow_next(Eo *obj, Elm_Slideshow_Data *sd) 494_elm_slideshow_next(Eo *obj, Elm_Slideshow_Data *sd)
481{ 495{
482 char buf[1024]; 496 char buf[1024];
483 Elm_Slideshow_Item *next = NULL; 497 Elm_Slideshow_Item_Data *next = NULL;
484 498
485 if (sd->current) next = _item_next_get(sd->current); 499 if (sd->current) next = _item_next_get(sd->current);
486 500
@@ -517,7 +531,7 @@ EOLIAN static void
517_elm_slideshow_previous(Eo *obj, Elm_Slideshow_Data *sd) 531_elm_slideshow_previous(Eo *obj, Elm_Slideshow_Data *sd)
518{ 532{
519 char buf[1024]; 533 char buf[1024];
520 Elm_Slideshow_Item *prev = NULL; 534 Elm_Slideshow_Item_Data *prev = NULL;
521 535
522 if (sd->current) prev = _item_prev_get(sd->current); 536 if (sd->current) prev = _item_prev_get(sd->current);
523 537
@@ -626,18 +640,19 @@ _elm_slideshow_loop_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
626EOLIAN static void 640EOLIAN static void
627_elm_slideshow_clear(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd) 641_elm_slideshow_clear(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
628{ 642{
629 Elm_Slideshow_Item *item; 643 Elm_Slideshow_Item_Data *item;
644 Eo *eo_item;
630 645
631 sd->previous = NULL; 646 sd->previous = NULL;
632 sd->current = NULL; 647 sd->current = NULL;
633 EINA_LIST_FREE(sd->items_built, item) 648 EINA_LIST_FREE(sd->items_built, item)
634 { 649 {
635 if (item->itc->func.del) 650 if (item->itc->func.del)
636 item->itc->func.del(elm_widget_item_data_get(item), VIEW(item)); 651 item->itc->func.del(elm_object_item_data_get(EO_OBJ(item)), VIEW(item));
637 } 652 }
638 653
639 EINA_LIST_FREE(sd->items, item) 654 EINA_LIST_FREE(sd->items, eo_item)
640 elm_widget_item_free(item); 655 eo_del(eo_item);
641} 656}
642 657
643EOLIAN static const Eina_List* 658EOLIAN static const Eina_List*
@@ -649,13 +664,21 @@ _elm_slideshow_items_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
649EOLIAN static Elm_Object_Item* 664EOLIAN static Elm_Object_Item*
650_elm_slideshow_item_current_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd) 665_elm_slideshow_item_current_get(Eo *obj EINA_UNUSED, Elm_Slideshow_Data *sd)
651{ 666{
652 return (Elm_Object_Item *)sd->current; 667 Elm_Slideshow_Item_Data *it = sd->current;
668 return it?(Elm_Object_Item *)EO_OBJ(it):NULL;
653} 669}
654 670
655EAPI Evas_Object * 671EAPI Evas_Object *
656elm_slideshow_item_object_get(const Elm_Object_Item *it) 672elm_slideshow_item_object_get(const Elm_Object_Item *it)
657{ 673{
658 ELM_SLIDESHOW_ITEM_CHECK_OR_RETURN(it, NULL); 674 Evas_Object *ret = NULL;
675 eo_do((Eo*)it, ret = elm_obj_slideshow_item_object_get());
676 return ret;
677}
678
679EOLIAN static Evas_Object *
680_elm_slideshow_item_object_get(Eo *eo_item EINA_UNUSED, Elm_Slideshow_Item_Data *it)
681{
659 return VIEW(it); 682 return VIEW(it);
660} 683}
661 684
@@ -728,4 +751,5 @@ _elm_slideshow_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
728 return &atspi_actions[0]; 751 return &atspi_actions[0];
729} 752}
730 753
754#include "elm_slideshow_item.eo.c"
731#include "elm_slideshow.eo.c" 755#include "elm_slideshow.eo.c"
diff --git a/src/lib/elm_slideshow_common.h b/src/lib/elm_slideshow_common.h
index 23a27214c..9c7d9e7ab 100644
--- a/src/lib/elm_slideshow_common.h
+++ b/src/lib/elm_slideshow_common.h
@@ -18,37 +18,6 @@ struct _Elm_Slideshow_Item_Class
18 } func; 18 } func;
19}; /**< member definitions of #Elm_Slideshow_Item_Class */ 19}; /**< member definitions of #Elm_Slideshow_Item_Class */
20 20
21/**
22 * Display a given slideshow widget's item, programmatically.
23 *
24 * @param it The item to display on @p obj's viewport
25 *
26 * The change between the current item and @p item will use the
27 * transition @p obj is set to use (@see
28 * elm_slideshow_transition_set()).
29 *
30 * @ingroup Slideshow
31 */
32EAPI void elm_slideshow_item_show(Elm_Object_Item *it); 21EAPI void elm_slideshow_item_show(Elm_Object_Item *it);
33 22
34/**
35 * Get the real Evas object created to implement the view of a
36 * given slideshow item
37 *
38 * @param it The slideshow item.
39 * @return the Evas object implementing this item's view.
40 *
41 * This returns the actual Evas object used to implement the
42 * specified slideshow item's view. This may be @c NULL, as it may
43 * not have been created or may have been deleted, at any time, by
44 * the slideshow. <b>Do not modify this object</b> (move, resize,
45 * show, hide, etc.), as the slideshow is controlling it. This
46 * function is for querying, emitting custom signals or hooking
47 * lower level callbacks for events on that object. Do not delete
48 * this object under any circumstances.
49 *
50 * @see elm_object_item_data_get()
51 *
52 * @ingroup Slideshow
53 */
54EAPI Evas_Object *elm_slideshow_item_object_get(const Elm_Object_Item *it); 23EAPI Evas_Object *elm_slideshow_item_object_get(const Elm_Object_Item *it);
diff --git a/src/lib/elm_slideshow_item.eo b/src/lib/elm_slideshow_item.eo
new file mode 100644
index 000000000..57e3b9dad
--- /dev/null
+++ b/src/lib/elm_slideshow_item.eo
@@ -0,0 +1,42 @@
1class Elm_Slideshow_Item(Elm_Widget_Item)
2{
3 legacy_prefix: null;
4 eo_prefix: elm_obj_slideshow_item;
5 methods {
6 show {
7 /*@
8 Display a given slideshow widget's item, programmatically.
9
10 The change between the current item and @p item will use the
11 transition @p obj is set to use (@see
12 elm_slideshow_transition_set()).
13
14 @ingroup Slideshow
15 */
16 }
17 object_get @const {
18 /*@
19 Get the real Evas object created to implement the view of a
20 given slideshow item
21
22 This returns the actual Evas object used to implement the
23 specified slideshow item's view. This may be @c NULL, as it may
24 not have been created or may have been deleted, at any time, by
25 the slideshow. <b>Do not modify this object</b> (move, resize,
26 show, hide, etc.), as the slideshow is controlling it. This
27 function is for querying, emitting custom signals or hooking
28 lower level callbacks for events on that object. Do not delete
29 this object under any circumstances.
30
31 @see elm_object_item_data_get()
32
33 @ingroup Slideshow
34 */
35 return: Evas_Object*;
36 }
37 }
38 implements {
39 Eo.Base.constructor;
40 Elm_Widget_Item.del_pre;
41 }
42}
diff --git a/src/lib/elm_widget_slideshow.h b/src/lib/elm_widget_slideshow.h
index c9c914fe6..c29f7bf4b 100644
--- a/src/lib/elm_widget_slideshow.h
+++ b/src/lib/elm_widget_slideshow.h
@@ -2,6 +2,9 @@
2#define ELM_WIDGET_SLIDESHOW_H 2#define ELM_WIDGET_SLIDESHOW_H
3 3
4#include "Elementary.h" 4#include "Elementary.h"
5#include "elm_slideshow_item.eo.h"
6
7#include "elm_object_item_migration_temp.h"
5 8
6/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR 9/* DO NOT USE THIS HEADER UNLESS YOU ARE PREPARED FOR BREAKING OF YOUR
7 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT 10 * CODE. THIS IS ELEMENTARY'S INTERNAL WIDGET API (for now) AND IS NOT
@@ -24,11 +27,11 @@
24 * Base layout smart data extended with slideshow instance data. 27 * Base layout smart data extended with slideshow instance data.
25 */ 28 */
26typedef struct _Elm_Slideshow_Data Elm_Slideshow_Data; 29typedef struct _Elm_Slideshow_Data Elm_Slideshow_Data;
27typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; 30typedef struct _Elm_Slideshow_Item_Data Elm_Slideshow_Item_Data;
28 31
29struct _Elm_Slideshow_Item 32struct _Elm_Slideshow_Item_Data
30{ 33{
31 ELM_WIDGET_ITEM; 34 Elm_Widget_Item_Data *base;
32 35
33 Eina_List *l, *l_built; 36 Eina_List *l, *l_built;
34 37
@@ -41,8 +44,8 @@ struct _Elm_Slideshow_Data
41 Eina_List *items; 44 Eina_List *items;
42 Eina_List *items_built; 45 Eina_List *items_built;
43 46
44 Elm_Slideshow_Item *current; 47 Elm_Slideshow_Item_Data *current;
45 Elm_Slideshow_Item *previous; 48 Elm_Slideshow_Item_Data *previous;
46 49
47 Eina_List *transitions; 50 Eina_List *transitions;
48 const char *transition; 51 const char *transition;
@@ -89,12 +92,15 @@ struct _Elm_Slideshow_Data
89 if (EINA_UNLIKELY(!eo_isa((obj), ELM_SLIDESHOW_CLASS))) \ 92 if (EINA_UNLIKELY(!eo_isa((obj), ELM_SLIDESHOW_CLASS))) \
90 return 93 return
91 94
92#define ELM_SLIDESHOW_ITEM_CHECK(it) \ 95#define ELM_SLIDESHOW_ITEM_CHECK(obj) \
93 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \ 96 if (EINA_UNLIKELY(!eo_isa(EO_OBJ(obj), ELM_SLIDESHOW_ITEM_CLASS))) \
94 ELM_SLIDESHOW_CHECK(it->base.widget); 97 return
98
99#define ELM_SLIDESHOW_ITEM_CHECK_OR_RETURN(obj, ...) \
100 if (EINA_UNLIKELY(!eo_isa(EO_OBJ(obj), ELM_SLIDESHOW_ITEM_CLASS))) \
101 return __VA_ARGS__;
95 102
96#define ELM_SLIDESHOW_ITEM_CHECK_OR_RETURN(it, ...) \ 103#define ELM_SLIDESHOW_ITEM_DATA_GET(o, sd) \
97 ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \ 104 Elm_Slideshow_Item_Data *sd = eo_data_scope_get((Eo *)o, ELM_SLIDESHOW_ITEM_CLASS)
98 ELM_SLIDESHOW_CHECK(it->base.widget) __VA_ARGS__;
99 105
100#endif 106#endif