6#include <QtWaylandCompositor/QWaylandSurface>
7#include <QtWaylandCompositor/QWaylandCompositor>
9#include <QtWaylandCompositor/private/qwaylandsurface_p.h>
51 qWarning() <<
"Failed to find QWaylandCompositor when initializing QWaylandViewporter";
62 return QWaylandViewporterPrivate::interface();
68 wl_resource_destroy(resource->handle);
75 qWarning() <<
"Couldn't find surface for viewporter";
80 if (surfacePrivate->viewport) {
81 wl_resource_post_error(resource->handle, WP_VIEWPORTER_ERROR_VIEWPORT_EXISTS,
82 "viewport already exists for surface");
86 surfacePrivate->viewport =
new Viewport(surface, resource->client(),
id);
90 : QtWaylandServer::wp_viewport(client,
id, 1)
100 Q_ASSERT(surfacePrivate->viewport ==
this);
101 surfacePrivate->viewport =
nullptr;
120 wl_resource_post_error(resource()->
handle, error_bad_size,
121 "non-integer size (%fx%f) with unset destination",
126 if (m_surface->bufferSize().isValid()) {
130 wl_resource_post_error(resource()->
handle, error_out_of_buffer,
131 "source %f,%f, %fx%f extends outside attached buffer %fx%f",
150 surfacePrivate->pending.destinationSize =
QSize();
151 surfacePrivate->pending.sourceGeometry =
QRectF();
153 wl_resource_destroy(resource->handle);
161 wl_resource_post_error(resource->handle, error_no_surface,
162 "set_source requested for destroyed surface");
170 if (sourceGeometry ==
QRectF(-1, -1, -1, -1)) {
172 surfacePrivate->pending.sourceGeometry =
QRectF();
177 wl_resource_post_error(resource->handle, error_bad_value,
178 "negative position in set_source");
182 if (!
size.isValid()) {
183 wl_resource_post_error(resource->handle, error_bad_value,
184 "negative size in set_source");
189 surfacePrivate->pending.sourceGeometry = sourceGeometry;
197 wl_resource_post_error(resource->handle, error_no_surface,
198 "set_destination requested for destroyed surface");
203 if (!destinationSize.
isValid() && destinationSize !=
QSize(-1, -1)) {
204 wl_resource_post_error(resource->handle, error_bad_value,
205 "negative size in set_destination");
209 surfacePrivate->pending.destinationSize = destinationSize;
214#include "moc_qwaylandviewporter.cpp"
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
constexpr qreal height() const noexcept
Returns the height of the rectangle.
constexpr qreal width() const noexcept
Returns the width of the rectangle.
QRectF united(const QRectF &other) const noexcept
constexpr bool isValid() const noexcept
Returns true if both the width and height is equal to or greater than 0; otherwise returns false.
\inmodule QtWaylandCompositor
virtual void initialize()
Initializes the QWaylandCompositorExtension.
QWaylandObject * extensionContainer() const
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
static QWaylandSurfacePrivate * get(QWaylandSurface *surface)
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
static QWaylandSurface * fromResource(::wl_resource *resource)
Returns the QWaylandSurface corresponding to the Wayland resource resource.
void wp_viewport_set_source(Resource *resource, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height) override
void wp_viewport_set_destination(Resource *resource, int32_t width, int32_t height) override
Viewport(QWaylandSurface *surface, wl_client *client, int id)
void checkCommittedState()
void wp_viewport_destroy_resource(Resource *resource) override
void wp_viewport_destroy(Resource *resource) override
void wp_viewporter_get_viewport(Resource *resource, uint32_t id, wl_resource *surface) override
void wp_viewporter_destroy(Resource *resource) override
\inmodule QtWaylandCompositor
QWaylandViewporter()
Constructs a QWaylandViewporter object.
static const struct wl_interface * interface()
Returns the Wayland interface for the QWaylandViewporter.
void initialize() override
Initializes the extension.
Combined button and popup list for selecting options.
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char * destination
static QOpenGLCompositor * compositor
GLuint64 GLenum void * handle
GLint GLint GLint GLint GLint x
[0]
GLint GLsizei GLsizei height
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLsizei GLsizei GLchar * source
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)