#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/task/single_thread_task_runner.h"
#include "base/task/task_runner.h"
#include "base/time/time.h"
#include "base/trace_event/trace_event.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/devices/input_device.h"
#include "ui/events/devices/keyboard_device.h"
#include "ui/events/devices/microphone_mute_switch_monitor.h"
#include "ui/events/devices/touchpad_device.h"
#include "ui/events/event_utils.h"
#include "ui/events/ozone/device/device_event.h"
#include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/cursor_delegate_evdev.h"
#include "ui/events/ozone/evdev/input_controller_evdev.h"
#include "ui/events/ozone/evdev/input_device_factory_evdev.h"
#include "ui/events/ozone/evdev/input_device_factory_evdev_proxy.h"
#include "ui/events/ozone/evdev/input_injector_evdev.h"
#include "ui/events/ozone/evdev/mouse_button_property.h"
#include "ui/events/ozone/evdev/touch_evdev_types.h"
#include "ui/events/ozone/features.h"
#include "ui/events/ozone/gamepad/gamepad_provider_ozone.h"
namespace ui {
namespace {
class ProxyDeviceEventDispatcher : public DeviceEventDispatcherEvdev { … };
template <typename T>
gfx::PointF GetTransformedEventLocation(const T& params) { … }
template <typename T>
PointerDetails GetTransformedEventPointerDetails(const T& params) { … }
}
EventFactoryEvdev::EventFactoryEvdev(CursorDelegateEvdev* cursor,
DeviceManager* device_manager,
KeyboardLayoutEngine* keyboard_layout)
: … { … }
EventFactoryEvdev::~EventFactoryEvdev() = default;
void EventFactoryEvdev::Init() { … }
void EventFactoryEvdev::SetUserInputTaskRunner(
scoped_refptr<base::SingleThreadTaskRunner> user_input_task_runner) { … }
std::unique_ptr<SystemInputInjector>
EventFactoryEvdev::CreateSystemInputInjector() { … }
void EventFactoryEvdev::DispatchKeyEvent(const KeyEventParams& params) { … }
void EventFactoryEvdev::DispatchMouseMoveEvent(
const MouseMoveEventParams& params) { … }
void EventFactoryEvdev::DispatchMouseButtonEvent(
const MouseButtonEventParams& params) { … }
void EventFactoryEvdev::DispatchMouseWheelEvent(
const MouseWheelEventParams& params) { … }
void EventFactoryEvdev::DispatchPinchEvent(const PinchEventParams& params) { … }
void EventFactoryEvdev::DispatchScrollEvent(const ScrollEventParams& params) { … }
void EventFactoryEvdev::DispatchTouchEvent(const TouchEventParams& params) { … }
void EventFactoryEvdev::DispatchGamepadEvent(const GamepadEvent& event) { … }
void EventFactoryEvdev::DispatchUiEvent(Event* event) { … }
void EventFactoryEvdev::DispatchKeyboardDevicesUpdated(
const std::vector<KeyboardDevice>& devices,
base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) { … }
void EventFactoryEvdev::DispatchTouchscreenDevicesUpdated(
const std::vector<TouchscreenDevice>& devices) { … }
void EventFactoryEvdev::DispatchMouseDevicesUpdated(
const std::vector<InputDevice>& devices,
bool has_mouse) { … }
void EventFactoryEvdev::DispatchPointingStickDevicesUpdated(
const std::vector<InputDevice>& devices) { … }
void EventFactoryEvdev::DispatchTouchpadDevicesUpdated(
const std::vector<TouchpadDevice>& devices,
bool has_haptic_touchpad) { … }
void EventFactoryEvdev::DispatchDeviceListsComplete() { … }
void EventFactoryEvdev::DispatchStylusStateChanged(StylusState stylus_state) { … }
void EventFactoryEvdev::DispatchMicrophoneMuteSwitchValueChanged(bool muted) { … }
void EventFactoryEvdev::DispatchGraphicsTabletDevicesUpdated(
const std::vector<InputDevice>& devices) { … }
void EventFactoryEvdev::DispatchUncategorizedDevicesUpdated(
const std::vector<InputDevice>& devices) { … }
void EventFactoryEvdev::DispatchGamepadDevicesUpdated(
const std::vector<GamepadDevice>& devices,
base::flat_map<int, std::vector<uint64_t>> key_bits_mapping) { … }
void EventFactoryEvdev::DispatchAnyKeysPressedUpdated(bool any) { … }
void EventFactoryEvdev::OnDeviceEvent(const DeviceEvent& event) { … }
void EventFactoryEvdev::OnDispatcherListChanged() { … }
void EventFactoryEvdev::WarpCursorTo(gfx::AcceleratedWidget widget,
const gfx::PointF& location) { … }
int EventFactoryEvdev::NextDeviceId() { … }
void EventFactoryEvdev::StartThread() { … }
void EventFactoryEvdev::OnThreadStarted(
std::unique_ptr<InputDeviceFactoryEvdevProxy> input_device_factory) { … }
}