jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2fc23aa561a86b4a26daaaa71acc0d590cafe62c

commit 2fc23aa561a86b4a26daaaa71acc0d590cafe62c
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Thu Oct 13 17:59:13 2016 +0900

    evas: Fix evas_object_smart_clipped_clipper_get
    
    This was broken for smart objects that are not "clipped smart
    objects". This fixes the example evas_smart_object.
    
    NOTE: This EAPI was removed in efl-1.18!
    /!\ This was an uncaught API break between 1.17 and 1.18 /!\
    
    @fix
---
 src/lib/evas/Evas_Legacy.h                      | 10 ++++++++++
 src/lib/evas/canvas/evas_object_smart_clipped.c | 13 +++++--------
 2 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 7b96028..95d2b20 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -5445,6 +5445,16 @@ EAPI void evas_object_smart_data_set(Evas_Object *obj, 
void *data);
 EAPI void *evas_object_smart_data_get(const Evas_Object *obj);
 
 /**
+ * @brief Get the clipper object for the given clipped smart object.
+ *
+ * Use this function if you want to change any of this clipper's properties,
+ * like colors.
+ *
+ * @ingroup Evas_Object_Smart
+ */
+EAPI Evas_Object *evas_object_smart_clipped_clipper_get(const Evas_Object 
*obj) EINA_WARN_UNUSED_RESULT;
+
+/**
  * @brief Retrieves the list of the member objects of a given Evas smart
  * object.
  *
diff --git a/src/lib/evas/canvas/evas_object_smart_clipped.c 
b/src/lib/evas/canvas/evas_object_smart_clipped.c
index b8abd63..f9f95dd 100644
--- a/src/lib/evas/canvas/evas_object_smart_clipped.c
+++ b/src/lib/evas/canvas/evas_object_smart_clipped.c
@@ -11,19 +11,16 @@
         efl_data_scope_get(eo_obj, MY_CLASS) :                               \
         evas_object_smart_data_get(eo_obj));
 
-#define CSO_DATA_GET_OR_RETURN(eo_obj, ptr)                                 \
-  CSO_DATA_GET(eo_obj, ptr)                                             \
-  if (!ptr) return;
+#define CSO_DATA_GET_OR_RETURN(eo_obj, ptr, ...) \
+  CSO_DATA_GET(eo_obj, ptr) \
+  if (!ptr) return __VA_ARGS__;
 
 EAPI Evas_Object *
 evas_object_smart_clipped_clipper_get(const Evas_Object *eo_obj)
 {
-   Evas_Object_Smart_Clipped_Data *obj;
+   CSO_DATA_GET_OR_RETURN(eo_obj, cso, NULL);
 
-   if (!efl_isa(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS))
-     return NULL;
-   obj = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS);
-   return obj->clipper;
+   return cso->clipper;
 }
 
 static void

-- 


Reply via email to