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.
This commit is contained in:
parent
2fb5747fc9
commit
fd35532d9e
|
@ -591,6 +591,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);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
|
|
@ -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
|
||||
]]
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue