From: Jean-Philippe Andre Date: Thu, 16 Jun 2016 08:33:42 +0000 (+0900) Subject: Evas: Nove smart data get to smart class X-Git-Tag: upstream/1.20.0~5661 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=93fad2a19f2507a7b447d51b1259c15db5363f1f;p=platform%2Fupstream%2Fefl.git Evas: Nove smart data get to smart class It didn't make sense where it was. No idea why evas_box was overwriting smart_data.get (esp. since it was returning a private struct). --- diff --git a/src/lib/evas/canvas/evas_box.eo b/src/lib/evas/canvas/evas_box.eo index 5e74b80..54d440a 100644 --- a/src/lib/evas/canvas/evas_box.eo +++ b/src/lib/evas/canvas/evas_box.eo @@ -657,7 +657,6 @@ class Evas.Box (Evas.Smart.Clipped) implements { class.constructor; Eo.Base.constructor; - Evas.Object.smart_data.get; Evas.Object.Smart.calculate; Evas.Object.Smart.add; Evas.Object.Smart.del; diff --git a/src/lib/evas/canvas/evas_object.eo b/src/lib/evas/canvas/evas_object.eo index fd2c180..3cadac8 100644 --- a/src/lib/evas/canvas/evas_object.eo +++ b/src/lib/evas/canvas/evas_object.eo @@ -467,12 +467,6 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack, $false otherwise.]] } } - @property smart_data { - get { - [[Retrieve user data stored on a given smart object.]] - return: void_ptr @warn_unused; [[A pointer to data or $null.]] - } - } @property smart_clipped_clipper { get { [[Get the clipper object for the given clipped smart object. diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c index 415a671..0e71434 100644 --- a/src/lib/evas/canvas/evas_object_box.c +++ b/src/lib/evas/canvas/evas_object_box.c @@ -1973,17 +1973,10 @@ _evas_box_option_property_vget(const Eo *o EINA_UNUSED, Evas_Object_Box_Data *_p return EINA_FALSE; } -EOLIAN static void* -_evas_box_evas_object_smart_data_get(Eo *obj EINA_UNUSED, Evas_Object_Box_Data *_pd) -{ - return (void *)_pd; -} - EOLIAN static void _evas_box_class_constructor(Eo_Class *klass) { evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); } - #include "canvas/evas_box.eo.c" diff --git a/src/lib/evas/canvas/evas_object_main.c b/src/lib/evas/canvas/evas_object_main.c index fa24674..ecca759 100644 --- a/src/lib/evas/canvas/evas_object_main.c +++ b/src/lib/evas/canvas/evas_object_main.c @@ -2135,12 +2135,6 @@ _evas_object_render_parent_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Dat return obj->smart.parent; } -EOLIAN static void * -_evas_object_smart_data_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED) -{ - return NULL; -} - EOLIAN static Eina_Bool _evas_object_smart_type_check(const Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj EINA_UNUSED, const char *type EINA_UNUSED) { diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 0f02909..e94a54b 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -6,6 +6,11 @@ #define MY_CLASS_NAME "Evas_Smart" #define MY_CLASS_NAME_LEGACY "Evas_Object_Smart" +#define EVAS_OBJECT_SMART_GET_OR_RETURN(eo_obj, ...) \ + Evas_Smart_Data *o = eo_isa(eo_obj, EVAS_OBJECT_SMART_CLASS) ? \ + eo_data_scope_get(eo_obj, EVAS_OBJECT_SMART_CLASS) : NULL; \ + do { if (!o) { MAGIC_CHECK_FAILED(eo_obj,0,MAGIC_SMART) return __VA_ARGS__; } } while (0) + extern Eina_Hash* signals_hash_table; static Eina_Hash *_evas_smart_class_names_hash_table = NULL; @@ -123,8 +128,8 @@ _evas_object_smart_data_set(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o, void *da eo_data_ref(eo_obj, NULL); } -EOLIAN static void * -_evas_object_smart_evas_object_smart_data_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o) +EOLIAN void * +_evas_object_smart_data_get(Evas_Object *eo_obj EINA_UNUSED, Evas_Smart_Data *o) { return o->data; } diff --git a/src/lib/evas/canvas/evas_object_smart.eo b/src/lib/evas/canvas/evas_object_smart.eo index 3f2c2e3..62497e3 100644 --- a/src/lib/evas/canvas/evas_object_smart.eo +++ b/src/lib/evas/canvas/evas_object_smart.eo @@ -68,6 +68,7 @@ class Evas.Object.Smart (Evas.Object) } } @property data { + get {} set { [[Store a pointer to user data for a given smart object. @@ -305,7 +306,6 @@ class Evas.Object.Smart (Evas.Object) Eo.Base.constructor; Evas.Object.smart_type_check_ptr; Evas.Object.smart_type_check; - Evas.Object.smart_data.get; Evas.Object.paragraph_direction.set; Evas.Object.paragraph_direction.get; } diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 0262699..b5301b8 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -587,7 +587,7 @@ MAGIC_CHECK_FAILED(o, t, m) // helper function for legacy EAPI implementations #define EVAS_OBJ_GET_OR_RETURN(o, ...) ({ \ - Evas_Object_Protected_Data *_obj = eo_isa(eo_obj, EVAS_OBJECT_CLASS) ? \ + Evas_Object_Protected_Data *_obj = eo_isa(o, EVAS_OBJECT_CLASS) ? \ eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS) : NULL; \ if (!_obj) { MAGIC_CHECK_FAILED(o,0,0) return __VA_ARGS__; } \ _obj; })