Evas: Move object static_clip to legacy

This is a horrible API used for internal optimizations. Which
may or may not be partly broken anyway.

We can do better, in the future. Let's not expose this kind
of API.
This commit is contained in:
Jean-Philippe Andre 2016-06-16 16:20:25 +09:00
parent cc427152bd
commit ab4e15e9c3
4 changed files with 49 additions and 36 deletions

View File

@ -1366,6 +1366,30 @@ EAPI void evas_object_stack_above(Evas_Object *obj, Evas_Object *above) EINA_ARG
*/
EAPI void evas_object_lower(Evas_Object *obj);
/**
* @brief Set a hint flag on the given Evas object that it's used as a "static
* clipper".
*
* This is a hint to Evas that this object is used as a big static clipper and
* shouldn't be moved with children and otherwise considered specially. The
* default value for new objects is @c false.
*
* @param[in] is_static_clip @c true if it's to be used as a static clipper,
* @c false otherwise.
*
* @ingroup Evas_Object
*/
EAPI void evas_object_static_clip_set(Evas_Object *obj, Eina_Bool is_static_clip);
/**
* @brief Get the "static clipper" hint flag for a given Evas object.
*
* @return @c true if it's to be used as a static clipper, @c false otherwise.
*
* @ingroup Evas_Object
*/
EAPI Eina_Bool evas_object_static_clip_get(const Evas_Object *obj);
#include "canvas/evas_common_interface.eo.legacy.h"
#include "canvas/evas_object.eo.legacy.h"

View File

@ -296,25 +296,6 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx, Efl.Gfx.Stack,
default size.]]
}
}
@property static_clip {
set {
[[Set a hint flag on the given Evas object that it's used as a
"static clipper".
This is a hint to Evas that this object is used as a big
static clipper and shouldn't be moved with children and
otherwise considered specially. The default value for new
objects is $false.
]]
}
get {
[[Get the "static clipper" hint flag for a given Evas object.]]
}
values {
is_static_clip: bool; [[$true if it's to be used as a static
clipper, $false otherwise.]]
}
}
@property focus {
set {
[[Sets or unsets a given object as the currently focused one on

View File

@ -1778,7 +1778,7 @@ _evas_object_eo_base_dbg_info_get(Eo *eo_obj, Evas_Object_Protected_Data *obj EI
visible = efl_gfx_visible_get(eo_obj);
layer = efl_gfx_stack_layer_get(eo_obj);
name = evas_obj_name_get(eo_obj);
name = eo_name_get(eo_obj); // evas_object_name_get(eo_obj);
efl_gfx_position_get(eo_obj, &x, &y);
efl_gfx_size_get(eo_obj, &w, &h);
scale = evas_obj_scale_get(eo_obj);
@ -2095,19 +2095,6 @@ _evas_object_precise_is_inside_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected
return obj->precise_is_inside;
}
EOLIAN static void
_evas_object_static_clip_set(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj, Eina_Bool is_static_clip)
{
evas_object_async_block(obj);
obj->is_static_clip = is_static_clip;
}
EOLIAN static Eina_Bool
_evas_object_static_clip_get(Eo *eo_obj EINA_UNUSED, Evas_Object_Protected_Data *obj)
{
return obj->is_static_clip;
}
static void
_is_frame_flag_set(Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
{
@ -2190,12 +2177,26 @@ _evas_object_legacy_ctor(Eo *eo_obj, Evas_Object_Protected_Data *obj)
EAPI const char *
evas_object_type_get(const Evas_Object *eo_obj)
{
Evas_Object_Protected_Data *obj = eo_isa(eo_obj, EVAS_OBJECT_CLASS) ?
eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS) : NULL;
if (!obj || obj->delete_me) return "";
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
if (obj->delete_me) return "";
return obj->type;
}
EAPI void
evas_object_static_clip_set(Evas_Object *eo_obj, Eina_Bool is_static_clip)
{
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
evas_object_async_block(obj);
obj->is_static_clip = is_static_clip;
}
EAPI Eina_Bool
evas_object_static_clip_get(const Evas_Object *eo_obj)
{
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, EINA_FALSE);
return obj->is_static_clip;
}
EAPI void
evas_object_size_hint_aspect_set(Evas_Object *obj, Evas_Aspect_Control aspect, Evas_Coord w, Evas_Coord h)
{

View File

@ -585,6 +585,13 @@ MAGIC_CHECK_FAILED(o, t, m)
# define MAGIC_CHECK_END() }}
#endif
// 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) ? \
eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS) : NULL; \
if (!_obj) { MAGIC_CHECK_FAILED(o,0,0) return __VA_ARGS__; } \
_obj; })
#define NEW_RECT(_r, _x, _y, _w, _h) (_r) = eina_rectangle_new(_x, _y, _w, _h);
#define MERR_NONE() _evas_alloc_error = EVAS_ALLOC_ERROR_NONE