evas-init-shutdown.c
#include <Evas.h>
#include <stdio.h>
#include <errno.h>
int
main(void)
{
Eina_List *engine_list, *l;
char *engine_name;
/* Initialize Evas. This will startup other dependencies such as
* eina, eet, ecore, etc. and initializes various internal things
* (threads, filters, etc.) */
evas_init();
/* When building Evas you can configure a variety of engines to be
* built with it. Get a list of what engines are available using the
* evas_render_method_list routine.
*/
engine_list = evas_render_method_list();
if (!engine_list)
{
fprintf(stderr, "ERROR: Evas supports no engines! Exit.\n");
exit(-1);
}
/* 'engine_list' is a linked list (@see Eina_List.) The
* EINA_LIST_FOREACH macro permits navigating through the items using
* the iterator 'l', making the node data available as 'engine_name'.
*/
printf("Available Evas Engines:\n");
EINA_LIST_FOREACH(engine_list, l, engine_name)
printf("%s\n", engine_name);
/* To free the list, we use evas_render_method_list's corresponding
* destructor routine.
*/
evas_render_method_list_free(engine_list);
/* Shuts down all dependencies if nothing else is using them, and
* clears allocated data held internally.
*/
evas_shutdown();
return 0;
}
Eina_List
struct _Eina_List Eina_List
Type for a generic double linked list.
Definition eina_list.h:304
EINA_LIST_FOREACH
#define EINA_LIST_FOREACH(list, l, _data)
Definition for the macro to iterate over a list.
Definition eina_list.h:1415
evas_init
EVAS_API int evas_init(void)
Directly initialize Evas and its required dependencies.
Definition evas_main.c:152
evas_shutdown
EVAS_API int evas_shutdown(void)
Directly shutdown Evas.
Definition evas_main.c:239
evas_render_method_list_free
EVAS_API void evas_render_method_list_free(Eina_List *list)
This function should be called to free a list of engine names.
Definition evas_main.c:773
evas_render_method_list
EVAS_API Eina_List * evas_render_method_list(void)
List all the rendering engines compiled into the copy of the Evas library.
Definition evas_main.c:767