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
This commit is contained in:
Jean-Philippe Andre 2016-10-13 17:59:13 +09:00
parent 9b9c044865
commit 2fc23aa561
2 changed files with 15 additions and 8 deletions

View File

@ -5444,6 +5444,16 @@ EAPI Evas_Smart *evas_object_smart_smart_get(const Evas_Object *obj) EINA_WARN_U
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.

View File

@ -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