12#include <QtWaylandCompositor/qwaylandcompositor.h>
13#include <QtWaylandCompositor/qwaylandseat.h>
14#include <QtWaylandCompositor/qwaylandbufferref.h>
15#if QT_CONFIG(draganddrop)
16#include <QtWaylandCompositor/QWaylandDrag>
18#include <QtWaylandCompositor/private/qwlclientbufferintegration_p.h>
19#include <QtWaylandCompositor/private/qwaylandsurface_p.h>
22# include <QtOpenGL/QOpenGLTexture>
23# include <QtGui/QOpenGLFunctions>
26#include <QtGui/QKeyEvent>
27#include <QtGui/QGuiApplication>
28#include <QtGui/QScreen>
30#include <QtQuick/QSGSimpleTextureNode>
31#include <QtQuick/QQuickWindow>
32#include <QtQuick/qsgtexture.h>
34#include <QtCore/QFile>
35#include <QtCore/QMutexLocker>
36#include <QtCore/QMutex>
38#include <wayland-server-core.h>
42#include <QtGui/private/qshaderdescription_p.h>
45#ifndef GL_TEXTURE_EXTERNAL_OES
46#define GL_TEXTURE_EXTERNAL_OES 0x8D65
53 const char *
const vertexShaderSourceFile;
54 const char *
const fragmentShaderSourceFile;
56 bool canProvideTexture;
57 QSGMaterial::Flags materialFlags;
61 {
"",
"", 0,
false, {}, {} },
65 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
66 ":/qt-project.org/wayland/compositor/shaders/surface_rgbx.frag.qsb",
74 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
75 ":/qt-project.org/wayland/compositor/shaders/surface_rgba.frag.qsb",
83 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
84 ":/qt-project.org/wayland/compositor/shaders/surface_oes_external.frag",
92 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
93 ":/qt-project.org/wayland/compositor/shaders/surface_y_u_v.frag.qsb",
101 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
102 ":/qt-project.org/wayland/compositor/shaders/surface_y_uv.frag.qsb",
110 ":/qt-project.org/wayland/compositor/shaders/surface.vert.qsb",
111 ":/qt-project.org/wayland/compositor/shaders/surface_y_xuxv.frag.qsb",
125 setupExternalOESShader(fragmentShaderSourceFile);
127 setShaderFileName(FragmentStage, fragmentShaderSourceFile);
130void QWaylandBufferMaterialShader::setupExternalOESShader(
const QString &shaderFilename)
133 QFile shaderFile(shaderFilename);
135 qCWarning(qLcWaylandCompositor) <<
"Cannot find external OES shader file:" << shaderFilename;
140 static const char *FS_GLES_PREAMBLE =
141 "#extension GL_OES_EGL_image_external : require\n"
142 "precision highp float;\n";
143 static const char *FS_GL_PREAMBLE =
145 "#extension GL_OES_EGL_image_external : require\n";
153 texCoordInput.
name =
"v_texcoord";
155 texCoordInput.location = 0;
157 descData->
inVars = { texCoordInput };
160 fragColorOutput.
name =
"gl_FragColor";
162 fragColorOutput.location = 0;
164 descData->
outVars = { fragColorOutput };
167 matrixBlockVar.
name =
"qt_Matrix";
169 matrixBlockVar.offset = 0;
170 matrixBlockVar.
size = 64;
173 opacityBlockVar.
name =
"qt_Opacity";
175 opacityBlockVar.offset = 64;
176 opacityBlockVar.
size = 4;
180 ubufStruct.structName =
"ubuf";
181 ubufStruct.
size = 64 + 4;
182 ubufStruct.binding = 0;
183 ubufStruct.members = { matrixBlockVar, opacityBlockVar };
188 samplerTex0.
name =
"tex0";
190 samplerTex0.binding = 1;
196 shaderPack.setDescription(desc);
200 setShader(FragmentStage, shaderPack);
208 bool changed =
false;
212 if (
state.isMatrixDirty()) {
214 memcpy(
buf->data(),
m.constData(), 64);
218 if (
state.isOpacityDirty()) {
219 const float opacity =
state.opacity();
220 memcpy(
buf->data() + 64, &opacity, 4);
227void QWaylandBufferMaterialShader::updateSampledImage(RenderState &
state,
int binding,
QSGTexture **
texture,
232 QWaylandBufferMaterial *material =
static_cast<QWaylandBufferMaterial *
>(newMaterial);
235 *
texture = material->m_scenegraphTextures.at(0);
238 *
texture = material->m_scenegraphTextures.at(1);
241 *
texture = material->m_scenegraphTextures.at(2);
251 (*texture)->commitTextureOperations(
state.rhi(),
state.resourceUpdateBatch());
257 setFlag(bufferTypes[m_format].materialFlags);
260QWaylandBufferMaterial::~QWaylandBufferMaterial()
265void QWaylandBufferMaterial::setTextureForPlane(
int plane,
269 if (plane < 0 || plane >= bufferTypes[m_format].planeCount) {
270 qWarning(
"plane index is out of range");
275 setTextureParameters(
texture->target());
277 ensureTextures(plane - 1);
279 if (m_textures.size() <= plane) {
281 m_scenegraphTextures << scenegraphTexture;
283 delete m_scenegraphTextures[plane];
286 m_scenegraphTextures[plane] = scenegraphTexture;
290void QWaylandBufferMaterial::bind()
292 ensureTextures(bufferTypes[m_format].planeCount);
294 switch (m_textures.size()) {
297 m_textures[2]->bind(2);
301 m_textures[1]->bind(1);
305 m_textures[0]->bind(0);
311 return const_cast<QSGMaterialType *
>(&bufferTypes[m_format].materialType);
317 return new QWaylandBufferMaterialShader(m_format);
321void QWaylandBufferMaterial::setTextureParameters(
GLenum target)
331void QWaylandBufferMaterial::ensureTextures(
int count)
333 for (
int plane = m_textures.size(); plane <
count; plane++) {
334 m_textures <<
nullptr;
335 m_scenegraphTextures <<
nullptr;
342 for (
int plane = 0; plane < bufferTypes[
ref.bufferFormatEgl()].planeCount; plane++) {
343 if (
auto texture =
ref.toOpenGLTexture(plane)) {
344 QQuickWindow::CreateTextureOptions
opt;
345 QWaylandQuickSurface *waylandSurface = qobject_cast<QWaylandQuickSurface *>(surfaceItem->surface());
347 opt |= QQuickWindow::TextureHasAlphaChannel;
350 scenegraphTexture = QNativeInterface::QSGOpenGLTexture::fromNativeExternalOES(
texture->textureId(),
351 surfaceItem->window(),
355 scenegraphTexture = QNativeInterface::QSGOpenGLTexture::fromNative(
texture->textureId(),
356 surfaceItem->window(),
361 setTextureForPlane(plane,
texture, scenegraphTexture);
389 if (m_ref.hasBuffer()) {
390 if (
buffer.isSharedMemory()) {
391 m_sgTex = surfaceItem->window()->createTextureFromImage(
buffer.image());
394 QQuickWindow::CreateTextureOptions
opt;
397 opt |= QQuickWindow::TextureHasAlphaChannel;
403 m_sgTex = QNativeInterface::QSGOpenGLTexture::fromNative(textureId, surfaceItem->window(),
size,
opt);
405 qCWarning(qLcWaylandCompositor) <<
"Without OpenGL support only shared memory textures are supported";
409 emit textureChanged();
421 bool m_smooth =
false;
473 disconnect(
this, &QQuickItem::windowChanged,
this, &QWaylandQuickItem::updateWindow);
478 d->provider->deleteLater();
496 return d->view->surface() ?
d->view->surface()->compositor() :
nullptr;
505 return d->view.data();
523 return d->view->surface();
533 if (oldComp != newComp)
584 if (!
d->shouldSendInputEvents()) {
601 d->hoverPos =
event->position();
610 if (
d->shouldSendInputEvents()) {
612#if QT_CONFIG(draganddrop)
621 seat->drag()->dragMove(targetSurface, surfacePosition);
627 d->hoverPos =
event->position();
641 if (
d->shouldSendInputEvents()) {
643#if QT_CONFIG(draganddrop)
645 d->isDragging =
false;
646 seat->drag()->drop();
668 if (
d->shouldSendInputEvents()) {
671 d->hoverPos =
event->position();
689 if (
d->shouldSendInputEvents()) {
691 if (
event->position() !=
d->hoverPos) {
693 d->hoverPos =
event->position();
706 if (
d->shouldSendInputEvents()) {
714#if QT_CONFIG(wheelevent)
718void QWaylandQuickItem::wheelEvent(QWheelEvent *
event)
721 if (
d->shouldSendInputEvents()) {
729 if (
event->angleDelta().x() != 0)
731 if (
event->angleDelta().y() != 0)
745 if (
d->shouldSendInputEvents()) {
750 qWarning() <<
"Unable to set keyboard focus, cannot send key press event";
762 if (
d->shouldSendInputEvents()) {
776 if (
d->shouldSendInputEvents() &&
d->touchEventsEnabled) {
780 const QList<QTouchEvent::TouchPoint> &
points =
event->points();
782 pointPos =
points.at(0).position();
796 d->touchingSeats.append(seat);
798 d->touchingSeats.removeOne(seat);
812 if (
d->shouldSendInputEvents())
813 for (
auto seat :
d->touchingSeats)
816 d->touchingSeats.clear();
826 if (
d->shouldSendInputEvents()) {
827 d->oldSurface->inputMethodControl()->inputMethodEvent(
event);
843void QWaylandQuickItem::handleSubsurfaceAdded(
QWaylandSurface *childSurface)
846 if (
d->subsurfaceHandler.isNull()) {
849 childItem->setVisible(
true);
850 childItem->setParentItem(
this);
851 childItem->setParent(
this);
861 qWarning(
"QWaylandQuickItem: subsurfaceHandler does not implement handleSubsurfaceAdded()");
865void QWaylandQuickItem::handlePlaceAbove(
QWaylandSurface *referenceSurface)
872 if (
parent->surface() == referenceSurface) {
873 d->placeAboveParent();
874 }
else if (
auto *sibling =
d->findSibling(referenceSurface)) {
875 d->placeAboveSibling(sibling);
877 qWarning() <<
"Couldn't find QWaylandQuickItem for surface" << referenceSurface
878 <<
"when handling wl_subsurface.place_above";
882void QWaylandQuickItem::handlePlaceBelow(
QWaylandSurface *referenceSurface)
889 if (
parent->surface() == referenceSurface) {
890 d->placeBelowParent();
891 }
else if (
auto *sibling =
d->findSibling(referenceSurface)) {
892 d->placeBelowSibling(sibling);
894 qWarning() <<
"Couldn't find QWaylandQuickItem for surface" << referenceSurface
895 <<
"when handling wl_subsurface.place_below";
899void QWaylandQuickItem::updateFocus()
903 compositor()->defaultSeat()->setKeyboardFocus(
d->view->surface());
933 return d->subsurfaceHandler.data();
939 if (
d->subsurfaceHandler.data() != handler) {
940 d->subsurfaceHandler = handler;
958 return d->view->output();
986 return d->view->isBufferLocked();
992 d->view->setBufferLocked(locked);
1010 return d->view->allowDiscardFrontBuffer();
1016 d->view->setAllowDiscardFrontBuffer(discard);
1033 d->view->setPrimary();
1039void QWaylandQuickItem::handleSurfaceChanged()
1042 if (
d->oldSurface) {
1045 disconnect(
d->oldSurface.data(), &QWaylandSurface::destinationSizeChanged,
this, &QWaylandQuickItem::updateSize);
1052#if QT_CONFIG(draganddrop)
1062 connect(newSurface, &QWaylandSurface::destinationSizeChanged,
this, &QWaylandQuickItem::updateSize);
1069#if QT_CONFIG(draganddrop)
1076 if (newSurface->origin() !=
d->origin) {
1077 d->origin = newSurface->origin();
1085 if (!subsurface.isNull())
1086 handleSubsurfaceAdded(subsurface.data());
1092 d->oldSurface =
d->view->surface();
1132 if (textInputMethod)
1140void QWaylandQuickItem::surfaceMappedChanged()
1163void QWaylandQuickItem::updateSize()
1169 qWarning() <<
"No update on item size as the buffer is currently locked";
1200 return d->focusOnClick;
1206 if (
d->focusOnClick ==
focus)
1241 return point /
d->scaleFactor();
1246 return QPointF(point.
x() / xScale, point.
y() / yScale);
1263QPointF QWaylandQuickItem::mapFromSurface(
const QPointF &point)
const
1267 return point *
d->scaleFactor();
1272 return QPointF(point.
x() * xScale, point.
y() * yScale);
1289 return d->oldSurface->inputMethodControl()->inputMethodQuery(
query,
argument);
1315 return d->paintEnabled;
1346 return d->touchEventsEnabled;
1349void QWaylandQuickItem::updateBuffer(
bool hasBuffer)
1359void QWaylandQuickItem::updateWindow()
1364 if (newWindow ==
d->connectedWindow)
1367 if (
d->connectedWindow) {
1372 d->connectedWindow = newWindow;
1374 if (
d->connectedWindow) {
1388void QWaylandQuickItem::updateOutput()
1391 if (
d->view->output() ==
d->connectedOutput)
1394 if (
d->connectedOutput)
1397 d->connectedOutput =
d->view->output();
1399 if (
d->connectedOutput)
1405void QWaylandQuickItem::beforeSync()
1408 if (
d->view->advance()) {
1409 d->newTexture =
true;
1415void QWaylandQuickItem::updateInputMethod(Qt::InputMethodQueries queries)
1419 setFlag(QQuickItem::ItemAcceptsInputMethod,
1420 d->oldSurface ?
d->oldSurface->inputMethodControl()->enabled() :
false);
1454 d->lastMatrix =
data->transformNode->combinedMatrix();
1455 const bool bufferHasContent =
d->view->currentBuffer().hasContent();
1457 if (
d->view->isBufferLocked() &&
d->paintEnabled)
1460 if (!bufferHasContent || !
d->paintEnabled || !
surface()) {
1470 if (
ref.isSharedMemory()
1472 || bufferTypes[
ref.bufferFormatEgl()].canProvideTexture
1475#if QT_CONFIG(opengl)
1476 if (oldNode && !
d->paintByProvider) {
1481 d->paintByProvider =
true;
1490 d->newTexture =
true;
1496 d->texProviderConnection =
1503 if (itemPriv->provider) {
1504 itemPriv->provider->deleteLater();
1505 itemPriv->provider =
nullptr;
1507 disconnect(itemPriv->texProviderConnection); }
1512 if (
d->newTexture) {
1513 d->newTexture =
false;
1514 d->provider->setBufferRef(
this,
ref);
1518 d->provider->setSmooth(
smooth());
1528#if QT_CONFIG(opengl)
1531 if (oldNode &&
d->paintByProvider) {
1536 d->paintByProvider =
false;
1542 d->newTexture =
true;
1546 QWaylandBufferMaterial *material =
static_cast<QWaylandBufferMaterial *
>(node->
material());
1552 material =
new QWaylandBufferMaterial(
ref.bufferFormatEgl());
1554 if (
d->newTexture) {
1555 d->newTexture =
false;
1556 material->setBufferRef(
this,
ref);
1561 const QRectF normalizedCoordinates =
1564 sourceGeometry.
y() / surfaceSize.
height(),
1565 sourceGeometry.
width() / surfaceSize.
width(),
1579 qCWarning(qLcWaylandCompositor) <<
"Without OpenGL support only shared memory textures are supported";
1587 if (
d->touchEventsEnabled !=
enabled) {
1596 return d->inputEventsEnabled;
1602 if (
d->inputEventsEnabled !=
enabled) {
1644 if (seat ==
nullptr)
1648 qWarning() <<
"No seat, can't send mouse event";
1660void QWaylandQuickItem::handleSubsurfacePosition(
const QPoint &
pos)
1666#if QT_CONFIG(draganddrop)
1667void QWaylandQuickItem::handleDragStarted(
QWaylandDrag *drag)
1672 d->isDragging =
true;
1679#if !defined(Q_OS_MACOS)
1681 f /=
window->devicePixelRatio();
1689 auto *
parent =
q->parentItem();
1693 const auto siblings =
q->parentItem()->childItems();
1694 for (
auto *sibling : siblings) {
1695 auto *waylandItem = qobject_cast<QWaylandQuickItem *>(sibling);
1696 if (waylandItem && waylandItem->surface() == surface)
1705 q->stackAfter(sibling);
1706 q->setZ(sibling->
z());
1713 q->stackBefore(sibling);
1714 q->setZ(sibling->
z());
1722 const auto siblings =
q->parentItem()->childItems();
1725 bool foundSibling =
false;
1728 if (sibling && !sibling->d_func()->belowParent) {
1729 q->stackBefore(sibling);
1730 foundSibling =
true;
1736 if (!foundSibling && siblings.last() !=
q)
1737 q->stackAfter(siblings.last());
1739 q->setZ(
q->parentItem()->z());
1747 const auto siblings =
q->parentItem()->childItems();
1750 bool foundSibling =
false;
1751 for (
auto it = siblings.crbegin();
it != siblings.crend(); ++
it) {
1753 if (sibling && sibling->d_func()->belowParent) {
1754 q->stackAfter(sibling);
1755 foundSibling =
true;
1761 if (!foundSibling && siblings.first() !=
q)
1762 q->stackBefore(siblings.first());
1764 q->setZ(
q->parentItem()->z() - 1.0);
1770#include "moc_qwaylandquickitem.cpp"
IOBluetoothDevice * device
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
The QKeyEvent class describes a key event.
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
void deleteLater()
\threadsafe
static QOpenGLContext * currentContext()
Returns the last context which called makeCurrent in the current thread, or \nullptr,...
The QOpenGLFunctions class provides cross-platform access to the OpenGL ES 2.0 API.
void glTexParameteri(GLenum target, GLenum pname, GLint param)
Convenience function that calls glTexParameteri(target, pname, param).
\inmodule QtCore\reentrant
constexpr qreal x() const noexcept
Returns the x coordinate of this point.
constexpr qreal y() const noexcept
Returns the y coordinate of this point.
\inmodule QtCore\reentrant
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
QPointF mapToScene(const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within the scene's coor...
Flags flags() const
Returns the item flags for this item.
void activeFocusChanged(bool)
void setFlag(Flag flag, bool enabled=true)
Enables the specified flag for this item if enabled is true; if enabled is false, the flag is disable...
Q_INVOKABLE QPointF mapToItem(const QQuickItem *item, const QPointF &point) const
Maps the given point in this item's coordinate system to the equivalent point within item's coordinat...
qreal z
\qmlproperty real QtQuick::Item::z
bool hasActiveFocus() const
virtual QSGTextureProvider * textureProvider() const
Returns the texture provider for an item.
QQuickWindow * window() const
Returns the window in which this item is rendered.
qreal width
This property holds the width of this item.
QQuickItem * parentItem() const
QQuickItem * parent
\qmlproperty Item QtQuick::Item::parent This property holds the visual parent of the item.
Q_INVOKABLE void forceActiveFocus()
\qmlmethod point QtQuick::Item::mapToItem(Item item, real x, real y) \qmlmethod point QtQuick::Item::...
bool smooth
\qmlproperty bool QtQuick::Item::smooth
qreal height
This property holds the height of this item.
void setPosition(const QPointF &)
bool enabled
\qmlproperty bool QtQuick::Item::enabled
void update()
Schedules a call to updatePaintNode() for this item.
virtual bool isTextureProvider() const
Returns true if this item is a texture provider.
void setImplicitSize(qreal, qreal)
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
void beforeSynchronizing()
This signal is emitted before the scene graph is synchronized with the QML state.
\inmodule QtCore\reentrant
constexpr qreal y() const noexcept
Returns the y-coordinate of the rectangle's top edge.
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
constexpr qreal x() const noexcept
Returns the x-coordinate of the rectangle's left edge.
constexpr bool isValid() const noexcept
Returns true if the rectangle is valid, otherwise returns false.
const QSGGeometry * geometry() const
Returns this node's geometry.
void setGeometry(QSGGeometry *geometry)
Sets the geometry of this node to geometry.
The QSGGeometryNode class is used for all rendered content in the scene graph.
QSGMaterial * material() const
Returns the material of the QSGGeometryNode.
void setMaterial(QSGMaterial *material)
Sets the material of this geometry node to material.
The QSGGeometry class provides low-level storage for graphics primitives in the \l{Qt Quick Scene Gra...
static const AttributeSet & defaultAttributes_TexturedPoint2D()
Convenience function which returns attributes to be used for textured 2D drawing.
static void updateTexturedRectGeometry(QSGGeometry *g, const QRectF &rect, const QRectF &sourceRect)
Updates the geometry g with the coordinates in rect and texture coordinates from textureRect.
The QSGMaterialShader class represents a graphics API independent shader program.
The QSGMaterial class encapsulates rendering state for a shader program.
\group qtquick-scenegraph-nodes \title Qt Quick Scene Graph Node classes
void setFlag(Flag, bool=true)
Sets the flag f on this node if enabled is true; otherwise clears the flag.
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
The QSGSimpleTextureNode class is provided for convenience to easily draw textured content using the ...
void setRect(const QRectF &rect)
Sets the target rect of this texture node to r.
void setFiltering(QSGTexture::Filtering filtering)
Sets the filtering to be used for this texture node to filtering.
void setTexture(QSGTexture *texture)
Sets the texture of this texture node to texture.
void setSourceRect(const QRectF &r)
Sets the source rect of this texture node to r.
The QSGTextureProvider class encapsulates texture based entities in QML.
void setFiltering(Filtering filter)
Sets the sampling mode to filter.
const_iterator cend() const noexcept
const_iterator cbegin() const noexcept
void setStage(Stage stage)
Sets the pipeline stage.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QThread * currentThread()
The QTouchEvent class contains parameters that describe a touch event.
static auto fromValue(T &&value) noexcept(std::is_nothrow_copy_constructible_v< T > &&Private::CanUseInternalSpace< T >) -> std::enable_if_t< std::conjunction_v< std::is_copy_constructible< T >, std::is_destructible< T > >, QVariant >
\inmodule QtWaylandCompositor
@ BufferFormatEgl_EXTERNAL_OES
TextInputProtocols textInputProtocols() const
static QWaylandTextInput * findIn(QWaylandObject *container)
If any instance of the interface has been registered with container, this is returned.
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
QWaylandSeat * seat() const
QWaylandSurface * origin() const
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
void scaleFactorChanged()
int scaleFactor
\qmlproperty int QtWayland.Compositor::WaylandOutput::scaleFactor
QWaylandCompositor * compositor
void setFocus(QWaylandSurface *surface)
QWaylandQuickItem * findSibling(QWaylandSurface *surface) const
qreal scaleFactor() const
QScopedPointer< QWaylandView > view
void placeBelowSibling(QWaylandQuickItem *sibling)
void placeAboveSibling(QWaylandQuickItem *sibling)
static const QWaylandQuickItemPrivate * get(const QWaylandQuickItem *item)
\qmltype WaylandQuickItem \instantiates QWaylandQuickItem \inqmlmodule QtWayland.Compositor
void keyPressEvent(QKeyEvent *event) override
Q_INVOKABLE void setPrimary()
\qmlmethod WaylandQuickItem::setPrimary()
bool isBufferLocked() const
Q_INVOKABLE QPointF mapToSurface(const QPointF &point) const
\qmlmethod point WaylandQuickItem::mapToSurface(point point)
void mousePressEvent(QMouseEvent *event) override
void setAllowDiscardFrontBuffer(bool discard)
void setInputEventsEnabled(bool enabled)
void hoverEnterEvent(QHoverEvent *event) override
virtual void takeFocus(QWaylandSeat *device=nullptr)
Calling this function causes the item to take the focus of the input device.
void setPaintEnabled(bool paintEnabled)
void touchEventsEnabledChanged()
QSGTextureProvider * textureProvider() const override
Returns the texture provider of this QWaylandQuickItem.
QWaylandOutput * output
\qmlproperty WaylandOutput QtWayland.Compositor::WaylandQuickItem::output
~QWaylandQuickItem() override
Destroy the QWaylandQuickItem.
bool isTextureProvider() const override
Returns true if this item is a texture provider.
bool touchEventsEnabled
\qmlproperty bool QtWayland.Compositor::WaylandQuickItem::touchEventsEnabled
bool focusOnClick
\qmlproperty bool QtWayland.Compositor::WaylandQuickItem::focusOnClick
void inputEventsEnabledChanged()
void sendMouseMoveEvent(const QPointF &position, QWaylandSeat *seat=nullptr)
void setFocusOnClick(bool focus)
void hoverLeaveEvent(QHoverEvent *event) override
void paintEnabledChanged()
virtual void surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface)
void mouseReleaseEvent(QMouseEvent *event) override
bool isPaintEnabled() const
void subsurfaceHandlerChanged()
void touchEvent(QTouchEvent *event) override
QWaylandView * view() const
Returns the view rendered by this QWaylandQuickItem.
void setTouchEventsEnabled(bool enabled)
QWaylandSurface::Origin origin
\qmlproperty enum QtWayland.Compositor::WaylandQuickItem::origin
QObject * subsurfaceHandler
QWaylandQuickItem(QQuickItem *parent=nullptr)
Constructs a QWaylandQuickItem with the given parent.
bool inputRegionContains(const QPointF &localPosition) const
Returns true if the input region of this item's surface contains the position given by localPosition.
void setSurface(QWaylandSurface *surface)
void setSubsurfaceHandler(QObject *)
void hoverMoveEvent(QHoverEvent *event) override
void focusOnClickChanged()
void setBufferLocked(bool locked)
QWaylandCompositor * compositor
\qmlproperty WaylandCompositor QtWayland.Compositor::WaylandQuickItem::compositor
void keyReleaseEvent(QKeyEvent *event) override
QSGNode * updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override
Called on the render thread when it is time to sync the state of the item with the scene graph.
void mouseMoveEvent(QMouseEvent *event) override
bool allowDiscardFrontBuffer
By default, the item locks the current buffer until a new buffer is available and updatePaintNode() i...
void mouseMove(const QPointF &windowPosition)
QWaylandSurface * surface
\qmlproperty WaylandSurface QtWayland.Compositor::WaylandQuickItem::surface
void touchUngrabEvent() override
This event handler can be reimplemented in a subclass to be notified when a touch ungrab event has oc...
void setOutput(QWaylandOutput *output)
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
void sendMouseMoveEvent(QWaylandView *surface, const QPointF &localPos, const QPointF &outputSpacePos=QPointF())
Sets the mouse focus to view and sends a mouse move event to the pointer device with the local positi...
void sendMouseReleaseEvent(Qt::MouseButton button)
Sends a mouse release event for button to the QWaylandSeat's pointer device.
void setMouseFocus(QWaylandView *view)
Sets the current mouse focus to view.
void sendFullTouchEvent(QWaylandSurface *surface, QTouchEvent *event)
Sends the event to the specified surface on the touch device.
void sendMousePressEvent(Qt::MouseButton button)
Sends a mouse press event for button to the QWaylandSeat's pointer device.
void sendFullKeyEvent(QKeyEvent *event)
Sends the event to the keyboard device.
QWaylandView * mouseFocus() const
Returns the view that currently has mouse focus.
bool setKeyboardFocus(QWaylandSurface *surface)
Sets the current keyboard focus to surface.
void sendMouseWheelEvent(Qt::Orientation orientation, int delta)
Sends a mouse wheel event to the QWaylandSeat's pointer device with the given orientation and delta.
Q_INVOKABLE void sendTouchCancelEvent(QWaylandClient *client)
\qmlmethod void QtWayland.Compositor::WaylandSeat::sendTouchCancelEvent(WaylandClient client)
QWaylandSurfaceTextureProvider()
QSGTexture * texture() const override
Returns a pointer to the texture object.
void setBufferRef(QWaylandQuickItem *surfaceItem, const QWaylandBufferRef &buffer)
void setSmooth(bool smooth)
~QWaylandSurfaceTextureProvider() override
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
QSize destinationSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::destinationSize
QWaylandSurface::Origin origin
\qmlproperty enum QtWayland.Compositor::WaylandSurface::origin
void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent)
void dragStarted(QWaylandDrag *drag)
\qmlsignal void QtWayland.Compositor::WaylandSurface::dragStarted(WaylandDrag drag)
void subsurfacePlaceAbove(QWaylandSurface *sibling)
void childAdded(QWaylandSurface *child)
\qmlsignal QtWayland.Compositor::WaylandSurface::childAdded(WaylandSurface child)
void configure(bool hasBuffer)
int bufferScale
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferScale
void subsurfacePositionChanged(const QPoint &position)
QSize bufferSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferSize
QWaylandClient * client
\qmlproperty WaylandClient QtWayland.Compositor::WaylandSurface::client
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
bool isOpaque
\qmlproperty bool QtWayland.Compositor::WaylandSurface::isOpaque
void subsurfacePlaceBelow(QWaylandSurface *sibling)
QRectF sourceGeometry
\qmlproperty rect QtWayland.Compositor::WaylandSurface::sourceGeometry
void bufferScaleChanged()
void setFocus(QWaylandSurface *surface)
void setFocus(QWaylandSurface *surface)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
QWaylandOutput * output
\qmlproperty WaylandOutput QtWayland.Compositor::WaylandView::output
void screenChanged(QScreen *screen)
This signal is emitted when a window's screen changes, either by being set explicitly with setScreen(...
qDeleteAll(list.begin(), list.end())
QSet< QString >::iterator it
Combined button and popup list for selecting options.
static QDBusError::ErrorType get(const char *name)
#define qCWarning(category,...)
#define qCDebug(category,...)
#define Q_ARG(Type, data)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLdouble GLdouble GLdouble GLdouble top
GLenum GLenum GLsizei count
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLenum GLenum GLsizei const GLuint GLboolean enabled
typedef GLenum(GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSKHRPROC)(void)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLint GLsizei GLsizei GLenum format
GLsizei GLsizei GLchar * source
GLfixed GLfixed GLint GLint GLfixed points
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLenum GLenum GLenum scale
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_CONFIG(feature)
QT_BEGIN_NAMESPACE typedef uchar * output
bool testFlag(MaskType mask, FlagType flag)
myObject disconnect()
[26]
socketLayer bind(QHostAddress::Any, 4000)
The QSGMaterialType class is used as a unique type token in combination with QSGMaterial.
QList< QShaderDescription::InOutVariable > inVars
static QShaderDescriptionPrivate * get(QShaderDescription *desc)
QList< QShaderDescription::InOutVariable > combinedImageSamplers
QList< QShaderDescription::InOutVariable > outVars
QList< QShaderDescription::UniformBlock > uniformBlocks
\variable QShaderDescription::InOutVariable::name