File indexing completed on 2024-05-12 05:32:16

0001 /*
0002     KWin - the KDE window manager
0003     This file is part of the KDE project.
0004 
0005     SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <QObject>
0013 
0014 namespace KWin
0015 {
0016 class SurfaceInterface;
0017 class SubSurfaceInterface;
0018 }
0019 
0020 namespace KWin
0021 {
0022 
0023 /**
0024  * The SubSurfaceMonitor class provides a convenient way for monitoring changes in
0025  * sub-surface trees, e.g. addition or removal of sub-surfaces, etc.
0026  */
0027 class SubSurfaceMonitor : public QObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     /**
0033      * Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent.
0034      */
0035     SubSurfaceMonitor(SurfaceInterface *surface, QObject *parent);
0036 
0037 Q_SIGNALS:
0038     /**
0039      * This signal is emitted when a new sub-surface has been added to the tree.
0040      */
0041     void subSurfaceAdded();
0042     /**
0043      * This signal is emitted when a sub-surface has been removed from the tree.
0044      */
0045     void subSurfaceRemoved();
0046     /**
0047      * This signal is emitted when a sub-surface has been moved relative to its parent.
0048      */
0049     void subSurfaceMoved();
0050     /**
0051      * This signal is emitted when a sub-surface has been resized.
0052      */
0053     void subSurfaceResized();
0054     /**
0055      * This signal is emitted when a sub-surface is mapped.
0056      */
0057     void subSurfaceMapped();
0058     /**
0059      * This signal is emitted when a sub-surface is unmapped.
0060      */
0061     void subSurfaceUnmapped();
0062     /**
0063      * This signal is emitted when the buffer size of a subsurface has changed.
0064      */
0065     void subSurfaceBufferSizeChanged();
0066     void subSurfaceCommitted(SubSurfaceInterface *subSurface);
0067 
0068 private:
0069     void registerSubSurface(SubSurfaceInterface *subSurface);
0070     void unregisterSubSurface(SubSurfaceInterface *subSurface);
0071     void registerSurface(SurfaceInterface *surface);
0072     void unregisterSurface(SurfaceInterface *surface);
0073 };
0074 
0075 } // namespace KWin