Evas: Move smart_get to legacy and smart_attach to internals

smart_get and attach referred to an opaque struct, from EO
point of view.

Also, attach was an EO-only function, used nowhere besides
evas object smart itself, and evas grid (which is not EO
public API).
This commit is contained in:
Jean-Philippe Andre 2016-06-17 13:42:09 +09:00
parent 317b9ec559
commit b88ca02fe9
6 changed files with 18 additions and 26 deletions

View File

@ -3576,6 +3576,13 @@ EAPI Eina_Bool evas_smart_class_inherit_full(Evas_Smart_
*/
EAPI int evas_smart_usage_get(const Evas_Smart *s);
/**
* @brief Get the @ref Evas_Smart from which @c obj smart object was created.
*
* @return the @ref Evas_Smart handle or @c null, on errors.
*/
EAPI Evas_Smart *evas_object_smart_smart_get(const Evas_Object *obj) EINA_WARN_UNUSED_RESULT;
/**
* @def evas_smart_class_inherit
* Easy to use version of evas_smart_class_inherit_full().

View File

@ -5086,6 +5086,7 @@ EAPI Eina_Bool evas_object_smart_type_check(const Evas_Object *obj, const char *
*/
EAPI Eina_Bool evas_object_smart_type_check_ptr(const Evas_Object *obj, const char *type) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2);
/**
* This gets the internal counter that counts the number of smart calculations
*

View File

@ -273,7 +273,7 @@ EOLIAN static Eo *
_evas_grid_eo_base_constructor(Eo *obj, Evas_Grid_Data *class_data EINA_UNUSED)
{
obj = eo_constructor(eo_super(obj, MY_CLASS));
evas_obj_smart_attach(obj, _evas_object_grid_smart_class_new());
evas_object_smart_attach(obj, _evas_object_grid_smart_class_new());
return obj;
// return evas_object_smart_add(evas, _evas_object_grid_smart_class_new());

View File

@ -194,10 +194,10 @@ evas_object_smart_interface_data_get(const Evas_Object *eo_obj,
return NULL;
}
EOLIAN static Evas_Smart*
_evas_object_smart_smart_get(Eo *eo_obj EINA_UNUSED, Evas_Smart_Data *o EINA_UNUSED)
EAPI Evas_Smart*
evas_object_smart_smart_get(const Evas_Object_Smart *eo_obj)
{
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj, NULL);
return obj->smart.smart;
}
@ -574,7 +574,7 @@ evas_object_smart_add(Evas *eo_e, Evas_Smart *s)
return NULL;
MAGIC_CHECK_END();
eo_obj = eo_add(EVAS_OBJECT_SMART_CLASS, eo_e);
evas_obj_smart_attach(eo_obj, s);
evas_object_smart_attach(eo_obj, s);
return eo_obj;
}
@ -701,14 +701,12 @@ _evas_object_smart_smart_no_render_set(Eo *eo_obj, Evas_Smart_Data *o EINA_UNUSE
}
}
EOLIAN static void
_evas_object_smart_attach(Eo *eo_obj, Evas_Smart_Data *_pd EINA_UNUSED, Evas_Smart *s)
void
evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s)
{
MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART);
return;
MAGIC_CHECK_END();
Evas_Object_Protected_Data *obj = EVAS_OBJ_GET_OR_RETURN(eo_obj);
unsigned int i;
Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
obj->smart.smart = s;
obj->type = s->smart_class->name;
evas_object_smart_use(s);

View File

@ -1,6 +1,5 @@
/* XXX: Putting the next two as externs because this interface will hopefully
be removed for efl 2.0, so no need to bother. */
struct @extern Evas.Smart;
struct @extern Evas.Smart.Cb_Description;
class Evas.Object.Smart (Evas.Object)
@ -96,13 +95,6 @@ class Evas.Object.Smart (Evas.Object)
return: list<Evas.Object> @warn_unused; [[Returns the list of the member objects of $obj.]]
}
}
@property smart {
get {
[[Get the @Evas.Smart from which $obj smart object was created.]]
return: Evas.Smart * @warn_unused; [[the @Evas.Smart handle or $null, on errors.]]
}
}
show {
[[No description supplied by the EAPI.]]
legacy: null;
@ -292,13 +284,6 @@ class Evas.Object.Smart (Evas.Object)
[[Deletes a smart object.]]
legacy: null;
}
attach {
[[Attach a given smart data to a given smart object.]]
params {
@in s: Evas.Smart *;
}
legacy: null;
}
move_children_relative {
[[Moves all children objects of a given smart object relative to a
given offset.

View File

@ -1588,6 +1588,7 @@ void evas_call_smarts_calculate(Evas *e);
void evas_object_smart_bounding_box_update(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj);
void evas_object_smart_need_bounding_box_update(Evas_Object *eo_obj, Evas_Smart_Data *o, Evas_Object_Protected_Data *obj);
Eina_Bool evas_object_smart_changed_get(Evas_Object *eo_obj);
void evas_object_smart_attach(Evas_Object *eo_obj, Evas_Smart *s);
void *evas_mem_calloc(int size);
void _evas_post_event_callback_call(Evas *e, Evas_Public_Data* e_pd);
void _evas_post_event_callback_free(Evas *e);