chromium/ui/ozone/platform/wayland/host/wayland_touch.cc

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ui/ozone/platform/wayland/host/wayland_touch.h"

#include <stylus-unstable-v2-client-protocol.h>

#include "base/logging.h"
#include "base/notreached.h"
#include "base/time/time.h"
#include "ui/events/types/event_type.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/ozone/platform/wayland/common/wayland_util.h"
#include "ui/ozone/platform/wayland/host/wayland_connection.h"
#include "ui/ozone/platform/wayland/host/wayland_serial_tracker.h"
#include "ui/ozone/platform/wayland/host/wayland_window.h"

namespace ui {

namespace {

// TODO(crbug.com/40235357): Remove this method when Compositors other
// than Exo comply with `wl_touch.frame`.
//
// For instance, on Gnome/Wayland, KDE and Weston compositors a wl_touch.up does
// not come accompanied by a respective wl_touch.frame event. On these scenarios
// be conservative and always dispatch the events immediately.
wl::EventDispatchPolicy EventDispatchPolicyForPlatform() {}

}  // namespace

WaylandTouch::WaylandTouch(wl_touch* touch,
                           WaylandConnection* connection,
                           Delegate* delegate)
    :{}

WaylandTouch::~WaylandTouch() {}

// static
void WaylandTouch::OnTouchDown(void* data,
                               wl_touch* touch,
                               uint32_t serial,
                               uint32_t time,
                               struct wl_surface* surface,
                               int32_t id,
                               wl_fixed_t x,
                               wl_fixed_t y) {}

// static
void WaylandTouch::OnTouchUp(void* data,
                             wl_touch* touch,
                             uint32_t serial,
                             uint32_t time,
                             int32_t id) {}

// static
void WaylandTouch::OnTouchMotion(void* data,
                                 wl_touch* touch,
                                 uint32_t time,
                                 int32_t id,
                                 wl_fixed_t x,
                                 wl_fixed_t y) {}

// static
void WaylandTouch::OnTouchShape(void* data,
                                wl_touch* touch,
                                int32_t id,
                                wl_fixed_t major,
                                wl_fixed_t minor) {}

// static
void WaylandTouch::OnTouchOrientation(void* data,
                                      wl_touch* touch,
                                      int32_t id,
                                      wl_fixed_t orientation) {}

// static
void WaylandTouch::OnTouchCancel(void* data, wl_touch* touch) {}

// static
void WaylandTouch::OnTouchFrame(void* data, wl_touch* touch) {}

void WaylandTouch::SetupStylus() {}

// static
void WaylandTouch::OnTouchStylusTool(void* data,
                                     struct zcr_touch_stylus_v2* stylus,
                                     uint32_t id,
                                     uint32_t stylus_type) {}

// static
void WaylandTouch::OnTouchStylusForce(void* data,
                                      struct zcr_touch_stylus_v2* stylus,
                                      uint32_t time,
                                      uint32_t id,
                                      wl_fixed_t force) {}

// static
void WaylandTouch::OnTouchStylusTilt(void* data,
                                     struct zcr_touch_stylus_v2* stylus,
                                     uint32_t time,
                                     uint32_t id,
                                     wl_fixed_t tilt_x,
                                     wl_fixed_t tilt_y) {}

}  // namespace ui