Mir
pointer_event.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015 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_POINTER_EVENT_H_
20 #define MIR_TOOLKIT_POINTER_EVENT_H_
21 
22 #include <stdbool.h>
23 
24 #ifdef __cplusplus
25 
29 extern "C" {
30 #endif
31 
36 
40 typedef enum {
41  /* A pointer button has come up */
43  /* A pointer button has gone down */
45  /* The pointer has entered the surface to which this event was delivered */
47  /* The pointer has left the surface to which this event was delivered */
49  /* Axis values have changed for the pointer */
52 
56 typedef enum {
57 /* Absolute axis containing the x coordinate of the pointer */
59 /* Absolute axis containing the y coordinate of the pointer */
61 /* Relative axis containing ticks reported by the vertical scroll wheel */
63 /* Relative axis containing ticks reported by the horizontal scroll wheel */
65 /* Relative axis containing the last reported x differential from the pointer */
67 /* Relative axis containing the last reported y differential from the pointer */
69 
71 
72 /*
73  * Identifiers for pointer buttons
74  */
75 typedef enum {
82 typedef unsigned int MirPointerButtons;
83 
91 
99 
109  MirPointerButton button);
110 
118 MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const* event);
119 
128  MirPointerAxis axis);
129 
130 /*
131  * Retrieve the corresponding input event.
132  *
133  * \param [in] event The pointer event
134  * \return The input event
135  */
137 
138 #ifdef __cplusplus
139 }
141 #endif
142 
143 #endif /* MIR_TOOLKIT_POINTER_EVENT_H_ */
Definition: pointer_event.h:78
Definition: pointer_event.h:48
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition: pointer_event.h:35
MirInputEvent const * mir_pointer_event_input_event(MirPointerEvent const *event)
Definition: input_event.cpp:185
MirPointerAction mir_pointer_event_action(MirPointerEvent const *event)
Retrieve the action which occured to generate a given pointer event.
Definition: input_event.cpp:355
MirPointerAction
Possible pointer actions.
Definition: pointer_event.h:40
Definition: pointer_event.h:44
unsigned int MirInputEventModifiers
Definition: input_event.h:65
float mir_pointer_event_axis_value(MirPointerEvent const *event, MirPointerAxis axis)
Retrieve the axis value reported by a given pointer event.
Definition: input_event.cpp:388
Definition: pointer_event.h:68
MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const *event)
Retrieve the modifier keys pressed when the pointer action occured.
Definition: input_event.cpp:349
Definition: pointer_event.h:42
Definition: pointer_event.h:77
Definition: pointer_event.h:58
Definition: pointer_event.h:80
unsigned int MirPointerButtons
Definition: pointer_event.h:82
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const *event)
Retreive the pointer button state as a masked set of values.
Definition: input_event.cpp:382
MirPointerButton
Definition: pointer_event.h:75
Definition: pointer_event.h:76
Definition: pointer_event.h:66
Definition: pointer_event.h:50
Definition: pointer_event.h:60
struct MirInputEvent MirInputEvent
Definition: event.h:56
Definition: pointer_event.h:46
MirPointerAxis
Identifiers for pointer axis.
Definition: pointer_event.h:56
Definition: pointer_event.h:62
Definition: pointer_event.h:64
Definition: pointer_event.h:79
bool mir_pointer_event_button_state(MirPointerEvent const *event, MirPointerButton button)
Retrieve the state of a given pointer button when the action occurred.
Definition: input_event.cpp:361

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Oct 8 16:20:16 UTC 2015