#include "ui/events/ozone/evdev/libgestures_glue/haptic_touchpad_handler.h"
#include <linux/input.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
#include "ui/events/ozone/evdev/input_device_settings_evdev.h"
#ifndef EVIOCFFTAKECONTROL
#define EVIOCFFTAKECONTROL …
#define EVIOCFFRELEASECONTROL …
#define FF_HID …
struct ff_hid_effect { … };
local_ff_effect;
#else
using local_ff_effect = ff_effect;
#endif
namespace ui {
namespace {
constexpr int kInvalidEffectId = …;
constexpr int kReleaseEffectId = …;
constexpr int kPressEffectId = …;
constexpr uint16_t kGoogleVendorId = …;
constexpr uint8_t kHIDWaveformUsagePage = …;
constexpr struct { … } kEffectToHIDUsage[] = …;
}
std::unique_ptr<HapticTouchpadHandler> HapticTouchpadHandler::Create(
int fd,
const EventDeviceInfo& devinfo) { … }
HapticTouchpadHandler::HapticTouchpadHandler(int fd)
: … { … }
void HapticTouchpadHandler::Initialize() { … }
HapticTouchpadHandler::~HapticTouchpadHandler() = default;
bool HapticTouchpadHandler::IsValid() { … }
void HapticTouchpadHandler::SetEffectForNextButtonRelease(
HapticTouchpadEffect effect,
HapticTouchpadEffectStrength strength) { … }
void HapticTouchpadHandler::SetClickStrength(
HapticTouchpadEffectStrength strength) { … }
void HapticTouchpadHandler::OnGestureClick(bool press) { … }
void HapticTouchpadHandler::PlayEffect(HapticTouchpadEffect effect,
HapticTouchpadEffectStrength strength) { … }
bool HapticTouchpadHandler::SetupFf() { … }
void HapticTouchpadHandler::DestroyAllFfEffects() { … }
void HapticTouchpadHandler::DestroyFfEffect(int effect_id) { … }
void HapticTouchpadHandler::PlayFfEffect(int effect_id) { … }
int HapticTouchpadHandler::UploadFfEffect(uint16_t hid_usage,
uint8_t intensity) { … }
bool HapticTouchpadHandler::TakeControlOfClickEffects() { … }
void HapticTouchpadHandler::ReleaseControlOfClickEffects() { … }
}