1 #include "evas_common.h"
2 #include "evas_private.h"
5 * @defgroup Evas_Object_Name_Group Object Name Function
7 * Functions that retrieve and set the name of an evas object.
11 * Sets the name of the given evas object to the given name.
12 * @param obj The given object.
13 * @param name The given name.
14 * @ingroup Evas_Object_Name_Group
17 evas_object_name_set(Evas_Object *obj, const char *name)
19 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
24 obj->layer->evas->name_hash = evas_hash_del(obj->layer->evas->name_hash, obj->name, obj);
27 if (!name) obj->name = NULL;
30 obj->name = strdup(name);
31 obj->layer->evas->name_hash = evas_hash_add(obj->layer->evas->name_hash, obj->name, obj);
36 * Retrieves the name of the given evas object.
37 * @param obj The given object.
38 * @return The name of the object. @c NULL if no name has been given
40 * @ingroup Evas_Object_Name_Group
43 evas_object_name_get(const Evas_Object *obj)
45 MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
52 * Retrieves the object on the given evas with the given name.
53 * @param e The given evas.
54 * @param name The given name.
55 * @return If successful, the evas object with the given name. Otherwise,
57 * @ingroup Evas_Object_Name_Group
60 evas_object_name_find(const Evas *e, const char *name)
62 MAGIC_CHECK(e, Evas, MAGIC_EVAS);
65 if (!name) return NULL;
66 return (Evas_Object *)evas_hash_find(e->name_hash, name);