#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/events/platform/x11/x11_hotplug_event_handler.h"
#include <stdint.h>
#include <algorithm>
#include <cmath>
#include <limits>
#include <set>
#include <string>
#include <vector>
#include "base/check.h"
#include "base/command_line.h"
#include "base/containers/fixed_flat_set.h"
#include "base/files/file_path.h"
#include "base/functional/bind.h"
#include "base/location.h"
#include "base/process/launch.h"
#include "base/strings/string_util.h"
#include "base/system/sys_info.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/thread_pool.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/device_hotplug_event_observer.h"
#include "ui/events/devices/device_util_linux.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/devices/keyboard_device.h"
#include "ui/events/devices/touchpad_device.h"
#include "ui/events/devices/touchscreen_device.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/extension_manager.h"
#include "ui/gfx/x/future.h"
namespace ui {
namespace {
enum DeviceType { … };
KeyboardDeviceCallback;
TouchpadDeviceCallback;
TouchscreenDeviceCallback;
InputDeviceCallback;
struct UiCallbacks { … };
double Fp3232ToDouble(const x11::Input::Fp3232& x) { … }
struct ValuatorClassInfo { … };
struct TouchClassInfo { … };
struct DeviceInfo { … };
struct DisplayState { … };
bool IsKnownInvalidKeyboardDevice(const std::string& name) { … }
bool IsTestDevice(const std::string& name) { … }
base::FilePath GetDevicePath(x11::Connection* connection,
const x11::Input::XIDeviceInfo& device) { … }
void HandleKeyboardDevicesInWorker(const std::vector<DeviceInfo>& device_infos,
scoped_refptr<base::TaskRunner> reply_runner,
KeyboardDeviceCallback callback) { … }
void HandleMouseDevicesInWorker(const std::vector<DeviceInfo>& device_infos,
scoped_refptr<base::TaskRunner> reply_runner,
InputDeviceCallback callback) { … }
void HandleTouchpadDevicesInWorker(const std::vector<DeviceInfo>& device_infos,
scoped_refptr<base::TaskRunner> reply_runner,
TouchpadDeviceCallback callback) { … }
void HandleTouchscreenDevicesInWorker(
const std::vector<DeviceInfo>& device_infos,
const DisplayState& display_state,
scoped_refptr<base::TaskRunner> reply_runner,
TouchscreenDeviceCallback callback) { … }
void HandleHotplugEventInWorker(const std::vector<DeviceInfo>& devices,
const DisplayState& display_state,
scoped_refptr<base::TaskRunner> reply_runner,
UiCallbacks callbacks) { … }
DeviceHotplugEventObserver* GetHotplugEventObserver() { … }
void OnKeyboardDevices(const std::vector<KeyboardDevice>& devices) { … }
void OnTouchscreenDevices(const std::vector<TouchscreenDevice>& devices) { … }
void OnMouseDevices(const std::vector<InputDevice>& devices) { … }
void OnTouchpadDevices(const std::vector<TouchpadDevice>& devices) { … }
void OnHotplugFinished() { … }
}
X11HotplugEventHandler::X11HotplugEventHandler() = default;
X11HotplugEventHandler::~X11HotplugEventHandler() = default;
void X11HotplugEventHandler::OnHotplugEvent() { … }
}