ethumb_client.c File Reference

This is the client-server thumbnail library, see Client-Server Thumbnailing Tutorial. More...

Functions

EAPI int ethumb_client_init (void)
 Initialize the Ethumb_Client library.
EAPI int ethumb_client_shutdown (void)
 Shut down the Ethumb_Client library.
EAPI Ethumb_Clientethumb_client_connect (Ethumb_Client_Connect_Cb connect_cb, const void *data, Eina_Free_Cb free_data)
 Connects to Ethumb server and return the client instance.
EAPI void ethumb_client_disconnect (Ethumb_Client *client)
 Disconnect the client, releasing all client resources.
EAPI void ethumb_client_on_server_die_callback_set (Ethumb_Client *client, Ethumb_Client_Die_Cb server_die_cb, const void *data, Eina_Free_Cb free_data)
 Sets the callback to report server died.
EAPI void ethumb_client_ethumb_setup (Ethumb_Client *client)
 Send setup to server.
EAPI void ethumb_client_generate_cancel (Ethumb_Client *client, int id, Ethumb_Client_Generate_Cancel_Cb cancel_cb, const void *data, Eina_Free_Cb free_data)
 Ask server to cancel generation of thumbnail.
EAPI void ethumb_client_generate_cancel_all (Ethumb_Client *client)
 Ask server to cancel generation of all thumbnails.
EAPI void ethumb_client_fdo_set (Ethumb_Client *client, Ethumb_Thumb_FDO_Size s)
 Configure future requests to use FreeDesktop.Org preset.
EAPI void ethumb_client_size_set (Ethumb_Client *client, int tw, int th)
 Configure future request to use custom size.
EAPI void ethumb_client_size_get (const Ethumb_Client *client, int *tw, int *th)
 Retrieve future request to use custom size.
EAPI void ethumb_client_format_set (Ethumb_Client *client, Ethumb_Thumb_Format f)
 Configure format to use for future requests.
EAPI Ethumb_Thumb_Format ethumb_client_format_get (const Ethumb_Client *client)
 Retrieve format to use for future requests.
EAPI void ethumb_client_aspect_set (Ethumb_Client *client, Ethumb_Thumb_Aspect a)
 Configure aspect mode to use.
EAPI Ethumb_Thumb_Aspect ethumb_client_aspect_get (const Ethumb_Client *client)
 Get current aspect in use for requests.
EAPI void ethumb_client_orientation_set (Ethumb_Client *client, Ethumb_Thumb_Orientation o)
 Configure orientation to use for future requests.
EAPI Ethumb_Thumb_Orientation ethumb_client_orientation_get (const Ethumb_Client *client)
 Get current orientation in use for requests.
EAPI void ethumb_client_crop_align_set (Ethumb_Client *client, float x, float y)
 Configure crop alignment in use for future requests.
EAPI void ethumb_client_crop_align_get (const Ethumb_Client *client, float *x, float *y)
 Get current crop alignment in use for requests.
EAPI void ethumb_client_quality_set (Ethumb_Client *client, int quality)
 Configure quality to be used in thumbnails.
EAPI int ethumb_client_quality_get (const Ethumb_Client *client)
 Get quality to be used in thumbnails.
EAPI void ethumb_client_compress_set (Ethumb_Client *client, int compress)
 Configure compression level used in requests.
EAPI int ethumb_client_compress_get (const Ethumb_Client *client)
 Get compression level used in requests.
EAPI Eina_Bool ethumb_client_frame_set (Ethumb_Client *client, const char *file, const char *group, const char *swallow)
 Set frame to apply to future thumbnails.
EAPI void ethumb_client_dir_path_set (Ethumb_Client *client, const char *path)
 Configure where to store thumbnails in future requests.
EAPI const char * ethumb_client_dir_path_get (const Ethumb_Client *client)
 Get base directory path where to store thumbnails.
EAPI void ethumb_client_category_set (Ethumb_Client *client, const char *category)
 Category directory to store thumbnails.
EAPI const char * ethumb_client_category_get (const Ethumb_Client *client)
 Get category sub-directory where to store thumbnails.
EAPI void ethumb_client_video_time_set (Ethumb_Client *client, float t)
 Set the video time (duration) in seconds.
EAPI void ethumb_client_video_start_set (Ethumb_Client *client, float start)
 Set initial video position to start thumbnailing, in percentage.
EAPI void ethumb_client_video_interval_set (Ethumb_Client *client, float interval)
 Set the video frame interval, in seconds.
EAPI void ethumb_client_video_ntimes_set (Ethumb_Client *client, unsigned int ntimes)
 Set the number of frames to thumbnail.
EAPI void ethumb_client_video_fps_set (Ethumb_Client *client, unsigned int fps)
 Set the number of frames per second to thumbnail the video.
EAPI void ethumb_client_document_page_set (Ethumb_Client *client, unsigned int page)
 Set the page number to thumbnail in paged documents.
EAPI Eina_Bool ethumb_client_file_set (Ethumb_Client *client, const char *path, const char *key)
 Set source file to be thumbnailed.
EAPI void ethumb_client_file_get (Ethumb_Client *client, const char **path, const char **key)
 Get values set with ethumb_client_file_get()
EAPI void ethumb_client_file_free (Ethumb_Client *client)
 Reset previously set file to NULL.
EAPI void ethumb_client_thumb_path_set (Ethumb_Client *client, const char *path, const char *key)
 Set a defined path and key to store the thumbnail.
EAPI void ethumb_client_thumb_path_get (Ethumb_Client *client, const char **path, const char **key)
 Get the configured thumbnail path.
EAPI Ethumb_Existsethumb_client_thumb_exists (Ethumb_Client *client, Ethumb_Client_Thumb_Exists_Cb exists_cb, const void *data)
 Checks whenever file already exists (locally!)
EAPI void ethumb_client_thumb_exists_cancel (Ethumb_Exists *exists)
 Cancel an ongoing exists request.
EAPI Eina_Bool ethumb_client_thumb_exists_check (Ethumb_Exists *exists)
 Check if an exists request was cancelled.
EAPI int ethumb_client_generate (Ethumb_Client *client, Ethumb_Client_Generate_Cb generated_cb, const void *data, Eina_Free_Cb free_data)
 Ask server to generate thumbnail.
static void _ethumb_client_async_free (Ethumb_Client_Async *async)
static void _ethumb_client_thumb_finish (void *data, Ethumb_Client *client, int id, const char *file, const char *key, const char *thumb_path, const char *thumb_key, Eina_Bool success)
static Eina_Bool _ethumb_client_thumb_generate_idler (void *data)
static void _ethumb_client_thumb_exists (void *data, Ethumb_Client *client, Ethumb_Exists *request, Eina_Bool exists)
static Eina_Bool _ethumb_client_thumb_exists_idler (void *data)
EAPI Ethumb_Client_Async * ethumb_client_thumb_async_get (Ethumb_Client *client, Ethumb_Client_Async_Done_Cb done, Ethumb_Client_Async_Error_Cb error, const void *data)
EAPI void ethumb_client_thumb_async_cancel (Ethumb_Client *client, Ethumb_Client_Async *request)

Variables

static Ecore_Idler * idler [2] = { NULL, NULL }
static Eina_List * pending = NULL
static Eina_List * idle_tasks [2] = { NULL, NULL }

Detailed Description

This is the client-server thumbnail library, see Client-Server Thumbnailing Tutorial.

Copyright (C) 2009 by ProFUSION embedded systems

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, see <http://www.gnu.org/licenses/>.

Author:
Rafael Antognolli <antognolli@profusion.mobi>
Gustavo Sverzut Barbieri <barbieri@profusion.mobi>