evas: Add seat arg to modifier/lock EO APIs
authorJean-Philippe Andre <jp.andre@samsung.com>
Tue, 16 May 2017 08:41:09 +0000 (17:41 +0900)
committerJean-Philippe Andre <jp.andre@samsung.com>
Tue, 16 May 2017 11:47:49 +0000 (20:47 +0900)
This now matches the new seat-related set of APIs present as EAPI.

src/lib/elementary/efl_ui_win.c
src/lib/evas/canvas/efl_input_key.c
src/lib/evas/canvas/efl_input_pointer.c
src/lib/evas/canvas/efl_input_state.eo

index dcd41a4..0c7f244 100644 (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
index 7f6d794..ade0e41 100644 (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);
index 6eec18e..02b0727 100644 (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);
index 41a0ed5..19f5c18 100644 (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.]]