Tizen Native API
5.5
|
Low level Evas canvas functions. Sub groups will present more high level ones, though.
Most of these functions deal with low level Evas actions, like:
Most users will be using Evas by means of the Ecore_Evas
wrapper, which deals with all the above mentioned issues automatically for them. Thus, you'll be looking at this section only if you're building low level stuff.
The groups within present you functions that deal with the canvas directly, too, and not yet with its objects. They are the functions you need to use at a minimum to get a working canvas.
Some of the functions in this group are exemplified here.
Functions | |
void | evas_render_updates_free (Eina_List *updates) |
const Evas_Modifier * | evas_key_modifier_get (const Evas *obj) |
Returns a handle to the list of modifier keys registered in the canvas e . | |
Evas_Modifier_Mask | evas_key_modifier_mask_get (const Evas *evas, const char *keyname) |
Creates a bit mask from the keyname modifier key. Values returned from different calls to it may be ORed together, naturally. | |
const Evas_Lock * | evas_key_lock_get (const Evas *obj) |
Returns a handle to the list of lock keys registered in the canvas e . | |
Eina_Bool | evas_pointer_inside_by_device_get (const Evas *obj, Efl_Input_Device *dev) |
Returns whether the mouse pointer is logically inside the canvas. | |
Eina_Bool | evas_pointer_inside_get (const Evas *obj) |
Returns whether the default mouse pointer is logically inside the canvas. | |
void | evas_output_view_get (const Evas_Out *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) EINA_DEPRECATED |
Gets the viewport region of the canvas that the output display. | |
void | evas_output_framespace_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) |
Sets the output framespace size of the render engine of the given evas. | |
void | evas_output_framespace_get (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) |
Get the render engine's output framespace coordinates in canvas units. | |
void | evas_output_viewport_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) |
Sets the output viewport of the given evas in evas units. | |
void | evas_output_viewport_get (const Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) |
Get the render engine's output viewport coordinates in canvas units. | |
void | evas_output_method_set (Evas *e, int render_method) |
Sets the output engine for the given evas. | |
int | evas_output_method_get (const Evas *e) |
Retrieves the number of the output engine used for the given evas. | |
void | evas_output_size_set (Evas *e, int w, int h) |
Sets the output size of the render engine of the given evas. | |
void | evas_output_size_get (const Evas *e, int *w, int *h) |
Retrieve the output size of the render engine of the given evas. | |
Typedefs | |
typedef Eo | Evas |
typedef struct _Evas_Public_Data | Evas_Public_Data |
An opaque handle to an Evas canvas.
Public data for an Evas.
Evas_Engine_Info* evas_engine_info_get | ( | const Evas * | obj | ) |
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.
Eina_Bool evas_engine_info_set | ( | Evas * | obj, |
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.
[in] | info | The pointer to the engine info to use. |
true
if no error occurred, false
otherwise. Eina_Bool evas_font_hinting_can_hint | ( | const Evas * | e, |
Evas_Font_Hinting_Flags | hinting | ||
) |
Checks if the font hinting is supported by the given evas.
One of #EVAS_FONT_HINTING_NONE, #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
[in] | hinting | The hinting to use. |
true
if it is supported, false
otherwise. Frees the given evas and any objects created on it.
Any objects with 'free' callbacks will have those callbacks called in this function.
e | The given evas. |
const Evas_Lock* evas_key_lock_get | ( | const Evas * | obj | ) |
Returns a handle to the list of lock keys registered in the canvas e
.
This is required to check for which locks are set at a given time with the evas_key_lock_is_set function.
null
on error. const Evas_Modifier* evas_key_modifier_get | ( | const Evas * | obj | ) |
Returns a handle to the list of modifier keys registered in the canvas e
.
This is required to check for which modifiers are set at a given time with the evas_key_modifier_is_set function.
See also evas_key_modifier_add, evas_key_modifier_del, evas_key_modifier_on, evas_key_modifier_off, evas_seat_key_modifier_on, evas_seat_key_modifier_off.
null
on error. Evas_Modifier_Mask evas_key_modifier_mask_get | ( | const Evas * | evas, |
const char * | keyname | ||
) |
Creates a bit mask from the keyname
modifier key. Values returned from different calls to it may be ORed together, naturally.
This function is meant to be using in conjunction with evas_object_key_grab/@ref evas_object_key_ungrab. Go check their documentation for more information.
See also evas_key_modifier_add, evas_key_modifier_get, evas_key_modifier_on, evas_key_modifier_off, evas_seat_key_modifier_on, evas_seat_key_modifier_off, evas_key_modifier_is_set, evas_seat_key_modifier_is_set..
[in] | keyname | The name of the modifier key to create the mask for. |
keyname
key wasn't registered as a modifier for canvas e
. Creates a new empty evas.
Note that before you can use the evas, you will to at a minimum:
This function should only fail if the memory allocation fails
ecore_evas_new()
. See Ecore.NULL
. Evas_Object* evas_object_smart_add | ( | Evas * | e, |
Evas_Smart * | s | ||
) |
Instantiates a new smart object described by s
.
e | the canvas on which to add the object |
s | the #Evas_Smart describing the smart object |
This is the function one should use when defining the public function adding an instance of the new smart object to a given canvas. It will take care of setting all of its internals to work as they should, if the user set things properly, as seem on the EVAS_SMART_SUBCLASS_NEW, for example.
void evas_object_smart_calculate | ( | Evas_Object * | obj | ) |
Call the calculate() smart function immediately on a given smart object.
This will force immediate calculations (see Evas_Smart_Class) needed for renderization of this object and, besides, unset the flag on it telling it needs recalculation for the next rendering phase.
See also evas_object_smart_need_recalculate_set
void evas_object_smart_callback_add | ( | Evas_Object * | obj, |
const char * | event, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Add (register) a callback function to the smart event specified by event
on the smart object obj
.
obj | a smart object |
event | the event's name string |
func | the callback function |
data | user data to be passed to the callback function |
Smart callbacks look very similar to Evas callbacks, but are implemented as smart object's custom ones.
This function adds a function callback to an smart object when the event named event
occurs in it. The function is func
.
In the event of a memory allocation error during addition of the callback to the object, evas_alloc_error() should be used to determine the nature of the error, if any, and the program should sensibly try and recover.
A smart callback function must have the ::Evas_Smart_Cb prototype definition. The first parameter (data
) in this definition will have the same value passed to evas_object_smart_callback_add() as the data
parameter, at runtime. The second parameter obj
is a handle to the object on which the event occurred. The third parameter, event_info
, is a pointer to data which is totally dependent on the smart object's implementation and semantic for the given event.
There is an infrastructure for introspection on smart objects' events (see evas_smart_callbacks_descriptions_get()), but no internal smart objects on Evas implement them yet.
void evas_object_smart_callback_call | ( | Evas_Object * | obj, |
const char * | event, | ||
void * | event_info | ||
) |
Call a given smart callback on the smart object obj
.
obj | the smart object |
event | the event's name string |
event_info | pointer to an event specific struct or information to pass to the callback functions registered on this smart event |
This should be called internally, from the smart object's own code, when some specific event has occurred and the implementor wants is to pertain to the object's events API (see Smart events and callbacks). The documentation for the smart object should include a list of possible events and what type of event_info
to expect for each of them. Also, when defining an Evas_Smart_Class, smart object implementors are strongly encouraged to properly set the Evas_Smart_Class::callbacks callbacks description array, so that the users of the smart object can have introspection on its events API at run time.
void* evas_object_smart_callback_del | ( | Evas_Object * | obj, |
const char * | event, | ||
Evas_Smart_Cb | func | ||
) |
Delete (unregister) a callback function from the smart event specified by event
on the smart object obj
.
obj | a smart object |
event | the event's name string |
func | the callback function |
This function removes the first added smart callback on the object obj
matching the event name event
and the registered function pointer func
. If the removal is successful it will also return the data pointer that was passed to evas_object_smart_callback_add() (that will be the same as the parameter) when the callback(s) was(were) added to the canvas. If not successful NULL
will be returned.
void* evas_object_smart_callback_del_full | ( | Evas_Object * | obj, |
const char * | event, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Delete (unregister) a callback function from the smart event specified by event
on the smart object obj
.
obj | a smart object |
event | the event's name string |
func | the callback function |
data | the data pointer that was passed to the callback |
This function removes the first added smart callback on the object obj
matching the event name event
, the registered function pointer func
and the callback data pointer data
. If the removal is successful it will also return the data pointer that was passed to evas_object_smart_callback_add() (that will be the same as the parameter) when the callback(s) was(were) added to the canvas. If not successful NULL
will be returned. A common use would be to remove an exact match of a callback
type
and func
, use evas_object_smart_callback_del(). void evas_object_smart_callback_description_find | ( | const Evas_Object * | obj, |
const char * | name, | ||
const Evas_Smart_Cb_Description ** | class_description, | ||
const Evas_Smart_Cb_Description ** | instance_description | ||
) |
Find callback description for callback called name or null
if not found.
If parameter is null
, no search will be done on instance descriptions.
[in] | name | name of desired callback, must not be null . The search have a special case for name being the same pointer as registered with Evas_Smart_Cb_Description, one can use it to avoid excessive use of strcmp(). |
[out] | class_description | pointer to return class description or null if not found. If parameter is null , no search will be done on class descriptions. |
[out] | instance_description | pointer to return instance description. |
void evas_object_smart_callback_priority_add | ( | Evas_Object * | obj, |
const char * | event, | ||
Evas_Callback_Priority | priority, | ||
Evas_Smart_Cb | func, | ||
const void * | data | ||
) |
Add (register) a callback function to the smart event specified by event
on the smart object obj
. Except for the priority field, it's exactly the same as evas_object_smart_callback_add
obj | a smart object |
event | the event's name string |
priority | The priority of the callback, lower values called first. |
func | the callback function |
data | user data to be passed to the callback function |
void evas_object_smart_callbacks_descriptions_get | ( | const Evas_Object * | obj, |
const Evas_Smart_Cb_Description *** | class_descriptions, | ||
unsigned int * | class_count, | ||
const Evas_Smart_Cb_Description *** | instance_descriptions, | ||
unsigned int * | instance_count | ||
) |
Retrieve an smart object's know smart callback descriptions (both instance and class ones).
This call searches for registered callback descriptions for both instance and class of the given smart object. These arrays will be sorted by Evas_Smart_Cb_Description.name and also null
terminated, so both class_count and instance_count can be ignored, if the caller wishes so. The terminator null
is not counted in these values.
null
pointers on the descriptions/counters you're not interested in: they'll be ignored by the function.evas_smart_callbacks_descriptions_get().
[out] | class_descriptions | Where to store class callbacks descriptions array, if any is known. If no descriptions are known, null is returned. |
[out] | class_count | Returns how many class callbacks descriptions are known. |
[out] | instance_descriptions | Where to store instance callbacks descriptions array, if any is known. If no descriptions are known, null is returned. |
[out] | instance_count | Returns how many instance callbacks descriptions are known. |
Eina_Bool evas_object_smart_callbacks_descriptions_set | ( | Evas_Object * | obj, |
const Evas_Smart_Cb_Description * | descriptions | ||
) |
Set an smart object instance's smart callbacks descriptions.
These descriptions are hints to be used by introspection and are not enforced in any way.
It will not be checked if instance callbacks descriptions have the same name as respective possibly registered in the smart object class. Both are kept in different arrays and users of evas_object_smart_callbacks_descriptions_get() should handle this case as they wish.
descriptions
must be null
terminated, and because a null
name makes little sense, too, Evas_Smart_Cb_Description.name must not be null
.[in] | descriptions | null terminated array with Evas_Smart_Cb_Description descriptions. Array elements won't be modified at run time, but references to them and their contents will be made, so this array should be kept alive during the whole object's lifetime. |
true
on success, false
on failure. void evas_object_smart_changed | ( | Evas_Object * | obj | ) |
Mark smart object as changed, dirty.
This will flag the given object as needing recalculation, forcefully. As an effect, on the next rendering cycle its calculate() (see Evas_Smart_Class) smart function will be called.
See also evas_object_smart_need_recalculate_set and evas_object_smart_calculate.
Evas_Object* evas_object_smart_clipped_clipper_get | ( | const Evas_Object * | obj | ) |
Get the clipper object for the given clipped smart object.
Use this function if you want to change any of this clipper's properties, like colors.
void* evas_object_smart_data_get | ( | const Evas_Object * | obj | ) |
void evas_object_smart_data_set | ( | Evas_Object * | obj, |
void * | data | ||
) |
Store a pointer to user data for a given smart object.
This data is stored independently of the one set by evas_object_data_set(), naturally.
See also evas_object_smart_data_get.
[in] | data | A pointer to user data. |
void* evas_object_smart_interface_data_get | ( | const Evas_Object * | obj, |
const Evas_Smart_Interface * | iface | ||
) |
Retrieve an Evas smart object interface's private data.
obj | An Evas smart object. |
iface | The given object's interface handle. |
NULL
otherwise. const void* evas_object_smart_interface_get | ( | const Evas_Object * | obj, |
const char * | name | ||
) |
Retrieve an Evas smart object's interface, by name string pointer.
obj | An Evas smart object. |
name | Name string of the desired interface, which must be the same pointer used at the interface's declarion, when creating the smart object obj. |
NULL
otherwise. Eina_Iterator* evas_object_smart_iterator_new | ( | const Evas_Object * | obj | ) |
Retrieves an iterator of the member objects of a given Evas smart object.
See also Efl::Canvas::Group::group_member_add and Efl::Canvas::Group::group_member_remove
obj
.void evas_object_smart_member_add | ( | Evas_Object * | obj, |
Evas_Object * | smart_obj | ||
) |
Set an Evas object as a member of a given smart object.
obj | The member object |
smart_obj | The smart object |
Members will automatically be stacked and layered together with the smart object. The various stacking functions will operate on members relative to the other members instead of the entire canvas, since they now live on an exclusive layer (see evas_object_stack_above(), for more details).
Any smart_obj
object's specific implementation of the member_add()
smart function will take place too, naturally.
void evas_object_smart_member_del | ( | Evas_Object * | obj | ) |
Removes a member object from a given smart object.
obj | the member object |
This removes a member object from a smart object, if it was added to any. The object will still be on the canvas, but no longer associated with whichever smart object it was associated with.
Eina_List* evas_object_smart_members_get | ( | const Evas_Object * | obj | ) |
Retrieves the list of the member objects of a given Evas smart object.
The returned list should be freed with eina_list_free()
when you no longer need it.
This function will return null
when a non-smart object is passed.
See also Efl::Canvas::Group::group_member_add, Efl::Canvas::Group::group_member_remove and evas_object_smart_iterator_new.
obj
.void evas_object_smart_move_children_relative | ( | Evas_Object * | obj, |
Evas_Coord | dx, | ||
Evas_Coord | dy | ||
) |
Moves all children objects of a given smart object relative to a given offset.
This will make each of obj
object's children to move, from where they before, with those delta values (offsets) on both directions.
move
functions.move
smart function definition.[in] | dx | Horizontal offset (delta). |
[in] | dy | Vertical offset (delta). |
Eina_Bool evas_object_smart_need_recalculate_get | ( | const Evas_Object * | obj | ) |
Get the value of the flag signalling that a given smart object needs to get recalculated.
calculate()
smart function is called, if one is provided. If it's not provided, then the flag will be left unchanged after the rendering phase.See also evas_object_smart_need_recalculate_set, for more details.
void evas_object_smart_need_recalculate_set | ( | Evas_Object * | obj, |
Eina_Bool | value | ||
) |
Set or unset the flag signalling that a given smart object needs to get recalculated.
If this flag is set, then the calculate()
smart function of obj
will be called, if one is provided, during rendering phase of Evas (see evas_render()), after which this flag will be automatically unset.
If that smart function is not provided for the given object, this flag will be left unchanged.
true
as parameter.See also evas_object_smart_need_recalculate_get, evas_object_smart_calculate and evas_smart_objects_calculate().
[in] | value | whether one wants to set ($true) or to unset ($false) the flag. |
Evas_Smart* evas_object_smart_smart_get | ( | const Evas_Object * | obj | ) |
Get the Evas_Smart from which obj
smart object was created.
null
, on errors. Eina_Bool evas_object_smart_type_check | ( | const Evas_Object * | obj, |
const char * | type | ||
) |
Checks whether a given smart object or any of its smart object parents is of a given smart class.
If obj
is not a smart object, this call will fail immediately.
This function supports Eo and legacy inheritance mechanisms. However, it is recommended to use efl_isa instead if your object is using Eo from top to bottom.
The checks use smart classes names and string comparison. There is a version of this same check using pointer comparison, since a smart class' name is a single string in Evas.
See also evas_object_smart_type_check_ptr.
[in] | type | The name (type) of the smart class to check for. |
Eina_Bool evas_object_smart_type_check_ptr | ( | const Evas_Object * | obj, |
const char * | type | ||
) |
Checks whether a given smart object or any of its smart object parents is of a given smart class, using pointer comparison.
[in] | type | The type (name string) to check for. Must be the name. |
true
if obj
or any of its parents is of type type
, false
otherwise. Evas_Object* evas_object_top_in_rectangle_get | ( | const Eo * | obj, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
Eina_Bool | include_pass_events_objects, | ||
Eina_Bool | include_hidden_objects | ||
) |
Retrieve the Evas object stacked at the top of a given rectangular region in a canvas.
This function will traverse all the layers of the given canvas, from top to bottom, querying for objects with areas overlapping with the given rectangular region inside e
. The user can remove from the query objects which are hidden and/or which are set to pass events.
[in] | obj | The object. |
[in] | x | The top left corner's horizontal coordinate for the rectangular region. |
[in] | y | The top left corner's vertical coordinate for the rectangular region. |
[in] | w | The width of the rectangular region. |
[in] | h | The height of the rectangular region. |
[in] | include_pass_events_objects | Boolean flag to include or not objects which pass events in this calculation. |
[in] | include_hidden_objects | Boolean flag to include or not hidden objects in this calculation. |
void evas_output_framespace_get | ( | const Evas * | e, |
Evas_Coord * | x, | ||
Evas_Coord * | y, | ||
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Get the render engine's output framespace coordinates in canvas units.
[out] | x | The left coordinate in output units, usually pixels. |
[out] | y | The top coordinate in output units, usually pixels. |
[out] | w | The width in output units, usually pixels. |
[out] | h | The height in output units, usually pixels. |
void evas_output_framespace_set | ( | Evas * | e, |
Evas_Coord | x, | ||
Evas_Coord | y, | ||
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the output framespace size of the render engine of the given evas.
The framespace size is used in the Wayland engines to denote space in the viewport which is occupied by the window frame. This is mainly used in ecore_evas to draw borders.
The units used for w
and h
depend on the engine used by the evas.
[in] | x | The left coordinate in output units, usually pixels. |
[in] | y | The top coordinate in output units, usually pixels. |
[in] | w | The width in output units, usually pixels. |
[in] | h | The height in output units, usually pixels. |
int evas_output_method_get | ( | const Evas * | e | ) |
Retrieves the number of the output engine used for the given evas.
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.
[in] | render_method | The numeric engine value to use. |
void evas_output_size_get | ( | const Evas * | e, |
int * | w, | ||
int * | h | ||
) |
Retrieve the output size of the render engine of the given evas.
The output size is given in whatever the output units are for the engine.
If either w
or h
is null
, then it is ignored. If e
is invalid, the returned results are undefined.
[out] | w | The width in output units, usually pixels. |
[out] | h | The height in output units, usually pixels. |
void evas_output_size_set | ( | Evas * | e, |
int | w, | ||
int | h | ||
) |
Sets the output size of the render engine of the given evas.
The evas will render to a rectangle of the given size once this function is called. The output size is independent of the viewport size. The viewport will be stretched to fill the given rectangle.
The units used for w
and h
depend on the engine used by the evas.
[in] | w | The width in output units, usually pixels. |
[in] | h | The height in output units, usually pixels. |
void evas_output_view_get | ( | const Evas_Out * | obj, |
Evas_Coord * | x, | ||
Evas_Coord * | y, | ||
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Gets the viewport region of the canvas that the output display.
[in] | obj | The object |
[out] | x | |
[out] | y | |
[out] | w | |
[out] | h |
void evas_output_viewport_get | ( | const Evas * | e, |
Evas_Coord * | x, | ||
Evas_Coord * | y, | ||
Evas_Coord * | w, | ||
Evas_Coord * | h | ||
) |
Get the render engine's output viewport coordinates in canvas units.
Calling this function writes the current canvas output viewport size and location values into the variables pointed to by x
, y
, w
and h
. On success the variables have the output location and size values written to them in canvas units. Any of x
, y
, w
or h
that are null
will not be written to. If e
is invalid, the results are undefined.
[out] | x | The top-left corner x value of the viewport. |
[out] | y | The top-left corner y value of the viewport. |
[out] | w | The width of the viewport. Must be greater than 0. |
[out] | h | The height of the viewport. Must be greater than 0. |
void evas_output_viewport_set | ( | Evas * | e, |
Evas_Coord | x, | ||
Evas_Coord | y, | ||
Evas_Coord | w, | ||
Evas_Coord | h | ||
) |
Sets the output viewport of the given evas in evas units.
The output viewport is the area of the evas that will be visible to the viewer. The viewport will be stretched to fit the output target of the evas when rendering is performed.
[in] | x | The top-left corner x value of the viewport. |
[in] | y | The top-left corner y value of the viewport. |
[in] | w | The width of the viewport. Must be greater than 0. |
[in] | h | The height of the viewport. Must be greater than 0. |
Eina_Bool evas_pointer_inside_by_device_get | ( | const Evas * | obj, |
Efl_Input_Device * | dev | ||
) |
Returns whether the mouse pointer is logically inside the canvas.
[in] | obj | The object. |
[in] | dev | The pointer device. |
true
if the pointer is inside, false
otherwise.Eina_Bool evas_pointer_inside_get | ( | const Evas * | obj | ) |
Returns whether the default mouse pointer is logically inside the canvas.
When this function is called it will return a value of either false
or true
, depending on if event_feed_mouse_in or event_feed_mouse_out have been called to feed in a mouse enter event into the canvas.
A return value of true
indicates the mouse is logically inside the canvas, and false
implies it is logically outside the canvas.
A canvas begins with the mouse being assumed outside ($false).
If e
is not a valid canvas, the return value is undefined.
[in] | obj | The object. |
true
if the mouse pointer is inside the canvas, false
otherwise void evas_render_updates_free | ( | Eina_List * | updates | ) |
Free the rectangles returned by evas_render_updates().
updates | The list of updated rectangles of the canvas. |
This function removes the region from the render updates list. It makes the region doesn't be render updated anymore.
void evas_smart_objects_calculate | ( | Eo * | obj | ) |
Call user-provided calculate
smart functions and unset the flag signalling that the object needs to get recalculated to all smart objects in the canvas.
Eina_Bool evas_smart_objects_calculating_get | ( | const Eo * | obj | ) |
Get if the canvas is currently calculating smart objects.
[in] | obj | The object. |
true
if currently calculating smart objects.