KWin
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
pointerconstraints_v1.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2016 Martin Gräßlin <mgraesslin@kde.org>
3 SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#pragma once
9
10#include "kwin_export.h"
11
12#include <QObject>
13#include <QRegion>
14#include <memory>
15
16struct wl_resource;
17
18namespace KWin
19{
20class ConfinedPointerV1InterfacePrivate;
21class Display;
22class LockedPointerV1InterfacePrivate;
23class PointerConstraintsV1InterfacePrivate;
24class SurfaceInterface;
25
34class KWIN_EXPORT PointerConstraintsV1Interface : public QObject
35{
36 Q_OBJECT
37
38public:
39 explicit PointerConstraintsV1Interface(Display *display, QObject *parent = nullptr);
41
42private:
43 std::unique_ptr<PointerConstraintsV1InterfacePrivate> d;
44};
45
60class KWIN_EXPORT LockedPointerV1Interface : public QObject
61{
62 Q_OBJECT
63
64public:
66
67 enum class LifeTime : uint {
68 OneShot = 1,
69 Persistent = 2,
70 };
71
72 LifeTime lifeTime() const;
73
85 QRegion region() const;
86
102 QPointF cursorPositionHint() const;
103
109 bool isLocked() const;
110
124 void setLocked(bool locked);
125
126Q_SIGNALS:
131
138
145
152
153private:
154 LockedPointerV1Interface(SurfaceInterface *surface, LifeTime lifeTime, const QRegion &region, ::wl_resource *resource);
155 std::unique_ptr<LockedPointerV1InterfacePrivate> d;
158};
159
176class KWIN_EXPORT ConfinedPointerV1Interface : public QObject
177{
178 Q_OBJECT
179
180public:
182
183 enum class LifeTime : uint {
184 OneShot = 1,
185 Persistent = 2,
186 };
187
188 LifeTime lifeTime() const;
189
201 QRegion region() const;
202
208 bool isConfined() const;
209
221 void setConfined(bool confined);
222
223Q_SIGNALS:
230
237
238private:
239 ConfinedPointerV1Interface(SurfaceInterface *surface, LifeTime lifeTime, const QRegion &region, ::wl_resource *resource);
240 std::unique_ptr<ConfinedPointerV1InterfacePrivate> d;
243};
244
245} // namespace KWin
Class holding the Wayland server display loop.
Definition display.h:34
Resource representing a wl_surface.
Definition surface.h:80
struct _XDisplay Display