#include "ui/events/x/events_x_utils.h"
#include <stddef.h>
#include <string.h>
#include <algorithm>
#include <cmath>
#include "base/logging.h"
#include "base/memory/singleton.h"
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "ui/display/display.h"
#include "ui/display/screen.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/touch_factory_x11.h"
#include "ui/events/devices/x11/xinput_util.h"
#include "ui/events/event_constants.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
#include "ui/events/pointer_details.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/x/atom_cache.h"
#include "ui/gfx/x/extension_manager.h"
#include "ui/gfx/x/xproto.h"
namespace {
const int kWheelScrollAmount = …;
const int kMinWheelButton = …;
const int kMaxWheelButton = …;
class XModifierStateWatcher { … };
bool TouchEventIsGeneratedHack(const x11::Event& x11_event) { … }
int GetEventFlagsFromXState(x11::KeyButMask state) { … }
int GetEventFlagsFromXState(uint32_t state) { … }
int GetEventFlagsFromXGenericEvent(const x11::Event& x11_event) { … }
int GetEventFlagsForButton(int button) { … }
int GetEventFlagsForButton(x11::Button button) { … }
int GetButtonMaskForX2Event(const x11::Input::DeviceEvent& xievent) { … }
ui::EventType GetTouchEventType(const x11::Event& x11_event) { … }
double GetParamFromXEvent(const x11::Event& xev,
ui::DeviceDataManagerX11::DataType val,
double default_value) { … }
void ScaleTouchRadius(const x11::Event& x11_event, double* radius) { … }
bool GetGestureTimes(const x11::Event& xev,
double* start_time,
double* end_time) { … }
int64_t g_last_seen_timestamp_ms = …;
int64_t g_rollover_ms = …;
base::TimeTicks TimeTicksFromXEventTime(x11::Time timestamp) { … }
base::TimeTicks TimeTicksFromXEvent(const x11::Event& xev) { … }
double Fp1616ToDouble(x11::Input::Fp1616 x) { … }
}
namespace ui {
EventType EventTypeFromXEvent(const x11::Event& xev) { … }
int GetEventFlagsFromXKeyEvent(const x11::KeyEvent& key, bool send_event) { … }
int EventFlagsFromXEvent(const x11::Event& xev) { … }
base::TimeTicks EventTimeFromXEvent(const x11::Event& xev) { … }
gfx::Point EventLocationFromXEvent(const x11::Event& xev) { … }
gfx::Point EventSystemLocationFromXEvent(const x11::Event& xev) { … }
int EventButtonFromXEvent(const x11::Event& xev) { … }
int GetChangedMouseButtonFlagsFromXEvent(const x11::Event& xev) { … }
gfx::Vector2d GetMouseWheelOffsetFromXEvent(const x11::Event& xev) { … }
float GetStylusForceFromXEvent(const x11::Event& x11_event) { … }
float GetStylusTiltXFromXEvent(const x11::Event& x11_event) { … }
float GetStylusTiltYFromXEvent(const x11::Event& x11_event) { … }
PointerDetails GetStylusPointerDetailsFromXEvent(const x11::Event& xev) { … }
int GetTouchIdFromXEvent(const x11::Event& xev) { … }
float GetTouchRadiusXFromXEvent(const x11::Event& xev) { … }
float GetTouchRadiusYFromXEvent(const x11::Event& xev) { … }
float GetTouchAngleFromXEvent(const x11::Event& xev) { … }
float GetTouchForceFromXEvent(const x11::Event& x11_event) { … }
PointerDetails GetTouchPointerDetailsFromXEvent(const x11::Event& xev) { … }
bool GetScrollOffsetsFromXEvent(const x11::Event& xev,
float* x_offset,
float* y_offset,
float* x_offset_ordinal,
float* y_offset_ordinal,
int* finger_count) { … }
bool GetFlingDataFromXEvent(const x11::Event& xev,
float* vx,
float* vy,
float* vx_ordinal,
float* vy_ordinal,
bool* is_cancel) { … }
bool IsAltPressed() { … }
int GetModifierKeyState() { … }
void ResetTimestampRolloverCountersForTesting() { … }
}