Mir
include
client
mir_toolkit
events
input
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
35
typedef
struct
MirPointerEvent
MirPointerEvent
;
36
40
typedef
enum
{
41
/* A pointer button has come up */
42
mir_pointer_action_button_up
= 0,
43
/* A pointer button has gone down */
44
mir_pointer_action_button_down
= 1,
45
/* The pointer has entered the surface to which this event was delivered */
46
mir_pointer_action_enter
= 2,
47
/* The pointer has left the surface to which this event was delivered */
48
mir_pointer_action_leave
= 3,
49
/* Axis values have changed for the pointer */
50
mir_pointer_action_motion
= 4,
51
52
mir_pointer_actions
53
}
MirPointerAction
;
54
58
typedef
enum
{
59
/* Absolute axis containing the x coordinate of the pointer */
60
mir_pointer_axis_x
= 0,
61
/* Absolute axis containing the y coordinate of the pointer */
62
mir_pointer_axis_y
= 1,
63
/* Relative axis containing ticks reported by the vertical scroll wheel */
64
mir_pointer_axis_vscroll
= 2,
65
/* Relative axis containing ticks reported by the horizontal scroll wheel */
66
mir_pointer_axis_hscroll
= 3,
67
/* Relative axis containing the last reported x differential from the pointer */
68
mir_pointer_axis_relative_x
= 4,
69
/* Relative axis containing the last reported y differential from the pointer */
70
mir_pointer_axis_relative_y
= 5,
71
72
mir_pointer_axes
73
}
MirPointerAxis
;
74
75
/*
76
* Identifiers for pointer buttons
77
*/
78
typedef
enum
{
79
mir_pointer_button_primary
= 1 << 0,
80
mir_pointer_button_secondary
= 1 << 1,
81
mir_pointer_button_tertiary
= 1 << 2,
82
mir_pointer_button_back
= 1 << 3,
83
mir_pointer_button_forward
= 1 << 4,
84
mir_pointer_button_side
= 1 << 5,
85
mir_pointer_button_extra
= 1 << 6,
86
mir_pointer_button_task
= 1 << 7
87
}
MirPointerButton
;
88
typedef
unsigned
int
MirPointerButtons
;
89
96
MirInputEventModifiers
mir_pointer_event_modifiers
(
MirPointerEvent
const
* event);
97
104
MirPointerAction
mir_pointer_event_action
(
MirPointerEvent
const
* event);
105
114
bool
mir_pointer_event_button_state
(
MirPointerEvent
const
* event,
115
MirPointerButton
button);
116
124
MirPointerButtons
mir_pointer_event_buttons
(
MirPointerEvent
const
* event);
125
133
float
mir_pointer_event_axis_value
(
MirPointerEvent
const
* event,
134
MirPointerAxis axis);
135
142
MirInputEvent
const
*
mir_pointer_event_input_event
(
MirPointerEvent
const
* event);
143
144
#ifdef __cplusplus
145
}
147
#endif
148
149
#endif
/* MIR_TOOLKIT_POINTER_EVENT_H_ */
mir_pointer_button_tertiary
Definition:
pointer_event.h:81
mir_pointer_action_leave
Definition:
pointer_event.h:48
MirPointerEvent
struct MirPointerEvent MirPointerEvent
An event type describing a change in pointer device state.
Definition:
pointer_event.h:35
mir_pointer_axes
Definition:
pointer_event.h:72
mir_pointer_event_input_event
MirInputEvent const * mir_pointer_event_input_event(MirPointerEvent const *event)
Retrieve the corresponding input event.
mir_pointer_event_action
MirPointerAction mir_pointer_event_action(MirPointerEvent const *event)
Retrieve the action which occured to generate a given pointer event.
MirPointerAction
MirPointerAction
Possible pointer actions.
Definition:
pointer_event.h:40
mir_pointer_button_side
Definition:
pointer_event.h:84
mir_pointer_action_button_down
Definition:
pointer_event.h:44
MirInputEventModifiers
unsigned int MirInputEventModifiers
Definition:
input_event.h:67
mir_pointer_event_axis_value
float mir_pointer_event_axis_value(MirPointerEvent const *event, MirPointerAxis axis)
Retrieve the axis value reported by a given pointer event.
mir_pointer_button_extra
Definition:
pointer_event.h:85
mir_pointer_axis_relative_y
Definition:
pointer_event.h:70
mir_pointer_event_modifiers
MirInputEventModifiers mir_pointer_event_modifiers(MirPointerEvent const *event)
Retrieve the modifier keys pressed when the pointer action occured.
mir_pointer_action_button_up
Definition:
pointer_event.h:42
mir_pointer_button_secondary
Definition:
pointer_event.h:80
mir_pointer_axis_x
Definition:
pointer_event.h:60
mir_pointer_button_forward
Definition:
pointer_event.h:83
MirPointerButtons
unsigned int MirPointerButtons
Definition:
pointer_event.h:88
mir_pointer_actions
Definition:
pointer_event.h:52
mir_pointer_event_buttons
MirPointerButtons mir_pointer_event_buttons(MirPointerEvent const *event)
Retreive the pointer button state as a masked set of values.
MirPointerButton
MirPointerButton
Definition:
pointer_event.h:78
mir_pointer_button_primary
Definition:
pointer_event.h:79
mir_pointer_axis_relative_x
Definition:
pointer_event.h:68
mir_pointer_action_motion
Definition:
pointer_event.h:50
mir_pointer_axis_y
Definition:
pointer_event.h:62
MirInputEvent
struct MirInputEvent MirInputEvent
Definition:
event.h:69
mir_pointer_button_task
Definition:
pointer_event.h:86
mir_pointer_action_enter
Definition:
pointer_event.h:46
MirPointerAxis
MirPointerAxis
Identifiers for pointer axis.
Definition:
pointer_event.h:58
mir_pointer_axis_vscroll
Definition:
pointer_event.h:64
mir_pointer_axis_hscroll
Definition:
pointer_event.h:66
mir_pointer_button_back
Definition:
pointer_event.h:82
mir_pointer_event_button_state
bool mir_pointer_event_button_state(MirPointerEvent const *event, MirPointerButton button)
Retrieve the state of a given pointer button when the action occurred.
Copyright © 2012-2016 Canonical Ltd.
Generated on Mon Mar 27 12:06:55 UTC 2017