From a1abc129ec5d8e3b6ae5009b4ebdc613fbf747c8 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Mon, 15 May 2017 16:47:34 +0900 Subject: [PATCH] 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 --- src/lib/efl/interfaces/efl_config.eo | 1 + src/lib/evas/Evas_Legacy.h | 51 ++++++++++++++++++++++++++ src/lib/evas/canvas/evas_canvas.eo | 28 -------------- src/lib/evas/canvas/evas_font_dir.c | 15 +++++--- src/lib/evas/canvas/evas_touch_point.c | 5 --- src/lib/evas/canvas/evas_types.eot | 9 ----- src/lib/evas/include/evas_private.h | 5 +++ 7 files changed, 66 insertions(+), 48 deletions(-) diff --git a/src/lib/efl/interfaces/efl_config.eo b/src/lib/efl/interfaces/efl_config.eo index 33c4d1a519..27ac9fca63 100644 --- a/src/lib/efl/interfaces/efl_config.eo +++ b/src/lib/efl/interfaces/efl_config.eo @@ -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) diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 559055a877..3710de43de 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -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 * diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index af7e9155d1..062f1196e5 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -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. diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 1b7041c76e..8e0692de87 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -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); diff --git a/src/lib/evas/canvas/evas_touch_point.c b/src/lib/evas/canvas/evas_touch_point.c index db7d4c2734..c266675a44 100644 --- a/src/lib/evas/canvas/evas_touch_point.c +++ b/src/lib/evas/canvas/evas_touch_point.c @@ -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) { diff --git a/src/lib/evas/canvas/evas_types.eot b/src/lib/evas/canvas/evas_types.eot index 38aab6e425..c64bdd6832 100644 --- a/src/lib/evas/canvas/evas_types.eot +++ b/src/lib/evas/canvas/evas_types.eot @@ -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]] diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 9ee190d1fe..94ad660b21 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -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) \ { \