From 83d1162171ec07c4d326f0bf07c7438327459a33 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Andre Date: Tue, 16 May 2017 16:25:23 +0900 Subject: [PATCH] evas: Remove Evas.Lock from EO This is a step towards the removal of the modifier & lock API as it is and use enums exclusively. Ref T5312 --- src/lib/evas/Evas_Common.h | 99 ---------------------- src/lib/evas/Evas_Legacy.h | 127 +++++++++++++++++++++++++++++ src/lib/evas/canvas/evas_canvas.eo | 14 ---- src/lib/evas/canvas/evas_key.c | 5 +- src/lib/evas/canvas/evas_types.eot | 2 - 5 files changed, 130 insertions(+), 117 deletions(-) diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 108d23c954..7b2bac7a02 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -3232,105 +3232,6 @@ EAPI void evas_language_reinit(void); * @ingroup Evas_Canvas */ -/** - * @addtogroup Evas_Keys - * @{ - */ - -/** - * Checks the state of a given modifier of the default seat, at the time of the - * call. If the modifier is set, such as shift being pressed, this - * function returns @c Eina_True. - * - * @param m The current modifiers set, as returned by - * evas_key_modifier_get(). - * @param keyname The name of the modifier key to check status for. - * - * @return @c Eina_True if the modifier key named @p keyname is on, @c - * Eina_False otherwise. - * - * @see evas_key_modifier_add - * @see evas_key_modifier_del - * @see evas_key_modifier_get - * @see evas_key_modifier_on - * @see evas_key_modifier_off - * @see evas_seat_key_modifier_is_set - */ -EAPI Eina_Bool evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); - -/** - * Checks the state of a given modifier key of a given seat, at the time of the - * call. If the modifier is set, such as shift being pressed, this - * function returns @c Eina_True. - * - * @param m The current modifiers set, as returned by - * evas_key_modifier_get(). - * @param keyname The name of the modifier key to check status for. - * @param seat The seat to check if the lock is set. Use @c NULL for the default seat. - * - * @return @c Eina_True if the modifier key named @p keyname is on, @c - * Eina_False otherwise. - * - * @see evas_key_modifier_add - * @see evas_key_modifier_del - * @see evas_key_modifier_get - * @see evas_key_modifier_on - * @see evas_key_modifier_off - * @see evas_seat_key_modifier_on - * @see evas_seat_key_modifier_off - * @see evas_key_modifier_is_set - * @since 1.19 - */ -EAPI Eina_Bool evas_seat_key_modifier_is_set(const Evas_Modifier *m, const char *keyname, const Evas_Device *seat) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); - -/** - * Checks the state of a given lock key of the default seat, at the time of the call. If - * the lock is set, such as caps lock, this function returns @c - * Eina_True. - * - * @param l The current locks set, as returned by evas_key_lock_get(). - * @param keyname The name of the lock key to check status for. - * - * @return @c Eina_True if the @p keyname lock key is set, @c - * Eina_False otherwise. - * - * @see evas_key_lock_get - * @see evas_key_lock_add - * @see evas_key_lock_del - * @see evas_key_lock_on - * @see evas_key_lock_off - * @see evas_seat_key_lock_on - * @see evas_seat_key_lock_off - * @see evas_seat_key_lock_is_set - */ -EAPI Eina_Bool evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); - -/** - * Checks the state of a given lock key of a given seat, at the time of the call. If - * the lock is set, such as caps lock, this function returns @c - * Eina_True. - * - * @param l The current locks set, as returned by evas_key_lock_get(). - * @param keyname The name of the lock key to check status for. - * @param seat The seat to check if the lock is set. Use @c NULL for the default seat. - * - * @return @c Eina_True if the @p keyname lock key is set, @c - * Eina_False otherwise. - * - * @see evas_key_lock_get - * @see evas_key_lock_add - * @see evas_key_lock_del - * @see evas_key_lock_on - * @see evas_key_lock_off - * @see evas_key_lock_is_set - * @since 1.19 - */ -EAPI Eina_Bool evas_seat_key_lock_is_set(const Evas_Lock *l, const char *keyname, const Evas_Device *seat) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); - -/** - * @} - */ - /** * @ingroup Evas_Font_Group * diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index c97c6a9382..8587624e83 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -87,6 +87,20 @@ EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj); #include "canvas/evas_canvas.eo.legacy.h" +/** + * @} + */ + +/** @addtogroup Evas_Keys + * @{ + */ + +/** + * An opaque type containing information on which lock keys are registered in + * an Evas canvas. + */ +typedef struct _Evas_Lock Evas_Lock; + /** * @} */ @@ -847,6 +861,15 @@ EAPI void evas_event_feed_hold(Evas *obj, int hold, unsigned int tim */ EAPI void evas_event_refeed_event(Evas *obj, void *event_copy, Evas_Callback_Type event_type); +/** + * @} + */ + +/** + * @addtogroup Evas_Keys + * @{ + */ + /** * A bitmask of modifier keys. * @@ -876,6 +899,110 @@ typedef unsigned long long Evas_Modifier_Mask; */ EAPI Evas_Modifier_Mask evas_key_modifier_mask_get(const Evas *evas, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2); +/** + * Checks the state of a given modifier of the default seat, at the time of the + * call. If the modifier is set, such as shift being pressed, this + * function returns @c Eina_True. + * + * @param m The current modifiers set, as returned by + * evas_key_modifier_get(). + * @param keyname The name of the modifier key to check status for. + * + * @return @c Eina_True if the modifier key named @p keyname is on, @c + * Eina_False otherwise. + * + * @see evas_key_modifier_add + * @see evas_key_modifier_del + * @see evas_key_modifier_get + * @see evas_key_modifier_on + * @see evas_key_modifier_off + * @see evas_seat_key_modifier_is_set + */ +EAPI Eina_Bool evas_key_modifier_is_set(const Evas_Modifier *m, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); + +/** + * Checks the state of a given modifier key of a given seat, at the time of the + * call. If the modifier is set, such as shift being pressed, this + * function returns @c Eina_True. + * + * @param m The current modifiers set, as returned by + * evas_key_modifier_get(). + * @param keyname The name of the modifier key to check status for. + * @param seat The seat to check if the lock is set. Use @c NULL for the default seat. + * + * @return @c Eina_True if the modifier key named @p keyname is on, @c + * Eina_False otherwise. + * + * @see evas_key_modifier_add + * @see evas_key_modifier_del + * @see evas_key_modifier_get + * @see evas_key_modifier_on + * @see evas_key_modifier_off + * @see evas_seat_key_modifier_on + * @see evas_seat_key_modifier_off + * @see evas_key_modifier_is_set + * @since 1.19 + */ +EAPI Eina_Bool evas_seat_key_modifier_is_set(const Evas_Modifier *m, const char *keyname, const Evas_Device *seat) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); + +/** + * Checks the state of a given lock key of the default seat, at the time of the call. If + * the lock is set, such as caps lock, this function returns @c + * Eina_True. + * + * @param l The current locks set, as returned by evas_key_lock_get(). + * @param keyname The name of the lock key to check status for. + * + * @return @c Eina_True if the @p keyname lock key is set, @c + * Eina_False otherwise. + * + * @see evas_key_lock_get + * @see evas_key_lock_add + * @see evas_key_lock_del + * @see evas_key_lock_on + * @see evas_key_lock_off + * @see evas_seat_key_lock_on + * @see evas_seat_key_lock_off + * @see evas_seat_key_lock_is_set + */ +EAPI Eina_Bool evas_key_lock_is_set(const Evas_Lock *l, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); + +/** + * Checks the state of a given lock key of a given seat, at the time of the call. If + * the lock is set, such as caps lock, this function returns @c + * Eina_True. + * + * @param l The current locks set, as returned by evas_key_lock_get(). + * @param keyname The name of the lock key to check status for. + * @param seat The seat to check if the lock is set. Use @c NULL for the default seat. + * + * @return @c Eina_True if the @p keyname lock key is set, @c + * Eina_False otherwise. + * + * @see evas_key_lock_get + * @see evas_key_lock_add + * @see evas_key_lock_del + * @see evas_key_lock_on + * @see evas_key_lock_off + * @see evas_key_lock_is_set + * @since 1.19 + */ +EAPI Eina_Bool evas_seat_key_lock_is_set(const Evas_Lock *l, const char *keyname, const Evas_Device *seat) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1, 2); + +/** + * @brief Returns a handle to the list of lock keys registered in the canvas + * @c e. + * + * This is required to check for which locks are set at a given time with the + * @ref evas_key_lock_is_set function. + * + * @return An Evas_Lock handle to query Evas' keys subsystem with @ref + * evas_key_lock_is_set or @ref evas_seat_key_lock_is_set, or @c null on error. + * + * @ingroup Evas_Canvas + */ +EAPI const Evas_Lock *evas_key_lock_get(const Evas *obj) EINA_WARN_UNUSED_RESULT; + /** * @} */ diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index 7a91da3c91..7de84b64be 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -142,20 +142,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, on it (if any) or $null otherwise.]] } } - @property key_lock { - get { - [[Returns a handle to the list of lock keys registered in the - canvas $e. - - This is required to check for which locks are set at a given - time with the \@ref evas_key_lock_is_set function. - ]] - return: ptr(const(Evas.Lock)) @warn_unused; [[ - An Evas_Lock handle to query Evas' keys subsystem with - \@ref evas_key_lock_is_set or \@ref evas_seat_key_lock_is_set, or $null on error. - ]] - } - } @property pointer_canvas_xy_by_device { [[This function returns the current known default pointer coordinates. @since 1.19]] get {} diff --git a/src/lib/evas/canvas/evas_key.c b/src/lib/evas/canvas/evas_key.c index dd2d56603f..3cc25702cc 100644 --- a/src/lib/evas/canvas/evas_key.c +++ b/src/lib/evas/canvas/evas_key.c @@ -37,9 +37,10 @@ _evas_canvas_key_modifier_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) return &(e->modifiers); } -EOLIAN const Evas_Lock* -_evas_canvas_key_lock_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e) +EAPI const Evas_Lock* +evas_key_lock_get(const Evas *eo_e) { + EVAS_LEGACY_API(eo_e, e, NULL); return &(e->locks); } diff --git a/src/lib/evas/canvas/evas_types.eot b/src/lib/evas/canvas/evas_types.eot index 1993adc8fd..8762c4327d 100644 --- a/src/lib/evas/canvas/evas_types.eot +++ b/src/lib/evas/canvas/evas_types.eot @@ -1,6 +1,4 @@ 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]] - // ---------------------------------------------------------------------------- // All the below types are for Evas 3D