2014-08-28 07:52:35 +00:00
|
|
|
/********************************************************************
|
2014-09-17 13:57:56 +00:00
|
|
|
Copyright 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-08-28 07:52:35 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
This library is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
|
|
|
License as published by the Free Software Foundation; either
|
|
|
|
version 2.1 of the License, or (at your option) version 3, or any
|
|
|
|
later version accepted by the membership of KDE e.V. (or its
|
|
|
|
successor approved by the membership of KDE e.V.), which shall
|
|
|
|
act as a proxy defined in Section 6 of version 3 of the license.
|
2014-08-28 07:52:35 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
This library is distributed in the hope that it will be useful,
|
2014-08-28 07:52:35 +00:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2014-09-17 13:57:56 +00:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
Lesser General Public License for more details.
|
2014-08-28 07:52:35 +00:00
|
|
|
|
2014-09-17 13:57:56 +00:00
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
2014-08-28 07:52:35 +00:00
|
|
|
*********************************************************************/
|
2014-09-17 14:20:56 +00:00
|
|
|
#ifndef WAYLAND_SERVER_SURFACE_INTERFACE_H
|
|
|
|
#define WAYLAND_SERVER_SURFACE_INTERFACE_H
|
2014-08-28 07:52:35 +00:00
|
|
|
|
2014-11-14 08:45:02 +00:00
|
|
|
#include "resource.h"
|
2014-08-28 07:52:35 +00:00
|
|
|
#include "output_interface.h"
|
|
|
|
|
|
|
|
#include <QObject>
|
2014-10-14 12:04:35 +00:00
|
|
|
#include <QPointer>
|
2014-08-28 07:52:35 +00:00
|
|
|
#include <QRegion>
|
|
|
|
|
2014-10-14 11:43:24 +00:00
|
|
|
#include <KWayland/Server/kwaylandserver_export.h>
|
2014-09-17 13:10:43 +00:00
|
|
|
|
2014-09-17 14:10:38 +00:00
|
|
|
namespace KWayland
|
2014-08-28 07:52:35 +00:00
|
|
|
{
|
2014-09-17 14:10:38 +00:00
|
|
|
namespace Server
|
2014-08-28 07:52:35 +00:00
|
|
|
{
|
2014-08-28 12:22:53 +00:00
|
|
|
class BufferInterface;
|
2014-08-28 07:52:35 +00:00
|
|
|
class CompositorInterface;
|
2014-10-14 12:04:35 +00:00
|
|
|
class SubSurfaceInterface;
|
2014-08-28 07:52:35 +00:00
|
|
|
|
2014-11-14 08:45:02 +00:00
|
|
|
class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource
|
2014-08-28 07:52:35 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QRegion damage READ damage NOTIFY damaged)
|
|
|
|
Q_PROPERTY(QRegion opaque READ opaque NOTIFY opaqueChanged)
|
|
|
|
Q_PROPERTY(QRegion input READ input NOTIFY inputChanged)
|
|
|
|
Q_PROPERTY(qint32 scale READ scale NOTIFY scaleChanged)
|
2014-09-17 14:10:38 +00:00
|
|
|
Q_PROPERTY(KWayland::Server::OutputInterface::Transform transform READ transform NOTIFY transformChanged)
|
2015-03-03 09:16:11 +00:00
|
|
|
Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
|
2014-08-28 07:52:35 +00:00
|
|
|
public:
|
|
|
|
virtual ~SurfaceInterface();
|
|
|
|
|
|
|
|
void frameRendered(quint32 msec);
|
|
|
|
|
2014-09-19 05:06:31 +00:00
|
|
|
QRegion damage() const;
|
|
|
|
QRegion opaque() const;
|
|
|
|
QRegion input() const;
|
2014-10-16 12:59:01 +00:00
|
|
|
bool inputIsInfitine() const;
|
2014-09-19 05:06:31 +00:00
|
|
|
qint32 scale() const;
|
|
|
|
OutputInterface::Transform transform() const;
|
|
|
|
BufferInterface *buffer();
|
|
|
|
QPoint offset() const;
|
2015-03-03 09:16:11 +00:00
|
|
|
/**
|
|
|
|
* The size of the Surface.
|
|
|
|
* @since 5.3
|
|
|
|
**/
|
|
|
|
QSize size() const;
|
2014-09-19 05:06:31 +00:00
|
|
|
|
2014-10-14 12:04:35 +00:00
|
|
|
/**
|
|
|
|
* @returns The SubSurface for this Surface in case there is one.
|
|
|
|
**/
|
|
|
|
QPointer<SubSurfaceInterface> subSurface() const;
|
|
|
|
/**
|
|
|
|
* @returns Children in stacking order from bottom (first) to top (last).
|
|
|
|
**/
|
|
|
|
QList<QPointer<SubSurfaceInterface>> childSubSurfaces() const;
|
|
|
|
|
2014-09-19 05:06:31 +00:00
|
|
|
static SurfaceInterface *get(wl_resource *native);
|
2015-02-09 13:31:20 +00:00
|
|
|
/**
|
|
|
|
* @returns The SurfaceInterface with given @p id, if it exists, otherwise @c nullptr.
|
|
|
|
* @since 5.3
|
|
|
|
**/
|
|
|
|
static SurfaceInterface *get(quint32 id);
|
2014-08-28 07:52:35 +00:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
|
|
|
void damaged(const QRegion&);
|
|
|
|
void opaqueChanged(const QRegion&);
|
|
|
|
void inputChanged(const QRegion&);
|
|
|
|
void scaleChanged(qint32);
|
2014-09-17 14:10:38 +00:00
|
|
|
void transformChanged(KWayland::Server::OutputInterface::Transform);
|
2014-11-28 07:33:32 +00:00
|
|
|
/**
|
|
|
|
* Emitted when the Surface removes its content
|
|
|
|
**/
|
|
|
|
void unmapped();
|
2015-03-03 09:16:11 +00:00
|
|
|
/**
|
|
|
|
* @since 5.3
|
|
|
|
**/
|
|
|
|
void sizeChanged();
|
2014-08-28 07:52:35 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
friend class CompositorInterface;
|
2014-10-14 12:04:35 +00:00
|
|
|
friend class SubSurfaceInterface;
|
2014-11-20 15:40:14 +00:00
|
|
|
explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource);
|
2014-09-19 05:06:31 +00:00
|
|
|
|
|
|
|
class Private;
|
2014-11-14 08:45:02 +00:00
|
|
|
Private *d_func() const;
|
2014-08-28 07:52:35 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|