2020-03-15 15:19:28 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
|
2020-10-31 14:03:30 +00:00
|
|
|
SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@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
|
|
|
|
*/
|
2020-10-31 14:03:30 +00:00
|
|
|
|
|
|
|
#pragma once
|
2014-10-14 12:04:35 +00:00
|
|
|
|
|
|
|
#include "subcompositor_interface.h"
|
2020-10-31 14:03:30 +00:00
|
|
|
#include "surfacerole_p.h"
|
|
|
|
|
2014-10-14 12:04:35 +00:00
|
|
|
#include <QPoint>
|
2020-10-31 14:03:30 +00:00
|
|
|
#include <QPointer>
|
|
|
|
|
|
|
|
#include "qwayland-server-wayland.h"
|
2014-10-14 12:04:35 +00:00
|
|
|
|
2020-04-29 14:56:38 +00:00
|
|
|
namespace KWaylandServer
|
2014-10-14 12:04:35 +00:00
|
|
|
{
|
|
|
|
|
2020-10-31 14:03:30 +00:00
|
|
|
class SubCompositorInterfacePrivate : public QtWaylandServer::wl_subcompositor
|
2014-10-14 12:04:35 +00:00
|
|
|
{
|
|
|
|
public:
|
2020-10-31 14:03:30 +00:00
|
|
|
SubCompositorInterfacePrivate(Display *display, SubCompositorInterface *q);
|
2014-10-14 12:04:35 +00:00
|
|
|
|
2020-10-31 14:03:30 +00:00
|
|
|
SubCompositorInterface *q;
|
2014-10-14 12:04:35 +00:00
|
|
|
|
2020-10-31 14:03:30 +00:00
|
|
|
protected:
|
|
|
|
void subcompositor_destroy(Resource *resource) override;
|
|
|
|
void subcompositor_get_subsurface(Resource *resource, uint32_t id,
|
|
|
|
struct ::wl_resource *surface_resource,
|
|
|
|
struct ::wl_resource *parent_resource) override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SubSurfaceInterfacePrivate : public SurfaceRole, public QtWaylandServer::wl_subsurface
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static SubSurfaceInterfacePrivate *get(SubSurfaceInterface *subsurface);
|
|
|
|
|
|
|
|
SubSurfaceInterfacePrivate(SubSurfaceInterface *q, SurfaceInterface *surface,
|
|
|
|
SurfaceInterface *parent, ::wl_resource *resource);
|
|
|
|
|
|
|
|
void commit() override;
|
|
|
|
|
|
|
|
void parentCommit(bool synchronized = false);
|
|
|
|
void synchronizedCommit();
|
|
|
|
|
|
|
|
void commitToCache();
|
|
|
|
void commitFromCache();
|
|
|
|
|
|
|
|
SubSurfaceInterface *q;
|
|
|
|
QPoint position = QPoint(0, 0);
|
|
|
|
QPoint pendingPosition = QPoint(0, 0);
|
|
|
|
SubSurfaceInterface::Mode mode = SubSurfaceInterface::Mode::Synchronized;
|
2014-10-14 12:04:35 +00:00
|
|
|
QPointer<SurfaceInterface> surface;
|
|
|
|
QPointer<SurfaceInterface> parent;
|
2020-10-31 14:03:30 +00:00
|
|
|
bool hasCacheState = false;
|
|
|
|
bool hasPendingPosition = false;
|
2014-10-14 12:04:35 +00:00
|
|
|
|
2020-10-31 14:03:30 +00:00
|
|
|
protected:
|
|
|
|
void subsurface_destroy_resource(Resource *resource) override;
|
|
|
|
void subsurface_destroy(Resource *resource) override;
|
|
|
|
void subsurface_set_position(Resource *resource, int32_t x, int32_t y) override;
|
|
|
|
void subsurface_place_above(Resource *resource, struct ::wl_resource *sibling_resource) override;
|
|
|
|
void subsurface_place_below(Resource *resource, struct ::wl_resource *sibling_resource) override;
|
|
|
|
void subsurface_set_sync(Resource *resource) override;
|
|
|
|
void subsurface_set_desync(Resource *resource) override;
|
2014-10-14 12:04:35 +00:00
|
|
|
};
|
|
|
|
|
2020-10-31 14:03:30 +00:00
|
|
|
} // namespace KWaylandServer
|