summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-20 15:17:32 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-06-20 17:25:42 +0200
commitb0c29edd7853abd893559d84a29b89a7bd201e50 (patch)
treeec2257fb504b4ab828d9e58889796f2c4da637ec
parent6b8900d4fc694ac714ba0b04dacb7b5f4968496c (diff)
efl_input_device: split up has_pointer_cap
it was somehow confusing that this function was used for two different things. Now we have 2 functions for checking is it is of pointer_type or how many pointer devices are in a seat. ref T7963 Reviewed-by: Chris Michael <cp.michael@samsung.com> Differential Revision: https://phab.enlightenment.org/D9142
-rw-r--r--src/lib/efl/interfaces/efl_input_device.c11
-rw-r--r--src/lib/efl/interfaces/efl_input_device.eo25
2 files changed, 28 insertions, 8 deletions
diff --git a/src/lib/efl/interfaces/efl_input_device.c b/src/lib/efl/interfaces/efl_input_device.c
index 4924f1f9d0..bd77780e00 100644
--- a/src/lib/efl/interfaces/efl_input_device.c
+++ b/src/lib/efl/interfaces/efl_input_device.c
@@ -213,12 +213,19 @@ _efl_input_device_children_iterate(Eo *obj, Efl_Input_Device_Data *pd)
213 return &it->iterator; 213 return &it->iterator;
214} 214}
215 215
216EOLIAN static unsigned int 216EOLIAN static int
217_efl_input_device_has_pointer_caps(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd) 217_efl_input_device_pointer_device_count_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
218{ 218{
219 if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT) 219 if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
220 return pd->pointer_count; 220 return pd->pointer_count;
221 return -1;
222}
223
224EOLIAN static Eina_Bool
225_efl_input_device_is_pointer_type_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
226{
221 return _is_pointer(pd); 227 return _is_pointer(pd);
222} 228}
223 229
230
224#include "interfaces/efl_input_device.eo.c" 231#include "interfaces/efl_input_device.eo.c"
diff --git a/src/lib/efl/interfaces/efl_input_device.eo b/src/lib/efl/interfaces/efl_input_device.eo
index 28ec10eb5d..d296c5cafc 100644
--- a/src/lib/efl/interfaces/efl_input_device.eo
+++ b/src/lib/efl/interfaces/efl_input_device.eo
@@ -67,14 +67,27 @@ class @beta Efl.Input.Device extends Efl.Object
67 ]] 67 ]]
68 return: iterator<const(Efl.Input.Device)> @owned; [[List of device children]] 68 return: iterator<const(Efl.Input.Device)> @owned; [[List of device children]]
69 } 69 }
70 has_pointer_caps { 70 @property pointer_device_count {
71 [[Determine whether a device has pointer capabilities. 71 [[The number of pointer devices in this seat.
72 72
73 Returns 1 for Mouse, Touch, Pen, Pointer, and Wand type devices. 73 Pointer devices are the ones whose @.device_type is $mouse, $pen, $touch or $wand.
74 74 In case this device is not of the type $seat, -1 is returned.
75 If a seat device is passed returns the number of pointer devices in the seat.
76 ]] 75 ]]
77 return: uint; [[Pointer caps]] 76 get {
77
78 }
79 values {
80 devices : int; [[The number of pointer devices.]]
81 }
82 }
83 @property is_pointer_type {
84 [[$true if @.device_type is $mouse, $pen, $touch or $wand.]]
85 get {
86
87 }
88 values {
89 pointer_type : bool; [[$true if the device has pointing capabilities.]]
90 }
78 } 91 }
79 } 92 }
80 implements { 93 implements {