Elm_Thumb(3)

NAME
Elm_Thumb - Thumbnail

SYNOPSIS

  Macros
#define ELM_THUMB_CLASS elm_thumb_class_get()
Elementary thumbnail class.
#define ELM_THUMB_EVENT_GENERATE_ERROR (&(_ELM_THUMB_EVENT_GENERATE_ERROR))
Called when an error occurred during thumbnail generation.
#define ELM_THUMB_EVENT_GENERATE_START (&(_ELM_THUMB_EVENT_GENERATE_START))
Called when thumbnail generation started.
#define ELM_THUMB_EVENT_GENERATE_STOP (&(_ELM_THUMB_EVENT_GENERATE_STOP))
Called when thumbnail generation stopped.
#define ELM_THUMB_EVENT_LOAD_ERROR (&(_ELM_THUMB_EVENT_LOAD_ERROR))
Called when an error occurred during loading.
#define ELM_THUMB_EVENT_PRESS (&(_ELM_THUMB_EVENT_PRESS))
Called when pressed.

  Enumerations
enum Elm_Thumb_Animation_Setting { ELM_THUMB_ANIMATION_START = 0, ELM_THUMB_ANIMATION_LOOP, ELM_THUMB_ANIMATION_STOP, ELM_THUMB_ANIMATION_LAST }
Used to set if a video thumbnail is animating or not.

  Functions
Eina_Bool elm_need_ethumb (void)
Request that your elementary application needs ethumb.
void * elm_thumb_ethumb_client_get (void)
Get the ethumb_client handle so custom configuration can be made.
Eina_Bool elm_thumb_ethumb_client_connected_get (void)
Get the ethumb_client connection state.
Evas_Object * elm_thumb_add (Evas_Object *parent)
Add a new thumb object to the parent.
void elm_thumb_file_set (Eo *obj, const char *file, const char *key)
Set the file that will be used as thumbnail source.
void elm_thumb_file_get (const Eo *obj, const char **file, const char **key)
Get the image or video path and key used to generate the thumbnail.
Eina_Bool elm_thumb_editable_set (Evas_Object *obj, Eina_Bool edit)
Make the thumbnail 'editable'.
Eina_Bool elm_thumb_editable_get (const Evas_Object *obj)
Get whether the thumbnail is editable.
void elm_thumb_compress_set (Evas_Object *obj, int compress)
Set the compression for the thumb object.
void elm_thumb_compress_get (const Evas_Object *obj, int *compress)
Get the compression of the thumb object.
void elm_thumb_format_set (Evas_Object *obj, Ethumb_Thumb_Format format)
Set the format for the thumb object.
Ethumb_Thumb_Format elm_thumb_format_get (const Evas_Object *obj)
Get the format of the thumb object.
void elm_thumb_animate_set (Evas_Object *obj, Elm_Thumb_Animation_Setting setting)
Set the animation state for the thumb object.
Elm_Thumb_Animation_Setting elm_thumb_animate_get (const Evas_Object *obj)
Get the animation state for the thumb object.
void elm_thumb_fdo_size_set (Evas_Object *obj, Ethumb_Thumb_FDO_Size size)
Set the FDO size for the thumb object.
Ethumb_Thumb_FDO_Size elm_thumb_fdo_size_get (const Evas_Object *obj)
Get the fdo size of the thumb object.
void elm_thumb_orientation_set (Evas_Object *obj, Ethumb_Thumb_Orientation orient)
Set the orientation for the thumb object.
Ethumb_Thumb_Orientation elm_thumb_orientation_get (const Evas_Object *obj)
Get the orientation of the thumb object.
void elm_thumb_aspect_set (Evas_Object *obj, Ethumb_Thumb_Aspect aspect)
Set the aspect for the thumb object.
Ethumb_Thumb_Aspect elm_thumb_aspect_get (const Evas_Object *obj)
Get the aspect of the thumb object.
void elm_thumb_quality_set (Evas_Object *obj, int quality)
Set the quality for the thumb object.
void elm_thumb_quality_get (const Evas_Object *obj, int *quality)
Get the quality of the thumb object.
void elm_thumb_size_set (Evas_Object *obj, int tw, int th)
Set the size for the thumb object.
void elm_thumb_size_get (const Evas_Object *obj, int *tw, int *th)
Get the size of the thumb object.
void elm_thumb_crop_align_set (Evas_Object *obj, double cropx, double cropy)
Set the crop alignment for the thumb object.
void elm_thumb_crop_align_get (const Evas_Object *obj, double *cropx, double *cropy)
Get the crop alignment of the thumb object.
void elm_thumb_path_get (const Evas_Object *obj, const char **file, const char **key)
Get the path and key to the image or video thumbnail generated by ethumb.
void elm_thumb_reload (Evas_Object *obj)
Reload thumbnail if it was generated before.

