2020-08-02 22:22:19 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
2020-04-22 11:59:42 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
2020-04-22 11:59:42 +00:00
|
|
|
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2020-04-22 11:59:42 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
namespace KWaylandServer
|
|
|
|
{
|
|
|
|
class SurfaceInterface;
|
|
|
|
class SubSurfaceInterface;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The SubSurfaceMonitor class provides a convenient way for monitoring changes in
|
|
|
|
* sub-surface trees, e.g. addition or removal of sub-surfaces, etc.
|
|
|
|
*/
|
|
|
|
class SubSurfaceMonitor : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* Constructs a SubSurfaceTreeMonitor with the given @a surface and @a parent.
|
|
|
|
*/
|
|
|
|
SubSurfaceMonitor(KWaylandServer::SurfaceInterface *surface, QObject *parent);
|
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a new sub-surface has been added to the tree.
|
|
|
|
*/
|
|
|
|
void subSurfaceAdded();
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a sub-surface has been removed from the tree.
|
|
|
|
*/
|
|
|
|
void subSurfaceRemoved();
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a sub-surface has been moved relative to its parent.
|
|
|
|
*/
|
|
|
|
void subSurfaceMoved();
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a sub-surface has been resized.
|
|
|
|
*/
|
|
|
|
void subSurfaceResized();
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a sub-surface is mapped.
|
|
|
|
*/
|
|
|
|
void subSurfaceMapped();
|
|
|
|
/**
|
|
|
|
* This signal is emitted when a sub-surface is unmapped.
|
|
|
|
*/
|
|
|
|
void subSurfaceUnmapped();
|
2020-06-10 16:40:44 +00:00
|
|
|
/**
|
|
|
|
* This signal is emitted when the mapping between the surface-local coordinate space
|
|
|
|
* and the buffer coordinate space for a sub-surface has changed.
|
|
|
|
*/
|
|
|
|
void subSurfaceSurfaceToBufferMatrixChanged();
|
2020-06-30 06:33:45 +00:00
|
|
|
/**
|
|
|
|
* This signal is emitted when the buffer size of a subsurface has changed.
|
|
|
|
*/
|
|
|
|
void subSurfaceBufferSizeChanged();
|
2021-02-02 13:16:33 +00:00
|
|
|
void subSurfaceCommitted(KWaylandServer::SubSurfaceInterface *subSurface);
|
2020-04-22 11:59:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void registerSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);
|
|
|
|
void unregisterSubSurface(KWaylandServer::SubSurfaceInterface *subSurface);
|
|
|
|
void registerSurface(KWaylandServer::SurfaceInterface *surface);
|
|
|
|
void unregisterSurface(KWaylandServer::SurfaceInterface *surface);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace KWin
|