KWin
Loading...
Searching...
No Matches
subcompositor.h
Go to the documentation of this file.
1/*
2 SPDX-FileCopyrightText: 2014 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 <memory>
14
15struct wl_resource;
16
17namespace KWin
18{
19class Display;
20class SubCompositorInterfacePrivate;
21class SurfaceInterface;
22class SurfaceRole;
23class SubSurfaceInterface;
24class SubSurfaceInterfacePrivate;
25
33class KWIN_EXPORT SubCompositorInterface : public QObject
34{
35 Q_OBJECT
36
37public:
38 explicit SubCompositorInterface(Display *display, QObject *parent = nullptr);
39 ~SubCompositorInterface() override;
40
41Q_SIGNALS:
46
47private:
48 std::unique_ptr<SubCompositorInterfacePrivate> d;
49};
50
54class KWIN_EXPORT SubSurfaceInterface : public QObject
55{
56 Q_OBJECT
57
58public:
59 ~SubSurfaceInterface() override;
60
61 static SurfaceRole *role();
62
66 QPoint position() const;
67
71 enum class Mode {
72 Synchronized,
73 Desynchronized,
74 };
75
81 Mode mode() const;
82
92 bool isSynchronized() const;
93
98 SurfaceInterface *surface() const;
99
103 SurfaceInterface *parentSurface() const;
104
108 SurfaceInterface *mainSurface() const;
109
110Q_SIGNALS:
114 void positionChanged(const QPoint &position);
119
120private:
121 SubSurfaceInterface(SurfaceInterface *surface, SurfaceInterface *parent, wl_resource *resource);
122
123 void parentDesynchronized();
124 void parentApplyState(quint32 serial);
125
126 std::unique_ptr<SubSurfaceInterfacePrivate> d;
130};
131
132} // namespace KWin
133
Class holding the Wayland server display loop.
Definition display.h:34
void subSurfaceCreated(KWin::SubSurfaceInterface *subsurface)
void positionChanged(const QPoint &position)
void modeChanged(KWin::SubSurfaceInterface::Mode mode)
Resource representing a wl_surface.
Definition surface.h:80
Q_DECLARE_METATYPE(KWin::SwitchEvent::State)
struct _XDisplay Display