diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index a43145e8b9..484a6ef96f 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -203,8 +203,6 @@ elm_legacy_eolian_files = \ lib/elementary/elm_actionslider_part.eo \ lib/elementary/elm_bubble_part.eo \ lib/elementary/elm_fileselector_part.eo \ - lib/elementary/elm_slideshow.eo \ - lib/elementary/elm_slideshow_item.eo \ lib/elementary/elm_table.eo \ lib/elementary/elm_thumb.eo \ $(NULL) @@ -385,6 +383,10 @@ lib/elementary/elm_separator_eo.c \ lib/elementary/elm_separator_eo.legacy.c \ lib/elementary/elm_slider_eo.c \ lib/elementary/elm_slider_part_indicator_eo.c \ +lib/elementary/elm_slideshow_eo.c \ +lib/elementary/elm_slideshow_eo.legacy.c \ +lib/elementary/elm_slideshow_item_eo.c \ +lib/elementary/elm_slideshow_item_eo.legacy.c \ $(NULL) elm_legacy_eo_headers = \ @@ -570,6 +572,10 @@ lib/elementary/elm_slider_eo.h \ lib/elementary/elm_slider_eo.legacy.h \ lib/elementary/elm_slider_part_indicator_eo.h \ lib/elementary/elm_slider_part_indicator_eo.legacy.h \ +lib/elementary/elm_slideshow_eo.h \ +lib/elementary/elm_slideshow_eo.legacy.h \ +lib/elementary/elm_slideshow_item_eo.h \ +lib/elementary/elm_slideshow_item_eo.legacy.h \ $(NULL) diff --git a/src/lib/elementary/elm_slideshow.c b/src/lib/elementary/elm_slideshow.c index 925930b758..741be9eeb5 100644 --- a/src/lib/elementary/elm_slideshow.c +++ b/src/lib/elementary/elm_slideshow.c @@ -9,8 +9,8 @@ #include #include "elm_priv.h" -#include "elm_slideshow.eo.h" -#include "elm_slideshow_item.eo.h" +#include "elm_slideshow_eo.h" +#include "elm_slideshow_item_eo.h" #include "elm_widget_slideshow.h" #define MY_CLASS ELM_SLIDESHOW_CLASS @@ -717,5 +717,5 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(elm_slideshow, Elm_Slideshow_Data) ELM_LAYOUT_SIZING_EVAL_OPS(elm_slideshow), \ EFL_CANVAS_GROUP_ADD_DEL_OPS(elm_slideshow) -#include "elm_slideshow_item.eo.c" -#include "elm_slideshow.eo.c" +#include "elm_slideshow_item_eo.c" +#include "elm_slideshow_eo.c" diff --git a/src/lib/elementary/elm_slideshow.eo b/src/lib/elementary/elm_slideshow.eo deleted file mode 100644 index 08c8eb97dd..0000000000 --- a/src/lib/elementary/elm_slideshow.eo +++ /dev/null @@ -1,316 +0,0 @@ -type Elm_Slideshow_Item_Class: __undefined_type; [[Elementary slideshow item class type]] - -class Elm.Slideshow extends Efl.Ui.Layout_Base implements Efl.Access.Widget.Action, Efl.Ui.Legacy -{ - [[Elementary slideshow class]] - eo_prefix: elm_obj_slideshow; - legacy_prefix: elm_slideshow; - event_prefix: elm_slideshow; - methods { - @property cache_after { - set { - [[Set the number of items to cache, on a given slideshow widget, - after the current item. - - The default value for this property is 2. See - \@ref Slideshow_Caching "slideshow caching" for more details. - ]] - } - get { - [[Get the number of items to cache, on a given slideshow widget, - after the current item. - ]] - } - values { - count: int; [[Number of items to cache after the current one.]] - } - } - @property cache_before { - set { - [[Set the number of items to cache, on a given slideshow widget, - before the current item. - - The default value for this property is 2. See - \@ref Slideshow_Caching "slideshow caching" for more details. - ]] - } - get { - [[Get the number of items to cache, on a given slideshow widget, - before the current item. - ]] - } - values { - count: int; [[Number of items to cache before the current one.]] - } - } - @property layout { - set { - [[Set the current slide layout in use for a given slideshow widget - - If $layout is implemented in $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 @.layouts.get for more details. - ]] - } - get { - [[Get the current slide layout in use for a given slideshow widget.]] - } - values { - layout: string; [[The new layout's name string.]] - } - } - @property transition { - set { - [[Set the current slide transition/effect in use for a given - slideshow widget. - - If $transition is implemented in $obj's theme (i.e., is - contained in the list returned by @.transitions.get), this - new sliding effect will be used on the widget. - ]] - } - get { - [[Get the current slide transition/effect in use for a given - slideshow widget. - ]] - } - values { - transition: string @nullable; [[The new transition's name string.]] - } - } - @property items_loop { - set { - [[Set if the slideshow items should be displayed cyclically or not, - so when the end is reached it will restart from the first item. - - Note: This will affect the "automatic" slidshow behaviour and the - @.next and @.previous functions as well. - ]] - legacy: elm_slideshow_loop_set; - } - get { - [[Get if, after a slideshow is started, for a given slideshow - widget, its items are to be displayed cyclically or not. - ]] - legacy: elm_slideshow_loop_get; - } - values { - loop: bool; [[Use $true to make it cycle through items or - $false for it to stop at the end of $obj's - internal list of items.]] - } - } - @property timeout { - set { - [[Set the interval between each image transition on a given - slideshow widget and start the slideshow itself. - - 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 $timeout, in 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 $timeout will disable - the widget's internal timer, thus halting any slideshow which - could be happening on $obj. - ]] - } - get { - [[Get the interval set for image transitions on a given - slideshow widget. - ]] - } - values { - timeout: double; [[The new displaying timeout for images.]] - } - } - @property items { - get { - [[Get the internal list of items in a given slideshow widget. - - This list is not to be modified in any way and must not be - freed. - - Warning: This list is only valid until $obj object's internal - items list is changed. It should be fetched again with another - call to this function when changes happen. - ]] - return: const(list); [[ - The list of items (#Elm.Widget.Item as data) or $null on - errors. - ]] - } - } - @property transitions { - get { - [[Returns the list of sliding transition/effect names available, - for a given slideshow widget. - - The transitions, which come from $obj's theme, must be an EDC - data item named $"transitions" on the theme file, with (prefix) - names of EDC programs actually implementing them. - - The available transitions for slideshows on the default theme - are "fade" (the current item fades out, while the new one - fades in to the slideshow's viewport), "black_fade" (the - current item fades to black, and just then, the new item - will fade in), "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), - "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), "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 - \@ref eina_stringshare_ref them. Also the list is an internal - list and so is only valid for as long as the slideshow object - is valid and has not internally changed its list for some - reason, so make a copy if you need it around. - ]] - return: const(list); [[ - The list of transitions (list of stringshared strings - as data). - ]] - } - } - @property count { - get { - [[Get the number of items stored in a given slideshow widget.]] - return: uint; [[The number of items on $obj, at the moment of this call.]] - } - } - @property item_current { - get { - [[Returns the currently displayed item, in a given slideshow widget.]] - return: Elm.Widget.Item; [[A handle to the item being displayed - in $obj or $null, if none is (and - on errors)]] - } - } - @property layouts { - get { - [[Returns the list of layout names available, for a given - slideshow widget. - - 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 $obj's theme, must be an EDC - data item name $"layouts" on the theme file, with (prefix) - names of EDC programs actually implementing them. - - The available layouts for slideshows on the default theme are - "fullscreen" (item images with original aspect, scaled to - touch top and down slideshow borders or, if the image's height - is not enough, left and right slideshow borders) and - "not_fullscreen" (the same behavior as the "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 - \@ref eina_stringshare_ref them. - ]] - return: const(list); [[ - The list of layouts (list of stringshared strings as data) - ]] - } - } - previous { - [[Slide to the previous item, in a given slideshow widget - - The sliding animation $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. - ]] - } - item_nth_get @const { - [[Get the the item, in a given slideshow widget, placed at - position $nth, in its internal items list. - ]] - return: Elm.Widget.Item; [[The item stored in $obj at position - $nth or $null if there's no item with - that index (and on errors).]] - params { - @in nth: uint; [[The number of the item to grab a handle to - (0 being the first).]] - } - } - next { - [[Slide to the next item, in a given slideshow widget. - - The sliding animation $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. - ]] - } - clear { - [[Remove all items from a given slideshow widget. - - This removes (and deletes) all items in $obj, leaving it empty. - ]] - } - item_add { - [[Add (append) a new item in a given slideshow widget. - - Add a new item to $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 $data - parameter is going to be passed to both class functions of the - item. - ]] - return: Elm.Widget.Item; [[A handle to the item added or $null on errors.]] - params { - @cref itc: Elm_Slideshow_Item_Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item's data.]] - } - } - item_sorted_insert { - [[Insert a new item into the given slideshow widget, using the - $func function to sort items (by item handles). - - Add a new item to $obj's internal list of items, in a position - determined by the $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 $data parameter is going to - be passed to both class functions of the item. - ]] - return: Elm.Widget.Item; [[Returns The slideshow item handle, - on success, or $null on errors.]] - params { - @cref itc: Elm_Slideshow_Item_Class; [[The item class for the item.]] - @in data: const(void_ptr); [[The item's data.]] - @in func: Eina_Compare_Cb; [[The comparing function to be used to sort the slideshow - items by #Elm_Slideshow_Item_Class item handles.]] - } - } - } - implements { - class.constructor; - Efl.Object.constructor; - Efl.Ui.Widget.widget_input_event_handler; - Efl.Access.Widget.Action.elm_actions { get; } - } - events { - changed: Efl.Object; [[Called when slideshow widget changed]] - transition,end: Efl.Object; [[Called on transition end]] - } -} diff --git a/src/lib/elementary/elm_slideshow_eo.c b/src/lib/elementary/elm_slideshow_eo.c new file mode 100644 index 0000000000..145b94babf --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.c @@ -0,0 +1,321 @@ +EWAPI const Efl_Event_Description _ELM_SLIDESHOW_EVENT_CHANGED = + EFL_EVENT_DESCRIPTION("changed"); +EWAPI const Efl_Event_Description _ELM_SLIDESHOW_EVENT_TRANSITION_END = + EFL_EVENT_DESCRIPTION("transition,end"); + +void _elm_slideshow_cache_after_set(Eo *obj, Elm_Slideshow_Data *pd, int count); + + +static Eina_Error +__eolian_elm_slideshow_cache_after_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_cache_after_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_cache_after_set, EFL_FUNC_CALL(count), int count); + +int _elm_slideshow_cache_after_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_cache_after_get_reflect(Eo *obj) +{ + int val = elm_obj_slideshow_cache_after_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_cache_after_get, int, 0); + +void _elm_slideshow_cache_before_set(Eo *obj, Elm_Slideshow_Data *pd, int count); + + +static Eina_Error +__eolian_elm_slideshow_cache_before_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; int cval; + if (!eina_value_int_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_cache_before_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_cache_before_set, EFL_FUNC_CALL(count), int count); + +int _elm_slideshow_cache_before_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_cache_before_get_reflect(Eo *obj) +{ + int val = elm_obj_slideshow_cache_before_get(obj); + return eina_value_int_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_cache_before_get, int, 0); + +void _elm_slideshow_layout_set(Eo *obj, Elm_Slideshow_Data *pd, const char *layout); + + +static Eina_Error +__eolian_elm_slideshow_layout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_layout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_layout_set, EFL_FUNC_CALL(layout), const char *layout); + +const char *_elm_slideshow_layout_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_layout_get_reflect(Eo *obj) +{ + const char *val = elm_obj_slideshow_layout_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_layout_get, const char *, NULL); + +void _elm_slideshow_transition_set(Eo *obj, Elm_Slideshow_Data *pd, const char *transition); + + +static Eina_Error +__eolian_elm_slideshow_transition_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; const char *cval; + if (!eina_value_string_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_transition_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_transition_set, EFL_FUNC_CALL(transition), const char *transition); + +const char *_elm_slideshow_transition_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_transition_get_reflect(Eo *obj) +{ + const char *val = elm_obj_slideshow_transition_get(obj); + return eina_value_string_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_transition_get, const char *, NULL); + +void _elm_slideshow_items_loop_set(Eo *obj, Elm_Slideshow_Data *pd, Eina_Bool loop); + + +static Eina_Error +__eolian_elm_slideshow_items_loop_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; Eina_Bool cval; + if (!eina_value_bool_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_items_loop_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_items_loop_set, EFL_FUNC_CALL(loop), Eina_Bool loop); + +Eina_Bool _elm_slideshow_items_loop_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_items_loop_get_reflect(Eo *obj) +{ + Eina_Bool val = elm_obj_slideshow_items_loop_get(obj); + return eina_value_bool_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_items_loop_get, Eina_Bool, 0); + +void _elm_slideshow_timeout_set(Eo *obj, Elm_Slideshow_Data *pd, double timeout); + + +static Eina_Error +__eolian_elm_slideshow_timeout_set_reflect(Eo *obj, Eina_Value val) +{ + Eina_Error r = 0; double cval; + if (!eina_value_double_convert(&val, &cval)) + { + r = EINA_ERROR_VALUE_FAILED; + goto end; + } + elm_obj_slideshow_timeout_set(obj, cval); + end: + eina_value_flush(&val); + return r; +} + +EOAPI EFL_VOID_FUNC_BODYV(elm_obj_slideshow_timeout_set, EFL_FUNC_CALL(timeout), double timeout); + +double _elm_slideshow_timeout_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Value +__eolian_elm_slideshow_timeout_get_reflect(Eo *obj) +{ + double val = elm_obj_slideshow_timeout_get(obj); + return eina_value_double_init(val); +} + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_timeout_get, double, 0); + +const Eina_List *_elm_slideshow_items_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_items_get, const Eina_List *, NULL); + +const Eina_List *_elm_slideshow_transitions_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_transitions_get, const Eina_List *, NULL); + +unsigned int _elm_slideshow_count_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_count_get, unsigned int, 0); + +Elm_Widget_Item *_elm_slideshow_item_current_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_item_current_get, Elm_Widget_Item *, NULL); + +const Eina_List *_elm_slideshow_layouts_get(const Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_layouts_get, const Eina_List *, NULL); + +void _elm_slideshow_previous(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_previous); + +Elm_Widget_Item *_elm_slideshow_item_nth_get(const Eo *obj, Elm_Slideshow_Data *pd, unsigned int nth); + +EOAPI EFL_FUNC_BODYV_CONST(elm_obj_slideshow_item_nth_get, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(nth), unsigned int nth); + +void _elm_slideshow_next(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_next); + +void _elm_slideshow_clear(Eo *obj, Elm_Slideshow_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_clear); + +Elm_Widget_Item *_elm_slideshow_item_add(Eo *obj, Elm_Slideshow_Data *pd, const Elm_Slideshow_Item_Class *itc, const void *data); + +EOAPI EFL_FUNC_BODYV(elm_obj_slideshow_item_add, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data), const Elm_Slideshow_Item_Class *itc, const void *data); + +Elm_Widget_Item *_elm_slideshow_item_sorted_insert(Eo *obj, Elm_Slideshow_Data *pd, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +EOAPI EFL_FUNC_BODYV(elm_obj_slideshow_item_sorted_insert, Elm_Widget_Item *, NULL, EFL_FUNC_CALL(itc, data, func), const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +Efl_Object *_elm_slideshow_efl_object_constructor(Eo *obj, Elm_Slideshow_Data *pd); + + +Eina_Bool _elm_slideshow_efl_ui_widget_widget_input_event_handler(Eo *obj, Elm_Slideshow_Data *pd, const Efl_Event *eo_event, Efl_Canvas_Object *source); + + +const Efl_Access_Action_Data *_elm_slideshow_efl_access_widget_action_elm_actions_get(const Eo *obj, Elm_Slideshow_Data *pd); + + +static Eina_Bool +_elm_slideshow_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDESHOW_EXTRA_OPS +#define ELM_SLIDESHOW_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_after_set, _elm_slideshow_cache_after_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_after_get, _elm_slideshow_cache_after_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_before_set, _elm_slideshow_cache_before_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_cache_before_get, _elm_slideshow_cache_before_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layout_set, _elm_slideshow_layout_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layout_get, _elm_slideshow_layout_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transition_set, _elm_slideshow_transition_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transition_get, _elm_slideshow_transition_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_loop_set, _elm_slideshow_items_loop_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_loop_get, _elm_slideshow_items_loop_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_timeout_set, _elm_slideshow_timeout_set), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_timeout_get, _elm_slideshow_timeout_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_items_get, _elm_slideshow_items_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_transitions_get, _elm_slideshow_transitions_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_count_get, _elm_slideshow_count_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_current_get, _elm_slideshow_item_current_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_layouts_get, _elm_slideshow_layouts_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_previous, _elm_slideshow_previous), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_nth_get, _elm_slideshow_item_nth_get), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_next, _elm_slideshow_next), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_clear, _elm_slideshow_clear), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_add, _elm_slideshow_item_add), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_sorted_insert, _elm_slideshow_item_sorted_insert), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_slideshow_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_ui_widget_input_event_handler, _elm_slideshow_efl_ui_widget_widget_input_event_handler), + EFL_OBJECT_OP_FUNC(efl_access_widget_action_elm_actions_get, _elm_slideshow_efl_access_widget_action_elm_actions_get), + ELM_SLIDESHOW_EXTRA_OPS + ); + opsp = &ops; + + static const Efl_Object_Property_Reflection refl_table[] = { + {"cache_after", __eolian_elm_slideshow_cache_after_set_reflect, __eolian_elm_slideshow_cache_after_get_reflect}, + {"cache_before", __eolian_elm_slideshow_cache_before_set_reflect, __eolian_elm_slideshow_cache_before_get_reflect}, + {"layout", __eolian_elm_slideshow_layout_set_reflect, __eolian_elm_slideshow_layout_get_reflect}, + {"transition", __eolian_elm_slideshow_transition_set_reflect, __eolian_elm_slideshow_transition_get_reflect}, + {"items_loop", __eolian_elm_slideshow_items_loop_set_reflect, __eolian_elm_slideshow_items_loop_get_reflect}, + {"timeout", __eolian_elm_slideshow_timeout_set_reflect, __eolian_elm_slideshow_timeout_get_reflect}, + }; + static const Efl_Object_Property_Reflection_Ops rops = { + refl_table, EINA_C_ARRAY_LENGTH(refl_table) + }; + ropsp = &rops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slideshow_class_desc = { + EO_VERSION, + "Elm.Slideshow", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Slideshow_Data), + _elm_slideshow_class_initializer, + _elm_slideshow_class_constructor, + NULL +}; + +EFL_DEFINE_CLASS(elm_slideshow_class_get, &_elm_slideshow_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); + +#include "elm_slideshow_eo.legacy.c" diff --git a/src/lib/elementary/elm_slideshow_eo.h b/src/lib/elementary/elm_slideshow_eo.h new file mode 100644 index 0000000000..00dd7aeeb8 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.h @@ -0,0 +1,408 @@ +#ifndef _ELM_SLIDESHOW_EO_H_ +#define _ELM_SLIDESHOW_EO_H_ + +#ifndef _ELM_SLIDESHOW_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow; + +#endif + +#ifndef _ELM_SLIDESHOW_EO_TYPES +#define _ELM_SLIDESHOW_EO_TYPES + + +#endif +/** Elementary slideshow class + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_CLASS elm_slideshow_class_get() + +EWAPI const Efl_Class *elm_slideshow_class_get(void); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, after + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_cache_after_set(Eo *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, after + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI int elm_obj_slideshow_cache_after_get(const Eo *obj); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, before + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_cache_before_set(Eo *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, before + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow + */ +EOAPI int elm_obj_slideshow_cache_before_get(const Eo *obj); + +/** + * @brief Set the current slide layout in use for a given slideshow widget + * + * If @c layout is implemented in @c 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 @ref elm_obj_slideshow_layouts_get for more details. + * + * @param[in] obj The object. + * @param[in] layout The new layout's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_layout_set(Eo *obj, const char *layout); + +/** + * @brief Get the current slide layout in use for a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The new layout's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI const char *elm_obj_slideshow_layout_get(const Eo *obj); + +/** + * @brief Set the current slide transition/effect in use for a given slideshow + * widget. + * + * If @c transition is implemented in @c obj's theme (i.e., is contained in the + * list returned by @ref elm_obj_slideshow_transitions_get), this new sliding + * effect will be used on the widget. + * + * @param[in] obj The object. + * @param[in] transition The new transition's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_transition_set(Eo *obj, const char *transition); + +/** + * @brief Get the current slide transition/effect in use for a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new transition's name string. + * + * @ingroup Elm_Slideshow + */ +EOAPI const char *elm_obj_slideshow_transition_get(const Eo *obj); + +/** + * @brief Set if the slideshow items should be displayed cyclically or not, so + * when the end is reached it will restart from the first item. + * + * @note This will affect the "automatic" slidshow behaviour and the + * @ref elm_obj_slideshow_next and @ref elm_obj_slideshow_previous functions as + * well. + * + * @param[in] obj The object. + * @param[in] loop Use @c true to make it cycle through items or @c false for + * it to stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_items_loop_set(Eo *obj, Eina_Bool loop); + +/** + * @brief Get if, after a slideshow is started, for a given slideshow widget, + * its items are to be displayed cyclically or not. + * + * @param[in] obj The object. + * + * @return Use @c true to make it cycle through items or @c false for it to + * stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow + */ +EOAPI Eina_Bool elm_obj_slideshow_items_loop_get(const Eo *obj); + +/** + * @brief Set the interval between each image transition on a given slideshow + * widget and start the slideshow itself. + * + * 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 @c timeout, in 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 @c timeout will disable the + * widget's internal timer, thus halting any slideshow which could be happening + * on @c obj. + * + * @param[in] obj The object. + * @param[in] timeout The new displaying timeout for images. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_timeout_set(Eo *obj, double timeout); + +/** + * @brief Get the interval set for image transitions on a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new displaying timeout for images. + * + * @ingroup Elm_Slideshow + */ +EOAPI double elm_obj_slideshow_timeout_get(const Eo *obj); + +/** + * @brief Get the internal list of items in a given slideshow widget. + * + * This list is not to be modified in any way and must not be freed. + * + * @warning This list is only valid until @c obj object's internal items list + * is changed. It should be fetched again with another call to this function + * when changes happen. + * + * @param[in] obj The object. + * + * @return The list of items (#Elm.Widget.Item as data) or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_items_get(const Eo *obj); + +/** + * @brief Returns the list of sliding transition/effect names available, for a + * given slideshow widget. + * + * The transitions, which come from @c obj's theme, must be an EDC data item + * named $"transitions" on the theme file, with (prefix) names of EDC programs + * actually implementing them. + * + * The available transitions for slideshows on the default theme are "fade" + * (the current item fades out, while the new one fades in to the slideshow's + * viewport), "black_fade" (the current item fades to black, and just then, the + * new item will fade in), "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), "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), "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 @ref eina_stringshare_ref them. Also the list + * is an internal list and so is only valid for as long as the slideshow object + * is valid and has not internally changed its list for some reason, so make a + * copy if you need it around. + * + * @param[in] obj The object. + * + * @return The list of transitions (list of stringshared strings as data). + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_transitions_get(const Eo *obj); + +/** + * @brief Get the number of items stored in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The number of items on @c obj, at the moment of this call. + * + * @ingroup Elm_Slideshow + */ +EOAPI unsigned int elm_obj_slideshow_count_get(const Eo *obj); + +/** + * @brief Returns the currently displayed item, in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return A handle to the item being displayed in @c obj or @c null, if none + * is (and on errors) + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_current_get(const Eo *obj); + +/** + * @brief Returns the list of layout names available, for a given slideshow + * widget. + * + * 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 @c obj's theme, must be an EDC data item name + * $"layouts" on the theme file, with (prefix) names of EDC programs actually + * implementing them. + * + * The available layouts for slideshows on the default theme are "fullscreen" + * (item images with original aspect, scaled to touch top and down slideshow + * borders or, if the image's height is not enough, left and right slideshow + * borders) and "not_fullscreen" (the same behavior as the "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 @ref eina_stringshare_ref them. + * + * @param[in] obj The object. + * + * @return The list of layouts (list of stringshared strings as data) + * + * @ingroup Elm_Slideshow + */ +EOAPI const Eina_List *elm_obj_slideshow_layouts_get(const Eo *obj); + +/** + * @brief Slide to the previous item, in a given slideshow widget + * + * The sliding animation @c 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. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_previous(Eo *obj); + +/** + * @brief Get the the item, in a given slideshow widget, placed at position + * @c nth, in its internal items list. + * + * @param[in] obj The object. + * @param[in] nth The number of the item to grab a handle to (0 being the + * first). + * + * @return The item stored in @c obj at position @c nth or @c null if there's + * no item with that index (and on errors). + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_nth_get(const Eo *obj, unsigned int nth); + +/** + * @brief Slide to the next item, in a given slideshow widget. + * + * The sliding animation @c 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. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_next(Eo *obj); + +/** + * @brief Remove all items from a given slideshow widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow + */ +EOAPI void elm_obj_slideshow_clear(Eo *obj); + +/** + * @brief Add (append) a new item in a given slideshow widget. + * + * Add a new item to @c 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 @c data parameter is going to be passed to both class functions + * of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_add(Eo *obj, const Elm_Slideshow_Item_Class *itc, const void *data); + +/** + * @brief Insert a new item into the given slideshow widget, using the @c func + * function to sort items (by item handles). + * + * Add a new item to @c obj's internal list of items, in a position determined + * by the @c 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 @c data + * parameter is going to be passed to both class functions of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * @param[in] func The comparing function to be used to sort the slideshow + * items by #Elm_Slideshow_Item_Class item handles. + * + * @return Returns The slideshow item handle, on success, or @c null on errors. + * + * @ingroup Elm_Slideshow + */ +EOAPI Elm_Widget_Item *elm_obj_slideshow_item_sorted_insert(Eo *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +EWAPI extern const Efl_Event_Description _ELM_SLIDESHOW_EVENT_CHANGED; + +/** Called when slideshow widget changed + * @return Efl_Object * + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_EVENT_CHANGED (&(_ELM_SLIDESHOW_EVENT_CHANGED)) + +EWAPI extern const Efl_Event_Description _ELM_SLIDESHOW_EVENT_TRANSITION_END; + +/** Called on transition end + * @return Efl_Object * + * + * @ingroup Elm_Slideshow + */ +#define ELM_SLIDESHOW_EVENT_TRANSITION_END (&(_ELM_SLIDESHOW_EVENT_TRANSITION_END)) + +#endif diff --git a/src/lib/elementary/elm_slideshow_eo.legacy.c b/src/lib/elementary/elm_slideshow_eo.legacy.c new file mode 100644 index 0000000000..3cda2750bb --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.legacy.c @@ -0,0 +1,138 @@ + +EAPI void +elm_slideshow_cache_after_set(Elm_Slideshow *obj, int count) +{ + elm_obj_slideshow_cache_after_set(obj, count); +} + +EAPI int +elm_slideshow_cache_after_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_cache_after_get(obj); +} + +EAPI void +elm_slideshow_cache_before_set(Elm_Slideshow *obj, int count) +{ + elm_obj_slideshow_cache_before_set(obj, count); +} + +EAPI int +elm_slideshow_cache_before_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_cache_before_get(obj); +} + +EAPI void +elm_slideshow_layout_set(Elm_Slideshow *obj, const char *layout) +{ + elm_obj_slideshow_layout_set(obj, layout); +} + +EAPI const char * +elm_slideshow_layout_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_layout_get(obj); +} + +EAPI void +elm_slideshow_transition_set(Elm_Slideshow *obj, const char *transition) +{ + elm_obj_slideshow_transition_set(obj, transition); +} + +EAPI const char * +elm_slideshow_transition_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_transition_get(obj); +} + +EAPI void +elm_slideshow_loop_set(Elm_Slideshow *obj, Eina_Bool loop) +{ + elm_obj_slideshow_items_loop_set(obj, loop); +} + +EAPI Eina_Bool +elm_slideshow_loop_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_items_loop_get(obj); +} + +EAPI void +elm_slideshow_timeout_set(Elm_Slideshow *obj, double timeout) +{ + elm_obj_slideshow_timeout_set(obj, timeout); +} + +EAPI double +elm_slideshow_timeout_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_timeout_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_items_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_items_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_transitions_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_transitions_get(obj); +} + +EAPI unsigned int +elm_slideshow_count_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_count_get(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_current_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_item_current_get(obj); +} + +EAPI const Eina_List * +elm_slideshow_layouts_get(const Elm_Slideshow *obj) +{ + return elm_obj_slideshow_layouts_get(obj); +} + +EAPI void +elm_slideshow_previous(Elm_Slideshow *obj) +{ + elm_obj_slideshow_previous(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_nth_get(const Elm_Slideshow *obj, unsigned int nth) +{ + return elm_obj_slideshow_item_nth_get(obj, nth); +} + +EAPI void +elm_slideshow_next(Elm_Slideshow *obj) +{ + elm_obj_slideshow_next(obj); +} + +EAPI void +elm_slideshow_clear(Elm_Slideshow *obj) +{ + elm_obj_slideshow_clear(obj); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_add(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data) +{ + return elm_obj_slideshow_item_add(obj, itc, data); +} + +EAPI Elm_Widget_Item * +elm_slideshow_item_sorted_insert(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func) +{ + return elm_obj_slideshow_item_sorted_insert(obj, itc, data, func); +} diff --git a/src/lib/elementary/elm_slideshow_eo.legacy.h b/src/lib/elementary/elm_slideshow_eo.legacy.h new file mode 100644 index 0000000000..3670d7c913 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_eo.legacy.h @@ -0,0 +1,382 @@ +#ifndef _ELM_SLIDESHOW_EO_LEGACY_H_ +#define _ELM_SLIDESHOW_EO_LEGACY_H_ + +#ifndef _ELM_SLIDESHOW_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow; + +#endif + +#ifndef _ELM_SLIDESHOW_EO_TYPES +#define _ELM_SLIDESHOW_EO_TYPES + + +#endif + +/** + * @brief Set the number of items to cache, on a given slideshow widget, after + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_cache_after_set(Elm_Slideshow *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, after + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache after the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI int elm_slideshow_cache_after_get(const Elm_Slideshow *obj); + +/** + * @brief Set the number of items to cache, on a given slideshow widget, before + * the current item. + * + * The default value for this property is 2. See @ref Slideshow_Caching + * "slideshow caching" for more details. + * + * @param[in] obj The object. + * @param[in] count Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_cache_before_set(Elm_Slideshow *obj, int count); + +/** + * @brief Get the number of items to cache, on a given slideshow widget, before + * the current item. + * + * @param[in] obj The object. + * + * @return Number of items to cache before the current one. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI int elm_slideshow_cache_before_get(const Elm_Slideshow *obj); + +/** + * @brief Set the current slide layout in use for a given slideshow widget + * + * If @c layout is implemented in @c 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 @ref elm_slideshow_layouts_get for more details. + * + * @param[in] obj The object. + * @param[in] layout The new layout's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_layout_set(Elm_Slideshow *obj, const char *layout); + +/** + * @brief Get the current slide layout in use for a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The new layout's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const char *elm_slideshow_layout_get(const Elm_Slideshow *obj); + +/** + * @brief Set the current slide transition/effect in use for a given slideshow + * widget. + * + * If @c transition is implemented in @c obj's theme (i.e., is contained in the + * list returned by @ref elm_slideshow_transitions_get), this new sliding + * effect will be used on the widget. + * + * @param[in] obj The object. + * @param[in] transition The new transition's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_transition_set(Elm_Slideshow *obj, const char *transition); + +/** + * @brief Get the current slide transition/effect in use for a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new transition's name string. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const char *elm_slideshow_transition_get(const Elm_Slideshow *obj); + +/** + * @brief Set if the slideshow items should be displayed cyclically or not, so + * when the end is reached it will restart from the first item. + * + * @note This will affect the "automatic" slidshow behaviour and the + * @ref elm_slideshow_next and @ref elm_slideshow_previous functions as well. + * + * @param[in] obj The object. + * @param[in] loop Use @c true to make it cycle through items or @c false for + * it to stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_loop_set(Elm_Slideshow *obj, Eina_Bool loop); + +/** + * @brief Get if, after a slideshow is started, for a given slideshow widget, + * its items are to be displayed cyclically or not. + * + * @param[in] obj The object. + * + * @return Use @c true to make it cycle through items or @c false for it to + * stop at the end of @c obj's internal list of items. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Eina_Bool elm_slideshow_loop_get(const Elm_Slideshow *obj); + +/** + * @brief Set the interval between each image transition on a given slideshow + * widget and start the slideshow itself. + * + * 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 @c timeout, in 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 @c timeout will disable the + * widget's internal timer, thus halting any slideshow which could be happening + * on @c obj. + * + * @param[in] obj The object. + * @param[in] timeout The new displaying timeout for images. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_timeout_set(Elm_Slideshow *obj, double timeout); + +/** + * @brief Get the interval set for image transitions on a given slideshow + * widget. + * + * @param[in] obj The object. + * + * @return The new displaying timeout for images. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI double elm_slideshow_timeout_get(const Elm_Slideshow *obj); + +/** + * @brief Get the internal list of items in a given slideshow widget. + * + * This list is not to be modified in any way and must not be freed. + * + * @warning This list is only valid until @c obj object's internal items list + * is changed. It should be fetched again with another call to this function + * when changes happen. + * + * @param[in] obj The object. + * + * @return The list of items (#Elm.Widget.Item as data) or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_items_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the list of sliding transition/effect names available, for a + * given slideshow widget. + * + * The transitions, which come from @c obj's theme, must be an EDC data item + * named $"transitions" on the theme file, with (prefix) names of EDC programs + * actually implementing them. + * + * The available transitions for slideshows on the default theme are "fade" + * (the current item fades out, while the new one fades in to the slideshow's + * viewport), "black_fade" (the current item fades to black, and just then, the + * new item will fade in), "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), "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), "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 @ref eina_stringshare_ref them. Also the list + * is an internal list and so is only valid for as long as the slideshow object + * is valid and has not internally changed its list for some reason, so make a + * copy if you need it around. + * + * @param[in] obj The object. + * + * @return The list of transitions (list of stringshared strings as data). + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_transitions_get(const Elm_Slideshow *obj); + +/** + * @brief Get the number of items stored in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return The number of items on @c obj, at the moment of this call. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI unsigned int elm_slideshow_count_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the currently displayed item, in a given slideshow widget. + * + * @param[in] obj The object. + * + * @return A handle to the item being displayed in @c obj or @c null, if none + * is (and on errors) + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_current_get(const Elm_Slideshow *obj); + +/** + * @brief Returns the list of layout names available, for a given slideshow + * widget. + * + * 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 @c obj's theme, must be an EDC data item name + * $"layouts" on the theme file, with (prefix) names of EDC programs actually + * implementing them. + * + * The available layouts for slideshows on the default theme are "fullscreen" + * (item images with original aspect, scaled to touch top and down slideshow + * borders or, if the image's height is not enough, left and right slideshow + * borders) and "not_fullscreen" (the same behavior as the "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 @ref eina_stringshare_ref them. + * + * @param[in] obj The object. + * + * @return The list of layouts (list of stringshared strings as data) + * + * @ingroup Elm_Slideshow_Group + */ +EAPI const Eina_List *elm_slideshow_layouts_get(const Elm_Slideshow *obj); + +/** + * @brief Slide to the previous item, in a given slideshow widget + * + * The sliding animation @c 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. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_previous(Elm_Slideshow *obj); + +/** + * @brief Get the the item, in a given slideshow widget, placed at position + * @c nth, in its internal items list. + * + * @param[in] obj The object. + * @param[in] nth The number of the item to grab a handle to (0 being the + * first). + * + * @return The item stored in @c obj at position @c nth or @c null if there's + * no item with that index (and on errors). + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_nth_get(const Elm_Slideshow *obj, unsigned int nth); + +/** + * @brief Slide to the next item, in a given slideshow widget. + * + * The sliding animation @c 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. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_next(Elm_Slideshow *obj); + +/** + * @brief Remove all items from a given slideshow widget. + * + * This removes (and deletes) all items in @c obj, leaving it empty. + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI void elm_slideshow_clear(Elm_Slideshow *obj); + +/** + * @brief Add (append) a new item in a given slideshow widget. + * + * Add a new item to @c 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 @c data parameter is going to be passed to both class functions + * of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * + * @return A handle to the item added or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_add(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data); + +/** + * @brief Insert a new item into the given slideshow widget, using the @c func + * function to sort items (by item handles). + * + * Add a new item to @c obj's internal list of items, in a position determined + * by the @c 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 @c data + * parameter is going to be passed to both class functions of the item. + * + * @param[in] obj The object. + * @param[in] itc The item class for the item. + * @param[in] data The item's data. + * @param[in] func The comparing function to be used to sort the slideshow + * items by #Elm_Slideshow_Item_Class item handles. + * + * @return Returns The slideshow item handle, on success, or @c null on errors. + * + * @ingroup Elm_Slideshow_Group + */ +EAPI Elm_Widget_Item *elm_slideshow_item_sorted_insert(Elm_Slideshow *obj, const Elm_Slideshow_Item_Class *itc, const void *data, Eina_Compare_Cb func); + +#endif diff --git a/src/lib/elementary/elm_slideshow_item.eo b/src/lib/elementary/elm_slideshow_item.eo deleted file mode 100644 index c6d768630f..0000000000 --- a/src/lib/elementary/elm_slideshow_item.eo +++ /dev/null @@ -1,36 +0,0 @@ -class Elm.Slideshow.Item extends Elm.Widget.Item -{ - [[Elementary slideshow class]] - legacy_prefix: elm_slideshow_item; - eo_prefix: elm_obj_slideshow_item; - event_prefix: elm_slideshow_item; - methods { - show { - [[Display a given slideshow widget's item, programmatically. - - The change between the current item and $item will use the - transition $obj is set to use. - - See: Elm.Slidshow.transition.get]] - /* FIXME Make a proper ref ^ */ - } - object_get @const { - [[Get the real Evas object created to implement the view of a given slideshow item. - - This returns the actual Evas object used to implement the - specified slideshow item's view. This may be $null, as it may - not have been created or may have been deleted, at any time, by - the slideshow. **Do not modify this object** (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.]] - - return: Efl.Canvas.Object; [[Real evas object]] - } - } - implements { - Efl.Object.constructor; - Efl.Object.destructor; - } -} diff --git a/src/lib/elementary/elm_slideshow_item_eo.c b/src/lib/elementary/elm_slideshow_item_eo.c new file mode 100644 index 0000000000..4c919d210b --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.c @@ -0,0 +1,51 @@ + +void _elm_slideshow_item_show(Eo *obj, Elm_Slideshow_Item_Data *pd); + +EOAPI EFL_VOID_FUNC_BODY(elm_obj_slideshow_item_show); + +Efl_Canvas_Object *_elm_slideshow_item_object_get(const Eo *obj, Elm_Slideshow_Item_Data *pd); + +EOAPI EFL_FUNC_BODY_CONST(elm_obj_slideshow_item_object_get, Efl_Canvas_Object *, NULL); + +Efl_Object *_elm_slideshow_item_efl_object_constructor(Eo *obj, Elm_Slideshow_Item_Data *pd); + + +void _elm_slideshow_item_efl_object_destructor(Eo *obj, Elm_Slideshow_Item_Data *pd); + + +static Eina_Bool +_elm_slideshow_item_class_initializer(Efl_Class *klass) +{ + const Efl_Object_Ops *opsp = NULL; + + const Efl_Object_Property_Reflection_Ops *ropsp = NULL; + +#ifndef ELM_SLIDESHOW_ITEM_EXTRA_OPS +#define ELM_SLIDESHOW_ITEM_EXTRA_OPS +#endif + + EFL_OPS_DEFINE(ops, + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_show, _elm_slideshow_item_show), + EFL_OBJECT_OP_FUNC(elm_obj_slideshow_item_object_get, _elm_slideshow_item_object_get), + EFL_OBJECT_OP_FUNC(efl_constructor, _elm_slideshow_item_efl_object_constructor), + EFL_OBJECT_OP_FUNC(efl_destructor, _elm_slideshow_item_efl_object_destructor), + ELM_SLIDESHOW_ITEM_EXTRA_OPS + ); + opsp = &ops; + + return efl_class_functions_set(klass, opsp, ropsp); +} + +static const Efl_Class_Description _elm_slideshow_item_class_desc = { + EO_VERSION, + "Elm.Slideshow.Item", + EFL_CLASS_TYPE_REGULAR, + sizeof(Elm_Slideshow_Item_Data), + _elm_slideshow_item_class_initializer, + NULL, + NULL +}; + +EFL_DEFINE_CLASS(elm_slideshow_item_class_get, &_elm_slideshow_item_class_desc, ELM_WIDGET_ITEM_CLASS, NULL); + +#include "elm_slideshow_item_eo.legacy.c" diff --git a/src/lib/elementary/elm_slideshow_item_eo.h b/src/lib/elementary/elm_slideshow_item_eo.h new file mode 100644 index 0000000000..065a7f6b83 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.h @@ -0,0 +1,57 @@ +#ifndef _ELM_SLIDESHOW_ITEM_EO_H_ +#define _ELM_SLIDESHOW_ITEM_EO_H_ + +#ifndef _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow_Item; + +#endif + +#ifndef _ELM_SLIDESHOW_ITEM_EO_TYPES +#define _ELM_SLIDESHOW_ITEM_EO_TYPES + + +#endif +/** Elementary slideshow class + * + * @ingroup Elm_Slideshow_Item + */ +#define ELM_SLIDESHOW_ITEM_CLASS elm_slideshow_item_class_get() + +EWAPI const Efl_Class *elm_slideshow_item_class_get(void); + +/** + * @brief Display a given slideshow widget's item, programmatically. + * + * The change between the current item and @c item will use the transition + * @c obj is set to use. + * + * See: Elm.Slidshow.transition.get + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Item + */ +EOAPI void elm_obj_slideshow_item_show(Eo *obj); + +/** + * @brief Get the real Evas object created to implement the view of a given + * slideshow item. + * + * 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. **Do not modify + * this object** (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. + * + * @param[in] obj The object. + * + * @return Real evas object + * + * @ingroup Elm_Slideshow_Item + */ +EOAPI Efl_Canvas_Object *elm_obj_slideshow_item_object_get(const Eo *obj); + +#endif diff --git a/src/lib/elementary/elm_slideshow_item_eo.legacy.c b/src/lib/elementary/elm_slideshow_item_eo.legacy.c new file mode 100644 index 0000000000..b919b5186c --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.legacy.c @@ -0,0 +1,12 @@ + +EAPI void +elm_slideshow_item_show(Elm_Slideshow_Item *obj) +{ + elm_obj_slideshow_item_show(obj); +} + +EAPI Efl_Canvas_Object * +elm_slideshow_item_object_get(const Elm_Slideshow_Item *obj) +{ + return elm_obj_slideshow_item_object_get(obj); +} diff --git a/src/lib/elementary/elm_slideshow_item_eo.legacy.h b/src/lib/elementary/elm_slideshow_item_eo.legacy.h new file mode 100644 index 0000000000..7ce66ccb85 --- /dev/null +++ b/src/lib/elementary/elm_slideshow_item_eo.legacy.h @@ -0,0 +1,50 @@ +#ifndef _ELM_SLIDESHOW_ITEM_EO_LEGACY_H_ +#define _ELM_SLIDESHOW_ITEM_EO_LEGACY_H_ + +#ifndef _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE +#define _ELM_SLIDESHOW_ITEM_EO_CLASS_TYPE + +typedef Eo Elm_Slideshow_Item; + +#endif + +#ifndef _ELM_SLIDESHOW_ITEM_EO_TYPES +#define _ELM_SLIDESHOW_ITEM_EO_TYPES + + +#endif + +/** + * @brief Display a given slideshow widget's item, programmatically. + * + * The change between the current item and @c item will use the transition + * @c obj is set to use. + * + * See: Elm.Slidshow.transition.get + * @param[in] obj The object. + * + * @ingroup Elm_Slideshow_Item_Group + */ +EAPI void elm_slideshow_item_show(Elm_Slideshow_Item *obj); + +/** + * @brief Get the real Evas object created to implement the view of a given + * slideshow item. + * + * 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. **Do not modify + * this object** (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. + * + * @param[in] obj The object. + * + * @return Real evas object + * + * @ingroup Elm_Slideshow_Item_Group + */ +EAPI Efl_Canvas_Object *elm_slideshow_item_object_get(const Elm_Slideshow_Item *obj); + +#endif diff --git a/src/lib/elementary/elm_slideshow_legacy.h b/src/lib/elementary/elm_slideshow_legacy.h index d16ad0eb93..95a68b67f4 100644 --- a/src/lib/elementary/elm_slideshow_legacy.h +++ b/src/lib/elementary/elm_slideshow_legacy.h @@ -11,5 +11,5 @@ */ EAPI Evas_Object *elm_slideshow_add(Evas_Object *parent); -#include "elm_slideshow_item.eo.legacy.h" -#include "elm_slideshow.eo.legacy.h" +#include "elm_slideshow_item_eo.legacy.h" +#include "elm_slideshow_eo.legacy.h" diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 139941c062..d24f65eaf2 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -22,8 +22,6 @@ pub_legacy_eo_files = [ 'elm_actionslider_part.eo', 'elm_bubble_part.eo', 'elm_fileselector_part.eo', - 'elm_slideshow.eo', - 'elm_slideshow_item.eo', 'elm_table.eo', 'elm_thumb.eo', ] @@ -793,6 +791,10 @@ elementary_pub_headers = [ 'elm_slider_eo.legacy.h', 'elm_slider_part_indicator_eo.h', 'elm_slider_part_indicator_eo.legacy.h', + 'elm_slideshow_eo.h', + 'elm_slideshow_eo.legacy.h', + 'elm_slideshow_item_eo.h', + 'elm_slideshow_item_eo.legacy.h', ] elementary_header_src = [