Mir
include
test
mir
test
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
36
class
KeyParameters
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
;
47
EventAction
action
;
48
};
49
KeyParameters
a_key_down_event
();
50
KeyParameters
a_key_up_event
();
51
52
class
ButtonParameters
53
{
54
public
:
55
ButtonParameters
();
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
;
62
EventAction
action
;
63
};
64
ButtonParameters
a_button_down_event
();
65
ButtonParameters
a_button_up_event
();
66
67
class
MotionParameters
68
{
69
public
:
70
MotionParameters
();
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
};
78
MotionParameters
a_pointer_event
();
79
80
class
TouchParameters
81
{
82
public
:
83
enum class
Action
84
{
85
Tap = 0,
86
Move,
87
Release
88
};
89
90
TouchParameters
();
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
;
98
Action
action
;
99
};
100
TouchParameters
a_touch_event
();
101
102
}
103
}
104
}
105
106
#endif
/* MIR_TEST_EVENT_FACTORY_H */
mir::input::synthesis::a_key_down_event
KeyParameters a_key_down_event()
mir::input::synthesis::TouchParameters::abs_y
int abs_y
Definition:
event_factory.h:97
mir
AutoUnblockThread is a helper thread class that can gracefully shutdown at destruction time...
Definition:
sw_splash.h:26
mir::input::synthesis::TouchParameters::Action
Action
Definition:
event_factory.h:83
mir::input::synthesis::a_pointer_event
MotionParameters a_pointer_event()
mir::input::synthesis::KeyParameters
Definition:
event_factory.h:36
mir::input::synthesis::MotionParameters::device_id
int device_id
Definition:
event_factory.h:74
mir::input::synthesis::a_button_up_event
ButtonParameters a_button_up_event()
mir::input::synthesis::ButtonParameters::button
int button
Definition:
event_factory.h:61
mir::geometry::Point
Definition:
point.h:30
mir::input::synthesis::a_button_down_event
ButtonParameters a_button_down_event()
point.h
mir::input::synthesis::MotionParameters::rel_x
int rel_x
Definition:
event_factory.h:75
mir::input::synthesis::a_touch_event
TouchParameters a_touch_event()
mir::input::synthesis::a_key_up_event
KeyParameters a_key_up_event()
mir::input::synthesis::TouchParameters::action
Action action
Definition:
event_factory.h:98
mir::input::synthesis::ButtonParameters
Definition:
event_factory.h:52
mir::input::synthesis::MotionParameters
Definition:
event_factory.h:67
mir::input::synthesis::ButtonParameters::device_id
int device_id
Definition:
event_factory.h:60
mir::input::synthesis::TouchParameters
Definition:
event_factory.h:80
mir::input::synthesis::TouchParameters::device_id
int device_id
Definition:
event_factory.h:95
mir::input::synthesis::EventAction::Down
mir::input::synthesis::TouchParameters::abs_x
int abs_x
Definition:
event_factory.h:96
mir::input::synthesis::EventAction::Up
mir::input::synthesis::KeyParameters::action
EventAction action
Definition:
event_factory.h:47
mir::input::synthesis::ButtonParameters::action
EventAction action
Definition:
event_factory.h:62
mir::input::synthesis::KeyParameters::scancode
int scancode
Definition:
event_factory.h:46
mir::input::synthesis::MotionParameters::rel_y
int rel_y
Definition:
event_factory.h:76
mir::input::synthesis::EventAction
EventAction
Definition:
event_factory.h:31
mir::input::synthesis::KeyParameters::device_id
int device_id
Definition:
event_factory.h:45
Copyright © 2012-2017 Canonical Ltd.
Generated on Mon Oct 30 19:44:55 UTC 2017