Detailed Description

A thumbnail object is used for displaying the thumbnail of an image or video. You must have compiled Elementary with Ethumb_Client support. Also, Ethumb's DBus service must be present and auto-activated in order to have thumbnails generated. You must also have a session bus, not a system one.

Once the thumbnail object becomes visible, it will check if there is a previously generated thumbnail image for the file set on it. If not, it will start generating this thumbnail.

Different configuration settings will cause different thumbnails to be generated even on the same file.

Generated thumbnails are stored under $HOME/.thumbnails/. Check Ethumb's documentation to change this path, and to see other configuration options.

If you set formatting features such as, aspect, size, format, orientation, crop, compression, or quality after the thumbnail has been shown, it needs to be reloaded with elm_thumb_reload.

This widget emits the following signals:

•   'clicked' - This is called when a user has clicked the thumbnail object without dragging it around.

•   'clicked,double' - This is called when a user has double-clicked the thumbnail object.

•   'press' - This is called when a user has pressed down over the thumbnail object.

•   'generate,start' - The thumbnail generation has started.

•   'generate,stop' - The generation process has stopped.

•   'generate,error' - The thumbnail generation failed.

•   'load,error' - The thumbnail image loading failed.

Available styles:

•   'default'

•   'noframe'

An example of use of thumbnail:

•   Thumb - generating thumbnails.

Enumeration Type Documentation

  enum Elm_Thumb_Animation_Setting

Used to set if a video thumbnail is animating or not.

Enumerator

ELM_THUMB_ANIMATION_LOOP
    Play animation once.

ELM_THUMB_ANIMATION_STOP
    Keep playing animation until stop is requested.

ELM_THUMB_ANIMATION_LAST
    Stop playing the animation.

Function Documentation

  Eina_Bool elm_need_ethumb (void)

Request that your elementary application needs ethumb. This initializes the Ethumb library when called and if support exists it returns EINA_TRUE, otherwise returns EINA_FALSE. This must be called before any other function that deals with elm_thumb objects or ethumb_client instances.

Examples
fileselector_example.c, and thumb_example_01.c.

References EINA_TRUE.

  void* elm_thumb_ethumb_client_get (void)

Get the ethumb_client handle so custom configuration can be made.

Returns
    Ethumb_Client instance or NULL.

The ethumb client handle returned may or may not be NULL. It may or may not survive into the future (ethumbd may become disconnected). Do not use this unless you know what you are doing.

  Eina_Bool elm_thumb_ethumb_client_connected_get (void)

Get the ethumb_client connection state.

Returns
    EINA_TRUE if the client is connected to the server or EINA_FALSE otherwise.

Referenced by elm_icon_thumb_set().

  Evas_Object* elm_thumb_add (Evas_Object * parent)

Add a new thumb object to the parent.

Parameters
    parent The parent object.

Returns
    The new object or NULL if it cannot be created.

See also
    elm_thumb_file_set()

    elm_thumb_ethumb_client_get()

References EINA_SAFETY_ON_NULL_RETURN_VAL.

  void elm_thumb_file_set (Eo * obj, const char * file, const char * key)

Set the file that will be used as thumbnail source. The file can be an image or a video (in that case extension will e used to guess if it is a video or not). To start the video animation, use the function elm_thumb_animate().

See also
    elm_thumb_file_get()

    elm_thumb_reload()

    elm_thumb_animate()

Parameters
    file The path to file that will be used as thumbnail source.
    key The key used in case of an EET file.

  void elm_thumb_file_get (const Eo * obj, const char ** file, const char ** key)

Get the image or video path and key used to generate the thumbnail.

See also
    elm_thumb_file_set()

    elm_thumb_path_get()

Parameters
    file The path to file that will be used as thumbnail source.
    key The key used in case of an EET file.

  Eina_Bool elm_thumb_editable_set (Evas_Object * obj, Eina_Bool edit)

Make the thumbnail 'editable'. This means the thumbnail is a valid drag target for drag and drop, and can be cut or pasted too.

Parameters
    edit The editable state, default is false.

References EINA_TRUE.

  Eina_Bool elm_thumb_editable_get (const Evas_Object * obj)

Get whether the thumbnail is editable. This means the thumbnail is a valid drag target for drag and drop, and can be cut or pasted too.

Returns
    The editable state, default is false.

  void elm_thumb_compress_set (Evas_Object * obj, int compress)

Set the compression for the thumb object.

Parameters
    compress The compression of the thumb.

Since
    1.8

  void elm_thumb_compress_get (const Evas_Object * obj, int * compress)

Get the compression of the thumb object.

Parameters
    compress The compression of the thumb.

