2019-07-10 08:25:15 -07:00
|
|
|
enum Efl.Input.Device_Type
|
2016-04-28 01:08:14 -07:00
|
|
|
{
|
|
|
|
[[General type of input device.
|
|
|
|
|
2017-06-11 22:56:36 -07:00
|
|
|
Legacy support since 1.8 as $Evas_Device_Class.
|
2016-04-28 01:08:14 -07:00
|
|
|
]]
|
|
|
|
none, [[Not a device.]]
|
|
|
|
seat, [[The user/seat (the user themselves).]]
|
|
|
|
keyboard, [[A regular keyboard, numberpad or attached buttons.]]
|
|
|
|
mouse, [[A mouse, trackball or touchpad relative motion device.]]
|
|
|
|
touch, [[A touchscreen with fingers or stylus.]]
|
|
|
|
pen, [[A special pen device.]]
|
2017-12-22 02:41:11 -08:00
|
|
|
wand, [[A laser pointer, wii-style or "Minority Report" pointing device.]]
|
2016-04-28 01:08:14 -07:00
|
|
|
gamepad, [[A gamepad controller or joystick.]]
|
|
|
|
}
|
|
|
|
|
2017-05-23 21:26:51 -07:00
|
|
|
/* TODO: Add canvas property. Current problem is we need to return
|
|
|
|
Efl.Ui.Win and not Evas:
|
|
|
|
@property canvas { values { canvas: Efl.Canvas; } }
|
|
|
|
*/
|
2016-04-28 01:08:14 -07:00
|
|
|
|
2019-07-10 08:25:15 -07:00
|
|
|
class Efl.Input.Device extends Efl.Object
|
2016-04-28 01:08:14 -07:00
|
|
|
{
|
2017-12-22 02:41:11 -08:00
|
|
|
[[Represents a pointing device such as a touch finger, pen or mouse.
|
2016-04-28 01:08:14 -07:00
|
|
|
]]
|
|
|
|
methods {
|
|
|
|
@property device_type {
|
2018-02-12 09:56:31 -08:00
|
|
|
[[Device type property]]
|
2016-04-28 01:08:14 -07:00
|
|
|
values {
|
2018-05-23 01:56:08 -07:00
|
|
|
klass: Efl.Input.Device_Type; [[Input device class]]
|
2016-04-28 01:08:14 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property source {
|
2018-02-12 09:56:31 -08:00
|
|
|
[[Device source property]]
|
2016-04-28 01:08:14 -07:00
|
|
|
values {
|
2016-11-01 06:18:26 -07:00
|
|
|
src: Efl.Input.Device; [[Input device]]
|
2016-04-28 01:08:14 -07:00
|
|
|
}
|
|
|
|
}
|
2016-11-08 13:12:28 -08:00
|
|
|
@property seat {
|
|
|
|
[[Get the @Efl.Input.Device that represents a seat.
|
|
|
|
|
|
|
|
This method will find the seat the device belongs to.
|
|
|
|
|
|
|
|
For this, it walk through device's parents looking for a device
|
2018-05-23 01:56:08 -07:00
|
|
|
with @Efl.Input.Device_Type.seat. It may be
|
2016-11-08 13:12:28 -08:00
|
|
|
the device itself.
|
|
|
|
|
|
|
|
In case no seat is found, $null is returned.
|
|
|
|
]]
|
|
|
|
get {}
|
|
|
|
values {
|
|
|
|
seat: Efl.Input.Device; [[The seat this device belongs to.]]
|
|
|
|
}
|
|
|
|
}
|
2017-05-17 13:02:53 -07:00
|
|
|
@property seat_id {
|
|
|
|
[[Seat id number
|
|
|
|
]]
|
|
|
|
values {
|
|
|
|
id: uint; [[The id of the seat]]
|
|
|
|
}
|
|
|
|
}
|
2017-05-23 21:26:51 -07:00
|
|
|
children_iterate {
|
|
|
|
[[Lists the children attached to this device.
|
|
|
|
|
2017-06-07 01:36:50 -07:00
|
|
|
This is only meaningful with seat devices, as they are groups of
|
2017-05-23 21:26:51 -07:00
|
|
|
real input devices.
|
|
|
|
]]
|
2017-09-15 07:57:44 -07:00
|
|
|
return: iterator<const(Efl.Input.Device)> @owned; [[List of device children]]
|
2017-05-23 21:26:51 -07:00
|
|
|
}
|
2019-06-20 06:17:32 -07:00
|
|
|
@property pointer_device_count {
|
|
|
|
[[The number of pointer devices in this seat.
|
2017-06-09 17:16:07 -07:00
|
|
|
|
2019-06-20 06:17:32 -07:00
|
|
|
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.
|
2017-06-09 17:16:07 -07:00
|
|
|
]]
|
2019-06-20 06:17:32 -07:00
|
|
|
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.]]
|
|
|
|
}
|
2017-06-09 17:16:07 -07:00
|
|
|
}
|
2016-04-28 01:08:14 -07:00
|
|
|
}
|
|
|
|
implements {
|
2016-08-10 07:23:04 -07:00
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.destructor;
|
2017-06-07 01:36:50 -07:00
|
|
|
Efl.Object.parent { set; }
|
2016-04-28 01:08:14 -07:00
|
|
|
}
|
|
|
|
}
|