Mir
input_platform.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 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 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: Cemil Azizoglu <cemil.azizoglu@canonical.com>
17  */
18 #ifndef MIR_INPUT_X_INPUT_PLATFORM_H_
19 #define MIR_INPUT_X_INPUT_PLATFORM_H_
20 
21 #include "mir/input/platform.h"
22 #include <memory>
23 #include <X11/Xlib.h>
24 
25 namespace mir
26 {
27 
28 namespace dispatch
29 {
30 class ReadableFd;
31 }
32 
33 namespace input
34 {
35 
36 namespace X
37 {
38 class XInputDevice;
39 
41 {
42 public:
43  explicit XInputPlatform(
44  std::shared_ptr<input::InputDeviceRegistry> const& input_device_registry,
45  std::shared_ptr<::Display> const& conn);
46  ~XInputPlatform() = default;
47 
48  std::shared_ptr<dispatch::Dispatchable> dispatchable() override;
49  void start() override;
50  void stop() override;
51 
52 private:
53  void process_input_event();
54  std::shared_ptr<::Display> x11_connection;
55  std::shared_ptr<dispatch::ReadableFd> const xcon_dispatchable;
56  std::shared_ptr<input::InputDeviceRegistry> const registry;
57  std::shared_ptr<XInputDevice> const core_keyboard;
58  std::shared_ptr<XInputDevice> const core_pointer;
59 };
60 
61 }
62 }
63 }
64 
65 #endif // MIR_INPUT_X_INPUT_PLATFORM_H_
All things Mir.
Definition: atomic_callback.h:25
Input Platform is used to discover and access available input devices.
Definition: platform.h:65
std::promise< bool > stop
Definition: in.cpp:28
Definition: input_platform.h:40
detail::IntWrapper< struct XTag > X
Definition: dimensions.h:111

Copyright © 2012-2015 Canonical Ltd.
Generated on Wed Mar 30 00:29:56 UTC 2016