Mir
default_input_manager.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2015-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 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: Andreas Pokorny <andreas.pokorny@canonical.com>
17  */
18 
19 #ifndef MIR_INPUT_DEFAULT_INPUT_MANAGER_H_
20 #define MIR_INPUT_DEFAULT_INPUT_MANAGER_H_
21 
23 
24 #include <thread>
25 #include <atomic>
26 
27 namespace mir
28 {
29 namespace dispatch
30 {
31 class MultiplexingDispatchable;
32 class ThreadedDispatcher;
33 class ActionQueue;
34 }
35 namespace input
36 {
37 class Platform;
38 class InputEventHandlerRegister;
39 class InputDeviceRegistry;
40 
42 {
43 public:
45  std::shared_ptr<dispatch::MultiplexingDispatchable> const& multiplexer,
46  std::shared_ptr<Platform> const& platform);
48 
49  void start() override;
50  void stop() override;
51 private:
52  void start_platforms();
53  void stop_platforms();
54  std::shared_ptr<Platform> const platform;
55  std::shared_ptr<dispatch::MultiplexingDispatchable> const multiplexer;
56  std::shared_ptr<dispatch::ActionQueue> const queue;
57  std::unique_ptr<dispatch::ThreadedDispatcher> input_thread;
58 
59  enum class State
60  {
61  started,
62  stopped,
63  starting,
64  stopping
65  };
66  std::atomic<State> state;
67 };
68 
69 }
70 }
71 #endif
All things Mir.
Definition: atomic_callback.h:25
Definition: input_manager.h:28
std::promise< bool > stop
Definition: in.cpp:28
Definition: default_input_manager.h:41

Copyright © 2012-2015 Canonical Ltd.
Generated on Thu Sep 8 14:50:19 UTC 2016