From: Jean-Philippe Andre Date: Tue, 16 May 2017 07:25:23 +0000 (+0900) Subject: evas: Remove Evas.Lock from EO X-Git-Tag: upstream/1.20.0~1051 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83d1162171ec07c4d326f0bf07c7438327459a33;p=platform%2Fupstream%2Fefl.git 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 --- diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index 108d23c..7b2bac7 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -3233,105 +3233,6 @@ EAPI void evas_language_reinit(void); */ /** - * @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 c97c6a9..8587624 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -91,6 +91,20 @@ EAPI Evas_Engine_Info *evas_engine_info_get(const Evas *obj); * @} */ +/** @addtogroup Evas_Keys + * @{ + */ + +/** + * An opaque type containing information on which lock keys are registered in + * an Evas canvas. + */ +typedef struct _Evas_Lock Evas_Lock; + +/** + * @} + */ + /** * @ingroup Evas_Canvas_Events @@ -848,6 +862,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. * * See evas_key_modifier_mask_get() for the keyname to bit conversion. @@ -877,6 +900,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 7a91da3..7de84b6 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 dd2d566..3cc2570 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 1993adc..8762c43 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