forked from enlightenment/efl
[elementary] Documentation for the slideshow widget.
SVN revision: 61813
This commit is contained in:
parent
51491fbbae
commit
4619bd37a5
|
@ -60,7 +60,8 @@ WGT_PREVIEW = \
|
||||||
gengrid:preview-00.png:widget_preview_gengrid:200:160 \
|
gengrid:preview-00.png:widget_preview_gengrid:200:160 \
|
||||||
progressbar:preview-00.png:widget_preview_progressbar:150:50 \
|
progressbar:preview-00.png:widget_preview_progressbar:150:50 \
|
||||||
box:preview-00.png:widget_preview_box:200:160 \
|
box:preview-00.png:widget_preview_box:200:160 \
|
||||||
notify:preview-00.png:widget_preview_notify:60:30
|
notify:preview-00.png:widget_preview_notify:60:30 \
|
||||||
|
slideshow:preview-00.png:widget_preview_slideshow:50:50
|
||||||
|
|
||||||
widget-build:
|
widget-build:
|
||||||
@$(MAKE) -C widgets
|
@$(MAKE) -C widgets
|
||||||
|
|
|
@ -68,6 +68,8 @@
|
||||||
* @ref genlist_example_02
|
* @ref genlist_example_02
|
||||||
*
|
*
|
||||||
* @ref progressbar_example
|
* @ref progressbar_example
|
||||||
|
*
|
||||||
|
* @ref slideshow_example
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4361,6 +4363,119 @@
|
||||||
* @example notify_example_01.c
|
* @example notify_example_01.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page slideshow_example Slideshow widget example
|
||||||
|
*
|
||||||
|
* This application is aimed to exemplify the slideshow widget. It
|
||||||
|
* consists of a window with a slideshow widget set as "resize
|
||||||
|
* object", along with a control bar, in the form of a notify. Those
|
||||||
|
* controls will exercise most of the slideshow's API functions.
|
||||||
|
*
|
||||||
|
* We create the slideshow, itself, first, making it @b loop on its
|
||||||
|
* image itens, when in slideshow mode:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip slideshow = elm_slideshow_add
|
||||||
|
* @until evas_object_show
|
||||||
|
*
|
||||||
|
* Next, we define the <b>item class</b> for our slideshow
|
||||||
|
* items. Slideshow images are going to be Elementary @ref Photo "photo"
|
||||||
|
* widgets, here, as pointed by our @c get class
|
||||||
|
* function. We'll let the Elementary infrastructure to delete those
|
||||||
|
* objects for us, and, as there's no additional data attached to our
|
||||||
|
* slideshow items, the @c del class function can be left undefined:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip itc
|
||||||
|
* @until ;
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip itc.func
|
||||||
|
* @until = NULL
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip get our images to make slideshow items
|
||||||
|
* @until }
|
||||||
|
*
|
||||||
|
* We now get to populate the slideshow widget with items. Our images
|
||||||
|
* are going to be some randomly chosen from the Elementary package,
|
||||||
|
* nine of them. For the first eight, we insert them ordered in the
|
||||||
|
* widget, by using elm_slideshow_item_sorted_insert(). The comparing
|
||||||
|
* function will use the image names to sort items. The last item is
|
||||||
|
* inserted at the end of the slideshow's items list, with
|
||||||
|
* elm_slideshow_item_add(). We check out how that list ends with
|
||||||
|
* elm_slideshow_items_get(), than:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip static const char *img
|
||||||
|
* @until _2
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip first =
|
||||||
|
* @until data_get
|
||||||
|
*
|
||||||
|
* Note that we save the pointers to the first and last items in the
|
||||||
|
* slideshow, for future use.
|
||||||
|
*
|
||||||
|
* What follows is the code creating a notify, to be shown over the
|
||||||
|
* slideshow's viewport, with knobs to act on it. We're not showing
|
||||||
|
* that boilerplate code, but only the callbacks attached to the
|
||||||
|
* interesting smart events of those knobs. The first four are
|
||||||
|
* buttons, which will:
|
||||||
|
* - Select the @b next item in the slideshow
|
||||||
|
* - Select the @b previous item in the slideshow
|
||||||
|
* - Select the @b first item in the slideshow
|
||||||
|
* - Select the @b last item in the slideshow
|
||||||
|
*
|
||||||
|
* Check out the code for those four actions, being the two last @c
|
||||||
|
* data pointers the same @c first and @c last pointers we save
|
||||||
|
* before, respectively:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip jump to next
|
||||||
|
* @until }
|
||||||
|
* @until }
|
||||||
|
* @until }
|
||||||
|
* @until }
|
||||||
|
*
|
||||||
|
* What follow are two hoversels, meant for one to change the
|
||||||
|
* slideshow's @b transition and @b layout styles, respectively. We
|
||||||
|
* fetch all the available transition and layout names to populate
|
||||||
|
* those widgets and, when one selects any of them, we apply the
|
||||||
|
* corresponding setters on the slideshow:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip hv = elm_hoversel_add
|
||||||
|
* @until show(hv)
|
||||||
|
* @until show(hv)
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip transition changed
|
||||||
|
* @until }
|
||||||
|
* @until }
|
||||||
|
*
|
||||||
|
* For one to change the transition @b time on the slideshow widget,
|
||||||
|
* we use a spinner widget. We set it to the initial value of 3
|
||||||
|
* (seconds), which will be probed by the next knob -- a button
|
||||||
|
* starting the slideshow, de facto. Note that changing the transition
|
||||||
|
* time while a slideshow is already happening will ajust its
|
||||||
|
* transition time:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip spin = elm_spinner_add
|
||||||
|
* @until evas_object_show
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip slideshow transition time has
|
||||||
|
* @until }
|
||||||
|
*
|
||||||
|
* Finally, we have two buttons which will, respectively, start and
|
||||||
|
* stop the slideshow on our widget. Here are their "clicked"
|
||||||
|
* callbacks:
|
||||||
|
* @dontinclude slideshow_example.c
|
||||||
|
* @skip start the show
|
||||||
|
* @until }
|
||||||
|
* @until }
|
||||||
|
*
|
||||||
|
* This is how the example program's window looks like:
|
||||||
|
* @image html screenshots/slideshow_example.png
|
||||||
|
* @image latex screenshots/slideshow_example.eps width=\textwidth
|
||||||
|
*
|
||||||
|
* See the full @ref slideshow_example_c "source code" for
|
||||||
|
* this example.
|
||||||
|
*
|
||||||
|
* @example slideshow_example.c
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @page bg_example_01_c bg_example_01.c
|
* @page bg_example_01_c bg_example_01.c
|
||||||
* @include bg_example_01.c
|
* @include bg_example_01.c
|
||||||
|
@ -4502,3 +4617,9 @@
|
||||||
* @include progressbar_example.c
|
* @include progressbar_example.c
|
||||||
* @example progressbar_example.c
|
* @example progressbar_example.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @page slideshow_example_c Slideshow example
|
||||||
|
* @include slideshow_example.c
|
||||||
|
* @example slideshow_example.c
|
||||||
|
*/
|
||||||
|
|
|
@ -175,6 +175,9 @@
|
||||||
* @image html img/widget/slider/preview-00.png
|
* @image html img/widget/slider/preview-00.png
|
||||||
* @image latex img/widget/slider/preview-00.eps
|
* @image latex img/widget/slider/preview-00.eps
|
||||||
* @li @ref Slideshow
|
* @li @ref Slideshow
|
||||||
|
*
|
||||||
|
* @image html img/widget/slideshow/preview-00.png
|
||||||
|
* @image latex img/widget/slideshow/preview-00.eps
|
||||||
* @li @ref Spinner
|
* @li @ref Spinner
|
||||||
*
|
*
|
||||||
* @image html img/widget/spinner/preview-00.png
|
* @image html img/widget/spinner/preview-00.png
|
||||||
|
|
|
@ -76,7 +76,8 @@ widget_preview_panel \
|
||||||
widget_preview_gengrid \
|
widget_preview_gengrid \
|
||||||
widget_preview_progressbar \
|
widget_preview_progressbar \
|
||||||
widget_preview_box \
|
widget_preview_box \
|
||||||
widget_preview_notify
|
widget_preview_notify \
|
||||||
|
widget_preview_slideshow
|
||||||
|
|
||||||
LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_EMAP_LIBS@ @ELEMENTARY_LIBS@ @EIO_LIBS@ @my_libs@
|
LDADD = $(top_builddir)/src/lib/libelementary.la @ELEMENTARY_EWEATHER_LIBS@ @ELEMENTARY_EDBUS_LIBS@ @ELEMENTARY_EFREET_LIBS@ @ELEMENTARY_EMAP_LIBS@ @ELEMENTARY_LIBS@ @EIO_LIBS@ @my_libs@
|
||||||
|
|
||||||
|
@ -134,5 +135,6 @@ EXTRA_DIST = \
|
||||||
widget_preview_progressbar.c \
|
widget_preview_progressbar.c \
|
||||||
widget_preview_box.c \
|
widget_preview_box.c \
|
||||||
widget_preview_notify.c \
|
widget_preview_notify.c \
|
||||||
|
widget_preview_slideshow.c \
|
||||||
widget_preview_tmpl_foot.c \
|
widget_preview_tmpl_foot.c \
|
||||||
widget_preview_tmpl_head.c
|
widget_preview_tmpl_head.c
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
/* get our images to make slideshow items */
|
||||||
|
static Evas_Object *
|
||||||
|
_get(void *data,
|
||||||
|
Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object *photo = elm_photo_add(obj);
|
||||||
|
elm_photo_file_set(photo, data);
|
||||||
|
elm_photo_fill_inside_set(photo, EINA_TRUE);
|
||||||
|
elm_object_style_set(photo, "shadow");
|
||||||
|
|
||||||
|
return photo;
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "widget_preview_tmpl_head.c"
|
||||||
|
|
||||||
|
static const char *img9 = PACKAGE_DATA_DIR "/images/logo.png";
|
||||||
|
static Elm_Slideshow_Item_Class itc;
|
||||||
|
|
||||||
|
Evas_Object *o = elm_slideshow_add(win);
|
||||||
|
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
elm_win_resize_object_add(win, o);
|
||||||
|
evas_object_show(o);
|
||||||
|
|
||||||
|
itc.func.get = _get;
|
||||||
|
itc.func.del = NULL;
|
||||||
|
|
||||||
|
elm_slideshow_timeout_set(o, 0.01);
|
||||||
|
elm_slideshow_item_add(o, &itc, img9);
|
||||||
|
|
||||||
|
#include "widget_preview_tmpl_foot.c"
|
|
@ -93,6 +93,7 @@ SRCS = \
|
||||||
panel_example_01.c \
|
panel_example_01.c \
|
||||||
gengrid_example.c \
|
gengrid_example.c \
|
||||||
entry_example.c \
|
entry_example.c \
|
||||||
|
slideshow_example.c \
|
||||||
progressbar_example.c \
|
progressbar_example.c \
|
||||||
notify_example_01.c
|
notify_example_01.c
|
||||||
|
|
||||||
|
@ -177,6 +178,7 @@ pkglib_PROGRAMS += \
|
||||||
genlist_example_02 \
|
genlist_example_02 \
|
||||||
genlist_example_03 \
|
genlist_example_03 \
|
||||||
entry_example \
|
entry_example \
|
||||||
|
slideshow_example \
|
||||||
progressbar_example \
|
progressbar_example \
|
||||||
notify_example_01
|
notify_example_01
|
||||||
|
|
||||||
|
@ -235,7 +237,8 @@ SCREENSHOTS = \
|
||||||
entry_example:entry_example.png:0.0 \
|
entry_example:entry_example.png:0.0 \
|
||||||
progressbar_example:progressbar_example.png:0.0 \
|
progressbar_example:progressbar_example.png:0.0 \
|
||||||
notify_example_01:notify_example_01.png:0.0 \
|
notify_example_01:notify_example_01.png:0.0 \
|
||||||
notify_example_01:notify_example_01_a.png:6.0
|
notify_example_01:notify_example_01_a.png:6.0 \
|
||||||
|
slideshow_example:slideshow_example.png:1.0
|
||||||
|
|
||||||
HTML_SS_DIR=$(top_builddir)/doc/html/screenshots
|
HTML_SS_DIR=$(top_builddir)/doc/html/screenshots
|
||||||
LATEX_SS_DIR=$(top_builddir)/doc/latex/screenshots
|
LATEX_SS_DIR=$(top_builddir)/doc/latex/screenshots
|
||||||
|
|
|
@ -0,0 +1,321 @@
|
||||||
|
/**
|
||||||
|
* Simple Elementary's <b>slide show widget</b> example, illustrating its
|
||||||
|
* usage and API.
|
||||||
|
*
|
||||||
|
* See stdout/stderr for output. Compile with:
|
||||||
|
*
|
||||||
|
* @verbatim
|
||||||
|
* gcc -g `pkg-config --cflags --libs elementary` slideshow_example.c -o slideshow_example
|
||||||
|
* @endverbatim
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Elementary.h>
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "elementary_config.h"
|
||||||
|
#else
|
||||||
|
# define __UNUSED__
|
||||||
|
# define PACKAGE_DATA_DIR "../../data"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static void
|
||||||
|
_on_done(void *data __UNUSED__,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *slideshow, *bt_start, *bt_stop;
|
||||||
|
static Elm_Slideshow_Item_Class itc;
|
||||||
|
|
||||||
|
static const char *img1 = PACKAGE_DATA_DIR "/images/logo.png";
|
||||||
|
static const char *img2 = PACKAGE_DATA_DIR "/images/plant_01.jpg";
|
||||||
|
static const char *img3 = PACKAGE_DATA_DIR "/images/rock_01.jpg";
|
||||||
|
static const char *img4 = PACKAGE_DATA_DIR "/images/rock_02.jpg";
|
||||||
|
static const char *img5 = PACKAGE_DATA_DIR "/images/sky_01.jpg";
|
||||||
|
static const char *img6 = PACKAGE_DATA_DIR "/images/sky_04.jpg";
|
||||||
|
static const char *img7 = PACKAGE_DATA_DIR "/images/wood_01.jpg";
|
||||||
|
static const char *img8 = PACKAGE_DATA_DIR "/images/mystrale.jpg";
|
||||||
|
static const char *img9 = PACKAGE_DATA_DIR "/images/mystrale_2.jpg";
|
||||||
|
|
||||||
|
static void
|
||||||
|
_notify_show(void *data,
|
||||||
|
Evas *e __UNUSED__,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
evas_object_show(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* jump to next item, cyclically */
|
||||||
|
static void
|
||||||
|
_next(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_next(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_previous(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_previous(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_first(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_show(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_last(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_show(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_mouse_in(void *data,
|
||||||
|
Evas *e __UNUSED__,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_notify_timeout_set(data, 0.0);
|
||||||
|
evas_object_show(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_mouse_out(void *data,
|
||||||
|
Evas *e __UNUSED__,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_notify_timeout_set(data, 3.0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* transition changed */
|
||||||
|
static void
|
||||||
|
_transition_select(void *data,
|
||||||
|
Evas_Object *obj,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_transition_set(slideshow, data);
|
||||||
|
elm_object_text_set(obj, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_layout_select(void *data,
|
||||||
|
Evas_Object *obj,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_layout_set(slideshow, data);
|
||||||
|
elm_object_text_set(obj, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* start the show! */
|
||||||
|
static void
|
||||||
|
_start(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_timeout_set(slideshow, elm_spinner_value_get(data));
|
||||||
|
|
||||||
|
elm_object_disabled_set(bt_start, EINA_TRUE);
|
||||||
|
elm_object_disabled_set(bt_stop, EINA_FALSE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_stop(void *data __UNUSED__,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
elm_slideshow_timeout_set(slideshow, 0.0);
|
||||||
|
elm_object_disabled_set(bt_start, EINA_FALSE);
|
||||||
|
elm_object_disabled_set(bt_stop, EINA_TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* slideshow transition time has changed */
|
||||||
|
static void
|
||||||
|
_spin(void *data,
|
||||||
|
Evas_Object *obj __UNUSED__,
|
||||||
|
void *event_info __UNUSED__)
|
||||||
|
{
|
||||||
|
if (elm_slideshow_timeout_get(slideshow) > 0)
|
||||||
|
elm_slideshow_timeout_set(slideshow, elm_spinner_value_get(data));
|
||||||
|
}
|
||||||
|
|
||||||
|
/* get our images to make slideshow items */
|
||||||
|
static Evas_Object *
|
||||||
|
_get(void *data,
|
||||||
|
Evas_Object *obj)
|
||||||
|
{
|
||||||
|
Evas_Object *photo = elm_photo_add(obj);
|
||||||
|
elm_photo_file_set(photo, data);
|
||||||
|
elm_photo_fill_inside_set(photo, EINA_TRUE);
|
||||||
|
elm_object_style_set(photo, "shadow");
|
||||||
|
|
||||||
|
return photo;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ordering alphabetically */
|
||||||
|
static int
|
||||||
|
_cmp_func(const void *data1,
|
||||||
|
const void *data2)
|
||||||
|
{
|
||||||
|
const char *img_path1, *img_path2;
|
||||||
|
|
||||||
|
const Elm_Slideshow_Item *it1 = data1;
|
||||||
|
const Elm_Slideshow_Item *it2 = data2;
|
||||||
|
|
||||||
|
img_path1 = elm_slideshow_item_data_get(it1);
|
||||||
|
img_path2 = elm_slideshow_item_data_get(it2);
|
||||||
|
|
||||||
|
return strcasecmp(img_path1, img_path2);
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
elm_main(int argc __UNUSED__,
|
||||||
|
char **argv __UNUSED__)
|
||||||
|
{
|
||||||
|
Evas_Object *win, *bg, *notify, *bx, *bt, *hv, *spin;
|
||||||
|
Elm_Slideshow_Item *first, *last, *it;
|
||||||
|
const char *transition, *layout;
|
||||||
|
const Eina_List *l, *list;
|
||||||
|
|
||||||
|
win = elm_win_add(NULL, "slideshow", ELM_WIN_BASIC);
|
||||||
|
elm_win_title_set(win, "Slideshow example");
|
||||||
|
evas_object_smart_callback_add(win, "delete,request", _on_done, NULL);
|
||||||
|
|
||||||
|
bg = elm_bg_add(win);
|
||||||
|
elm_win_resize_object_add(win, bg);
|
||||||
|
evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_show(bg);
|
||||||
|
|
||||||
|
slideshow = elm_slideshow_add(win);
|
||||||
|
elm_slideshow_loop_set(slideshow, EINA_TRUE);
|
||||||
|
elm_win_resize_object_add(win, slideshow);
|
||||||
|
evas_object_size_hint_weight_set(slideshow,
|
||||||
|
EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
|
evas_object_show(slideshow);
|
||||||
|
|
||||||
|
itc.func.get = _get;
|
||||||
|
itc.func.del = NULL;
|
||||||
|
|
||||||
|
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, img3, _cmp_func);
|
||||||
|
elm_slideshow_item_sorted_insert(slideshow, &itc, img4, _cmp_func);
|
||||||
|
elm_slideshow_item_sorted_insert(slideshow, &itc, img5, _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, img8, _cmp_func);
|
||||||
|
last = elm_slideshow_item_add(slideshow, &itc, img9);
|
||||||
|
|
||||||
|
list = elm_slideshow_items_get(slideshow);
|
||||||
|
fprintf(stdout, "List of items in the slideshow:\n");
|
||||||
|
EINA_LIST_FOREACH(list, l, it)
|
||||||
|
fprintf(stdout, "\t%s\n",
|
||||||
|
(const char *)elm_slideshow_item_data_get(it));
|
||||||
|
|
||||||
|
notify = elm_notify_add(win);
|
||||||
|
elm_notify_orient_set(notify, ELM_NOTIFY_ORIENT_BOTTOM);
|
||||||
|
elm_win_resize_object_add(win, notify);
|
||||||
|
elm_notify_timeout_set(notify, 3.0);
|
||||||
|
|
||||||
|
bx = elm_box_add(win);
|
||||||
|
elm_box_horizontal_set(bx, EINA_TRUE);
|
||||||
|
elm_notify_content_set(notify, bx);
|
||||||
|
evas_object_show(bx);
|
||||||
|
|
||||||
|
evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_IN, _mouse_in,
|
||||||
|
notify);
|
||||||
|
evas_object_event_callback_add(bx, EVAS_CALLBACK_MOUSE_OUT, _mouse_out,
|
||||||
|
notify);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Previous");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _previous, slideshow);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Next");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _next, slideshow);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "First");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _first, first);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
elm_object_text_set(bt, "Last");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _last, last);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
hv = elm_hoversel_add(win);
|
||||||
|
elm_box_pack_end(bx, hv);
|
||||||
|
elm_hoversel_hover_parent_set(hv, win);
|
||||||
|
EINA_LIST_FOREACH(elm_slideshow_transitions_get(slideshow), l, transition)
|
||||||
|
elm_hoversel_item_add(hv, transition, NULL, 0, _transition_select,
|
||||||
|
transition);
|
||||||
|
elm_object_text_set(hv, eina_list_data_get(
|
||||||
|
elm_slideshow_transitions_get(slideshow)));
|
||||||
|
evas_object_show(hv);
|
||||||
|
|
||||||
|
hv = elm_hoversel_add(win);
|
||||||
|
elm_box_pack_end(bx, hv);
|
||||||
|
elm_hoversel_hover_parent_set(hv, win);
|
||||||
|
EINA_LIST_FOREACH(elm_slideshow_layouts_get(slideshow), l, layout)
|
||||||
|
elm_hoversel_item_add(hv, layout, NULL, 0, _layout_select, layout);
|
||||||
|
elm_object_text_set(hv, elm_slideshow_layout_get(slideshow));
|
||||||
|
evas_object_show(hv);
|
||||||
|
|
||||||
|
spin = elm_spinner_add(win);
|
||||||
|
elm_spinner_label_format_set(spin, "%2.0f s");
|
||||||
|
evas_object_smart_callback_add(spin, "changed", _spin, spin);
|
||||||
|
elm_spinner_step_set(spin, 1);
|
||||||
|
elm_spinner_min_max_set(spin, 1, 30);
|
||||||
|
elm_spinner_value_set(spin, 3);
|
||||||
|
elm_box_pack_end(bx, spin);
|
||||||
|
evas_object_show(spin);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
bt_start = bt;
|
||||||
|
elm_object_text_set(bt, "Start");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _start, spin);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
bt = elm_button_add(win);
|
||||||
|
bt_stop = bt;
|
||||||
|
elm_object_text_set(bt, "Stop");
|
||||||
|
evas_object_smart_callback_add(bt, "clicked", _stop, spin);
|
||||||
|
elm_box_pack_end(bx, bt);
|
||||||
|
elm_object_disabled_set(bt, EINA_TRUE);
|
||||||
|
evas_object_show(bt);
|
||||||
|
|
||||||
|
evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_UP,
|
||||||
|
_notify_show, notify);
|
||||||
|
evas_object_event_callback_add(slideshow, EVAS_CALLBACK_MOUSE_MOVE,
|
||||||
|
_notify_show, notify);
|
||||||
|
|
||||||
|
_notify_show(notify, NULL, NULL, NULL);
|
||||||
|
|
||||||
|
evas_object_resize(win, 600, 400);
|
||||||
|
evas_object_show(win);
|
||||||
|
|
||||||
|
elm_run();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ELM_MAIN()
|
|
@ -12652,12 +12652,78 @@ extern "C" {
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef struct _Elm_Slideshow_Item_Class Elm_Slideshow_Item_Class;
|
/**
|
||||||
typedef struct _Elm_Slideshow_Item_Class_Func Elm_Slideshow_Item_Class_Func;
|
* @defgroup Slideshow Slideshow
|
||||||
typedef struct _Elm_Slideshow_Item Elm_Slideshow_Item; /**< Item of Elm_Slideshow. Sub-type of Elm_Widget_Item */
|
*
|
||||||
typedef Evas_Object *(*SlideshowItemGetFunc) (void *data, Evas_Object *obj);
|
* @image html img/widget/slideshow/preview-00.png
|
||||||
typedef void (*SlideshowItemDelFunc) (void *data, Evas_Object *obj);
|
* @image latex img/widget/slideshow/preview-00.eps
|
||||||
|
*
|
||||||
|
* This widget, as the name indicates, is a pre-made image
|
||||||
|
* slideshow panel, with API functions acting on (child) image
|
||||||
|
* items presentation. Between those actions, are:
|
||||||
|
* - advance to next/previous image
|
||||||
|
* - select the style of image transition animation
|
||||||
|
* - set the exhibition time for each image
|
||||||
|
* - start/stop the slideshow
|
||||||
|
*
|
||||||
|
* The transition animations are defined in the widget's theme,
|
||||||
|
* consequently new animations can be added without having to
|
||||||
|
* update the widget's code.
|
||||||
|
*
|
||||||
|
* @section Slideshow_Items Slideshow items
|
||||||
|
*
|
||||||
|
* For slideshow items, just like for @ref Genlist "genlist" ones,
|
||||||
|
* the user defines a @b classes, specifying functions that will be
|
||||||
|
* called on the item's creation and deletion times.
|
||||||
|
*
|
||||||
|
* The #Elm_Slideshow_Item_Class structure contains the following
|
||||||
|
* members:
|
||||||
|
*
|
||||||
|
* - @c func.get - When an item is displayed, this function is
|
||||||
|
* called, and it's where one should create the item object, de
|
||||||
|
* facto. For example, the object can be a pure Evas image object
|
||||||
|
* or an Elementary @ref Photocam "photocam" widget. See
|
||||||
|
* #SlideshowItemGetFunc.
|
||||||
|
* - @c func.del - When an item is no more displayed, this function
|
||||||
|
* is called, where the user must delete any data associated to
|
||||||
|
* the item. See #SlideshowItemDelFunc.
|
||||||
|
*
|
||||||
|
* @section Slideshow_Caching Slideshow caching
|
||||||
|
*
|
||||||
|
* The slideshow provides facilities to have items adjacent to the
|
||||||
|
* one being displayed <b>already "realized"</b> (i.e. loaded) for
|
||||||
|
* you, so that the system does not have to decode image data
|
||||||
|
* anymore at the time it has to actually switch images on its
|
||||||
|
* viewport. The user is able to set the numbers of items to be
|
||||||
|
* cached @b before and @b after the current item, in the widget's
|
||||||
|
* item list.
|
||||||
|
*
|
||||||
|
* Smart events one can add callbacks for are:
|
||||||
|
*
|
||||||
|
* - @c "changed" - when the slideshow switches its view to a new
|
||||||
|
* item
|
||||||
|
*
|
||||||
|
* List of examples for the slideshow widget:
|
||||||
|
* @li @ref slideshow_example
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @addtogroup Slideshow
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
|
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 Elm_Slideshow_Item; /**< Slideshow item handle */
|
||||||
|
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. */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @struct _Elm_Slideshow_Item_Class
|
||||||
|
*
|
||||||
|
* Slideshow item class definition. See @ref Slideshow_Items for
|
||||||
|
* field details.
|
||||||
|
*/
|
||||||
struct _Elm_Slideshow_Item_Class
|
struct _Elm_Slideshow_Item_Class
|
||||||
{
|
{
|
||||||
struct _Elm_Slideshow_Item_Class_Func
|
struct _Elm_Slideshow_Item_Class_Func
|
||||||
|
@ -12665,38 +12731,486 @@ extern "C" {
|
||||||
SlideshowItemGetFunc get;
|
SlideshowItemGetFunc get;
|
||||||
SlideshowItemDelFunc del;
|
SlideshowItemDelFunc del;
|
||||||
} func;
|
} func;
|
||||||
};
|
}; /**< #Elm_Slideshow_Item_Class member definitions */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new slideshow widget to the given parent Elementary
|
||||||
|
* (container) object
|
||||||
|
*
|
||||||
|
* @param parent The parent object
|
||||||
|
* @return A new slideshow widget handle or @c NULL, on errors
|
||||||
|
*
|
||||||
|
* This function inserts a new slideshow widget on the canvas.
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
|
EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add (append) a new item in a given slideshow widget.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @aram itc The item class for the item
|
||||||
|
* @param data The item's data
|
||||||
|
* @return A handle to the item added or @c NULL, on errors
|
||||||
|
*
|
||||||
|
* Add a new item to @p obj's internal list of items, appending it.
|
||||||
|
* The item's class must contain the function really fetching the
|
||||||
|
* image object to show for this item, which could be an Evas image
|
||||||
|
* object or an Elementary photo, for example. The @p data
|
||||||
|
* parameter is going to be passed to both class functions of the
|
||||||
|
* item.
|
||||||
|
*
|
||||||
|
* @see #Elm_Slideshow_Item_Class
|
||||||
|
* @see elm_slideshow_item_sorted_insert()
|
||||||
|
*
|
||||||
|
* @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_Slideshow_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
|
||||||
|
* function to sort items (by item handles).
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @aram itc The item class for the item
|
||||||
|
* @param data The item's data
|
||||||
|
* @param func The comparing function to be used to sort slideshow
|
||||||
|
* items <b>by #Elm_Slideshow_Item item handles</b>
|
||||||
|
* @return Returns The slideshow item handle, on success, or
|
||||||
|
* @c NULL, on errors
|
||||||
|
*
|
||||||
|
* Add a new item to @p obj's internal list of items, in a position
|
||||||
|
* determined by the @p func comparing function. The item's class
|
||||||
|
* must contain the function really fetching the image object to
|
||||||
|
* show for this item, which could be an Evas image object or an
|
||||||
|
* Elementary photo, for example. The @p data parameter is going to
|
||||||
|
* be passed to both class functions of the item.
|
||||||
|
*
|
||||||
|
* @see #Elm_Slideshow_Item_Class
|
||||||
|
* @see elm_slideshow_item_add()
|
||||||
|
*
|
||||||
|
* @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_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);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Display a given slideshow widget's item, programmatically.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param item The item to display on @p obj's viewport
|
||||||
|
*
|
||||||
|
* The change between the current item and @p item will use the
|
||||||
|
* transition @p obj is set to use (@see
|
||||||
|
* elm_slideshow_transition_set()).
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_show(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_show(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Slide to the @b next item, in a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
*
|
||||||
|
* The sliding animation @p obj is set to use will be the
|
||||||
|
* transition effect used, after this call is issued.
|
||||||
|
*
|
||||||
|
* @note If the end of the slideshow's internal list of items is
|
||||||
|
* reached, it'll wrap around to the list's beginning, again.
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_next(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_next(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Slide to the @b previous item, in a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
*
|
||||||
|
* The sliding animation @p obj is set to use will be the
|
||||||
|
* transition effect used, after this call is issued.
|
||||||
|
*
|
||||||
|
* @note If the beginning of the slideshow's internal list of items
|
||||||
|
* is reached, it'll wrap around to the list's end, again.
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_previous(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_previous(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the list of sliding transition/effect names available, for a
|
||||||
|
* given slideshow widget.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The list of transitions (list of @b stringshared strings
|
||||||
|
* as data)
|
||||||
|
*
|
||||||
|
* The transitions, which come from @p obj's theme, must be an EDC
|
||||||
|
* data item named @c "transitions" on the theme file, with (prefix)
|
||||||
|
* names of EDC programs actually implementing them.
|
||||||
|
*
|
||||||
|
* The available transitions for slideshows on the default theme are:
|
||||||
|
* - @c "fade" - the current item fades out, while the new one
|
||||||
|
* fades in to the slideshow's viewport.
|
||||||
|
* - @c "black_fade" - the current item fades to black, and just
|
||||||
|
* then, the new item will fade in.
|
||||||
|
* - @c "horizontal" - the current item slides horizontally, until
|
||||||
|
* it gets out of the slideshow's viewport, while the new item
|
||||||
|
* comes from the left to take its place.
|
||||||
|
* - @c "vertical" - the current item slides vertically, until it
|
||||||
|
* gets out of the slideshow's viewport, while the new item comes
|
||||||
|
* from the bottom to take its place.
|
||||||
|
* - @c "square" - the new item starts to appear from the middle of
|
||||||
|
* the current one, but with a tiny size, growing until its
|
||||||
|
* target (full) size and covering the old one.
|
||||||
|
*
|
||||||
|
* @warning The stringshared strings get no new references
|
||||||
|
* exclusive to the user grabbing the list, here, so if you'd like
|
||||||
|
* to use them out of this call's context, you'd better @c
|
||||||
|
* eina_stringshare_ref() them.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_transition_set()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI const Eina_List *elm_slideshow_transitions_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI const Eina_List *elm_slideshow_transitions_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the current slide transition/effect in use for a given
|
||||||
|
* slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param transition The new transition's name string
|
||||||
|
*
|
||||||
|
* If @p transition is implemented in @p obj's theme (i.e., is
|
||||||
|
* contained in the list returned by
|
||||||
|
* elm_slideshow_transitions_get()), this new sliding effect will
|
||||||
|
* be used on the widget.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_transitions_get() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_transition_set(Evas_Object *obj, const char *transition) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_transition_set(Evas_Object *obj, const char *transition) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current slide transition/effect in use for a given
|
||||||
|
* slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The current transition's name
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_transition_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI const char *elm_slideshow_transition_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI const char *elm_slideshow_transition_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the interval between each image transition on a given
|
||||||
|
* slideshow widget, <b>and start the slideshow, itself</b>
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param timeout The new displaying timeout for images
|
||||||
|
*
|
||||||
|
* After this call, the slideshow widget will start cycling its
|
||||||
|
* view, sequentially and automatically, with the images of the
|
||||||
|
* items it has. The time between each new image displayed is going
|
||||||
|
* to be @p timeout, in @b seconds. If a different timeout was set
|
||||||
|
* previously and an slideshow was in progress, it will continue
|
||||||
|
* with the new time between transitions, after this call.
|
||||||
|
*
|
||||||
|
* @note A value less than or equal to 0 on @p timeout will disable
|
||||||
|
* the widget's internal timer, thus halting any slideshow which
|
||||||
|
* could be happening on @p obj.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_timeout_get()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_timeout_set(Evas_Object *obj, double timeout) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_timeout_set(Evas_Object *obj, double timeout) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the interval set for image transitions on a given slideshow
|
||||||
|
* widget.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return Returns the timeout set on it
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_timeout_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI double elm_slideshow_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI double elm_slideshow_timeout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set if, after a slideshow is started, for a given slideshow
|
||||||
|
* widget, its items should be displayed cyclically or not.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param loop Use @c EINA_TRUE to make it cycle through items or
|
||||||
|
* @c EINA_FALSE for it to stop at the end of @p obj's internal
|
||||||
|
* list of items
|
||||||
|
*
|
||||||
|
* @note elm_slideshow_next() and elm_slideshow_previous() will @b
|
||||||
|
* ignore what is set by this functions, i.e., they'll @b always
|
||||||
|
* cycle through items. This affects only the "automatic"
|
||||||
|
* slideshow, as set by elm_slideshow_timeout_set().
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_loop_get()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get if, after a slideshow is started, for a given slideshow
|
||||||
|
* widget, its items are to be displayed cyclically or not.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return @c EINA_TRUE, if the items in @p obj will be cycled
|
||||||
|
* through or @c EINA_FALSE, otherwise
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_loop_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI Eina_Bool elm_slideshow_loop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI Eina_Bool elm_slideshow_loop_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove all items from a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
*
|
||||||
|
* This removes (and deletes) all items in @p obj, leaving it
|
||||||
|
* empty.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_item_del(), to remove just one item.
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_clear(Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the internal list of items in a given slideshow widget.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The list of items (#Elm_Slideshow_Item as data) or
|
||||||
|
* @c NULL on errors.
|
||||||
|
*
|
||||||
|
* This list is @b not to be modified in any way and must not be
|
||||||
|
* freed. Use the list members with functions like
|
||||||
|
* elm_slideshow_item_del(), elm_slideshow_item_data_get().
|
||||||
|
*
|
||||||
|
* @warning This list is only valid until @p obj object's internal
|
||||||
|
* items list is changed. It should be fetched again with another
|
||||||
|
* call to this function when changes happen.
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI const Eina_List *elm_slideshow_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI const Eina_List *elm_slideshow_items_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete a given item from a slideshow widget.
|
||||||
|
*
|
||||||
|
* @param item The slideshow item
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_item_del(Elm_Slideshow_Item *item) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the data associated with a given slideshow item
|
||||||
|
*
|
||||||
|
* @param item The slideshow item
|
||||||
|
* @return Returns the data associated to this item
|
||||||
|
*
|
||||||
|
* @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_Slideshow_Item *item) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the currently displayed item, in a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return A handle to the item being displayed in @p obj or
|
||||||
|
* @c NULL, if none is (and on errors)
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI Elm_Slideshow_Item *elm_slideshow_item_current_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI Elm_Slideshow_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
|
||||||
|
* given slideshow item
|
||||||
|
*
|
||||||
|
* @param item The slideshow item.
|
||||||
|
* @return the Evas object implementing this item's view.
|
||||||
|
*
|
||||||
|
* This returns the actual Evas object used to implement the
|
||||||
|
* specified slideshow item's view. This may be @c NULL, as it may
|
||||||
|
* not have been created or may have been deleted, at any time, by
|
||||||
|
* the slideshow. <b>Do not modify this object</b> (move, resize,
|
||||||
|
* show, hide, etc.), as the slideshow is controlling it. This
|
||||||
|
* function is for querying, emitting custom signals or hooking
|
||||||
|
* lower level callbacks for events on that object. Do not delete
|
||||||
|
* this object under any circumstances.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_item_data_get()
|
||||||
|
*
|
||||||
|
* @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_Slideshow_Item* item) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the the item, in a given slideshow widget, placed at
|
||||||
|
* position @p nth, in its internal items list
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param nth The number of the item to grab a handle to (0 being
|
||||||
|
* the first)
|
||||||
|
* @return The item stored in @p obj at position @p nth or @c NULL,
|
||||||
|
* if there's no item with that index (and on errors)
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI Elm_Slideshow_Item *elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth) EINA_ARG_NONNULL(1);
|
EAPI Elm_Slideshow_Item *elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth) EINA_ARG_NONNULL(1);
|
||||||
EAPI const char *elm_slideshow_layout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
|
||||||
|
/**
|
||||||
|
* Set the current slide layout in use for a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param layout The new layout's name string
|
||||||
|
*
|
||||||
|
* If @p layout is implemented in @p obj's theme (i.e., is contained
|
||||||
|
* in the list returned by elm_slideshow_layouts_get()), this new
|
||||||
|
* images layout will be used on the widget.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_layouts_get() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_layout_set(Evas_Object *obj, const char *layout) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_layout_set(Evas_Object *obj, const char *layout) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the current slide layout in use for a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The current layout's name
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_layout_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
|
EAPI const char *elm_slideshow_layout_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the list of @b layout names available, for a given
|
||||||
|
* slideshow widget.
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The list of layouts (list of @b stringshared strings
|
||||||
|
* as data)
|
||||||
|
*
|
||||||
|
* Slideshow layouts will change how the widget is to dispose each
|
||||||
|
* image item in its viewport, with regard to cropping, scaling,
|
||||||
|
* etc.
|
||||||
|
*
|
||||||
|
* The layouts, which come from @p obj's theme, must be an EDC
|
||||||
|
* data item name @c "layouts" on the theme file, with (prefix)
|
||||||
|
* names of EDC programs actually implementing them.
|
||||||
|
*
|
||||||
|
* The available layouts for slideshows on the default theme are:
|
||||||
|
* - @c "fullscreen" - item images with original aspect, scaled to
|
||||||
|
* touch top and down slideshow borders or, if the image's heigh
|
||||||
|
* is not enough, left and right slideshow borders.
|
||||||
|
* - @c "not_fullscreen" - the same behavior as the @c "fullscreen"
|
||||||
|
* one, but always leaving 10% of the slideshow's dimensions of
|
||||||
|
* distance between the item image's borders and the slideshow
|
||||||
|
* borders, for each axis.
|
||||||
|
*
|
||||||
|
* @warning The stringshared strings get no new references
|
||||||
|
* exclusive to the user grabbing the list, here, so if you'd like
|
||||||
|
* to use them out of this call's context, you'd better @c
|
||||||
|
* eina_stringshare_ref() them.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_layout_set()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI const Eina_List *elm_slideshow_layouts_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI const Eina_List *elm_slideshow_layouts_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the number of items to cache, on a given slideshow widget,
|
||||||
|
* <b>before the current item</b>
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param count Number of items to cache before the current one
|
||||||
|
*
|
||||||
|
* The default value for this property is @c 2. See
|
||||||
|
* @ref Slideshow_Caching "slideshow caching" for more details.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_cache_before_get()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_cache_before_set(Evas_Object *obj, int count) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_cache_before_set(Evas_Object *obj, int count) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the number of items to cache, on a given slideshow widget,
|
||||||
|
* <b>before the current item</b>
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The number of items set to be cached before the current one
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_cache_before_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI int elm_slideshow_cache_before_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI int elm_slideshow_cache_before_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the number of items to cache, on a given slideshow widget,
|
||||||
|
* <b>after the current item</b>
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @param count Number of items to cache after the current one
|
||||||
|
*
|
||||||
|
* The default value for this property is @c 2. See
|
||||||
|
* @ref Slideshow_Caching "slideshow caching" for more details.
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_cache_after_get()
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI void elm_slideshow_cache_after_set(Evas_Object *obj, int count) EINA_ARG_NONNULL(1);
|
EAPI void elm_slideshow_cache_after_set(Evas_Object *obj, int count) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the number of items to cache, on a given slideshow widget,
|
||||||
|
* <b>after the current item</b>
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The number of items set to be cached after the current one
|
||||||
|
*
|
||||||
|
* @see elm_slideshow_cache_after_set() for more details
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI int elm_slideshow_cache_after_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI int elm_slideshow_cache_after_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the number of items stored in a given slideshow widget
|
||||||
|
*
|
||||||
|
* @param obj The slideshow object
|
||||||
|
* @return The number of items on @p obj, at the moment of this call
|
||||||
|
*
|
||||||
|
* @ingroup Slideshow
|
||||||
|
*/
|
||||||
EAPI unsigned int elm_slideshow_count_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
EAPI unsigned int elm_slideshow_count_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
|
||||||
/* smart callbacks called:
|
|
||||||
* "changed" - when the slideshow switch to another item
|
/**
|
||||||
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,24 +1,6 @@
|
||||||
#include <Elementary.h>
|
#include <Elementary.h>
|
||||||
#include "elm_priv.h"
|
#include "elm_priv.h"
|
||||||
|
|
||||||
/**
|
|
||||||
* @defgroup Slideshow Slideshow
|
|
||||||
*
|
|
||||||
* This object display a list of object (generally a list of images) and some actions like
|
|
||||||
* next/previous are used to navigate. The animations are defined in the theme,
|
|
||||||
* consequently new animations can be added without having to update the
|
|
||||||
* applications.
|
|
||||||
*
|
|
||||||
* The slideshow use 2 callbacks to create and delete the objects displayed. When an item
|
|
||||||
* is displayed the function itc->func.get() is called. This function should create the object,
|
|
||||||
* for example the object can be an evas_object_image or a photocam. When an object is no more
|
|
||||||
* displayed the function itc->func.del() is called, the user can delete the dana associated to the item.
|
|
||||||
*
|
|
||||||
* Signals that you can add callbacks for are:
|
|
||||||
*
|
|
||||||
* "changed" - when the slideshow switch to another item
|
|
||||||
*/
|
|
||||||
|
|
||||||
typedef struct _Widget_Data Widget_Data;
|
typedef struct _Widget_Data Widget_Data;
|
||||||
|
|
||||||
struct _Elm_Slideshow_Item
|
struct _Elm_Slideshow_Item
|
||||||
|
@ -344,14 +326,6 @@ _timer_cb(void *data)
|
||||||
return ECORE_CALLBACK_CANCEL;
|
return ECORE_CALLBACK_CANCEL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add a new slideshow to the parent
|
|
||||||
*
|
|
||||||
* @param parent The parent object
|
|
||||||
* @return The new object or NULL if it cannot be created
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
elm_slideshow_add(Evas_Object *parent)
|
elm_slideshow_add(Evas_Object *parent)
|
||||||
{
|
{
|
||||||
|
@ -402,16 +376,6 @@ elm_slideshow_add(Evas_Object *parent)
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add an object in the list. The object can be a evas object image or a elm photo for example.
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @aram itc Callbacks used to create the object and delete the data associated when the item is deleted.
|
|
||||||
* @param data Data used by the user to identified the item
|
|
||||||
* @return Returns The slideshow item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Elm_Slideshow_Item*
|
EAPI Elm_Slideshow_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)
|
||||||
{
|
{
|
||||||
|
@ -432,17 +396,6 @@ elm_slideshow_item_add(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, co
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Insert an object in the list. The object can be a evas object image or a elm photo for example.
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @aram itc Callbacks used to create the object and delete the data associated when the item is deleted.
|
|
||||||
* @param data Data used by the user to identified the item
|
|
||||||
* @param func The function to compare data
|
|
||||||
* @return Returns The slideshow item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Elm_Slideshow_Item*
|
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)
|
elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func)
|
||||||
{
|
{
|
||||||
|
@ -463,14 +416,6 @@ elm_slideshow_item_sorted_insert(Evas_Object *obj, const Elm_Slideshow_Item_Clas
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to the item
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param item The item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_show(Elm_Slideshow_Item *item)
|
elm_slideshow_show(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
|
@ -500,13 +445,6 @@ elm_slideshow_show(Elm_Slideshow_Item *item)
|
||||||
evas_object_smart_callback_call(item->base.widget, SIG_CHANGED, wd->current);
|
evas_object_smart_callback_call(item->base.widget, SIG_CHANGED, wd->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to the next item
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_next(Evas_Object *obj)
|
elm_slideshow_next(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -541,13 +479,6 @@ elm_slideshow_next(Evas_Object *obj)
|
||||||
evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
|
evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Go to the previous item
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_previous(Evas_Object *obj)
|
elm_slideshow_previous(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -582,14 +513,6 @@ elm_slideshow_previous(Evas_Object *obj)
|
||||||
evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
|
evas_object_smart_callback_call(obj, SIG_CHANGED, wd->current);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of transitions available.
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns the list of transitions (list of const char*)
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI const Eina_List *
|
EAPI const Eina_List *
|
||||||
elm_slideshow_transitions_get(const Evas_Object *obj)
|
elm_slideshow_transitions_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -599,14 +522,6 @@ elm_slideshow_transitions_get(const Evas_Object *obj)
|
||||||
return wd->transitions;
|
return wd->transitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of layouts available.
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns the list of layout (list of const char*)
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI const Eina_List *
|
EAPI const Eina_List *
|
||||||
elm_slideshow_layouts_get(const Evas_Object *obj)
|
elm_slideshow_layouts_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -616,14 +531,6 @@ elm_slideshow_layouts_get(const Evas_Object *obj)
|
||||||
return wd->layout.list;
|
return wd->layout.list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the transition to use
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param transition the new transition
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_transition_set(Evas_Object *obj, const char *transition)
|
elm_slideshow_transition_set(Evas_Object *obj, const char *transition)
|
||||||
{
|
{
|
||||||
|
@ -633,14 +540,6 @@ elm_slideshow_transition_set(Evas_Object *obj, const char *transition)
|
||||||
eina_stringshare_replace(&wd->transition, transition);
|
eina_stringshare_replace(&wd->transition, transition);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the transition to use
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return the transition set
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
elm_slideshow_transition_get(const Evas_Object *obj)
|
elm_slideshow_transition_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -650,15 +549,6 @@ elm_slideshow_transition_get(const Evas_Object *obj)
|
||||||
return wd->transition;
|
return wd->transition;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* The slideshow can go to the next item automatically after a few seconds.
|
|
||||||
* This method set the timeout to use. A timeout <=0 disable the timer.
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param timeout The new timeout
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_timeout_set(Evas_Object *obj, double timeout)
|
elm_slideshow_timeout_set(Evas_Object *obj, double timeout)
|
||||||
{
|
{
|
||||||
|
@ -672,14 +562,6 @@ elm_slideshow_timeout_set(Evas_Object *obj, double timeout)
|
||||||
wd->timer = ecore_timer_add(timeout, _timer_cb, obj);
|
wd->timer = ecore_timer_add(timeout, _timer_cb, obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the timeout value
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns the timeout
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI double
|
EAPI double
|
||||||
elm_slideshow_timeout_get(const Evas_Object *obj)
|
elm_slideshow_timeout_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -689,14 +571,6 @@ elm_slideshow_timeout_get(const Evas_Object *obj)
|
||||||
return wd->timeout;
|
return wd->timeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set if the first item should follow the last and vice versa
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param loop if EINA_TRUE, the first item will follow the last and vice versa
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop)
|
elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop)
|
||||||
{
|
{
|
||||||
|
@ -706,14 +580,6 @@ elm_slideshow_loop_set(Evas_Object *obj, Eina_Bool loop)
|
||||||
wd->loop = loop;
|
wd->loop = loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the current layout name
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @returns Returns the layout name
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI const char *
|
EAPI const char *
|
||||||
elm_slideshow_layout_get(const Evas_Object *obj)
|
elm_slideshow_layout_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -723,14 +589,6 @@ elm_slideshow_layout_get(const Evas_Object *obj)
|
||||||
return wd->layout.current;
|
return wd->layout.current;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set the layout
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param layout the new layout
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_layout_set(Evas_Object *obj, const char *layout)
|
elm_slideshow_layout_set(Evas_Object *obj, const char *layout)
|
||||||
{
|
{
|
||||||
|
@ -744,14 +602,6 @@ elm_slideshow_layout_set(Evas_Object *obj, const char *layout)
|
||||||
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
edje_object_signal_emit(wd->slideshow, buf, "slideshow");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return if the first item should follow the last and vice versa
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @returns Returns the loop flag
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
elm_slideshow_loop_get(const Evas_Object *obj)
|
elm_slideshow_loop_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -761,13 +611,6 @@ elm_slideshow_loop_get(const Evas_Object *obj)
|
||||||
return wd->loop;
|
return wd->loop;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete all the items
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_clear(Evas_Object *obj)
|
elm_slideshow_clear(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -791,13 +634,6 @@ elm_slideshow_clear(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Delete the item
|
|
||||||
*
|
|
||||||
* @param item The slideshow item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
||||||
{
|
{
|
||||||
|
@ -826,13 +662,6 @@ elm_slideshow_item_del(Elm_Slideshow_Item *item)
|
||||||
free(item);
|
free(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the list of items
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns the list of items (list of Elm_Slideshow_Item).
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI const Eina_List *
|
EAPI const Eina_List *
|
||||||
elm_slideshow_items_get(const Evas_Object *obj)
|
elm_slideshow_items_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -842,14 +671,6 @@ elm_slideshow_items_get(const Evas_Object *obj)
|
||||||
return wd->items;
|
return wd->items;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the current item displayed
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns the current item displayed
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Elm_Slideshow_Item *
|
EAPI Elm_Slideshow_Item *
|
||||||
elm_slideshow_item_current_get(const Evas_Object *obj)
|
elm_slideshow_item_current_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -859,14 +680,6 @@ elm_slideshow_item_current_get(const Evas_Object *obj)
|
||||||
return wd->current;
|
return wd->current;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the evas object associated to an item
|
|
||||||
*
|
|
||||||
* @param item The slideshow item
|
|
||||||
* @return Returns the evas object associated to this item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
|
elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
|
||||||
{
|
{
|
||||||
|
@ -874,14 +687,6 @@ elm_slideshow_item_object_get(const Elm_Slideshow_Item * item)
|
||||||
return item->base.view;
|
return item->base.view;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the data associated to an item
|
|
||||||
*
|
|
||||||
* @param item The slideshow item
|
|
||||||
* @return Returns the data associated to this item
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void *
|
EAPI void *
|
||||||
elm_slideshow_item_data_get(const Elm_Slideshow_Item * item)
|
elm_slideshow_item_data_get(const Elm_Slideshow_Item * item)
|
||||||
{
|
{
|
||||||
|
@ -889,14 +694,6 @@ elm_slideshow_item_data_get(const Elm_Slideshow_Item * item)
|
||||||
return elm_widget_item_data_get(item);
|
return elm_widget_item_data_get(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns max amount of cached items before current
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns max amount of cached items
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI int
|
EAPI int
|
||||||
elm_slideshow_cache_before_get(const Evas_Object *obj)
|
elm_slideshow_cache_before_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -906,14 +703,6 @@ elm_slideshow_cache_before_get(const Evas_Object *obj)
|
||||||
return wd->count_item_pre_before;
|
return wd->count_item_pre_before;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set max amount of cached items before current
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param count Max amount of cached items
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_cache_before_set(Evas_Object *obj, int count)
|
elm_slideshow_cache_before_set(Evas_Object *obj, int count)
|
||||||
{
|
{
|
||||||
|
@ -924,14 +713,6 @@ elm_slideshow_cache_before_set(Evas_Object *obj, int count)
|
||||||
wd->count_item_pre_before = count;
|
wd->count_item_pre_before = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns max amount of cached items after current
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return Returns max amount of cached items
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI int
|
EAPI int
|
||||||
elm_slideshow_cache_after_get(const Evas_Object *obj)
|
elm_slideshow_cache_after_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
@ -941,14 +722,6 @@ elm_slideshow_cache_after_get(const Evas_Object *obj)
|
||||||
return wd->count_item_pre_after;
|
return wd->count_item_pre_after;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set max amount of cached items after current
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param count max amount of cached items
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slideshow_cache_after_set(Evas_Object *obj, int count)
|
elm_slideshow_cache_after_set(Evas_Object *obj, int count)
|
||||||
{
|
{
|
||||||
|
@ -959,15 +732,6 @@ elm_slideshow_cache_after_set(Evas_Object *obj, int count)
|
||||||
wd->count_item_pre_after = count;
|
wd->count_item_pre_after = count;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the nth item of the slideshow
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @param nth The number of the element (0 being first)
|
|
||||||
* @return The item stored in slideshow at position required
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI Elm_Slideshow_Item *
|
EAPI Elm_Slideshow_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)
|
||||||
{
|
{
|
||||||
|
@ -977,14 +741,6 @@ elm_slideshow_item_nth_get(const Evas_Object *obj, unsigned int nth)
|
||||||
return eina_list_nth(wd->items, nth);
|
return eina_list_nth(wd->items, nth);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get count of items stored in slideshow
|
|
||||||
*
|
|
||||||
* @param obj The slideshow object
|
|
||||||
* @return The count of items
|
|
||||||
*
|
|
||||||
* @ingroup Slideshow
|
|
||||||
*/
|
|
||||||
EAPI unsigned int
|
EAPI unsigned int
|
||||||
elm_slideshow_count_get(const Evas_Object *obj)
|
elm_slideshow_count_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue