Mir
event_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2012 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify it
5  * under the terms of the GNU General Public License version 2 or 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 General Public License for more details.
12  *
13  * You should have received a copy of the GNU 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_TEST_EVENT_FACTORY_H
20 #define MIR_TEST_EVENT_FACTORY_H
21 
22 #include "mir/geometry/point.h"
23 
24 namespace mir
25 {
26 namespace input
27 {
28 namespace synthesis
29 {
30 
31 enum class EventAction
32 {
33  Down, Up
34 };
35 
37 {
38 public:
39  KeyParameters();
40 
41  KeyParameters& from_device(int device_id);
42  KeyParameters& of_scancode(int scancode);
43  KeyParameters& with_action(EventAction action);
44 
45  int device_id;
46  int scancode;
48 };
51 
53 {
54 public:
56  ButtonParameters& from_device(int device_id);
57  ButtonParameters& of_button(int scancode);
58  ButtonParameters& with_action(EventAction action);
59 
60  int device_id;
61  int button;
63 };
66 
68 {
69 public:
71  MotionParameters& from_device(int device_id);
72  MotionParameters& with_movement(int rel_x, int rel_y);
73 
74  int device_id;
75  int rel_x;
76  int rel_y;
77 };
79 
81 {
82 public:
83  enum class Action
84  {
85  Tap = 0,
86  Move,
87  Release
88  };
89 
91  TouchParameters& from_device(int device_id);
92  TouchParameters& at_position(geometry::Point abs_pos);
93  TouchParameters& with_action(Action touch_action);
94 
95  int device_id;
96  int abs_x;
97  int abs_y;
99 };
101 
102 }
103 }
104 }
105 
106 #endif /* MIR_TEST_EVENT_FACTORY_H */
KeyParameters a_key_down_event()
int abs_y
Definition: event_factory.h:97
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition: sw_splash.h:26
Action
Definition: event_factory.h:83
MotionParameters a_pointer_event()
Definition: event_factory.h:36
int device_id
Definition: event_factory.h:74
ButtonParameters a_button_up_event()
int button
Definition: event_factory.h:61
Definition: point.h:30
ButtonParameters a_button_down_event()
int rel_x
Definition: event_factory.h:75
TouchParameters a_touch_event()
KeyParameters a_key_up_event()
Action action
Definition: event_factory.h:98
Definition: event_factory.h:52
Definition: event_factory.h:67
int device_id
Definition: event_factory.h:60
Definition: event_factory.h:80
int device_id
Definition: event_factory.h:95
int abs_x
Definition: event_factory.h:96
EventAction action
Definition: event_factory.h:47
EventAction action
Definition: event_factory.h:62
int scancode
Definition: event_factory.h:46
int rel_y
Definition: event_factory.h:76
EventAction
Definition: event_factory.h:31
int device_id
Definition: event_factory.h:45

Copyright © 2012-2017 Canonical Ltd.
Generated on Mon Oct 30 19:44:55 UTC 2017