From 37ea40c0cc116127bb03253dc082ae2550cdb5ee Mon Sep 17 00:00:00 2001 From: Brett Nash Date: Sun, 6 Feb 2011 23:51:34 +0000 Subject: [PATCH] Add the extra proxy convenience functions. SVN revision: 56773 --- legacy/evas/src/lib/Evas.h | 2 + .../evas/src/lib/canvas/evas_object_proxy.c | 38 ++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index e97d661701..a0701f283c 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h @@ -2095,6 +2095,8 @@ struct _Evas_Smart_Cb_Description */ EAPI Evas_Object *evas_object_proxy_add (Evas *e) EINA_MALLOC; EAPI Eina_Bool evas_object_proxy_source_set (Evas_Object *o, Evas_Object *source); + EAPI Evas_Object *evas_object_proxy_source_get (Evas_Object *o); + EAPI Eina_Bool evas_object_proxy_source_unset (Evas_Object *o); /** * @defgroup Evas_Cserve Shared Image Cache Server diff --git a/legacy/evas/src/lib/canvas/evas_object_proxy.c b/legacy/evas/src/lib/canvas/evas_object_proxy.c index be8e600efc..525a88f6a0 100644 --- a/legacy/evas/src/lib/canvas/evas_object_proxy.c +++ b/legacy/evas/src/lib/canvas/evas_object_proxy.c @@ -116,7 +116,7 @@ evas_object_proxy_add(Evas *e) EAPI Eina_Bool evas_object_proxy_source_set(Evas_Object *obj, Evas_Object *src) { - Evas_Object_Proxy *o; + Evas_Object_Proxy *o,*so; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return false; @@ -128,6 +128,18 @@ evas_object_proxy_source_set(Evas_Object *obj, Evas_Object *src) if (o->source == src) return true; + if (src) + { + MAGIC_CHECK(src, Evas_Object, MAGIC_OBJ); + return false; + MAGIC_CHECK_END(); + so = src->object_data; + /* Stop the loop _now_ */ + /* FIXME: Should I check for smarts that contain proxies too? */ + if (so->magic == MAGIC_OBJ_PROXY) + return false; + } + if (o->source) { _proxy_unset(obj); @@ -141,6 +153,30 @@ evas_object_proxy_source_set(Evas_Object *obj, Evas_Object *src) return true; } +EAPI Evas_Object * +evas_object_proxy_source_get(Evas_Object *obj) +{ + Evas_Object_Proxy *o; + + MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); + return NULL; + MAGIC_CHECK_END(); + o = obj->object_data; + MAGIC_CHECK(o, Evas_Object_Proxy, MAGIC_OBJ_PROXY); + return NULL; + MAGIC_CHECK_END(); + + return o->source; +} + +EAPI Eina_Bool +evas_object_proxy_source_unset(Evas_Object *o) +{ + return evas_object_proxy_source_set(o, NULL); +} + + + /* Internal helpers */ static void -- 2.34.1