diff options
author | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-05-16 14:38:26 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-05-16 20:47:47 +0900 |
commit | fd35532d9e05ffe56d975a1aae7188a6a9340e77 (patch) | |
tree | 2022feb590cceae3f67769e5b8f79ea44a6e6283 | |
parent | 2fb5747fc9be908222740e9a8ad610ae48e33add (diff) | |
download | efl-fd35532d9e05ffe56d975a1aae7188a6a9340e77.tar.gz |
evas: Remove evas_key_modifier_mask_get from EO
Such an ugly API. This is an API to match a string to a number,
build a bitmask from it, and then use that. The supported
strings are well known (should be enum) and would need a
recompilation (ABI update) to support anything new anyway.
-rw-r--r-- | src/lib/evas/Evas_Legacy.h | 29 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_canvas.eo | 25 | ||||
-rw-r--r-- | src/lib/evas/canvas/evas_key.c | 5 |
3 files changed, 34 insertions, 25 deletions
diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h index 3710de43de..7cbb074189 100644 --- a/src/lib/evas/Evas_Legacy.h +++ b/src/lib/evas/Evas_Legacy.h @@ -592,6 +592,35 @@ 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); /** + * A bitmask of modifier keys. + * + * See evas_key_modifier_mask_get() for the keyname to bit conversion. + */ +typedef unsigned long long Evas_Modifier_Mask; + +/** + * @brief Creates a bit mask from the @c keyname modifier key. Values returned + * from different calls to it may be ORed together, naturally. + * + * This function is meant to be using in conjunction with @ref + * evas_object_key_grab/\@ref evas_object_key_ungrab. Go check their + * documentation for more information. + * + * See also @ref evas_key_modifier_add, @ref evas_key_modifier_get, + * @ref evas_key_modifier_on, @ref evas_key_modifier_off, + * @ref evas_seat_key_modifier_on, @ref evas_seat_key_modifier_off, @ref + * evas_key_modifier_is_set, @ref evas_seat_key_modifier_is_set.. + * + * @param[in] keyname The name of the modifier key to create the mask for. + * + * @return The bit mask or 0 if the @c keyname key wasn't registered as a + * modifier for canvas @c e. + * + * @ingroup Evas_Canvas + */ +EAPI Evas_Modifier_Mask evas_key_modifier_mask_get(const Evas *evas, const char *keyname) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(2); + +/** * @} */ diff --git a/src/lib/evas/canvas/evas_canvas.eo b/src/lib/evas/canvas/evas_canvas.eo index 7d80c43439..7a91da3c91 100644 --- a/src/lib/evas/canvas/evas_canvas.eo +++ b/src/lib/evas/canvas/evas_canvas.eo @@ -496,27 +496,6 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, @in seat: Efl.Input.Device; [[The seat to disable the keylock. A $null seat repesents the default seat.]] } } - key_modifier_mask_get @const { - [[Creates a bit mask from the $keyname modifier key. Values - returned from different calls to it may be ORed together, - naturally. - - This function is meant to be using in conjunction with - \@ref evas_object_key_grab/\@ref evas_object_key_ungrab. - Go check their documentation for more information. - - See also @.key_modifier_add, \@ref evas_key_modifier_get, - @.key_modifier_on, @.key_modifier_off, @.seat_key_modifier_on, @.seat_key_modifier_off, - \@ref evas_key_modifier_is_set, \@ref evas_seat_key_modifier_is_set.. - ]] - return: Evas.Modifier_Mask @warn_unused; [[ - The bit mask or 0 if the $keyname key wasn't registered as a - modifier for canvas $e. - ]] - params { - @in keyname: string @nonull; [[The name of the modifier key to create the mask for.]] - } - } key_modifier_add { [[Adds the $keyname key to the current list of modifier keys. @@ -548,7 +527,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, name $keyname for the default seat. See also @.key_modifier_add, \@ref evas_key_modifier_get, - @.key_modifier_on, @.key_modifier_mask_get, @.seat_key_modifier_off, + @.key_modifier_on, @.seat_key_modifier_off, @.seat_key_modifier_off, \@ref evas_key_modifier_is_set, \@ref evas_seat_key_modifier_is_set. ]] params { @@ -743,7 +722,7 @@ class Evas.Canvas (Efl.Object, Efl.Canvas, Efl.Animator, Efl.Input.Interface, name $keyname for a given seat. See also @.key_modifier_add, \@ref evas_key_modifier_get, - @.key_modifier_on, @.key_modifier_mask_get, @.seat_key_modifier_off, + @.key_modifier_on, @.seat_key_modifier_off, @.seat_key_modifier_off, \@ref evas_key_modifier_is_set, \@ref evas_seat_key_modifier_is_set. @since 1.19 ]] diff --git a/src/lib/evas/canvas/evas_key.c b/src/lib/evas/canvas/evas_key.c index 0afe5e633a..dd2d56603f 100644 --- a/src/lib/evas/canvas/evas_key.c +++ b/src/lib/evas/canvas/evas_key.c @@ -265,12 +265,13 @@ _evas_canvas_key_lock_off(Eo *eo_e, Evas_Public_Data *e, const char *keyname) /* errr need to add key grabbing/ungrabbing calls - missing modifier stuff. */ -EOLIAN Evas_Modifier_Mask -_evas_canvas_key_modifier_mask_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *keyname) +EAPI Evas_Modifier_Mask +evas_key_modifier_mask_get(const Evas *eo_e, const char *keyname) { int n; if (!keyname) return 0; + EVAS_LEGACY_API(eo_e, e, 0); n = evas_key_modifier_number(&(e->modifiers), keyname); if (n < 0 || n > 63) return 0; return 1ULL << n; |