evas: Add seat arg to modifier/lock EO APIs

This now matches the new seat-related set of APIs present as EAPI.
This commit is contained in:
Jean-Philippe Andre 2017-05-16 17:41:09 +09:00
parent 4c81e0c5b9
commit 01d4886328
4 changed files with 36 additions and 20 deletions

View File

@ -6557,19 +6557,21 @@ _efl_ui_win_elm_interface_atspi_component_extents_get(Eo *obj, Efl_Ui_Win_Data *
}
EOLIAN static Eina_Bool
_efl_ui_win_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Efl_Input_Modifier mod)
_efl_ui_win_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
const Evas_Modifier *m = evas_key_modifier_get(pd->evas);
const char *name = _efl_input_modifier_to_string(mod);
return evas_key_modifier_is_set(m, name);
return evas_seat_key_modifier_is_set(m, name, seat);
}
EOLIAN static Eina_Bool
_efl_ui_win_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, Efl_Input_Lock lock)
_efl_ui_win_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
const Evas_Lock *m = evas_key_lock_get(pd->evas);
const char *name = _efl_input_lock_to_string(lock);
return evas_key_lock_is_set(m, name);
return evas_seat_key_lock_is_set(m, name, seat);
}
// See evas_inline.x

View File

@ -240,28 +240,34 @@ _efl_input_key_efl_input_event_device_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Dat
}
EOLIAN static Eina_Bool
_efl_input_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Efl_Input_Modifier mod)
_efl_input_key_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
Efl_Input_Device *seat;
const char *name;
if (!pd->modifiers) return EINA_FALSE;
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
if (!seat)
{
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
}
name = _efl_input_modifier_to_string(mod);
if (!name) return EINA_FALSE;
return evas_seat_key_modifier_is_set(pd->modifiers, name, seat);
}
EOLIAN static Eina_Bool
_efl_input_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd, Efl_Input_Lock lock)
_efl_input_key_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Key_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
Efl_Input_Device *seat;
const char *name;
if (!pd->locks) return EINA_FALSE;
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
if (!seat)
{
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
}
name = _efl_input_lock_to_string(lock);
if (!name) return EINA_FALSE;
return evas_seat_key_lock_is_set(pd->locks, name, seat);

View File

@ -323,28 +323,34 @@ _efl_input_pointer_tool_set(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, int
}
EOLIAN static Eina_Bool
_efl_input_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Modifier mod)
_efl_input_pointer_efl_input_state_modifier_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
Efl_Input_Modifier mod, const Efl_Input_Device *seat)
{
Efl_Input_Device *seat;
const char *name;
if (!pd->modifiers) return EINA_FALSE;
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
if (!seat)
{
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
}
name = _efl_input_modifier_to_string(mod);
if (!name) return EINA_FALSE;
return evas_seat_key_modifier_is_set(pd->modifiers, name, seat);
}
EOLIAN static Eina_Bool
_efl_input_pointer_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd, Efl_Input_Lock lock)
_efl_input_pointer_efl_input_state_lock_enabled_get(Eo *obj EINA_UNUSED, Efl_Input_Pointer_Data *pd,
Efl_Input_Lock lock, const Efl_Input_Device *seat)
{
Efl_Input_Device *seat;
const char *name;
if (!pd->locks) return EINA_FALSE;
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
if (!seat)
{
seat = efl_input_device_seat_get(pd->device);
if (!seat) return EINA_FALSE;
}
name = _efl_input_lock_to_string(lock);
if (!name) return EINA_FALSE;
return evas_seat_key_lock_is_set(pd->locks, name, seat);

View File

@ -10,6 +10,7 @@ interface Efl.Input.State ()
get {}
keys {
mod: Efl.Input.Modifier; [[The modifier key to test.]]
seat: const(Efl.Input.Device) @optional; [[The seat device, may be $null]]
}
values {
is_set: bool; [[$true if the key modifier is pressed.]]
@ -20,6 +21,7 @@ interface Efl.Input.State ()
get {}
keys {
lock: Efl.Input.Lock; [[The lock key to test.]]
seat: const(Efl.Input.Device) @optional; [[The seat device, may be $null]]
}
values {
is_set: bool; [[$true if the key lock is on.]]