Evas_Group

Langue: en

Version: 374932 (fedora - 01/12/10)

Section: 3 (Bibliothèques de fonctions)

NAME

Top Level Functions -

Functions that affect Evas as a whole.

Functions


EAPI int evas_async_events_fd_get (void)
Get evas' internal asynchronous events read file descriptor.
EAPI int evas_async_events_process (void)
Trigger the processing of all events waiting on the file descriptor returned by evas_async_events_fd_get().
EAPI Eina_Bool evas_async_events_put (const void *target, Evas_Callback_Type type, void *event_info, void(*func)(void *target, Evas_Callback_Type type, void *event_info))
Insert asynchronous events on the canvas.
EAPI int evas_init (void)
Initialize Evas.
EAPI int evas_shutdown (void)
Shutdown Evas.
EAPI int evas_alloc_error (void)
Return if any allocation errors have occured during the prior function.

Detailed Description

Functions that affect Evas as a whole.

Function Documentation

EAPI int evas_alloc_error (void)

Return if any allocation errors have occured during the prior function. Returns:

The allocation error flag

This function will return if any memory allocation errors occured during, and what kind they were. The return value will be one of EVAS_ALLOC_ERROR_NONE, EVAS_ALLOC_ERROR_FATAL or EVAS_ALLOC_ERROR_RECOVERED with each meaning something different.

EVAS_ALLOC_ERROR_NONE means that no errors occured at all and the function worked as expected.

EVAS_ALLOC_ERROR_FATAL means the function was completely unable to perform its job and will have exited as cleanly as possible. The programmer should consider this as a sign of very low memory and should try and safely recover from the prior functions failure (or try free up memory elsewhere and try again after more memory is freed).

EVAS_ALLOC_ERROR_RECOVERED means that an allocation error occured, but was recovered from by evas finding memory of its own it has allocated and freeing what it sees as not really usefully allocated memory. What is freed may vary. Evas may reduce the resolution of images, free cached images or fonts, trhow out pre-rendered data, reduce the complexity of change lists etc. Evas and the program will function as per normal after this, but this is a sign of low memory, and it is suggested that the program try and identify memory it doesn't need, and free it.

Example:

  extern Evas_Object *object;
  void callback (void *data, Evas *e, Evas_Object *obj, void *event_info);
 
  evas_object_event_callback_add(object, EVAS_CALLBACK_MOUSE_DOWN, callback, NULL);
  if (evas_alloc_error() == EVAS_ALLOC_ERROR_FATAL)
    {
      fprintf(stderr, 'ERROR: Completely unable to attach callabck. Must);
      fprintf(stderr, '       destroy object now as it cannot be used.);
      evas_object_del(object);
      object = NULL;
      fprintf(stderr, 'WARNING: Memory is really low. Cleaning out RAM.);
      my_memory_cleanup();
    }
  if (evas_alloc_error() == EVAS_ALLOC_ERROR_RECOVERED)
    {
      fprintf(stderr, 'WARNING: Memory is really low. Cleaning out RAM.);
      my_memory_cleanup();
    }
 
 


 

EAPI int evas_async_events_fd_get (void)

Get evas' internal asynchronous events read file descriptor. Returns:

The canvas' asynchronous events read file descriptor.

Evas' asynchronous events are meant to be dealt with internally, i. e., when building stuff to be glued together into the EFL infrastructure -- a module, for example. The context which demands its use is when calculations need to be done out of the main thread, asynchronously, and some action must be performed after that.

An example of actual use of this API is for image asynchronous preload inside evas. If the canvas was instantiated throught ecore-evas usage, ecore itself will take care of calling those events' processing.

This function returns the read file descriptor where to get the asynchronous events of the canvas. Naturally, other mainloops, apart from ecore, may make use of it.

EAPI int evas_async_events_process (void)

Trigger the processing of all events waiting on the file descriptor returned by evas_async_events_fd_get(). Returns:

The number of events processed.

All asynchronous events queued up by evas_async_events_put() are processed here. More precisely, the callback functions, informed together with other event parameters, when queued, get called (with those parameters), in that order.

EAPI Eina_Bool evas_async_events_put (const void * target, Evas_Callback_Type type, void * event_info, void(*)(void *target, Evas_Callback_Type type, void *event_info) func)

Insert asynchronous events on the canvas. Parameters:

target The target to be affected by the events.
type The type of callback function.
event_info Information about the event.
func The callback function pointer.

This is the way, for a routine running outside evas' main thread, to report an asynchronous event. A callback function is informed, whose call is to happen after evas_async_events_process() is called.

EAPI int evas_init (void)

Initialize Evas. Returns:

The init counter value.

This function initialize evas, increments a counter of the number of calls to this function and returns this value.

See also:

evas_shutdown().

EAPI int evas_shutdown (void)

Shutdown Evas. Returns:

The init counter value.

This function finalize evas, decrements the counter of the number of calls to the function evas_init() and returns this value.

See also:

evas_init().

Author

Generated automatically by Doxygen for Evas from the source code.