Returns
    Force the return type to be sure the argument doesn't become the return

Since
    1.8

  void elm_thumb_format_set (Evas_Object * obj, Ethumb_Thumb_Format format)

Set the format for the thumb object.

Parameters
    format The format setting.

Since
    1.8

  Ethumb_Thumb_Format elm_thumb_format_get (const Evas_Object * obj)

Get the format of the thumb object.

Returns
    The format setting.

Since
    1.8

References ETHUMB_THUMB_FDO.

  void elm_thumb_animate_set (Evas_Object * obj, Elm_Thumb_Animation_Setting setting)

Set the animation state for the thumb object. If its content is an animated video, you may start/stop the animation or tell it o play continuously and looping.

Parameters
    setting The animation setting or ELM_THUMB_ANIMATION_LAST

References edje_object_signal_emit(), EINA_SAFETY_ON_TRUE_RETURN, ELM_THUMB_ANIMATION_LAST, ELM_THUMB_ANIMATION_LOOP, and ETHUMB_THUMB_EET.

  Elm_Thumb_Animation_Setting elm_thumb_animate_get (const Evas_Object * obj)

Get the animation state for the thumb object.

Returns
    The animation setting or ELM_THUMB_ANIMATION_LAST

  void elm_thumb_fdo_size_set (Evas_Object * obj, Ethumb_Thumb_FDO_Size size)

Set the FDO size for the thumb object.

Parameters
    size The FDO size setting.

Since
    1.8

  Ethumb_Thumb_FDO_Size elm_thumb_fdo_size_get (const Evas_Object * obj)

Get the fdo size of the thumb object.

Returns
    The FDO size setting.

Since
    1.8

References ETHUMB_THUMB_NORMAL.

  void elm_thumb_orientation_set (Evas_Object * obj, Ethumb_Thumb_Orientation orient)

Set the orientation for the thumb object.

Parameters
    orient The orientation setting.

Since
    1.8

  Ethumb_Thumb_Orientation elm_thumb_orientation_get (const Evas_Object * obj)

Get the orientation of the thumb object.

Returns
    The orientation setting.

Since
    1.8

References ETHUMB_THUMB_ORIENT_NONE.

  void elm_thumb_aspect_set (Evas_Object * obj, Ethumb_Thumb_Aspect aspect)

Set the aspect for the thumb object.

Parameters
    aspect The aspect setting.

Since
    1.8

  Ethumb_Thumb_Aspect elm_thumb_aspect_get (const Evas_Object * obj)

Get the aspect of the thumb object.

Returns
    The aspect setting.

Since
    1.8

References ETHUMB_THUMB_KEEP_ASPECT.

  void elm_thumb_quality_set (Evas_Object * obj, int quality)

Set the quality for the thumb object.

Parameters
    quality The quality of the thumb.

Since
    1.8

  void elm_thumb_quality_get (const Evas_Object * obj, int * quality)

Get the quality of the thumb object.

Parameters
    quality The quality of the thumb.

Since
    1.8

  void elm_thumb_size_set (Evas_Object * obj, int tw, int th)

Set the size for the thumb object.

Parameters
    tw The width of the thumb.
    th The height of the thumb.

Since
    1.8

  void elm_thumb_size_get (const Evas_Object * obj, int * tw, int * th)

Get the size of the thumb object.

Parameters
    tw The width of the thumb.
    th The height of the thumb.

Since
    1.8

  void elm_thumb_crop_align_set (Evas_Object * obj, double cropx, double cropy)

Set the crop alignment for the thumb object.

Parameters
    cropx The x coordinate of the crop.
    cropy The y coordinate of the crop.

Since
    1.8

  void elm_thumb_crop_align_get (const Evas_Object * obj, double * cropx, double * cropy)

Get the crop alignment of the thumb object.

Parameters
    cropx The x coordinate of the crop.
    cropy The y coordinate of the crop.

Since
    1.8

  void elm_thumb_path_get (const Evas_Object * obj, const char ** file, const char ** key)

Get the path and key to the image or video thumbnail generated by ethumb. One just needs to make sure that the thumbnail was generated before getting its path; otherwise, the path will be null. One way to do that is by asking for the path when/after the 'generate,stop' smart callback is called.

Parameters
    file Pointer to thumb path.
    key Pointer to thumb key.

  void elm_thumb_reload (Evas_Object * obj)

Reload thumbnail if it was generated before. This is useful if the ethumb client configuration changed, like its size, aspect or any other property one set in the handle returned by elm_thumb_ethumb_client_get().

If the options didn't change, the thumbnail won't be generated again, but the old one will still be used.

References eina_stringshare_replace(), and evas_object_visible_get().

Author

Generated automatically by Doxygen for EFL from the source code.