Mir
touch_event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU Lesser General Public License version 3,
6  * as published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Robert Carr <robert.carr@canonical.com>
17  */
18 
19 #ifndef MIR_TOOLKIT_TOUCH_EVENT_H_
20 #define MIR_TOOLKIT_TOUCH_EVENT_H_
21 
22 #ifdef __cplusplus
23 
27 extern "C" {
28 #endif
29 
34 
40 typedef int32_t MirTouchId;
41 
45 typedef enum {
46  /* This touch point is going up */
48  /* This touch point is going down */
50  /* Axis values have changed on this touch point */
52 
55 
59 typedef enum {
60 /* Axis representing the x coordinate for the touch */
62 /* Axis representing the y coordinate for the touch */
64 /* Axis representing pressure of the touch */
66 /* Axis representing the length of the major axis of an ellipse
67  centered at the touch point */
69 /* Axis representing the length of the minor axis of an ellipse
70  centered at the touch point */
72 /* Axis representing the diameter of a circle centered on the touch
73  point */
75 
77 } MirTouchAxis;
78 
82 typedef enum {
83 // Tool type could not be determined
85 // Touch is made with a finger
87 // Touch is made with a stylus
89 
92 
100 
108 unsigned int mir_touch_event_point_count(MirTouchEvent const* event);
109 
117 MirTouchId mir_touch_event_id(MirTouchEvent const* event, size_t touch_index);
118 
126 MirTouchAction mir_touch_event_action(MirTouchEvent const* event, size_t touch_index);
127 
135 MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const* event,
136  size_t touch_index);
137 
138 
147 float mir_touch_event_axis_value(MirTouchEvent const* event,
148  size_t touch_index, MirTouchAxis axis);
149 
157 
158 #ifdef __cplusplus
159 }
161 #endif
162 
163 #endif /* MIR_TOOLKIT_TOUCH_EVENT_H_ */
Definition: touch_event.h:71
Definition: touch_event.h:49
float mir_touch_event_axis_value(MirTouchEvent const *event, size_t touch_index, MirTouchAxis axis)
Retrieve the axis value for a given axis on an indexed touch.
Definition: touch_event.h:76
Definition: touch_event.h:68
unsigned int mir_touch_event_point_count(MirTouchEvent const *event)
Retrieve the number of touches reported for a given touch event.
Definition: touch_event.h:74
int32_t MirTouchId
An identifier for a touch-point.
Definition: touch_event.h:40
Definition: touch_event.h:61
MirTouchAxis
Identifiers for touch axis.
Definition: touch_event.h:59
MirInputEvent const * mir_touch_event_input_event(MirTouchEvent const *event)
Retrieve the corresponding input event.
Definition: touch_event.h:88
unsigned int MirInputEventModifiers
Definition: input_event.h:67
Definition: touch_event.h:47
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition: touch_event.h:33
Definition: touch_event.h:63
Definition: touch_event.h:90
MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const *event, size_t touch_index)
Retrieve the tooltype for touch at given index.
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_event.h:82
Definition: touch_event.h:51
Definition: touch_event.h:65
struct MirInputEvent MirInputEvent
Definition: event.h:70
MirInputEventModifiers mir_touch_event_modifiers(MirTouchEvent const *event)
Retrieve the modifier keys pressed when the touch action occured.
MirTouchAction
Possible per touch actions for state changing.
Definition: touch_event.h:45
MirTouchId mir_touch_event_id(MirTouchEvent const *event, size_t touch_index)
Retrieve the TouchID for a touch at given index.
Definition: touch_event.h:84
MirTouchAction mir_touch_event_action(MirTouchEvent const *event, size_t touch_index)
Retrieve the action which occured for a touch at given index.
Definition: touch_event.h:53
Definition: touch_event.h:86

Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Jun 5 13:49:26 UTC 2017