diff options
Diffstat (limited to 'libraries/evas/src/lib/canvas/evas_name.c')
-rw-r--r-- | libraries/evas/src/lib/canvas/evas_name.c | 72 |
1 files changed, 0 insertions, 72 deletions
diff --git a/libraries/evas/src/lib/canvas/evas_name.c b/libraries/evas/src/lib/canvas/evas_name.c deleted file mode 100644 index 1a9d20f..0000000 --- a/libraries/evas/src/lib/canvas/evas_name.c +++ /dev/null | |||
@@ -1,72 +0,0 @@ | |||
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 | } | ||
41 | |||
42 | static Evas_Object * | ||
43 | _evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) | ||
44 | { | ||
45 | const Eina_Inlist *lst; | ||
46 | Evas_Object *child; | ||
47 | |||
48 | if (!obj->smart.smart) return NULL; | ||
49 | lst = evas_object_smart_members_get_direct(obj); | ||
50 | EINA_INLIST_FOREACH(lst, child) | ||
51 | { | ||
52 | if (child->delete_me) continue; | ||
53 | if (!child->name) continue; | ||
54 | if (!strcmp(name, child->name)) return child; | ||
55 | if (recurse != 0) | ||
56 | { | ||
57 | if ((obj = _evas_object_name_child_find(child, name, recurse - 1))) | ||
58 | return (Evas_Object *)obj; | ||
59 | } | ||
60 | } | ||
61 | return NULL; | ||
62 | } | ||
63 | |||
64 | EAPI Evas_Object * | ||
65 | evas_object_name_child_find(const Evas_Object *obj, const char *name, int recurse) | ||
66 | { | ||
67 | MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); | ||
68 | return NULL; | ||
69 | MAGIC_CHECK_END(); | ||
70 | if (!name) return NULL; | ||
71 | return _evas_object_name_child_find(obj, name, recurse); | ||
72 | } | ||