forked from enlightenment/efl
Thumb: Use file interface.
This commit is contained in:
parent
0b9ec03952
commit
eb5cdaf088
|
@ -614,8 +614,8 @@ _elm_thumb_reload(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd)
|
|||
_thumb_show(sd);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key)
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_thumb_efl_file_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, const char *key)
|
||||
{
|
||||
Eina_Bool file_replaced, key_replaced;
|
||||
|
||||
|
@ -651,10 +651,12 @@ _elm_thumb_file_set(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char *file, c
|
|||
|
||||
if (((file_replaced) || (key_replaced)) && (evas_object_visible_get(obj)))
|
||||
_thumb_show(sd);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_elm_thumb_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
|
||||
_elm_thumb_efl_file_file_get(Eo *obj EINA_UNUSED, Elm_Thumb_Data *sd, const char **file, const char **key)
|
||||
{
|
||||
if (file)
|
||||
*file = sd->file;
|
||||
|
@ -848,4 +850,17 @@ _elm_thumb_class_constructor(Eo_Class *klass)
|
|||
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_thumb_file_set(Eo *obj, const char *file, const char *key)
|
||||
{
|
||||
eo_do((Eo *) obj, efl_file_set(file, key));
|
||||
}
|
||||
|
||||
EAPI void
|
||||
elm_thumb_file_get(const Eo *obj, const char **file, const char **key)
|
||||
{
|
||||
eo_do((Eo *) obj, efl_file_get(file, key));
|
||||
}
|
||||
|
||||
|
||||
#include "elm_thumb.eo.c"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
|
||||
class Elm_Thumb (Elm_Layout, Efl.File, Evas.Clickable_Interface)
|
||||
{
|
||||
eo_prefix: elm_obj_thumb;
|
||||
properties {
|
||||
|
@ -104,35 +104,6 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
|
|||
Ethumb_Thumb_FDO_Size size; /*@ The FDO size setting. */
|
||||
}
|
||||
}
|
||||
file {
|
||||
set {
|
||||
/*@
|
||||
Set the file that will be used as thumbnail @b source.
|
||||
|
||||
The file can be an image or a video (in that case, acceptable
|
||||
extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the
|
||||
video animation, use the function elm_thumb_animate().
|
||||
|
||||
@see elm_thumb_file_get()
|
||||
@see elm_thumb_reload()
|
||||
@see elm_thumb_animate()
|
||||
|
||||
@ingroup Thumb */
|
||||
}
|
||||
get {
|
||||
/*@
|
||||
Get the image or video path and key used to generate the thumbnail.
|
||||
|
||||
@see elm_thumb_file_set()
|
||||
@see elm_thumb_path_get()
|
||||
|
||||
@ingroup Thumb */
|
||||
}
|
||||
values {
|
||||
const(char)* file; /*@ The path to file that will be used as thumbnail source. */
|
||||
const(char)* key; /*@ The key used in case of an EET file. */
|
||||
}
|
||||
}
|
||||
orientation {
|
||||
set {
|
||||
/*@
|
||||
|
@ -331,6 +302,8 @@ class Elm_Thumb (Elm_Layout, Evas.Clickable_Interface)
|
|||
implements {
|
||||
class.constructor;
|
||||
Eo.Base.constructor;
|
||||
Efl.File.file.set;
|
||||
Efl.File.file.get;
|
||||
Evas.Object_Smart.hide;
|
||||
Evas.Object_Smart.add;
|
||||
Evas.Object_Smart.del;
|
||||
|
|
|
@ -11,4 +11,37 @@
|
|||
*/
|
||||
EAPI Evas_Object *elm_thumb_add(Evas_Object *parent);
|
||||
|
||||
#include "elm_thumb.eo.legacy.h"
|
||||
/**
|
||||
*
|
||||
* Set the file that will be used as thumbnail @b source.
|
||||
*
|
||||
* The file can be an image or a video (in that case, acceptable
|
||||
* extensions are: avi, mp4, ogv, mov, mpg and wmv). To start the
|
||||
* video animation, use the function elm_thumb_animate().
|
||||
*
|
||||
* @see elm_thumb_file_get()
|
||||
* @see elm_thumb_reload()
|
||||
* @see elm_thumb_animate()
|
||||
*
|
||||
* @ingroup Thumb
|
||||
*
|
||||
* @param[in] file The path to file that will be used as thumbnail source.
|
||||
* @param[in] key The key used in case of an EET file.
|
||||
*/
|
||||
EAPI void elm_thumb_file_set(Eo *obj, const char *file, const char *key);
|
||||
|
||||
/**
|
||||
*
|
||||
* Get the image or video path and key used to generate the thumbnail.
|
||||
*
|
||||
* @see elm_thumb_file_set()
|
||||
* @see elm_thumb_path_get()
|
||||
*
|
||||
* @ingroup Thumb
|
||||
*
|
||||
* @param[out] file The path to file that will be used as thumbnail source.
|
||||
* @param[out] key The key used in case of an EET file.
|
||||
*/
|
||||
EAPI void elm_thumb_file_get(const Eo *obj, const char **file, const char **key);
|
||||
|
||||
#include "elm_thumb.eo.legacy.h"
|
||||
|
|
Loading…
Reference in New Issue