2
* Copyright © 2015 Canonical Ltd.
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 3,
6
* as published by the Free Software Foundation.
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.
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/>.
16
* Authored by: Andreas Pokorny <andreas.pokorny@canonical.com>
19
#ifndef MIR_TEST_FRAMEWORK_FAKE_INPUT_DEVICE_IMPL_H_
20
#define MIR_TEST_FRAMEWORK_FAKE_INPUT_DEVICE_IMPL_H_
22
#include "mir_test_framework/fake_input_device.h"
24
#include "mir/input/input_device.h"
25
#include "mir/input/input_device_info.h"
27
namespace mi = mir::input;
36
namespace mir_test_framework
38
class FakeInputDeviceImpl : public FakeInputDevice
41
FakeInputDeviceImpl(mi::InputDeviceInfo const& info);
42
void emit_event(synthesis::KeyParameters const& key_params) override;
44
class InputDevice : public mi::InputDevice
47
InputDevice(mi::InputDeviceInfo const& info,
48
std::shared_ptr<mir::dispatch::Dispatchable> const& dispatchable);
49
std::shared_ptr<mir::dispatch::Dispatchable> dispatchable() override;
50
void start(mi::InputSink* destination) override;
53
void synthesize_events(synthesis::KeyParameters const& key_params);
54
mi::InputDeviceInfo get_device_info() override
59
mi::InputSink* sink{nullptr};
60
mi::InputDeviceInfo info;
61
std::shared_ptr<mir::dispatch::Dispatchable> const queue;
62
uint32_t modifiers{0};
64
std::shared_ptr<mir::dispatch::ActionQueue> queue;
65
std::shared_ptr<InputDevice> device;