Typedefs | Functions
Ethumb Basics

Functions that all users must know of to use Ethumb. More...

Typedefs

typedef struct _Ethumb Ethumb
 thumbnailer handle. More...
 
typedef void(* Ethumb_Generate_Cb) (void *data, Ethumb *e, Eina_Bool success)
 reports results of ethumb_generate(). More...
 

Functions

EAPI int ethumb_init (void)
 Initialize ethumb. More...
 
EAPI int ethumb_shutdown (void)
 Shutdown ethumb, unloading all currently-loaded modules. More...
 
EAPI Ethumbethumb_new (void)
 Create a new ethumb object. More...
 
EAPI void ethumb_free (Ethumb *e)
 Free an ethumb object.
 
EAPI Eina_Bool ethumb_file_set (Ethumb *e, const char *path, const char *key)
 Set the file for which to generate thumbnails. More...
 
EAPI void ethumb_file_get (const Ethumb *e, const char **path, const char **key)
 Get the file for which to generate thumbnails. More...
 
EAPI void ethumb_file_free (Ethumb *e)
 Reset the source file information. More...
 
EAPI Eina_Bool ethumb_generate (Ethumb *e, Ethumb_Generate_Cb finished_cb, const void *data, Eina_Free_Cb free_data)
 Generate the thumbnail. More...
 
EAPI Eina_Bool ethumb_exists (Ethumb *e)
 test if the thumbnailer exists More...
 
EAPI Ethumbethumb_dup (const Ethumb *e)
 Duplicate an thumbnailer. More...
 
EAPI Eina_Bool ethumb_cmp (const Ethumb *e1, const Ethumb *e2)
 Compare two thumbnailers. More...
 
EAPI int ethumb_hash (const void *key, int key_length)
 
EAPI int ethumb_key_cmp (const void *key1, int key1_length, const void *key2, int key2_length)
 
EAPI unsigned int ethumb_length (const void *key)
 

Detailed Description

Functions that all users must know of to use Ethumb.

Typedef Documentation

◆ Ethumb

typedef struct _Ethumb Ethumb

thumbnailer handle.

The handle is returned by ethumb_new() and destroyed by ethumb_free().

◆ Ethumb_Generate_Cb

typedef void(* Ethumb_Generate_Cb) (void *data, Ethumb *e, Eina_Bool success)

reports results of ethumb_generate().

Parameters
dataextra context given to ethumb_generate().
ehandle of the current thumbnailer.
successEINA_TRUE if generated or EINA_FALSE on errors.

Function Documentation

◆ ethumb_init()

EAPI int ethumb_init ( void  )

Initialize ethumb.

Returns
1 or greater on success, 0 otherwise.

◆ ethumb_shutdown()

EAPI int ethumb_shutdown ( void  )

Shutdown ethumb, unloading all currently-loaded modules.

Returns
0 if ethumb shuts down, an integer greater than 0 otherwise.

Referenced by ethumb_client_shutdown().

◆ ethumb_new()

EAPI Ethumb * ethumb_new ( void  )

Create a new ethumb object.

return The newly-created ethumb object

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ethumb_client_connect().

◆ ethumb_file_set()

EAPI Eina_Bool ethumb_file_set ( Ethumb e,
const char *  path,
const char *  key 
)

Set the file for which to generate thumbnails.

Parameters
eA pointer to an Ethumb object.
pathThe file to use.
keyIf path allows storing multiple resources in a single file (EET or Edje for instance), key is the key used to locate the right resource inside the file. NULL if not applicable.

References DBG, EINA_FALSE, eina_file_path_sanitize(), EINA_SAFETY_ON_NULL_RETURN_VAL, eina_stringshare_replace(), and EINA_TRUE.

Referenced by ethumb_client_file_set().

◆ ethumb_file_get()

EAPI void ethumb_file_get ( const Ethumb e,
const char **  path,
const char **  key 
)

Get the file for which to generate thumbnails.

Parameters
eA pointer to an Ethumb object.
[out]pathThe file being used.
[out]keyThe key used to locate the right resource in case the file can store several of them. NULL if not applicable.
See also
ethumb_file_set

References EINA_SAFETY_ON_NULL_RETURN.

Referenced by ethumb_client_file_get(), ethumb_client_generate(), and ethumb_client_thumb_exists().

◆ ethumb_file_free()

EAPI void ethumb_file_free ( Ethumb e)

Reset the source file information.

Parameters
eA pointer to an Ethumb object.

References DBG, EINA_SAFETY_ON_NULL_RETURN, and eina_stringshare_replace().

Referenced by ethumb_client_file_free().

◆ ethumb_generate()

EAPI Eina_Bool ethumb_generate ( Ethumb e,
Ethumb_Generate_Cb  finished_cb,
const void *  data,
Eina_Free_Cb  free_data 
)

Generate the thumbnail.

Parameters
ehandle of the current thumbnailer.
finished_cbThe callback function to run on opertaion end
free_dataThe callback function to run on free data.
Returns
EINA_TRUE on success and EINA_FALSE on failure

References DBG, EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and ERR.

◆ ethumb_exists()

EAPI Eina_Bool ethumb_exists ( Ethumb e)

test if the thumbnailer exists

Parameters
ehandle of the thumbnailer to test.
Returns
EINA_TRUE if thumbnailer exists and EINA_FALSE otherwise.

References DBG, EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

◆ ethumb_dup()

EAPI Ethumb * ethumb_dup ( const Ethumb e)

◆ ethumb_cmp()

EAPI Eina_Bool ethumb_cmp ( const Ethumb e1,
const Ethumb e2 
)

Compare two thumbnailers.

Parameters
e1First handle of thumbnailer to compare
e2Second handle of thumbnailer to compare
Returns
EINA_TRUE if the thumbnailers are equal and EINA_FALSE otherwise