Mir
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
include
client
mir_toolkit
events
input
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
33
typedef
struct
MirTouchEvent
MirTouchEvent
;
34
40
typedef
int32_t
MirTouchId
;
41
45
typedef
enum
{
46
/* This touch point is going up */
47
mir_touch_action_up
= 0,
48
/* This touch point is going down */
49
mir_touch_action_down
= 1,
50
/* Axis values have changed on this touch point */
51
mir_touch_action_change
= 2
52
}
MirTouchAction
;
53
57
typedef
enum
{
58
/* Axis representing the x coordinate for the touch */
59
mir_touch_axis_x
= 0,
60
/* Axis representing the y coordinate for the touch */
61
mir_touch_axis_y
= 1,
62
/* Axis representing pressure of the touch */
63
mir_touch_axis_pressure
= 2,
64
/* Axis representing the length of the major axis of an ellipse
65
centered at the touch point */
66
mir_touch_axis_touch_major
= 3,
67
/* Axis representing the length of the minor axis of an ellipse
68
centered at the touch point */
69
mir_touch_axis_touch_minor
= 4,
70
/* Axis representing the diameter of a circle centered on the touch
71
point */
72
mir_touch_axis_size
= 5
73
}
MirTouchAxis
;
74
78
typedef
enum
{
79
// Tool type could not be determined
80
mir_touch_tooltype_unknown
= 0,
81
// Touch is made with a finger
82
mir_touch_tooltype_finger
= 1,
83
// Touch is made with a stylus
84
mir_touch_tooltype_stylus
= 2
85
}
MirTouchTooltype
;
86
93
MirInputEventModifiers
mir_touch_event_modifiers
(
MirTouchEvent
const
* event);
94
102
unsigned
int
mir_touch_event_point_count
(
MirTouchEvent
const
* event);
103
111
MirTouchId
mir_touch_event_id
(
MirTouchEvent
const
* event,
size_t
touch_index);
112
120
MirTouchAction
mir_touch_event_action
(
MirTouchEvent
const
* event,
size_t
touch_index);
121
129
MirTouchTooltype
mir_touch_event_tooltype
(
MirTouchEvent
const
* event,
130
size_t
touch_index);
131
132
141
float
mir_touch_event_axis_value
(
MirTouchEvent
const
* event,
142
size_t
touch_index,
MirTouchAxis
axis);
143
144
/*
145
* Retrieve the corresponding input event.
146
*
147
* \param [in] event The touch event
148
* \return The input event
149
*/
150
MirInputEvent
const
*
mir_touch_event_input_event
(
MirTouchEvent
const
* event);
151
152
#ifdef __cplusplus
153
}
155
#endif
156
157
#endif
/* MIR_TOOLKIT_TOUCH_EVENT_H_ */
mir_touch_axis_touch_minor
Definition:
touch_event.h:69
mir_touch_action_down
Definition:
touch_event.h:49
mir_touch_event_axis_value
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:
input_event.cpp:304
mir_touch_axis_touch_major
Definition:
touch_event.h:66
mir_touch_event_point_count
unsigned int mir_touch_event_point_count(MirTouchEvent const *event)
Retrieve the number of touches reported for a given touch event.
Definition:
input_event.cpp:258
mir_touch_axis_size
Definition:
touch_event.h:72
MirTouchId
int32_t MirTouchId
An identifier for a touch-point.
Definition:
touch_event.h:40
mir_touch_axis_x
Definition:
touch_event.h:59
MirTouchAxis
MirTouchAxis
Identifiers for touch axis.
Definition:
touch_event.h:57
mir_touch_event_input_event
MirInputEvent const * mir_touch_event_input_event(MirTouchEvent const *event)
Definition:
input_event.cpp:195
mir_touch_tooltype_stylus
Definition:
touch_event.h:84
MirInputEventModifiers
unsigned int MirInputEventModifiers
Definition:
input_event.h:65
mir_touch_action_up
Definition:
touch_event.h:47
MirTouchEvent
struct MirTouchEvent MirTouchEvent
An event type describing a change in touch device state.
Definition:
touch_event.h:33
mir_touch_axis_y
Definition:
touch_event.h:61
mir_touch_event_tooltype
MirTouchTooltype mir_touch_event_tooltype(MirTouchEvent const *event, size_t touch_index)
Retrieve the tooltype for touch at given index.
Definition:
input_event.cpp:290
MirTouchTooltype
MirTouchTooltype
Identifiers for per-touch tool types.
Definition:
touch_event.h:78
mir_touch_action_change
Definition:
touch_event.h:51
mir_touch_axis_pressure
Definition:
touch_event.h:63
MirInputEvent
struct MirInputEvent MirInputEvent
Definition:
event.h:56
mir_touch_event_modifiers
MirInputEventModifiers mir_touch_event_modifiers(MirTouchEvent const *event)
Retrieve the modifier keys pressed when the touch action occured.
Definition:
input_event.cpp:240
MirTouchAction
MirTouchAction
Possible per touch actions for state changing.
Definition:
touch_event.h:45
mir_touch_event_id
MirTouchId mir_touch_event_id(MirTouchEvent const *event, size_t touch_index)
Retrieve the TouchID for a touch at given index.
Definition:
input_event.cpp:264
mir_touch_tooltype_unknown
Definition:
touch_event.h:80
mir_touch_event_action
MirTouchAction mir_touch_event_action(MirTouchEvent const *event, size_t touch_index)
Retrieve the action which occured for a touch at given index.
Definition:
input_event.cpp:277
mir_touch_tooltype_finger
Definition:
touch_event.h:82
Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015