#ifdef UNSAFE_BUFFERS_BUILD
#pragma allow_unsafe_buffers
#endif
#include "ui/events/test/events_test_utils_x11.h"
#include <stddef.h>
#include "base/check_op.h"
#include "base/notreached.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
#include "ui/events/devices/x11/xinput_util.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/xinput.h"
#include "ui/gfx/x/xproto.h"
namespace {
x11::KeyButMask XEventState(int flags) { … }
x11::KeyEvent::Opcode XKeyEventType(ui::EventType type) { … }
int XIKeyEventType(ui::EventType type) { … }
int XIButtonEventType(ui::EventType type) { … }
unsigned int XButtonEventButton(ui::EventType type, int flags) { … }
void InitValuatorsForXIDeviceEvent(x11::Input::DeviceEvent* devev) { … }
template <typename T>
x11::Input::Fp1616 ToFp1616(T x) { … }
x11::Event CreateXInput2Event(int deviceid,
int evtype,
int tracking_id,
const gfx::Point& location) { … }
}
namespace ui {
ScopedXI2Event::ScopedXI2Event() = default;
ScopedXI2Event::~ScopedXI2Event() = default;
void ScopedXI2Event::InitKeyEvent(EventType type,
KeyboardCode key_code,
int flags) { … }
void ScopedXI2Event::InitMotionEvent(const gfx::Point& location,
const gfx::Point& root_location,
int flags) { … }
void ScopedXI2Event::InitButtonEvent(EventType type,
const gfx::Point& location,
int flags) { … }
void ScopedXI2Event::InitGenericKeyEvent(int deviceid,
int sourceid,
EventType type,
KeyboardCode key_code,
int flags) { … }
void ScopedXI2Event::InitGenericButtonEvent(int deviceid,
EventType type,
const gfx::Point& location,
int flags) { … }
void ScopedXI2Event::InitGenericMouseWheelEvent(int deviceid,
int wheel_delta,
int flags) { … }
void ScopedXI2Event::InitScrollEvent(int deviceid,
int x_offset,
int y_offset,
int x_offset_ordinal,
int y_offset_ordinal,
int finger_count) { … }
void ScopedXI2Event::InitFlingScrollEvent(int deviceid,
int x_velocity,
int y_velocity,
int x_velocity_ordinal,
int y_velocity_ordinal,
bool is_cancel) { … }
void ScopedXI2Event::InitTouchEvent(int deviceid,
int evtype,
int tracking_id,
const gfx::Point& location,
const std::vector<Valuator>& valuators) { … }
void ScopedXI2Event::SetUpValuators(const std::vector<Valuator>& valuators) { … }
void SetUpTouchPadForTest(int deviceid) { … }
void SetUpTouchDevicesForTest(const std::vector<int>& devices) { … }
void SetUpPointerDevicesForTest(const std::vector<int>& devices) { … }
}