summaryrefslogtreecommitdiffstats
path: root/src/compositor/compositor_api/qwaylandresource.cpp
blob: 1060462b59962bbebb9e80aec29d680e881a1e47 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
// Copyright (C) 2021 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#include "qwaylandresource.h"

QT_BEGIN_NAMESPACE

/*!
 * \class QWaylandResource
 * \inmodule QtWaylandCompositor
 * \since 5.8
 * \brief QWaylandResource is a container for a \c wl_resource.
 *
 * The QWaylandResource is a simple wrapper around the Wayland type \c wl_resource, and makes it
 * possible to use wl_resource pointers in Qt Quick APIs.
 *
 * \sa {Qt Wayland Compositor Examples - Custom Shell}
 */

/*!
 * Constructs an invalid QWaylandResource. The \l{resource()} accessor will return null.
 */
QWaylandResource::QWaylandResource()
{
}

/*!
 * Constructs a QWaylandResource which contains \a resource.
 */
QWaylandResource::QWaylandResource(wl_resource *resource)
                : m_resource(resource)
{
}

/*!
 * \fn wl_resource *QWaylandResource::resource() const
 *
 * \return the wl_resource pointer held by this QWaylandResource.
 */

QT_END_NAMESPACE

#include "moc_qwaylandresource.cpp"