evas: Remove font_hinting from EO

We only need it in elm_config.
This removes the type Evas_Font_Hinting_Flags from EO,
as well as the functions font_hinting_set/get and
font_hinting_can_hint.

Ref T5312
This commit is contained in:
Jean-Philippe Andre 2017-05-15 16:47:34 +09:00
parent da229e34aa
commit a1abc129ec
7 changed files with 66 additions and 48 deletions

View File

@ -31,6 +31,7 @@ interface Efl.Config ()
}
/* NOTES:
- Font hinting seems to be missing!
- Elm_Color_Class list -> no need to return the struct, only the name matters
but also provide func to get desc from name
- Elm_Color_Overlay -> see with Jee-Yong and his color patch (common intf)

View File

@ -691,6 +691,57 @@ EAPI void evas_touch_point_list_nth_xy_get(Evas *eo_e, unsigned int n, Evas_Coor
*/
EAPI void evas_font_available_list_free(Evas *e, Eina_List *available) EINA_ARG_NONNULL(1);
/** Flags for Font Hinting
*
* @ingroup Evas_Font
*/
typedef enum
{
EVAS_FONT_HINTING_NONE = 0, /**< No font hinting */
EVAS_FONT_HINTING_AUTO, /**< Automatic font hinting */
EVAS_FONT_HINTING_BYTECODE /**< Bytecode font hinting */
} Evas_Font_Hinting_Flags;
/**
* @brief Changes the font hinting for the given evas.
*
* #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
*
* @param[in] hinting The used hinting, one of #EVAS_FONT_HINTING_NONE,
* #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
*
* @ingroup Evas_Font_Group
*/
EAPI void evas_font_hinting_set(Evas *e, Evas_Font_Hinting_Flags hinting);
/**
* @brief Retrieves the font hinting used by the given evas.
*
* @return The used hinting, one of #EVAS_FONT_HINTING_NONE,
* #EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
*
* @ingroup Evas_Font_Group
*/
EAPI Evas_Font_Hinting_Flags evas_font_hinting_get(const Evas *e);
/**
* @brief Checks if the font hinting is supported by the given evas.
*
* One of #EVAS_FONT_HINTING_NONE, #EVAS_FONT_HINTING_AUTO,
* #EVAS_FONT_HINTING_BYTECODE.
*
* @param[in] hinting The hinting to use.
*
* @return @c true if it is supported, @c false otherwise.
*
* @ingroup Evas_Canvas
*/
EAPI Eina_Bool evas_font_hinting_can_hint(const Evas *e, Evas_Font_Hinting_Flags hinting) EINA_WARN_UNUSED_RESULT;
/**
* @}
*/
/**
* @ingroup Evas_Object_Group_Basic
*

View File

@ -71,23 +71,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
data: void_ptr; [[The attached pointer.]]
}
}
@property font_hinting {
set {
[[Changes the font hinting for the given evas.
#EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
]]
}
get {
[[Retrieves the font hinting used by the given evas.]]
}
values {
hinting: Evas.Font.Hinting_Flags; [[
The used hinting, one of #EVAS_FONT_HINTING_NONE,
#EVAS_FONT_HINTING_AUTO, #EVAS_FONT_HINTING_BYTECODE.
]]
}
}
@property focus {
get {
[[Retrieve the object focused by the default seat.
@ -698,17 +681,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface,
[[Force the given evas and associated engine to flush its font cache.]]
}
font_hinting_can_hint @const {
[[Checks if the font hinting is supported by the given evas.
One of #EVAS_FONT_HINTING_NONE, #EVAS_FONT_HINTING_AUTO,
#EVAS_FONT_HINTING_BYTECODE.
]]
return: bool @warn_unused; [[$true if it is supported, $false otherwise.]]
params {
@in hinting: Evas.Font.Hinting_Flags; [[The hinting to use.]]
}
}
object_top_at_xy_get @const {
[[Retrieve the Evas object stacked at the top of a given position
in a canvas.

View File

@ -1445,11 +1445,12 @@ evas_font_object_rehint(Evas_Object *eo_obj)
}
}
EOLIAN void
_evas_canvas_font_hinting_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting)
EAPI void
evas_font_hinting_set(Eo *eo_e, Evas_Font_Hinting_Flags hinting)
{
Evas_Layer *lay;
EVAS_LEGACY_API(eo_e, e);
evas_canvas_async_block(e);
if (e->hinting == hinting) return;
e->hinting = hinting;
@ -1463,15 +1464,17 @@ _evas_canvas_font_hinting_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Fo
}
}
EOLIAN Evas_Font_Hinting_Flags
_evas_canvas_font_hinting_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
EAPI Evas_Font_Hinting_Flags
evas_font_hinting_get(const Evas *eo_e)
{
EVAS_LEGACY_API(eo_e, e, EVAS_FONT_HINTING_NONE);
return e->hinting;
}
EOLIAN Eina_Bool
_evas_canvas_font_hinting_can_hint(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, Evas_Font_Hinting_Flags hinting)
EAPI Eina_Bool
evas_font_hinting_can_hint(const Evas *eo_e, Evas_Font_Hinting_Flags hinting)
{
EVAS_LEGACY_API(eo_e, e, EINA_FALSE);
if (e->engine.func->font_hinting_can_hint && _evas_engine_context(e))
return e->engine.func->font_hinting_can_hint(_evas_engine_context(e),
hinting);

View File

@ -1,11 +1,6 @@
#include "evas_common_private.h"
#include "evas_private.h"
#define EVAS_LEGACY_API(_obj, _e, ...) \
Evas_Public_Data *_e = (_obj && efl_isa(_obj, EVAS_CANVAS_CLASS)) ? \
efl_data_scope_get(_obj, EVAS_CANVAS_CLASS) : NULL; \
if (!_e) return __VA_ARGS__
void
_evas_touch_point_append(Evas *eo_e, int id, Evas_Coord x, Evas_Coord y)
{

View File

@ -3,15 +3,6 @@ type @extern Evas.Load_Error: int; [[Evas load error type]] /* FIXME: Need to mi
type Evas.Modifier_Mask: ullong; [[An Evas modifier mask type]]
type Evas.Coord: int; [[A type for coordinates]]
enum Evas.Font.Hinting_Flags {
[[Flags for Font Hinting]]
legacy: Evas_Font_Hinting;
none, [[No font hinting]]
auto, [[Automatic font hinting]]
bytecode [[Bytecode font hinting]]
}
struct Evas.Modifier; [[An opaque type containing information on which modifier keys are registered in an Evas canvas]]
struct Evas.Lock; [[An opaque type containing information on which lock keys are registered in an Evas canvas]]

View File

@ -630,6 +630,11 @@ MAGIC_CHECK_FAILED(o, t, m)
} } while (0)
#endif
#define EVAS_LEGACY_API(_obj, _e, ...) \
Evas_Public_Data *_e = (_obj && efl_isa(_obj, EVAS_CANVAS_CLASS)) ? \
efl_data_scope_get(_obj, EVAS_CANVAS_CLASS) : NULL; \
if (!_e) return __VA_ARGS__
#define EVAS_OBJECT_IMAGE_FREE_FILE_AND_KEY(cur, prev) \
if (cur->u.file && !cur->mmaped_source) \
{ \