Mir
contact_state.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2016 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  * Author: Andreas Pokorny <andreas.pokorny@canonical.com>
17  */
18 
19 #ifndef MIR_EVENTS_CONTACT_STATE_H_
20 #define MIR_EVENTS_CONTACT_STATE_H_
21 
22 #include "mir_toolkit/event.h"
23 
24 namespace mir
25 {
26 namespace events
27 {
28 
30 {
34  float x;
35  float y;
36  float pressure;
37  float touch_major;
38  float touch_minor;
39  float orientation;
40 };
41 
42 inline bool operator==(ContactState const& lhs, ContactState const & rhs)
43 {
44  return lhs.touch_id == rhs.touch_id &&
45  lhs.action == rhs.action &&
46  lhs.tooltype == rhs.tooltype &&
47  lhs.x == rhs.x &&
48  lhs.y == rhs.y &&
49  lhs.pressure == rhs.pressure &&
50  lhs.touch_major == rhs.touch_major &&
51  lhs.touch_minor == rhs.touch_minor &&
52  lhs.orientation == rhs.orientation;
53 }
54 
55 }
56 }
57 
58 #endif // MIR_EVENTS_CONTACT_STATE_H_
Definition: as_render_target.h:27
float y
Definition: contact_state.h:35
float x
Definition: contact_state.h:34
int32_t MirTouchId
An identifier for a touch-point.
Definition: touch_event.h:40
bool operator==(ContactState const &lhs, ContactState const &rhs)
Definition: contact_state.h:42
Definition: contact_state.h:29
float touch_major
Definition: contact_state.h:37
MirTouchTooltype tooltype
Definition: contact_state.h:33
MirTouchTooltype
Identifiers for per-touch tool types.
Definition: touch_event.h:82
float orientation
Definition: contact_state.h:39
MirTouchId touch_id
Definition: contact_state.h:31
MirTouchAction
Possible per touch actions for state changing.
Definition: touch_event.h:45
MirTouchAction action
Definition: contact_state.h:32
float touch_minor
Definition: contact_state.h:38
float pressure
Definition: contact_state.h:36

Copyright © 2012-2016 Canonical Ltd.
Generated on Wed May 10 10:41:27 UTC 2017