Changeset View
Changeset View
Standalone View
Standalone View
subsurfacemonitor.h
- This file was added.
1 | /******************************************************************** | ||||
---|---|---|---|---|---|
2 | KWin - the KDE window manager | ||||
3 | This file is part of the KDE project. | ||||
4 | | ||||
5 | Copyright (C) 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org> | ||||
6 | | ||||
7 | This program is free software; you can redistribute it and/or modify | ||||
8 | it under the terms of the GNU General Public License as published by | ||||
9 | the Free Software Foundation; either version 2 of the License, or | ||||
10 | (at your option) any later version. | ||||
11 | | ||||
12 | This program is distributed in the hope that it will be useful, | ||||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | GNU General Public License for more details. | ||||
16 | | ||||
17 | You should have received a copy of the GNU General Public License | ||||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||
19 | *********************************************************************/ | ||||
20 | | ||||
21 | #pragma once | ||||
22 | | ||||
23 | #include <QObject> | ||||
24 | | ||||
25 | namespace KWayland | ||||
26 | { | ||||
27 | namespace Server | ||||
28 | { | ||||
29 | class SurfaceInterface; | ||||
30 | class SubSurfaceInterface; | ||||
31 | } | ||||
32 | } | ||||
33 | | ||||
34 | namespace KWin | ||||
35 | { | ||||
36 | | ||||
37 | /** | ||||
38 | * The SubSurfaceMonitor class provides a convenient way for monitoring changes in | ||||
39 | * sub-surface trees, e.g. addition or removal of sub-surfaces, etc. | ||||
40 | */ | ||||
41 | class SubSurfaceMonitor : public QObject | ||||
42 | { | ||||
43 | Q_OBJECT | ||||
44 | | ||||
45 | public: | ||||
46 | /** | ||||
47 | * Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent. | ||||
48 | */ | ||||
49 | SubSurfaceMonitor(KWayland::Server::SurfaceInterface *surface, QObject *parent); | ||||
50 | | ||||
51 | Q_SIGNALS: | ||||
52 | /** | ||||
53 | * This signal is emitted when a new sub-surface has been added to the tree. | ||||
54 | */ | ||||
55 | void subSurfaceAdded(); | ||||
56 | /** | ||||
57 | * This signal is emitted when a sub-surface has been removed from the tree. | ||||
58 | */ | ||||
59 | void subSurfaceRemoved(); | ||||
60 | /** | ||||
61 | * This signal is emitted when a sub-surface has been moved relative to its parent. | ||||
62 | */ | ||||
63 | void subSurfaceMoved(); | ||||
64 | /** | ||||
65 | * This signal is emitted when a sub-surface has been resized. | ||||
66 | */ | ||||
67 | void subSurfaceResized(); | ||||
68 | /** | ||||
69 | * This signal is emitted when a sub-surface is mapped. | ||||
70 | */ | ||||
71 | void subSurfaceMapped(); | ||||
72 | /** | ||||
73 | * This signal is emitted when a sub-surface is unmapped. | ||||
74 | */ | ||||
75 | void subSurfaceUnmapped(); | ||||
76 | | ||||
77 | private: | ||||
78 | void registerSubSurface(KWayland::Server::SubSurfaceInterface *subSurface); | ||||
79 | void unregisterSubSurface(KWayland::Server::SubSurfaceInterface *subSurface); | ||||
80 | void registerSurface(KWayland::Server::SurfaceInterface *surface); | ||||
81 | void unregisterSurface(KWayland::Server::SurfaceInterface *surface); | ||||
82 | }; | ||||
83 | | ||||
84 | } // namespace KWin |