10#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
11#if QT_CONFIG(wayland_datadevice)
18#include <QtWaylandCompositor/QWaylandCompositor>
19#include <QtWaylandCompositor/QWaylandClient>
20#include <QtWaylandCompositor/QWaylandView>
21#include <QtWaylandCompositor/QWaylandBufferRef>
23#include <QtWaylandCompositor/private/qwaylandcompositor_p.h>
24#include <QtWaylandCompositor/private/qwaylandview_p.h>
25#include <QtWaylandCompositor/private/qwaylandseat_p.h>
26#include <QtWaylandCompositor/private/qwaylandutils_p.h>
28#include <QtCore/private/qobject_p.h>
30#include <QtGui/QGuiApplication>
31#include <QtGui/QScreen>
33#include <QtCore/QDebug>
34#include <QtCore/QtMath>
75 return QRegion(
QRect(
QPoint(std::numeric_limits<int>::min(), std::numeric_limits<int>::min()),
76 QPoint(std::numeric_limits<int>::max(), std::numeric_limits<int>::max())));
119 const auto viewsCopy =
views;
125 emit q->hasContentChanged();
156 emit q->surfaceDestroyed();
162 wl_resource_destroy(resource->handle);
191 struct wl_resource *frame_callback = wl_resource_create(resource->client(), &wl_callback_interface, wl_callback_interface.version, callback);
231 if (!
pending.bufferDamage.isNull()) {
255 emit q->isOpaqueChanged();
284 emit q->bufferSizeChanged();
287 emit q->bufferScaleChanged();
290 emit q->destinationSizeChanged();
293 emit q->sourceGeometryChanged();
296 emit q->hasContentChanged();
298 if (!offsetForNextFrame.
isNull())
299 emit q->offsetForNextFrame(offsetForNextFrame);
311 switch (orientation) {
312 case WL_OUTPUT_TRANSFORM_90:
315 case WL_OUTPUT_TRANSFORM_180:
318 case WL_OUTPUT_TRANSFORM_270:
325 emit q->contentOrientationChanged();
441 d->notifyViewsAboutDestruction();
461 d->isInitialized =
true;
476 return d->isInitialized;
524 return d->hasContent;
555 return d->sourceGeometry;
580 return d->destinationSize;
609 return d->bufferSize;
630 return d->bufferScale;
651 return d->contentOrientation;
685 return d->bufferRef.origin();
694 return d->compositor;
713 uint time =
d->compositor->currentTimeMsecs();
715 while (i < d->frameCallbacks.size()) {
716 if (
d->frameCallbacks.at(
i)->canSend) {
717 d->frameCallbacks.at(
i)->surface =
nullptr;
718 d->frameCallbacks.at(
i)->send(
time);
719 d->frameCallbacks.removeAt(
i);
733 return d->inputRegion.contains(
p);
751 return d->inputRegion.contains(floored);
808 return d->isCursorSurface;
833 return !
d->idleInhibitors.isEmpty();
861 return d->inputMethodControl;
870#if QT_CONFIG(clipboard)
871void QWaylandSurface::updateSelection()
879 dataDevice->resourceMap().value(
d->resource()->client())->handle);
893 if (
d->views.isEmpty())
895 return d->views.first();
922 view->setSurface(
this);
943 if (
auto p = QtWayland::fromResource<QWaylandSurfacePrivate *>(
resource))
954 return d->resource()->handle;
978 if (
d->role &&
d->role !=
role) {
979 wl_resource_post_error(errorResource, errorCode,
980 "Cannot assign role %s to wl_surface@%d, already has role %s\n",
982 d->role->name().constData());
998 return surface ? surface->d_func() :
nullptr;
1026 for (
int i = 0; i < nViews && refCount > 0;
i++) {
1047 emit surface->q_func()->subsurfacePositionChanged(
position);
1132#include "moc_qwaylandsurface.cpp"
const char * constData() const noexcept
Returns a pointer to the const data stored in the byte array.
QScreen * primaryScreen
the primary (or default) screen of the application.
qsizetype size() const noexcept
bool removeOne(const AT &t)
const_reference at(qsizetype i) const noexcept
qsizetype removeAll(const AT &t)
void append(parameter_type t)
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr bool isNull() const noexcept
Returns true if both the x and y coordinates are set to 0, otherwise returns false.
constexpr int x() const noexcept
Returns the x coordinate of this point.
\inmodule QtCore\reentrant
constexpr QSizeF size() const noexcept
Returns the size of the rectangle.
\inmodule QtCore\reentrant
bool contains(const QRect &r, bool proper=false) const noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
The QRegion class specifies a clip region for a painter.
QRect boundingRect() const noexcept
Returns the bounding rectangle of this region.
The QScreen class is used to query screen properties. \inmodule QtGui.
Qt::ScreenOrientation primaryOrientation
the primary screen orientation
constexpr QSize toSize() const noexcept
Returns an integer based copy of this size.
\inmodule QtWaylandCompositor
bool hasContent() const
Returns true if this QWaylandBufferRef references a buffer that has content.
QSize size() const
Returns the size of the buffer.
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
wl_client * client() const
Returns the Wayland client of this QWaylandClient.
static QWaylandCompositorPrivate * get(QWaylandCompositor *compositor)
void destroySurface(QWaylandSurface *surface)
void unregisterSurface(QWaylandSurface *surface)
QtWayland::BufferManager * bufferManager() const
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
\inmodule QtWaylandCompositor
static QWaylandSeatPrivate * get(QWaylandSeat *device)
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
void subsurface_place_above(wl_subsurface::Resource *resource, struct wl_resource *sibling) override
void subsurface_set_sync(wl_subsurface::Resource *resource) override
void subsurface_set_desync(wl_subsurface::Resource *resource) override
void subsurface_place_below(wl_subsurface::Resource *resource, struct wl_resource *sibling) override
void subsurface_set_position(wl_subsurface::Resource *resource, int32_t x, int32_t y) override
QList< QtWayland::FrameCallback * > frameCallbacks
QtWayland::ClientBuffer * getBuffer(struct ::wl_resource *buffer)
void surface_destroy(Resource *resource) override
~QWaylandSurfacePrivate() override
void surface_set_buffer_transform(Resource *resource, int32_t transform) override
QWaylandViewporterPrivate::Viewport * viewport
QWaylandCompositor * compositor
void surface_set_input_region(Resource *resource, struct wl_resource *region) override
QList< QtWayland::FrameCallback * > pendingFrameCallbacks
static bool hasUninitializedSurface()
void surface_destroy_resource(Resource *resource) override
static QWaylandSurfacePrivate * get(QWaylandSurface *surface)
void surface_damage(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
QList< QWaylandView * > views
QWaylandBufferRef bufferRef
void refView(QWaylandView *view)
void surface_set_opaque_region(Resource *resource, struct wl_resource *region) override
void surface_set_buffer_scale(Resource *resource, int32_t bufferScale) override
void surface_frame(Resource *resource, uint32_t callback) override
static QList< QWaylandSurfacePrivate * > uninitializedSurfaces
void derefView(QWaylandView *view)
void surface_attach(Resource *resource, struct wl_resource *buffer, int x, int y) override
void notifyViewsAboutDestruction()
static void removeUninitializedSurface(QWaylandSurfacePrivate *surface)
void removeFrameCallback(QtWayland::FrameCallback *callback)
Qt::ScreenOrientation contentOrientation
static void addUninitializedSurface(QWaylandSurfacePrivate *surface)
void surface_damage_buffer(Resource *resource, int32_t x, int32_t y, int32_t width, int32_t height) override
struct QWaylandSurfacePrivate::@772 pending
void initSubsurface(QWaylandSurface *parent, struct ::wl_client *client, int id, int version)
void surface_commit(Resource *resource) override
\inmodule QtWaylandCompositor
const QByteArray name()
Returns the name of the QWaylandSurfaceRole.
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
QSize destinationSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::destinationSize
void markAsCursorSurface(bool cursorSurface)
QWaylandSurface::Origin origin
\qmlproperty enum QtWayland.Compositor::WaylandSurface::origin
QWaylandSurface()
Constructs a an uninitialized QWaylandSurface.
bool isInitialized() const
Returns true if the QWaylandSurface has been initialized.
struct wl_resource * resource() const
Returns the Wayland resource corresponding to this QWaylandSurface.
Q_INVOKABLE void frameStarted()
Prepares all frame callbacks for sending.
::wl_client * waylandClient() const
Holds the wl_client using this QWaylandSurface.
Q_INVOKABLE void sendFrameCallbacks()
Sends pending frame callbacks.
~QWaylandSurface() override
Destroys the QWaylandSurface.
bool isCursorSurface() const
QWaylandSurfaceRole * role() const
bool cursorSurface
\qmlproperty bool QtWayland.Compositor::WaylandSurface::cursorSurface
int bufferScale
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferScale
bool inhibitsIdle
\qmlproperty bool QtWayland.Compositor::WaylandSurface::inhibitsIdle
bool inputRegionContains(const QPoint &p) const
Returns true if the QWaylandSurface's input region contains the point p.
bool hasContent
\qmlproperty bool QtWayland.Compositor::WaylandSurface::hasContent
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
QSize bufferSize
\qmlproperty size QtWayland.Compositor::WaylandSurface::bufferSize
QWaylandClient * client
\qmlproperty WaylandClient QtWayland.Compositor::WaylandSurface::client
QWaylandView * primaryView() const
Updates the surface with the compositor's retained clipboard selection.
Origin
This enum type is used to specify the origin of a QWaylandSurface's buffer.
Qt::ScreenOrientation contentOrientation
\qmlproperty enum QtWayland.Compositor::WaylandSurface::contentOrientation
void setPrimaryView(QWaylandView *view)
Sets this QWaylandSurface's primary view to view, in case there are multiple views of this surface.
QList< QWaylandView * > views() const
Returns the views for this QWaylandSurface.
bool isOpaque
\qmlproperty bool QtWayland.Compositor::WaylandSurface::isOpaque
QWaylandCompositor * compositor() const
Returns the compositor for this QWaylandSurface.
bool setRole(QWaylandSurfaceRole *role, wl_resource *errorResource, uint32_t errorCode)
Sets a role on the surface.
Q_INVOKABLE void destroy()
\qmlmethod void QtWayland.Compositor::WaylandSurface::destroy()
void cursorSurfaceChanged()
Q_INVOKABLE void initialize(QWaylandCompositor *compositor, QWaylandClient *client, uint id, int version)
\qmlmethod void QtWayland.Compositor::WaylandSurface::initialize(WaylandCompositor compositor,...
Q_INVOKABLE bool isDestroyed() const
\qmlmethod bool QtWayland.Compositor::WaylandSurface::isDestroyed()
QRectF sourceGeometry
\qmlproperty rect QtWayland.Compositor::WaylandSurface::sourceGeometry
static QWaylandViewPrivate * get(QWaylandView *view)
void markSurfaceAsDestroyed(QWaylandSurface *surface)
\qmltype WaylandView \instantiates QWaylandView \inqmlmodule QtWayland.Compositor
void checkCommittedState()
ClientBuffer * getBuffer(struct ::wl_resource *buffer_resource)
QWaylandSurface * surface
FrameCallback(QWaylandSurface *surf, wl_resource *res)
static void destroyCallback(wl_resource *res)
static Region * fromResource(struct ::wl_resource *resource)
static QRegion infiniteRegion()
Combined button and popup list for selecting options.
@ InvertedLandscapeOrientation
@ InvertedPortraitOrientation
static bool contains(const QJsonArray &haystack, unsigned needle)
static QOpenGLCompositor * compositor
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLenum GLenum GLenum scale
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
bool contains(const AT &t) const noexcept
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent