elementary/slideshow - Elm_Slideshow_Item -> Elm_Object_Item

WARNING. This may cause build breaks. 



SVN revision: 66021
This commit is contained in:
ChunEon Park 2011-12-08 11:01:01 +00:00
parent 7dc62ae5c3
commit fdc7cd86a4
4 changed files with 54 additions and 53 deletions

View File

@ -100,10 +100,10 @@ _get(void *data, Evas_Object *obj)
} }
static void static void
_slide_transition(void *data, Evas_Object *obj __UNUSED__, void *event_info) _slide_transition(void *data, Evas_Object *obj __UNUSED__, void *event_info __UNUSED__)
{ {
Elm_Slideshow_Item *it = (Elm_Slideshow_Item *) event_info; Elm_Object_Item *slide_it = (Elm_Object_Item *) event_info;
if (data == it) if (data == slide_it)
printf("Reaches to End of slides\n"); printf("Reaches to End of slides\n");
} }
@ -113,7 +113,7 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin; Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin;
const Eina_List *l; const Eina_List *l;
const char *transition, *layout; const char *transition, *layout;
Elm_Slideshow_Item *last_item; Elm_Object_Item *slide_last_it;
win = elm_win_add(NULL, "slideshow", ELM_WIN_BASIC); win = elm_win_add(NULL, "slideshow", ELM_WIN_BASIC);
elm_win_title_set(win, "Slideshow"); elm_win_title_set(win, "Slideshow");
@ -141,8 +141,8 @@ test_slideshow(void *data __UNUSED__, Evas_Object *obj __UNUSED__, void *event_i
elm_slideshow_item_add(slideshow, &itc, img5); elm_slideshow_item_add(slideshow, &itc, img5);
elm_slideshow_item_add(slideshow, &itc, img6); elm_slideshow_item_add(slideshow, &itc, img6);
elm_slideshow_item_add(slideshow, &itc, img7); elm_slideshow_item_add(slideshow, &itc, img7);
last_item = elm_slideshow_item_add(slideshow, &itc, img8); slide_last_it = elm_slideshow_item_add(slideshow, &itc, img8);
evas_object_smart_callback_add(slideshow, "transition,end", _slide_transition, last_item); evas_object_smart_callback_add(slideshow, "transition,end", _slide_transition, slide_last_it);
notify = elm_notify_add(win); notify = elm_notify_add(win);
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);

View File

