#include "remoting/host/linux/remote_desktop_portal_injector.h"
#include <gio/gio.h>
#include <gio/gunixfdlist.h>
#include <glib-object.h>
#include <linux/input.h>
#include <poll.h>
#include <utility>
#include "base/check.h"
#include "base/notreached.h"
#include "base/sequence_checker.h"
#include "base/time/time.h"
#include "remoting/base/logging.h"
#include "third_party/libei/cipd/include/libei.h"
#include "third_party/webrtc/modules/portal/portal_request_response.h"
#include "third_party/webrtc/modules/portal/scoped_glib.h"
#include "third_party/webrtc/modules/portal/xdg_desktop_portal_utils.h"
namespace remoting::xdg_portal {
Scoped;
namespace {
constexpr int BUTTON_LEFT_KEYCODE = …;
constexpr int BUTTON_RIGHT_KEYCODE = …;
constexpr int BUTTON_MIDDLE_KEYCODE = …;
constexpr int BUTTON_FORWARD_KEYCODE = …;
constexpr int BUTTON_BACK_KEYCODE = …;
constexpr int BTN_UNKNOWN = …;
constexpr int EI_SCROLL_FACTOR = …;
int EvdevCodeToMouseButton(int code) { … }
}
RemoteDesktopPortalInjector::RemoteDesktopPortalInjector() { … }
RemoteDesktopPortalInjector::~RemoteDesktopPortalInjector() { … }
void RemoteDesktopPortalInjector::Shutdown() { … }
void RemoteDesktopPortalInjector::ValidateGDPBusProxyResult(
GObject* proxy,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortalInjector::InjectMouseButton(int code, bool pressed) { … }
void RemoteDesktopPortalInjector::InjectMouseScroll(int axis, int steps) { … }
void RemoteDesktopPortalInjector::MovePointerBy(int delta_x, int delta_y) { … }
bool RemoteDesktopPortalInjector::InDeviceRegion(uint32_t x, uint32_t y) { … }
void RemoteDesktopPortalInjector::MovePointerTo(int x, int y) { … }
void RemoteDesktopPortalInjector::InjectKeyPress(int code,
bool pressed,
bool is_code) { … }
void RemoteDesktopPortalInjector::SetSessionDetails(
webrtc::xdg_portal::SessionDetails session_details) { … }
static void ei_loghandler(struct ei* ei,
enum ei_log_priority priority,
const char* message,
struct ei_log_context* ctx) { … }
void RemoteDesktopPortalInjector::OnEiFdRequested(GObject* object,
GAsyncResult* result,
gpointer user_data) { … }
void RemoteDesktopPortalInjector::HandleRegions(struct ei_device* device) { … }
void RemoteDesktopPortalInjector::OnEiSeatAddedEvent(struct ei_event* event) { … }
void RemoteDesktopPortalInjector::OnEiSeatRemovedEvent(struct ei_event* event) { … }
void RemoteDesktopPortalInjector::OnEiDeviceAddedEvent(struct ei_event* event) { … }
void RemoteDesktopPortalInjector::OnEiDeviceResumedEvent(
struct ei_event* event) { … }
void RemoteDesktopPortalInjector::OnEiDevicePausedEvent(
struct ei_event* event) { … }
void RemoteDesktopPortalInjector::OnEiDeviceRemovedEvent(
struct ei_event* event) { … }
void RemoteDesktopPortalInjector::HandleEiEvent(struct ei_event* event) { … }
void RemoteDesktopPortalInjector::SetupLibei(
base::OnceCallback<void(bool)> OnLibeiDone) { … }
}