diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/lib/canvas/evas_name.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/libraries/evas/src/lib/canvas/evas_name.c b/libraries/evas/src/lib/canvas/evas_name.c new file mode 100644 index 0000000..c42f941 --- /dev/null +++ b/libraries/evas/src/lib/canvas/evas_name.c | |||
@@ -0,0 +1,40 @@ | |||
1 | #include "evas_common.h" | ||
2 | #include "evas_private.h" | ||
3 | |||
4 | EAPI void | ||
5 | evas_object_name_set(Evas_Object *obj, const char *name) | ||
6 | { | ||
7 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
8 | return; | ||
9 | MAGIC_CHECK_END(); | ||
10 | if (obj->name) | ||
11 | { | ||
12 | eina_hash_del(obj->layer->evas->name_hash, obj->name, obj); | ||
13 | free(obj->name); | ||
14 | } | ||
15 | if (!name) obj->name = NULL; | ||
16 | else | ||
17 | { | ||
18 | obj->name = strdup(name); | ||
19 | eina_hash_add(obj->layer->evas->name_hash, obj->name, obj); | ||
20 | } | ||
21 | } | ||
22 | |||
23 | EAPI const char * | ||
24 | evas_object_name_get(const Evas_Object *obj) | ||
25 | { | ||
26 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
27 | return NULL; | ||
28 | MAGIC_CHECK_END(); | ||
29 | return obj->name; | ||
30 | } | ||
31 | |||
32 | EAPI Evas_Object * | ||
33 | evas_object_name_find(const Evas *e, const char *name) | ||
34 | { | ||
35 | MAGIC_CHECK(e, Evas, MAGIC_EVAS); | ||
36 | return NULL; | ||
37 | MAGIC_CHECK_END(); | ||
38 | if (!name) return NULL; | ||
39 | return (Evas_Object *)eina_hash_find(e->name_hash, name); | ||
40 | } | ||