| 1 | // Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB). |
| 2 | // Copyright (C) 2021 The Qt Company Ltd. |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 4 | |
| 5 | #include "qwaylandresource.h" |
| 6 | |
| 7 | QT_BEGIN_NAMESPACE |
| 8 | |
| 9 | /*! |
| 10 | * \class QWaylandResource |
| 11 | * \inmodule QtWaylandCompositor |
| 12 | * \since 5.8 |
| 13 | * \brief QWaylandResource is a container for a \c wl_resource. |
| 14 | * |
| 15 | * The QWaylandResource is a simple wrapper around the Wayland type \c wl_resource, and makes it |
| 16 | * possible to use wl_resource pointers in Qt Quick APIs. |
| 17 | * |
| 18 | * \sa {Custom Shell} |
| 19 | */ |
| 20 | |
| 21 | /*! |
| 22 | * Constructs an invalid QWaylandResource. The \l{resource()} accessor will return null. |
| 23 | */ |
| 24 | QWaylandResource::QWaylandResource() |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | /*! |
| 29 | * Constructs a QWaylandResource which contains \a resource. |
| 30 | */ |
| 31 | QWaylandResource::QWaylandResource(wl_resource *resource) |
| 32 | : m_resource(resource) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | /*! |
| 37 | * \fn wl_resource *QWaylandResource::resource() const |
| 38 | * |
| 39 | * \return the wl_resource pointer held by this QWaylandResource. |
| 40 | */ |
| 41 | |
| 42 | QT_END_NAMESPACE |
| 43 | |
| 44 | #include "moc_qwaylandresource.cpp" |
| 45 | |