summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2016-10-13 17:59:13 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2016-10-14 14:00:02 +0900
commit2fc23aa561a86b4a26daaaa71acc0d590cafe62c (patch)
tree5bccac4878e5e26a0c1bc020299fef86718c2140
parent9b9c044865faf95e7084626a821baf221542798a (diff)
downloadefl-2fc23aa561a86b4a26daaaa71acc0d590cafe62c.tar.gz
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
-rw-r--r--src/lib/evas/Evas_Legacy.h10
-rw-r--r--src/lib/evas/canvas/evas_object_smart_clipped.c13
2 files changed, 15 insertions, 8 deletions
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 7b96028ab5..95d2b20013 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 b8abd63e55..f9f95dda98 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