#include "ui/events/devices/x11/touch_factory_x11.h"
#include <stddef.h>
#include <string_view>
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/system/sys_info.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/events/base_event_utils.h"
#include "ui/events/devices/x11/device_data_manager_x11.h"
#include "ui/events/devices/x11/device_list_cache_x11.h"
#include "ui/events/devices/x11/xinput_util.h"
#include "ui/events/event_switches.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/future.h"
namespace ui {
namespace {
void AddPointerDevicesFromString(
const std::string& pointer_devices,
EventPointerType type,
std::vector<std::pair<int, EventPointerType>>* devices) { … }
}
TouchFactory::TouchFactory()
: … { … }
TouchFactory::~TouchFactory() = default;
TouchFactory* TouchFactory::GetInstance() { … }
void TouchFactory::SetTouchDeviceListFromCommandLine() { … }
void TouchFactory::UpdateDeviceList(x11::Connection* connection) { … }
bool TouchFactory::ShouldProcessDeviceEvent(
const x11::Input::DeviceEvent& xiev) { … }
bool TouchFactory::ShouldProcessCrossingEvent(
const x11::Input::CrossingEvent& xiev) { … }
void TouchFactory::SetupXI2ForXWindow(x11::Window window) { … }
void TouchFactory::SetTouchDeviceList(
const std::vector<std::pair<int, EventPointerType>>& devices) { … }
bool TouchFactory::IsValidDevice(int deviceid) const { … }
bool TouchFactory::IsTouchDevice(x11::Input::DeviceId deviceid) const { … }
bool TouchFactory::IsMultiTouchDevice(x11::Input::DeviceId deviceid) const { … }
EventPointerType TouchFactory::GetTouchDevicePointerType(
x11::Input::DeviceId deviceid) const { … }
bool TouchFactory::QuerySlotForTrackingID(uint32_t tracking_id, int* slot) { … }
int TouchFactory::GetSlotForTrackingID(uint32_t tracking_id) { … }
void TouchFactory::ReleaseSlot(int slot) { … }
bool TouchFactory::IsTouchDevicePresent() { … }
void TouchFactory::ResetForTest() { … }
void TouchFactory::SetTouchDeviceForTest(const std::vector<int>& devices) { … }
void TouchFactory::SetPointerDeviceForTest(const std::vector<int>& devices) { … }
void TouchFactory::SetTouchscreensEnabled(bool enabled) { … }
void TouchFactory::CacheTouchscreenIds(x11::Input::DeviceId device_id) { … }
bool TouchFactory::ShouldProcessEventForDevice(
x11::Input::DeviceId device_id) const { … }
}