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>
63 InputSender(std::shared_ptr<compositor::Scene>
const& scene,
64 std::shared_ptr<MainLoop>
const& main_loop,
65 std::shared_ptr<InputSendObserver>
const& observer,
66 std::shared_ptr<InputReport>
const& report);
68 void send_event(
MirEvent const& event, std::shared_ptr<InputChannel>
const& channel)
override;
71 struct InputSenderState;
76 explicit SceneObserver(InputSenderState & state);
81 void scene_changed()
override;
84 InputSenderState & state;
90 ActiveTransfer(InputSenderState & state,
int server_fd,
input::Surface* surface);
94 void on_surface_disappeared();
99 void on_finish_signal();
100 void on_response_timeout();
103 droidinput::status_t send_key_event(uint32_t sequence_id,
MirKeyEvent const& event);
104 droidinput::status_t send_motion_event(uint32_t sequence_id,
MirMotionEvent const& event);
108 InputSenderState & state;
109 droidinput::InputPublisher publisher;
111 std::vector<InputSendEntry> pending_responses;
112 std::mutex transfer_mutex;
113 std::atomic<bool> subscribed{
false};
114 std::unique_ptr<time::Alarm> send_timer;
116 ActiveTransfer&
operator=(ActiveTransfer
const&) =
delete;
117 ActiveTransfer(ActiveTransfer
const&) =
delete;
120 struct InputSenderState
122 InputSenderState(std::shared_ptr<MainLoop>
const& main_loop,
123 std::shared_ptr<InputSendObserver>
const& observer,
124 std::shared_ptr<InputReport>
const& report);
127 void remove_transfer(
int fd);
129 std::shared_ptr<MainLoop>
const main_loop;
130 std::shared_ptr<InputReport>
const report;
131 std::shared_ptr<InputSendObserver>
const observer;
134 std::shared_ptr<ActiveTransfer> get_transfer(
int fd);
138 std::unordered_map<int,std::shared_ptr<ActiveTransfer>> transfers;
139 std::mutex sender_mutex;
142 InputSenderState state;
143 std::shared_ptr<compositor::Scene> scene;
All things Mir.
Definition: atomic_callback.h:25
Definition: input_send_entry.h:38
Definition: null_observer.h:28
Definition: event_private.h:51
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:178
Definition: event_private.h:91