Typedefs | Enumerations
Extra Object Manipulation

Miscellaneous functions that also apply to any object, but are less used or not implemented by all objects. More...

Typedefs

typedef enum _Evas_Object_Pointer_Mode Evas_Object_Pointer_Mode
 How the mouse pointer should be handled by Evas. More...
 

Enumerations

enum  _Evas_Object_Pointer_Mode {
  EVAS_OBJECT_POINTER_MODE_AUTOGRAB ,
  EVAS_OBJECT_POINTER_MODE_NOGRAB ,
  EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN
}
 How the mouse pointer should be handled by Evas. More...
 
EVAS_API void evas_object_data_set (Evas_Object *obj, const char *key, const void *data)
 Set an attached data pointer to an object with a given string key. More...
 
EVAS_API void * evas_object_data_get (const Evas_Object *obj, const char *key)
 Return an attached data pointer on an Evas object by its given string key. More...
 
EVAS_API void * evas_object_data_del (Evas_Object *obj, const char *key)
 Delete an attached data pointer from an object. More...
 

Detailed Description

Miscellaneous functions that also apply to any object, but are less used or not implemented by all objects.

Examples of this group of functions can be found here and here.

Typedef Documentation

◆ Evas_Object_Pointer_Mode

How the mouse pointer should be handled by Evas.

In the mode EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button is pressed down over an object and held, with the mouse pointer being moved outside of it, the pointer still behaves as being bound to that object, albeit out of its drawing region. When the button is released, the event will be fed to the object, that may check if the final position is over it or not and do something about it.

In the mode EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will always be bound to the object right below it. How the mouse pointer should be handled by Evas.

Enumeration Type Documentation

◆ _Evas_Object_Pointer_Mode

How the mouse pointer should be handled by Evas.

In the mode EVAS_OBJECT_POINTER_MODE_AUTOGRAB, when a mouse button is pressed down over an object and held, with the mouse pointer being moved outside of it, the pointer still behaves as being bound to that object, albeit out of its drawing region. When the button is released, the event will be fed to the object, that may check if the final position is over it or not and do something about it.

In the mode EVAS_OBJECT_POINTER_MODE_NOGRAB, the pointer will always be bound to the object right below it.

Enumerator
EVAS_OBJECT_POINTER_MODE_AUTOGRAB 

default, X11-like

EVAS_OBJECT_POINTER_MODE_NOGRAB 

pointer always bound to the object right below it

EVAS_OBJECT_POINTER_MODE_NOGRAB_NO_REPEAT_UPDOWN 

useful on object with "repeat events" enabled, where mouse/touch up and down events WONT be repeated to objects and these objects wont be auto-grabbed.

Since
1.2

Function Documentation

◆ evas_object_data_set()

EVAS_API void evas_object_data_set ( Evas_Object obj,
const char *  key,
const void *  data 
)

Set an attached data pointer to an object with a given string key.

Parameters
objThe object to attach the data pointer to
keyThe string key for the data to access it
dataThe pointer to the data to be attached

This attaches the pointer data to the object obj, given the access string key. This pointer will stay "hooked" to the object until a new pointer with the same string key is attached with evas_object_data_set() or it is deleted with evas_object_data_del(). On deletion of the object obj, the pointers will not be accessible from the object anymore.

You can find the pointer attached under a string key using evas_object_data_get(). It is the job of the calling application to free any data pointed to by data when it is no longer required.

If data is NULL, the old value stored at key will be removed but no new value will be stored. This is synonymous with calling evas_object_data_del() with obj and key.

Note
This function is very handy when you have data associated specifically to an Evas object, being of use only when dealing with it. Than you don't have the burden to a pointer to it elsewhere, using this family of functions.

Example:

int *my_data;
extern Evas_Object *obj;
my_data = malloc(500);
evas_object_data_set(obj, "name_of_data", my_data);
printf("The data that was attached was %p\n", evas_object_data_get(obj, "name_of_data"));
EVAS_API void evas_object_data_set(Evas_Object *eo_obj, const char *key, const void *data)
Set an attached data pointer to an object with a given string key.
Definition: evas_data.c:5
EVAS_API void * evas_object_data_get(const Evas_Object *obj, const char *key)
Return an attached data pointer on an Evas object by its given string key.
Definition: evas_data.c:12
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185

Referenced by edje_perspective_new(), and elm_access_action_cb_set().

◆ evas_object_data_get()

EVAS_API void * evas_object_data_get ( const Evas_Object obj,
const char *  key 
)

Return an attached data pointer on an Evas object by its given string key.

Parameters
objThe object to which the data was attached
keyThe string key the data was stored under
Returns
The data pointer stored, or NULL if none was stored

This function will return the data pointer attached to the object obj, stored using the string key key. If the object is valid and a data pointer was stored under the given key, that pointer will be returned. If this is not the case, NULL will be returned, signifying an invalid object or a non-existent key. It is possible that a NULL pointer was stored given that key, but this situation is nonsensical and thus can be considered an error as well. NULL pointers are never stored as this is the return value if an error occurs.

Example:

int *my_data;
extern Evas_Object *obj;
my_data = evas_object_data_get(obj, "name_of_my_data");
if (my_data) printf("Data stored was %p\n", my_data);
else printf("No data was stored on the object\n");
Examples
ecore_imf_example.c, emotion_test_main.c, ephysics_logo.c, evas-smart-interface.c, evas-smart-object.c, glview_example_01.c, prefs_example_01.c, prefs_example_02.c, test_camera.c, test_camera_track.c, test_delete.c, and test_rotating_forever.c.

Referenced by ecore_evas_buffer_ecore_evas_parent_get(), ecore_evas_object_ecore_evas_get(), ecore_evas_object_evas_get(), edje_evas_global_perspective_get(), edje_object_part_object_name_get(), elm_access_action_cb_set(), elm_access_object_get(), elm_object_tooltip_text_set(), and elm_transit_object_add().

◆ evas_object_data_del()

EVAS_API void * evas_object_data_del ( Evas_Object obj,
const char *  key 
)

Delete an attached data pointer from an object.

Parameters
objThe object to delete the data pointer from
keyThe string key the data was stored under
Returns
The original data pointer stored at key on obj

This will remove the stored data pointer from obj stored under key and return this same pointer, if actually there was data there, or NULL, if nothing was stored under that key.

Example:

int *my_data;
extern Evas_Object *obj;
my_data = evas_object_data_del(obj, "name_of_my_data");
EVAS_API void * evas_object_data_del(Evas_Object *obj, const char *key)
Delete an attached data pointer from an object.
Definition: evas_data.c:19
Examples
glview_example_01.c.