diff options
Diffstat (limited to 'src/lib/evas/canvas/efl_input_device.eo')
-rw-r--r-- | src/lib/evas/canvas/efl_input_device.eo | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/efl_input_device.eo b/src/lib/evas/canvas/efl_input_device.eo new file mode 100644 index 0000000..dda39b1 --- /dev/null +++ b/src/lib/evas/canvas/efl_input_device.eo | |||
@@ -0,0 +1,102 @@ | |||
1 | enum Efl.Input.Device_Type | ||
2 | { | ||
3 | [[General type of input device. | ||
4 | |||
5 | Legacy support since 1.8 as $Evas_Device_Class. | ||
6 | |||
7 | @since 1.23 | ||
8 | ]] | ||
9 | none, [[Not a device.]] | ||
10 | seat, [[The user/seat (the user themselves).]] | ||
11 | keyboard, [[A regular keyboard, numberpad or attached buttons.]] | ||
12 | mouse, [[A mouse, trackball or touchpad relative motion device.]] | ||
13 | touch, [[A touchscreen with fingers or stylus.]] | ||
14 | pen, [[A special pen device.]] | ||
15 | wand, [[A laser pointer, wii-style or "Minority Report" pointing device.]] | ||
16 | gamepad, [[A gamepad controller or joystick.]] | ||
17 | } | ||
18 | |||
19 | /* TODO: Add canvas property. Current problem is we need to return | ||
20 | Efl.Ui.Win and not Evas: | ||
21 | @property canvas { values { canvas: Efl.Canvas; } } | ||
22 | */ | ||
23 | |||
24 | class Efl.Input.Device extends Efl.Object | ||
25 | { | ||
26 | [[Represents a pointing device such as a touch finger, pen or mouse. | ||
27 | |||
28 | @since 1.23 | ||
29 | ]] | ||
30 | methods { | ||
31 | @property device_type { | ||
32 | [[Device type property]] | ||
33 | values { | ||
34 | klass: Efl.Input.Device_Type; [[Input device class]] | ||
35 | } | ||
36 | } | ||
37 | @property source { | ||
38 | [[Device source property]] | ||
39 | values { | ||
40 | src: Efl.Input.Device; [[Input device]] | ||
41 | } | ||
42 | } | ||
43 | @property seat { | ||
44 | [[Get the @Efl.Input.Device that represents a seat. | ||
45 | |||
46 | This method will find the seat the device belongs to. | ||
47 | |||
48 | For this, it walk through device's parents looking for a device | ||
49 | with @Efl.Input.Device_Type.seat. It may be | ||
50 | the device itself. | ||
51 | |||
52 | In case no seat is found, $null is returned. | ||
53 | ]] | ||
54 | get {} | ||
55 | values { | ||
56 | seat: Efl.Input.Device; [[The seat this device belongs to.]] | ||
57 | } | ||
58 | } | ||
59 | @property seat_id { | ||
60 | [[Seat id number | ||
61 | ]] | ||
62 | values { | ||
63 | id: uint; [[The id of the seat]] | ||
64 | } | ||
65 | } | ||
66 | children_iterate { | ||
67 | [[Lists the children attached to this device. | ||
68 | |||
69 | This is only meaningful with seat devices, as they are groups of | ||
70 | real input devices. | ||
71 | ]] | ||
72 | return: iterator<const(Efl.Input.Device)> @move; [[List of device children]] | ||
73 | } | ||
74 | @property pointer_device_count { | ||
75 | [[The number of pointer devices in this seat. | ||
76 | |||
77 | Pointer devices are the ones whose @.device_type is $mouse, $pen, $touch or $wand. | ||
78 | In case this device is not of the type $seat, -1 is returned. | ||
79 | ]] | ||
80 | get { | ||
81 | |||
82 | } | ||
83 | values { | ||
84 | devices : int; [[The number of pointer devices.]] | ||
85 | } | ||
86 | } | ||
87 | @property is_pointer_type { | ||
88 | [[$true if @.device_type is $mouse, $pen, $touch or $wand.]] | ||
89 | get { | ||
90 | |||
91 | } | ||
92 | values { | ||
93 | pointer_type : bool; [[$true if the device has pointing capabilities.]] | ||
94 | } | ||
95 | } | ||
96 | } | ||
97 | implements { | ||
98 | Efl.Object.constructor; | ||
99 | Efl.Object.destructor; | ||
100 | Efl.Object.parent { set; } | ||
101 | } | ||
102 | } | ||