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
This commit is contained in:
Marcel Hollerbach 2019-06-20 15:17:32 +02:00
parent 6b8900d4fc
commit b0c29edd78
2 changed files with 28 additions and 8 deletions

View File

@ -213,12 +213,19 @@ _efl_input_device_children_iterate(Eo *obj, Efl_Input_Device_Data *pd)
return &it->iterator;
}
EOLIAN static unsigned int
_efl_input_device_has_pointer_caps(Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
EOLIAN static int
_efl_input_device_pointer_device_count_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
{
if (pd->klass == EFL_INPUT_DEVICE_TYPE_SEAT)
return pd->pointer_count;
return -1;
}
EOLIAN static Eina_Bool
_efl_input_device_is_pointer_type_get(const Eo *obj EINA_UNUSED, Efl_Input_Device_Data *pd)
{
return _is_pointer(pd);
}
#include "interfaces/efl_input_device.eo.c"

View File

@ -67,14 +67,27 @@ class @beta Efl.Input.Device extends Efl.Object
]]
return: iterator<const(Efl.Input.Device)> @owned; [[List of device children]]
}
has_pointer_caps {
[[Determine whether a device has pointer capabilities.
@property pointer_device_count {
[[The number of pointer devices in this seat.
Returns 1 for Mouse, Touch, Pen, Pointer, and Wand type devices.
If a seat device is passed returns the number of pointer devices in the seat.
Pointer devices are the ones whose @.device_type is $mouse, $pen, $touch or $wand.
In case this device is not of the type $seat, -1 is returned.
]]
return: uint; [[Pointer caps]]
get {
}
values {
devices : int; [[The number of pointer devices.]]
}
}
@property is_pointer_type {
[[$true if @.device_type is $mouse, $pen, $touch or $wand.]]
get {
}
values {
pointer_type : bool; [[$true if the device has pointing capabilities.]]
}
}
}
implements {