19 #ifndef MIR_INPUT_DEFAULT_INPUT_DEVICE_HUB_H_ 20 #define MIR_INPUT_DEFAULT_INPUT_DEVICE_HUB_H_ 32 #include <linux/input.h> 39 class ServerActionQueue;
51 class MultiplexingDispatchable;
57 class InputDeviceObserver;
66 std::shared_ptr<Seat>
const& seat,
67 std::shared_ptr<dispatch::MultiplexingDispatchable>
const& input_multiplexer,
68 std::shared_ptr<ServerActionQueue>
const& observer_queue,
69 std::shared_ptr<cookie::Authority>
const& cookie_authority,
70 std::shared_ptr<KeyMapper>
const& key_mapper);
73 void add_device(std::shared_ptr<InputDevice>
const& device)
override;
74 void remove_device(std::shared_ptr<InputDevice>
const& device)
override;
77 void add_observer(std::shared_ptr<InputDeviceObserver>
const&)
override;
78 void remove_observer(std::weak_ptr<InputDeviceObserver>
const&)
override;
79 void for_each_input_device(std::function<
void(
Device const& device)>
const& callback)
override;
83 void add_device_handle(std::shared_ptr<DefaultDevice>
const& handle);
86 std::shared_ptr<Seat>
const seat;
87 std::shared_ptr<frontend::EventSink>
const sink;
88 std::shared_ptr<dispatch::MultiplexingDispatchable>
const input_dispatchable;
89 std::mutex observer_guard;
90 std::shared_ptr<ServerActionQueue>
const observer_queue;
91 std::shared_ptr<dispatch::ActionQueue>
const device_queue;
92 std::shared_ptr<cookie::Authority>
const cookie_authority;
93 std::shared_ptr<KeyMapper>
const key_mapper;
95 struct RegisteredDevice :
public InputSink 98 RegisteredDevice(std::shared_ptr<InputDevice>
const& dev,
100 std::shared_ptr<dispatch::MultiplexingDispatchable>
const& multiplexer,
101 std::shared_ptr<cookie::Authority>
const& cookie_authority,
102 std::shared_ptr<DefaultDevice>
const& handle);
103 void handle_input(
MirEvent& event)
override;
105 bool device_matches(std::shared_ptr<InputDevice>
const& dev)
const;
106 void start(std::shared_ptr<Seat>
const& seat);
109 std::shared_ptr<Seat> seat;
110 const std::shared_ptr<DefaultDevice> handle;
112 void key_state(std::vector<uint32_t>
const& scan_codes)
override;
116 std::unique_ptr<DefaultEventBuilder> builder;
117 std::shared_ptr<cookie::Authority> cookie_authority;
118 std::shared_ptr<InputDevice>
const device;
119 std::shared_ptr<dispatch::MultiplexingDispatchable>
const multiplexer;
122 std::vector<std::shared_ptr<Device>> handles;
123 std::vector<std::unique_ptr<RegisteredDevice>> devices;
124 std::vector<std::shared_ptr<InputDeviceObserver>> observers;
All things Mir.
Definition: atomic_callback.h:25
std::promise< bool > stop
Definition: in.cpp:28
Definition: rectangle.h:33