evas: engine_info set/get should never show up in Eo API.

Eo API are for something we want to expose to third party application
and bindings. engine_info is exactly what we don't want to expose.
This commit is contained in:
Cedric BAIL 2017-04-07 14:05:16 -07:00
parent bb83ff9094
commit b04f584346
3 changed files with 43 additions and 35 deletions

View File

@ -44,6 +44,42 @@ EAPI Evas *evas_new(void) EINA_WARN_UNUSED_RESULT EINA_MALLOC;
*/
EAPI void evas_free(Evas *e) EINA_ARG_NONNULL(1);
/**
* @brief Applies the engine settings for the given evas from the given
* @c Evas_Engine_Info structure.
*
* To get the Evas_Engine_Info structure to use, call
* @ref evas_engine_info_get. Do not try to obtain a pointer to an
* @c Evas_Engine_Info structure in any other way.
*
* You will need to call this function at least once before you can create
* objects on an evas or render that evas. Some engines allow their settings to
* be changed more than once.
*
* Once called, the @c info pointer should be considered invalid.
*
* @param[in] info The pointer to the engine info to use.
*
* @return @c true if no error occurred, @c false otherwise.
*
* @ingroup Evas_Canvas
*/
EAPI Eina_Bool evas_engine_info_set(Evas *obj, Evas_Engine_Info *info);
/**
* @brief Retrieves the current render engine info struct from the given evas.
*
* The returned structure is publicly modifiable. The contents are valid until
* either @ref evas_engine_info_set or @ref evas_render are called.
*
* This structure does not need to be freed by the caller.
*
* @return The pointer to the engine info to use.
*
* @ingroup Evas_Canvas
*/
EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj);
#include "canvas/evas_canvas.eo.legacy.h"
/**

View File

@ -88,37 +88,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
]]
}
}
@property engine_info {
set {
[[Applies the engine settings for the given evas from the
given $Evas_Engine_Info structure.
To get the Evas_Engine_Info structure to use, call
@.engine_info.get. Do not try to obtain a pointer to an
$Evas_Engine_Info structure in any other way.
You will need to call this function at least once before you
can create objects on an evas or render that evas. Some
engines allow their settings to be changed more than once.
Once called, the $info pointer should be considered invalid.
]]
return: bool; [[$true if no error occurred, $false otherwise.]]
}
get {
[[Retrieves the current render engine info struct from the given
evas.
The returned structure is publicly modifiable. The contents
are valid until either @.engine_info.set or @.render are called.
This structure does not need to be freed by the caller.
]]
}
values {
info: ptr(Evas.Engine_Info); [[The pointer to the engine info to use.]]
}
}
@property focus {
get {
[[Retrieve the object focused by the default seat.

View File

@ -421,9 +421,10 @@ _evas_canvas_efl_object_destructor(Eo *eo_e, Evas_Public_Data *e)
efl_destructor(efl_super(eo_e, MY_CLASS));
}
EOLIAN static Evas_Engine_Info*
_evas_canvas_engine_info_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
EAPI Evas_Engine_Info *
evas_engine_info_get(const Evas *obj)
{
const Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
Evas_Engine_Info *info;
if (!e->engine.info) return NULL;
@ -434,9 +435,11 @@ _evas_canvas_engine_info_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
return info;
}
EOLIAN static Eina_Bool
_evas_canvas_engine_info_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Engine_Info *info)
EAPI Eina_Bool
evas_engine_info_set(Evas *obj, Evas_Engine_Info *info)
{
Evas_Public_Data *e = efl_data_scope_get(obj, EVAS_CANVAS_CLASS);
if (!info) return EINA_FALSE;
if (info != e->engine.info) return EINA_FALSE;
if (info->magic != e->engine.info_magic) return EINA_FALSE;