@ -170,11 +170,11 @@ _cmp_func(const void *data1,
{ {
const char *img_path1, *img_path2; const char *img_path1, *img_path2;
const Elm_Slideshow_Item *it1 = data1; const Elm_Object_Item *slide_it1 = data1;
const Elm_Slideshow_Item *it2 = data2; const Elm_Object_Item *slide_it2 = data2;
img_path1 = elm_slideshow_item_data_get(it1); img_path1 = elm_slideshow_item_data_get(slide_it1);
img_path2 = elm_slideshow_item_data_get(it2); img_path2 = elm_slideshow_item_data_get(slide_it2);
return strcasecmp(img_path1, img_path2); return strcasecmp(img_path1, img_path2);
} }
@ -184,7 +184,7 @@ elm_main(int argc __UNUSED__,
char **argv __UNUSED__) char **argv __UNUSED__)
{ {
Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin; Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin;
Elm_Slideshow_Item *first, *last, *it; Elm_Object_Item *slide_first, *slide_last, *slide_it;
const char *transition, *layout; const char *transition, *layout;
const Eina_List *l, *list; const Eina_List *l, *list;
@ -207,7 +207,7 @@ elm_main(int argc __UNUSED__,
itc.func.get = _get; itc.func.get = _get;
itc.func.del = NULL; itc.func.del = NULL;
first = elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func); slide_first = elm_slideshow_item_sorted_insert(slideshow, &itc, img1, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img2, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img3, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
@ -215,13 +215,13 @@ elm_main(int argc __UNUSED__,
elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img6, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img7, _cmp_func);
elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func); elm_slideshow_item_sorted_insert(slideshow, &itc, img8, _cmp_func);
last = elm_slideshow_item_add(slideshow, &itc, img9); slide_last = elm_slideshow_item_add(slideshow, &itc, img9);
list = elm_slideshow_items_get(slideshow); list = elm_slideshow_items_get(slideshow);
fprintf(stdout, "List of items in the slideshow:\n"); fprintf(stdout, "List of items in the slideshow:\n");
EINA_LIST_FOREACH(list, l, it) EINA_LIST_FOREACH(list, l, it)
fprintf(stdout, "\t%s\n", fprintf(stdout, "\t%s\n",
(const char *)elm_slideshow_item_data_get(it)); (const char *)elm_slideshow_item_data_get(slide_it));
notify = elm_notify_add(win); notify = elm_notify_add(win);
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM); elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
@ -252,13 +252,13 @@ elm_main(int argc __UNUSED__,
bt = elm_button_add(win); bt = elm_button_add(win);
elm_object_text_set(bt, "First"); elm_object_text_set(bt, "First");
evas_object_smart_callback_add(bt, "clicked", _first, first); evas_object_smart_callback_add(bt, "clicked", _first, slide_first);
elm_box_pack_end(bx, bt); elm_box_pack_end(bx, bt);
evas_object_show(bt); evas_object_show(bt);
bt = elm_button_add(win); bt = elm_button_add(win);
elm_object_text_set(bt, "Last"); elm_object_text_set(bt, "Last");
evas_object_smart_callback_add(bt, "clicked", _last, last); evas_object_smart_callback_add(bt, "clicked", _last, slide_last);
elm_box_pack_end(bx, bt); elm_box_pack_end(bx, bt);
evas_object_show(bt); evas_object_show(bt);

View File

@ -20735,7 +20735,6 @@ extern "C" {
typedef struct _Elm_Slideshow_Item_Class Elm_Slideshow_Item_Class; /**< Slideshow item class definition struct */ typedef struct _Elm_Slideshow_Item_Class Elm_Slideshow_Item_Class; /**< Slideshow item class definition struct */
typedef struct _Elm_Slideshow_Item_Class_Func Elm_Slideshow_Item_Class_Func; /**< Class functions for slideshow item classes. */ typedef struct _Elm_Slideshow_Item_Class_Func Elm_Slideshow_Item_Class_Func; /**< Class functions for slideshow item classes. */
typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; /**< Slideshow item handle */
typedef Evas_Object *(*SlideshowItemGetFunc) (void *data, Evas_Object *obj); /**< Image fetching class function for slideshow item classes. */ typedef Evas_Object *(*SlideshowItemGetFunc) (void *data, Evas_Object *obj); /**< Image fetching class function for slideshow item classes. */
typedef void (*SlideshowItemDelFunc) (void *data, Evas_Object *obj); /**< Deletion class function for slideshow item classes. */ typedef void (*SlideshowItemDelFunc) (void *data, Evas_Object *obj); /**< Deletion class function for slideshow item classes. */
@ -20787,7 +20786,7 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI Elm_Slideshow_Item *elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data) EINA_ARG_NONNULL(1); EAPI Elm_Object_Item *elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data) EINA_ARG_NONNULL(1);
/** /**
* Insert a new item into the given slideshow widget, using the @p func * Insert a new item into the given slideshow widget, using the @p func
@ -20813,13 +20812,12 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI Elm_Slideshow_Item *elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) EINA_ARG_NONNULL(1); EAPI Elm_Object_Item *elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) EINA_ARG_NONNULL(1);
/** /**
* Display a given slideshow widget's item, programmatically. * Display a given slideshow widget's item, programmatically.
* *
* @param obj The slideshow object * @param it The item to display on @p obj's viewport
* @param item The item to display on @p obj's viewport
* *
* The change between the current item and @p item will use the * The change between the current item and @p item will use the
* transition @p obj is set to use (@see * transition @p obj is set to use (@see
@ -20827,7 +20825,7 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI void elm_slideshow_show(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); EAPI void elm_slideshow_show(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/** /**
* Slide to the @b next item, in a given slideshow widget * Slide to the @b next item, in a given slideshow widget
@ -21035,21 +21033,21 @@ extern "C" {
/** /**
* Delete a given item from a slideshow widget. * Delete a given item from a slideshow widget.
* *
* @param item The slideshow item * @param it The slideshow item
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); EAPI void elm_slideshow_item_del(Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/** /**
* Return the data associated with a given slideshow item * Return the data associated with a given slideshow item
* *
* @param item The slideshow item * @param it The slideshow item
* @return Returns the data associated to this item * @return Returns the data associated to this item
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI void *elm_slideshow_item_data_get(const Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1); EAPI void *elm_slideshow_item_data_get(const Elm_Object_Item *it) EINA_ARG_NONNULL(1);
/** /**
* Returns the currently displayed item, in a given slideshow widget * Returns the currently displayed item, in a given slideshow widget
@ -21060,7 +21058,7 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI Elm_Slideshow_Item *elm_slideshow_item_current_get(const Evas_Object *obj) EINA_ARG_NONNULL(1); EAPI Elm_Object_Item *elm_slideshow_item_current_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/** /**
* Get the real Evas object created to implement the view of a * Get the real Evas object created to implement the view of a
@ -21082,7 +21080,7 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI Evas_Object* elm_slideshow_item_object_get(const Elm_Slideshow_Item* item) EINA_ARG_NONNULL(1); EAPI Evas_Object* elm_slideshow_item_object_get(const Elm_Object_Item* it) EINA_ARG_NONNULL(1);
/** /**
* Get the the item, in a given slideshow widget, placed at * Get the the item, in a given slideshow widget, placed at
@ -21096,7 +21094,7 @@ extern "C" {
* *
* @ingroup Slideshow * @ingroup Slideshow
*/ */
EAPI Elm_Slideshow_Item *elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth) EINA_ARG_NONNULL(1); EAPI Elm_Object_Item *elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth) EINA_ARG_NONNULL(1);
/** /**
* Set the current slide layout in use for a given slideshow widget * Set the current slide layout in use for a given slideshow widget

View File

@ -2,6 +2,7 @@
#include "elm_priv.h" #include "elm_priv.h"
typedef struct _Widget_Data Widget_Data; typedef struct _Widget_Data Widget_Data;
typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item;
struct _Elm_Slideshow_Item struct _Elm_Slideshow_Item
{ {
@ -397,7 +398,7 @@ elm_slideshow_add(Evas_Object *parent)
return obj; return obj;
} }
EAPI Elm_Slideshow_Item* EAPI Elm_Object_Item*
elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data) elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data)
{ {
Elm_Slideshow_Item *item; Elm_Slideshow_Item *item;
@ -412,12 +413,12 @@ elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, co
wd->items = eina_list_merge(wd->items, item->l); wd->items = eina_list_merge(wd->items, item->l);
if (!wd->current) elm_slideshow_show(item); if (!wd->current) elm_slideshow_show((Elm_Object_Item *) item);
return item; return (Elm_Object_Item *) item;
} }
EAPI Elm_Slideshow_Item* EAPI Elm_Object_Item*
elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func)
{ {
Elm_Slideshow_Item *item; Elm_Slideshow_Item *item;
@ -432,23 +433,23 @@ elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Clas
wd->items = eina_list_sorted_merge(wd->items, item->l, func); wd->items = eina_list_sorted_merge(wd->items, item->l, func);
if (!wd->current) elm_slideshow_show(item); if (!wd->current) elm_slideshow_show((Elm_Object_Item *) item);
return item; return (Elm_Object_Item *) item;
} }
EAPI void EAPI void
elm_slideshow_show(Elm_Slideshow_Item *item) elm_slideshow_show(Elm_Object_Item *it)
{ {
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
char buf[1024]; char buf[1024];
Elm_Slideshow_Item *next = NULL; Elm_Slideshow_Item *item, *next = NULL;
Widget_Data *wd; Widget_Data *wd;
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); item = (Elm_Slideshow_Item *) it;
wd = elm_widget_data_get(WIDGET(item)); wd = elm_widget_data_get(WIDGET(item));
if (!wd) if (!wd) return;
return; if (item == wd->current) return;
if (item == wd->current)
return;
next = item; next = item;
_end(WIDGET(item), WIDGET(item), NULL, NULL); _end(WIDGET(item), WIDGET(item), NULL, NULL);
@ -653,9 +654,11 @@ elm_slideshow_clear(Evas_Object *obj)
} }
EAPI void EAPI void
elm_slideshow_item_del(Elm_Slideshow_Item *item) elm_slideshow_item_del(Elm_Object_Item *it)
{ {
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item); ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
Elm_Slideshow_Item *item = (Elm_Slideshow_Item *) it;
Widget_Data *wd = elm_widget_data_get(WIDGET(item)); Widget_Data *wd = elm_widget_data_get(WIDGET(item));
if (!wd) return; if (!wd) return;
if (wd->previous == item) wd->previous = NULL; if (wd->previous == item) wd->previous = NULL;
@ -694,27 +697,27 @@ elm_slideshow_items_get(const Evas_Object *obj)
return wd->items; return wd->items;
} }
EAPI Elm_Slideshow_Item * EAPI Elm_Object_Item *
elm_slideshow_item_current_get(const Evas_Object *obj) elm_slideshow_item_current_get(const Evas_Object *obj)
{ {
ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_CHECK_WIDTYPE(obj, widtype) NULL;
Widget_Data *wd = elm_widget_data_get(obj); Widget_Data *wd = elm_widget_data_get(obj);
if (!wd) return NULL; if (!wd) return NULL;
return wd->current; return (Elm_Object_Item *) wd->current;
} }
EAPI Evas_Object * EAPI Evas_Object *
elm_slideshow_item_object_get(const Elm_Slideshow_Item * item) elm_slideshow_item_object_get(const Elm_Object_Item * it)
{ {
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
return VIEW(item); return VIEW(it);
} }
EAPI void * EAPI void *
elm_slideshow_item_data_get(const Elm_Slideshow_Item * item) elm_slideshow_item_data_get(const Elm_Object_Item * it)
{ {
ELM_WIDGET_ITEM_WIDTYPE_CHECK_OR_RETURN(item, NULL); ELM_OBJ_ITEM_CHECK_OR_RETURN(it, NULL);
return elm_widget_item_data_get(item); return elm_widget_item_data_get(it);
} }
EAPI int EAPI int
@ -755,7 +758,7 @@ elm_slideshow_cache_after_set(Evas_Object *obj, int count)
wd->count_item_pre_after = count; wd->count_item_pre_after = count;
} }
EAPI Elm_Slideshow_Item * EAPI Elm_Object_Item *
elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth) elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth)
{ {
ELM_CHECK_WIDTYPE(obj, widtype) NULL; ELM_CHECK_WIDTYPE(obj, widtype) NULL;