19 #ifndef MIR_INPUT_ANDROID_INPUT_SENDER_H_ 20 #define MIR_INPUT_ANDROID_INPUT_SENDER_H_ 27 #include "androidfw/InputTransport.h" 30 #include <unordered_map> 58 InputSender(std::shared_ptr<compositor::Scene>
const& scene,
59 std::shared_ptr<MainLoop>
const& main_loop,
60 std::shared_ptr<InputReport>
const& report);
62 void send_event(
MirEvent const& event, std::shared_ptr<InputChannel>
const& channel)
override;
65 struct InputSenderState;
70 explicit SceneObserver(InputSenderState & state);
75 void scene_changed()
override;
78 InputSenderState & state;
84 ActiveTransfer(InputSenderState & state, std::shared_ptr<InputChannel>
const& channel,
input::Surface* surface);
86 void send(uint32_t sequence_id,
MirEvent const& event);
92 void on_finish_signal();
93 droidinput::status_t send_key_event(uint32_t sequence_id,
MirEvent const& event);
94 droidinput::status_t send_touch_event(uint32_t sequence_id,
MirEvent const& event);
95 droidinput::status_t send_pointer_event(uint32_t sequence_id,
MirEvent const& event);
97 InputSenderState & state;
98 droidinput::InputPublisher publisher;
100 std::shared_ptr<InputChannel>
const channel;
101 std::atomic<bool> subscribed{
false};
103 ActiveTransfer& operator=(ActiveTransfer
const&) =
delete;
104 ActiveTransfer(ActiveTransfer
const&) =
delete;
107 struct InputSenderState
109 InputSenderState(std::shared_ptr<MainLoop>
const& main_loop,
110 std::shared_ptr<InputReport>
const& report);
111 void send_event(std::shared_ptr<InputChannel>
const& channel,
MirEvent const& event);
112 void add_transfer(std::shared_ptr<InputChannel>
const& channel,
input::Surface* surface);
113 void remove_transfer(
int fd);
115 std::shared_ptr<MainLoop>
const main_loop;
116 std::shared_ptr<InputReport>
const report;
119 std::shared_ptr<ActiveTransfer> get_transfer(
int fd);
123 std::unordered_map<int,std::shared_ptr<ActiveTransfer>> transfers;
124 std::mutex sender_mutex;
127 InputSenderState state;
128 std::shared_ptr<compositor::Scene> scene;
All things Mir.
Definition: atomic_callback.h:25
Definition: null_observer.h:28
surface_removed
Definition: scene_report_tp.h:46
surface_added
Definition: scene_report_tp.h:41
Definition: android_input_receiver.h:36
Definition: event_private.h:181