forked from enlightenment/efl
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:
parent
9b9c044865
commit
2fc23aa561
|
@ -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_set(Evas_Object *obj, void *data);
|
||||||
EAPI void *evas_object_smart_data_get(const Evas_Object *obj);
|
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
|
* @brief Retrieves the list of the member objects of a given Evas smart
|
||||||
* object.
|
* object.
|
||||||
|
|
|
@ -11,19 +11,16 @@
|
||||||
efl_data_scope_get(eo_obj, MY_CLASS) : \
|
efl_data_scope_get(eo_obj, MY_CLASS) : \
|
||||||
evas_object_smart_data_get(eo_obj));
|
evas_object_smart_data_get(eo_obj));
|
||||||
|
|
||||||
#define CSO_DATA_GET_OR_RETURN(eo_obj, ptr) \
|
#define CSO_DATA_GET_OR_RETURN(eo_obj, ptr, ...) \
|
||||||
CSO_DATA_GET(eo_obj, ptr) \
|
CSO_DATA_GET(eo_obj, ptr) \
|
||||||
if (!ptr) return;
|
if (!ptr) return __VA_ARGS__;
|
||||||
|
|
||||||
EAPI Evas_Object *
|
EAPI Evas_Object *
|
||||||
evas_object_smart_clipped_clipper_get(const Evas_Object *eo_obj)
|
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 cso->clipper;
|
||||||
return NULL;
|
|
||||||
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_GROUP_CLIPPED_CLASS);
|
|
||||||
return obj->clipper;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue