2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2014-10-14 12:04:35 +00:00
|
|
|
|
2020-03-15 15:19:28 +00:00
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
|
|
|
|
*/
|
2014-10-14 12:04:35 +00:00
|
|
|
#ifndef WAYLAND_SERVER_SUBSURFACE_INTERFACE_P_H
|
|
|
|
#define WAYLAND_SERVER_SUBSURFACE_INTERFACE_P_H
|
|
|
|
|
|
|
|
#include "subcompositor_interface.h"
|
2014-11-14 08:45:02 +00:00
|
|
|
#include "resource_p.h"
|
2014-10-14 12:04:35 +00:00
|
|
|
// Qt
|
|
|
|
#include <QPoint>
|
|
|
|
// Wayland
|
|
|
|
#include <wayland-server.h>
|
|
|
|
|
|
|
|
namespace KWayland
|
|
|
|
{
|
|
|
|
namespace Server
|
|
|
|
{
|
|
|
|
|
2014-11-14 08:45:02 +00:00
|
|
|
class SubSurfaceInterface::Private : public Resource::Private
|
2014-10-14 12:04:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-11-20 15:40:14 +00:00
|
|
|
Private(SubSurfaceInterface *q, SubCompositorInterface *compositor, wl_resource *parentResource);
|
2014-10-14 12:04:35 +00:00
|
|
|
~Private();
|
|
|
|
|
2014-11-14 14:33:21 +00:00
|
|
|
using Resource::Private::create;
|
2014-11-19 15:53:56 +00:00
|
|
|
void create(ClientConnection *client, quint32 version, quint32 id, SurfaceInterface *surface, SurfaceInterface *parent);
|
2014-10-14 12:04:35 +00:00
|
|
|
void commit();
|
|
|
|
|
|
|
|
QPoint pos = QPoint(0, 0);
|
|
|
|
QPoint scheduledPos = QPoint();
|
|
|
|
bool scheduledPosChange = false;
|
|
|
|
Mode mode = Mode::Synchronized;
|
|
|
|
QPointer<SurfaceInterface> surface;
|
|
|
|
QPointer<SurfaceInterface> parent;
|
|
|
|
|
|
|
|
private:
|
2014-11-14 09:55:06 +00:00
|
|
|
SubSurfaceInterface *q_func() {
|
|
|
|
return reinterpret_cast<SubSurfaceInterface *>(q);
|
|
|
|
}
|
2014-10-14 12:04:35 +00:00
|
|
|
void setMode(Mode mode);
|
|
|
|
void setPosition(const QPoint &pos);
|
|
|
|
void placeAbove(SurfaceInterface *sibling);
|
|
|
|
void placeBelow(SurfaceInterface *sibling);
|
|
|
|
|
|
|
|
static void setPositionCallback(wl_client *client, wl_resource *resource, int32_t x, int32_t y);
|
|
|
|
static void placeAboveCallback(wl_client *client, wl_resource *resource, wl_resource *sibling);
|
|
|
|
static void placeBelowCallback(wl_client *client, wl_resource *resource, wl_resource *sibling);
|
|
|
|
static void setSyncCallback(wl_client *client, wl_resource *resource);
|
|
|
|
static void setDeSyncCallback(wl_client *client, wl_resource *resource);
|
|
|
|
|
|
|
|
static const struct wl_subsurface_interface s_interface;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|