Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandivisurface.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
7#if QT_CONFIG(wayland_compositor_quick)
9#endif
10
11#include <QtWaylandCompositor/QWaylandResource>
12#include <QDebug>
13
14#include <QtWaylandCompositor/private/qwaylandutils_p.h>
15
17
18QWaylandSurfaceRole QWaylandIviSurfacePrivate::s_role("ivi_surface");
19
52
62
74void QWaylandIviSurface::initialize(QWaylandIviApplication *iviApplication, QWaylandSurface *surface, uint iviId, const QWaylandResource &resource)
75{
77
78 d->m_iviApplication = iviApplication;
79 d->m_surface = surface;
80 d->m_iviId = iviId;
81
82 d->init(resource.resource());
84
87
89}
90
103{
104 Q_D(const QWaylandIviSurface);
105 return d->m_surface;
106}
107
121{
122 Q_D(const QWaylandIviSurface);
123 return d->m_iviId;
124}
125
129const struct wl_interface *QWaylandIviSurface::interface()
130{
131 return QWaylandIviSurfacePrivate::interface();
132}
133
135{
136 return QWaylandIviSurfacePrivate::interfaceName();
137}
138
143{
144 return &QWaylandIviSurfacePrivate::s_role;
145}
146
151{
152 if (auto p = QtWayland::fromResource<QWaylandIviSurfacePrivate *>(resource))
153 return p->q_func();
154 return nullptr;
155}
156
167{
168 if (!size.isValid()) {
169 qWarning() << "Can't configure ivi_surface with an invalid size" << size;
170 return;
171 }
173 d->send_configure(size.width(), size.height());
174}
175
176#if QT_CONFIG(wayland_compositor_quick)
177QWaylandQuickShellIntegration *QWaylandIviSurface::createIntegration(QWaylandQuickShellSurfaceItem *item)
178{
180}
181#endif
182
190
194
195void QWaylandIviSurfacePrivate::ivi_surface_destroy_resource(QtWaylandServer::ivi_surface::Resource *resource)
196{
197 Q_UNUSED(resource);
199 QWaylandIviApplicationPrivate::get(m_iviApplication)->unregisterIviSurface(q);
200 delete q;
201}
202
203void QWaylandIviSurfacePrivate::ivi_surface_destroy(QtWaylandServer::ivi_surface::Resource *resource)
204{
205 wl_resource_destroy(resource->handle);
206}
207
209
210#include "moc_qwaylandivisurface.cpp"
\inmodule QtCore
Definition qbytearray.h:57
\inmodule QtCore
Definition qsize.h:25
void setExtensionContainer(QWaylandObject *container)
Sets the extension container for this QWaylandCompositorExtension to container.
virtual void initialize()
Initializes the QWaylandCompositorExtension.
static QWaylandIviApplicationPrivate * get(QWaylandIviApplication *iviApplication)
\qmltype IviApplication \instantiates QWaylandIviApplication \inqmlmodule QtWayland....
void ivi_surface_destroy_resource(Resource *resource) override
void ivi_surface_destroy(Resource *resource) override
\qmltype IviSurface \instantiates QWaylandIviSurface \inqmlmodule QtWayland.Compositor....
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandIviSurface.
QWaylandIviSurface()
Constructs a QWaylandIviSurface.
static QWaylandSurfaceRole * role()
Returns the surface role for the QWaylandIviSurface.
QWaylandSurface * surface
\qmlproperty WaylandSurface IviSurface::surface
Q_INVOKABLE void sendConfigure(const QSize &size)
\qmlmethod int IviSurface::sendConfigure(size size)
uint iviId
\qmlproperty int IviSurface::iviId \readonly
static QByteArray interfaceName()
static QWaylandIviSurface * fromResource(::wl_resource *resource)
Returns the QWaylandIviSurface corresponding to the resource.
\qmltype ShellSurfaceItem \instantiates QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inq...
\inmodule QtWaylandCompositor
wl_resource * resource() const
\inmodule QtWaylandCompositor
\inmodule QtWaylandCompositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
Combined button and popup list for selecting options.
#define qWarning
Definition qlogging.h:166
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLfloat GLfloat p
[1]
#define emit
#define Q_UNUSED(x)
unsigned int uint
Definition qtypes.h:34
QGraphicsItem * item