Functions that affect Evas as a whole. More...
Functions | |
EVAS_API int | evas_init (void) |
Directly initialize Evas and its required dependencies. More... | |
EVAS_API int | evas_shutdown (void) |
Directly shutdown Evas. More... | |
EVAS_API Evas_Alloc_Error | evas_alloc_error (void) |
Get the error status of the most recent memory allocation call. More... | |
EVAS_API int | evas_async_events_fd_get (void) |
Access the canvas' asynchronous event queue. More... | |
EVAS_API int | evas_async_events_process (void) |
Process the asynchronous event queue. More... | |
EVAS_API Eina_Bool | evas_async_events_put (const void *target, Evas_Callback_Type type, void *event_info, Evas_Async_Events_Put_Cb func) |
Insert asynchronous events on the canvas. More... | |
Variables | |
EVAS_API Evas_Version * | evas_version |
Evas Version Information. | |
Functions that affect Evas as a whole.
EVAS_API int evas_init | ( | void | ) |
Directly initialize Evas and its required dependencies.
Permits use of Evas independently from Ecore. This can be useful in certain types of examples and test programs, as well as by Ecore-Evas' ecore_evas_init()
itself (which is what most EFL applications will be using instead).
The evas-buffer-simple.c example demonstrates use of evas_init(), and then manually setting up the canvas:
The canvas is set up using the example's create_canvas() routine, which forces selection of Evas' "buffer" rendering engine. The buffer engine simply renders to a memory buffer with no hardware acceleration.
References ecore_init(), eet_init(), eet_shutdown(), eina_init(), eina_log_domain_register(), eina_log_domain_unregister(), EINA_LOG_ERR, EINA_LOG_STATE_INIT, EINA_LOG_STATE_STOP, eina_log_timing(), EINA_SAFETY_ON_FALSE_GOTO, eina_shutdown(), EINA_TRUE, evil_init(), and evil_shutdown().
Referenced by ecore_evas_init(), edje_init(), and elm_quicklaunch_fork().
EVAS_API int evas_shutdown | ( | void | ) |
Directly shutdown Evas.
Low level routine to finalize Evas. Decrements a counter of the number of times evas_init() has been called, and, if appropriate, shuts down associated dependency modules and libraries. A return value of 0 indicates that everything has been properly shut down.
Ecore-Evas applications will typically use ecore_evas_shutdown() instead, as described in evas_init().
The evas-buffer-simple.c example shows use of evas_shutdown() in its destroy_canvas() routine:
References ecore_shutdown(), eet_shutdown(), eina_cow_del(), eina_log_domain_unregister(), EINA_LOG_ERR, EINA_LOG_STATE_SHUTDOWN, EINA_LOG_STATE_START, eina_log_timing(), eina_shutdown(), evas_font_path_global_clear(), and evil_shutdown().
Referenced by ecore_evas_init(), and ecore_evas_shutdown().
EVAS_API Evas_Alloc_Error evas_alloc_error | ( | void | ) |
Get the error status of the most recent memory allocation call.
Accesses the current error status for memory allocation, or EVAS_ALLOC_ERROR_NONE if allocation succeeded with no errors.
EVAS_ALLOC_ERROR_FATAL means that no memory allocation was possible, but the function call exited as cleanly as possible. This is a sign of very low memory, and indicates the caller should attempt a safe recovery and possibly re-try after freeing up additional memory.
EVAS_ALLOC_ERROR_RECOVERED indicates that Evas was able to free up sufficient memory internally to perform the requested memory allocation and the program will continue to function normally, but memory is in a low state and the program should strive to free memory itself. Evas' approach to free memory internally may reduce the resolution of images, free cached fonts or images, throw out pre-rendered data, or reduce the complexity of change lists.
Example:
EVAS_API int evas_async_events_fd_get | ( | void | ) |
Access the canvas' asynchronous event queue.
Normally, Evas handles asynchronous events internally, particularly in Evas-using modules that are part of the EFL infrastructure. Notably, ecore-evas takes care of processing these events for canvases instantiated through it.
However, when asynchronous calculations need to be done outside the main thread (in some other mainloop) with some followup action, this function permits accessing the events. An example would be asynchronous image preloading.
EVAS_API int evas_async_events_process | ( | void | ) |
Process the asynchronous event queue.
Triggers the callback functions for asynchronous events that were queued up by evas_async_events_put(). The callbacks are called in the same order that they were queued.
References ecore_pipe_wait().
EVAS_API Eina_Bool evas_async_events_put | ( | const void * | target, |
Evas_Callback_Type | type, | ||
void * | event_info, | ||
Evas_Async_Events_Put_Cb | func | ||
) |
Insert asynchronous events on the canvas.
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. |
Allows routines running outside Evas' main thread to report an asynchronous event. The target, type, and event info will be passed to the callback function when evas_async_events_process() is called.
References ecore_pipe_write(), EINA_FALSE, eina_inarray_grow(), eina_spinlock_release(), eina_spinlock_take(), EINA_TRUE, and _Eina_Inarray::len.