summaryrefslogtreecommitdiff
path: root/src/lib/efl/interfaces/efl_input_device.eo
blob: d296c5cafcbd12c48f7fca678b9ea82bb541f28a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
enum @beta Efl.Input.Device_Type
{
   [[General type of input device.

     Legacy support since 1.8 as $Evas_Device_Class.
   ]]
   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.]]
   wand,     [[A laser pointer, wii-style or "Minority Report" pointing device.]]
   gamepad,  [[A gamepad controller or joystick.]]
}

/* TODO: Add canvas property. Current problem is we need to return
         Efl.Ui.Win and not Evas:
  @property canvas { values { canvas: Efl.Canvas; } }
*/

class @beta Efl.Input.Device extends Efl.Object
{
   [[Represents a pointing device such as a touch finger, pen or mouse.
   ]]
   methods {
      @property device_type {
          [[Device type property]]
         values {
            klass: Efl.Input.Device_Type; [[Input device class]]
         }
      }
      @property source {
          [[Device source property]]
         values {
            src: Efl.Input.Device; [[Input device]]
         }
      }
      @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
           with @Efl.Input.Device_Type.seat. It may be
           the device itself.

           In case no seat is found, $null is returned.
         ]]
         get {}
         values {
            seat: Efl.Input.Device; [[The seat this device belongs to.]]
         }
      }
      @property seat_id {
         [[Seat id number
         ]]
          values {
             id: uint; [[The id of the seat]]
          }
      }
      children_iterate {
         [[Lists the children attached to this device.

           This is only meaningful with seat devices, as they are groups of
           real input devices.
         ]]
         return: iterator<const(Efl.Input.Device)> @owned; [[List of device children]]
      }
      @property pointer_device_count {
         [[The number of pointer devices in this 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.
         ]]
         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 {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Efl.Object.parent { set; }
   }
}