2020-11-03 18:44:32 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
|
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "pointerconstraints_v1_interface.h"
|
|
|
|
|
|
|
|
#include "qwayland-server-pointer-constraints-unstable-v1.h"
|
|
|
|
|
|
|
|
namespace KWaylandServer
|
|
|
|
{
|
|
|
|
class PointerConstraintsV1InterfacePrivate : public QtWaylandServer::zwp_pointer_constraints_v1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit PointerConstraintsV1InterfacePrivate(Display *display);
|
|
|
|
|
|
|
|
protected:
|
2021-08-29 05:11:06 +00:00
|
|
|
void zwp_pointer_constraints_v1_lock_pointer(Resource *resource,
|
|
|
|
uint32_t id,
|
2020-11-03 18:44:32 +00:00
|
|
|
struct ::wl_resource *surface_resource,
|
|
|
|
struct ::wl_resource *pointer_resource,
|
|
|
|
struct ::wl_resource *region_resource,
|
|
|
|
uint32_t lifetime) override;
|
2021-08-29 05:11:06 +00:00
|
|
|
void zwp_pointer_constraints_v1_confine_pointer(Resource *resource,
|
|
|
|
uint32_t id,
|
2020-11-03 18:44:32 +00:00
|
|
|
struct ::wl_resource *surface_resource,
|
|
|
|
struct ::wl_resource *pointer_resource,
|
|
|
|
struct ::wl_resource *region_resource,
|
|
|
|
uint32_t lifetime) override;
|
|
|
|
void zwp_pointer_constraints_v1_destroy(Resource *resource) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class LockedPointerV1InterfacePrivate : public QtWaylandServer::zwp_locked_pointer_v1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static LockedPointerV1InterfacePrivate *get(LockedPointerV1Interface *pointer);
|
|
|
|
|
2021-08-29 05:11:06 +00:00
|
|
|
LockedPointerV1InterfacePrivate(LockedPointerV1Interface *q, LockedPointerV1Interface::LifeTime lifeTime, const QRegion ®ion, ::wl_resource *resource);
|
2020-11-03 18:44:32 +00:00
|
|
|
|
|
|
|
void commit();
|
|
|
|
|
|
|
|
LockedPointerV1Interface *q;
|
|
|
|
LockedPointerV1Interface::LifeTime lifeTime;
|
|
|
|
QRegion region;
|
|
|
|
QRegion pendingRegion;
|
|
|
|
QPointF hint = QPointF(-1, -1);
|
|
|
|
QPointF pendingHint;
|
|
|
|
bool hasPendingRegion = false;
|
|
|
|
bool hasPendingHint = false;
|
|
|
|
bool isLocked = false;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void zwp_locked_pointer_v1_destroy_resource(Resource *resource) override;
|
|
|
|
void zwp_locked_pointer_v1_destroy(Resource *resource) override;
|
2021-08-29 05:11:06 +00:00
|
|
|
void zwp_locked_pointer_v1_set_cursor_position_hint(Resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y) override;
|
|
|
|
void zwp_locked_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region_resource) override;
|
2020-11-03 18:44:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class ConfinedPointerV1InterfacePrivate : public QtWaylandServer::zwp_confined_pointer_v1
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static ConfinedPointerV1InterfacePrivate *get(ConfinedPointerV1Interface *pointer);
|
|
|
|
|
|
|
|
ConfinedPointerV1InterfacePrivate(ConfinedPointerV1Interface *q,
|
|
|
|
ConfinedPointerV1Interface::LifeTime lifeTime,
|
2021-08-29 05:11:06 +00:00
|
|
|
const QRegion ®ion,
|
|
|
|
::wl_resource *resource);
|
2020-11-03 18:44:32 +00:00
|
|
|
|
|
|
|
void commit();
|
|
|
|
|
|
|
|
ConfinedPointerV1Interface *q;
|
|
|
|
ConfinedPointerV1Interface::LifeTime lifeTime;
|
|
|
|
QRegion region;
|
|
|
|
QRegion pendingRegion;
|
|
|
|
bool hasPendingRegion = false;
|
|
|
|
bool isConfined = false;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void zwp_confined_pointer_v1_destroy_resource(Resource *resource) override;
|
|
|
|
void zwp_confined_pointer_v1_destroy(Resource *resource) override;
|
2021-08-29 05:11:06 +00:00
|
|
|
void zwp_confined_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region_resource) override;
|
2020-11-03 18:44:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWaylandServer
|