Evas_Output_Method (3) - Linux Manuals

Evas_Output_Method: Functions that are used to set the render engine for a given function, and then get that engine working.

NAME

Evas Render Engine Functions - Functions that are used to set the render engine for a given function, and then get that engine working.

Functions


EAPI void evas_output_method_set (Evas *e, int render_method)
Sets the output engine for the given evas.
EAPI int evas_output_method_get (const Evas *e)
Retrieves the number of the output engine used for the given evas.
EAPI Evas_Engine_Info * evas_engine_info_get (const Evas *e)
Retrieves the current render engine info struct from the given evas.
EAPI void evas_engine_info_set (Evas *e, Evas_Engine_Info *info)
Applies the engine settings for the given evas from the given Evas_Engine_Info structure.
EAPI int evas_render_method_lookup (const char *name)
Look up a numeric ID from a string name of a rendering engine.
EAPI Evas_List * evas_render_method_list (void)
List all the rendering engines compiled into the copy of the Evas library.
EAPI void evas_render_method_list_free (Evas_List *list)
This function should be called to free a list of engine names.

Detailed Description

Functions that are used to set the render engine for a given function, and then get that engine working.

The following code snippet shows how they can be used to initialise an evas that uses the X11 software engine:

 Evas *evas;
 Evas_Engine_Info_Software_X11 *einfo;
 extern Display *display;
 extern Window win;

 evas = evas_new();
 evas_output_method_set(evas, evas_render_method_lookup('software_x11'));
 evas_output_size_set(evas, 640, 480);
 evas_output_viewport_set(evas, 0, 0, 640, 480);
 einfo = (Evas_Engine_Info_Software_X11 *)evas_engine_info_get(evas);
 einfo->info.display = display;
 einfo->info.visual = DefaultVisual(display, DefaultScreen(display));
 einfo->info.colormap = DefaultColormap(display, DefaultScreen(display));
 einfo->info.drawable = win;
 einfo->info.depth = DefaultDepth(display, DefaultScreen(display));
 evas_engine_info_set(evas, (Evas_Engine_Info *)einfo);


 

Function Documentation

EAPI Evas_Engine_Info* evas_engine_info_get (const Evas * e)

Retrieves the current render engine info struct from the given evas.

The returned structure is publicly modifiable. The contents are valid until either evas_engine_info_set or evas_render are called.

This structure does not need to be freed by the caller.

Parameters:

e The given evas.

Returns:

A pointer to the Engine Info structure. NULL is returned if an engine has not yet been assigned.

References _Evas_Engine_Info::magic.

EAPI void evas_engine_info_set (Evas * e, Evas_Engine_Info * info)

Applies the engine settings for the given evas from the given Evas_Engine_Info structure.

To get the Evas_Engine_Info structure to use, call evas_engine_info_get . Do not try to obtain a pointer to an Evas_Engine_Info structure in any other way.

You will need to call this function at least once before you can create objects on an evas or render that evas. Some engines allow their settings to be changed more than once.

Once called, the info pointer should be considered invalid.

Example:

Parameters:

e The pointer to the Evas Canvas
info The pointer to the Engine Info to use

References _Evas_Engine_Info::magic.

EAPI int evas_output_method_get (const Evas * e)

Retrieves the number of the output engine used for the given evas.

Parameters:

e The given evas.

Returns:

The ID number of the output engine being used. 0 is returned if there is an error.

EAPI void evas_output_method_set (Evas * e, int render_method)

Sets the output engine for the given evas.

Once the output engine for an evas is set, any attempt to change it will be ignored. The value for render_method can be found using evas_render_method_lookup .

Parameters:

e The given evas.
render_method The numeric engine value to use.

References _Evas_List::data, and _Evas_List::next.

EAPI Evas_List* evas_render_method_list (void)

List all the rendering engines compiled into the copy of the Evas library.

Returns:

A linked list whose data members are C strings of engine names

Calling this will return a handle (pointer) to an Evas linked list. Each node in the linked list will have the data pointer be a (char *) pointer to the string name of the rendering engine available. The strings should never be modified, neither should the list be modified. This list should be cleaned up as soon as the program no longer needs it using evas_render_method_list_free(). If no engines are available from Evas, NULL will be returned.

Example:

 Evas_List *engine_list, *l;

 engine_list = evas_render_method_list();
 if (!engine_list)
   {
     fprintf(stderr, 'ERROR: Evas supports no engines! Exit.);
     exit(-1);
   }
 printf('Availible Evas Engines:);
 for (l = engine_list; l; l = l->next)
   {
     char *engine_name;

     engine_name = l->data;
     printf('%s, engine_name);
   }
 evas_render_method_list_free(engine_list);


 

References evas_list_append().

EAPI void evas_render_method_list_free (Evas_List * list)

This function should be called to free a list of engine names.

Parameters:

list The Evas_List base pointer for the engine list to be freed

When this function is called it will free the engine list passed in as list. The list should only be a list of engines generated by calling evas_render_method_list(). If list is NULL, nothing will happen.

Example:

 Evas_List *engine_list, *l;

 engine_list = evas_render_method_list();
 if (!engine_list)
   {
     fprintf(stderr, 'ERROR: Evas supports no engines! Exit.);
     exit(-1);
   }
 printf('Availible Evas Engines:);
 for (l = engine_list; l; l = l->next)
   {
     char *engine_name;

     engine_name = l->data;
     printf('%s, engine_name);
   }
 evas_render_method_list_free(engine_list);


 

References _Evas_List::data, and evas_list_remove().

EAPI int evas_render_method_lookup (const char * name)

Look up a numeric ID from a string name of a rendering engine.

Parameters:

name The string name of an engine

Returns:

A numeric (opaque) ID for the rendering engine

This function looks up a numeric return value for the named engine in the string name. This is a normal C string, NUL byte terminated. The name is case sensitive. If the rendering engine is available, a numeric ID for that engine is returned that is not 0. If the engine is not available, 0 is returned, indicating an invalid engine.

The programmer should NEVER rely on the numeric ID of an engine unless it is returned by this function. Programs should NOT be written accessing render method ID's directly, without first obtaining it from this function.

Example:

 int engine_id;
 Evas *evas;

 evas = evas_new();
 if (!evas)
   {
     fprintf(stderr, 'ERROR: Canvas creation failed. Fatal error.);
     exit(-1);
   }
 engine_id = evas_render_method_lookup('software_x11');
 if (!engine_id)
   {
     fprintf(stderr, 'ERROR: Requested rendering engine is absent.);
     exit(-1);
   }
 evas_output_method_set(evas, engine_id);


 

Author

Generated automatically by Doxygen for Evas from the source code.