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
qwaylandwlshellintegration_p.h
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
4#ifndef QWAYLANDWLSHELLINTEGRATION_H
5#define QWAYLANDWLSHELLINTEGRATION_H
6
7#include <QtWaylandCompositor/private/qwaylandquickshellsurfaceitem_p.h>
8
9#include <QtWaylandCompositor/QWaylandWlShellSurface>
10
11#include <QtCore/qpointer.h>
12
14
15//
16// W A R N I N G
17// -------------
18//
19// This file is not part of the Qt API. It exists purely as an
20// implementation detail. This header file may change from version to
21// version without notice, or even be removed.
22//
23// We mean it.
24//
25
26namespace QtWayland {
27
29{
31public:
33 ~WlShellIntegration() override;
34
35protected:
36 bool eventFilter(QObject *object, QEvent *event) override;
37
38private Q_SLOTS:
39 void handleStartMove(QWaylandSeat *seat);
40 void handleStartResize(QWaylandSeat *seat, QWaylandWlShellSurface::ResizeEdge edges);
41 void handleSetDefaultTopLevel();
42 void handleSetTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, bool inactive);
43 void handleSetMaximized(QWaylandOutput *output);
44 void handleSetFullScreen(QWaylandWlShellSurface::FullScreenMethod method, uint framerate, QWaylandOutput *output);
45 void handleSetPopup(QWaylandSeat *seat, QWaylandSurface *parent, const QPoint &relativeToParent);
46 void handleShellSurfaceDestroyed();
47 void handleSurfaceHasContentChanged();
48 void handleRedraw();
49 void adjustOffsetForNextFrame(const QPointF &offset);
50 void handleFullScreenSizeChanged();
51 void handleMaximizedSizeChanged();
52
53private:
54 enum class GrabberState {
55 Default,
56 Resize,
57 Move
58 };
59
60 void handlePopupClosed();
61 void handlePopupRemoved();
62 qreal devicePixelRatio() const;
63
64 QWaylandQuickShellSurfaceItem *m_item = nullptr;
65 QPointer<QWaylandWlShellSurface> m_shellSurface;
66 GrabberState grabberState = GrabberState::Default;
67 struct {
68 QWaylandSeat *seat = nullptr;
70 bool initialized = false;
71 } moveState;
72 struct {
73 QWaylandSeat *seat = nullptr;
77 bool initialized = false;
78 } resizeState;
79
80 bool isPopup = false;
81
82 enum class State {
83 Windowed,
84 Maximized,
85 FullScreen
86 };
87
88 State currentState = State::Windowed;
89 State nextState = State::Windowed;
90
91 struct {
93 QMetaObject::Connection sizeChangedConnection; // Depending on whether maximized or fullscreen,
94 // will be hooked to geometry-changed or available-
95 // geometry-changed.
96 } nonwindowedState;
97
98 QPointF normalPosition;
99 QPointF finalPosition;
100
101 bool filterMouseMoveEvent(QMouseEvent *event);
102 bool filterMouseReleaseEvent(QMouseEvent *event);
103};
104
105}
106
108
109#endif // QWAYLANDWLSHELLINTEGRATION_H
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
\inmodule QtGui
Definition qevent.h:196
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
\inmodule QtCore\reentrant
Definition qpoint.h:217
\inmodule QtCore\reentrant
Definition qpoint.h:25
\inmodule QtCore
Definition qsize.h:208
\qmltype WaylandOutput \instantiates QWaylandOutput \inqmlmodule QtWayland.Compositor
\qmltype ShellSurfaceItem \instantiates QWaylandQuickShellSurfaceItem \inherits WaylandQuickItem \inq...
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
ResizeEdge
This enum type provides a way to specify an edge or corner of the surface.
WlShellIntegration(QWaylandQuickShellSurfaceItem *item)
bool eventFilter(QObject *object, QEvent *event) override
Filters events if this object has been installed as an event filter for the watched object.
QWaylandWlShellSurface::ResizeEdge resizeEdges
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 * method
GLenum GLuint GLintptr offset
struct _cl_event * event
@ Default
#define Q_OBJECT
#define Q_SLOTS
unsigned int uint
Definition qtypes.h:34
double qreal
Definition qtypes.h:187
QGraphicsItem * item