Changeset View
Changeset View
Standalone View
Standalone View
tests/pointerconstraintstest.h
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Line(s) | |||||
44 | 44 | | |||
45 | class Backend : public QObject | 45 | class Backend : public QObject | ||
46 | { | 46 | { | ||
47 | Q_OBJECT | 47 | Q_OBJECT | ||
48 | public: | 48 | public: | ||
49 | Backend(QObject *parent = nullptr) : QObject(parent) {} | 49 | Backend(QObject *parent = nullptr) : QObject(parent) {} | ||
50 | 50 | | |||
51 | Q_PROPERTY(int mode READ mode CONSTANT) | 51 | Q_PROPERTY(int mode READ mode CONSTANT) | ||
52 | Q_PROPERTY(bool lockHint MEMBER m_lockHint NOTIFY lockHintChanged) | ||||
52 | Q_PROPERTY(bool errorsAllowed READ errorsAllowed WRITE setErrorsAllowed NOTIFY errorsAllowedChanged) | 53 | Q_PROPERTY(bool errorsAllowed READ errorsAllowed WRITE setErrorsAllowed NOTIFY errorsAllowedChanged) | ||
53 | 54 | | |||
54 | virtual void init(QQuickView *view) { | 55 | virtual void init(QQuickView *view) { | ||
55 | m_view = view; | 56 | m_view = view; | ||
56 | } | 57 | } | ||
57 | int mode() const { | 58 | int mode() const { | ||
58 | return (int)m_mode; | 59 | return (int)m_mode; | ||
59 | } | 60 | } | ||
61 | | ||||
62 | bool lockHint() const { | ||||
63 | return m_lockHint; | ||||
64 | } | ||||
60 | bool errorsAllowed() const { | 65 | bool errorsAllowed() const { | ||
61 | return m_errorsAllowed; | 66 | return m_errorsAllowed; | ||
62 | } | 67 | } | ||
63 | void setErrorsAllowed(bool set) { | 68 | void setErrorsAllowed(bool set) { | ||
64 | if (m_errorsAllowed == set) { | 69 | if (m_errorsAllowed == set) { | ||
65 | return; | 70 | return; | ||
66 | } | 71 | } | ||
67 | m_errorsAllowed = set; | 72 | m_errorsAllowed = set; | ||
Show All 14 Lines | |||||
82 | Q_INVOKABLE virtual void hideAndConfineRequest(bool confineBeforeHide = false) { | 87 | Q_INVOKABLE virtual void hideAndConfineRequest(bool confineBeforeHide = false) { | ||
83 | Q_UNUSED(confineBeforeHide); | 88 | Q_UNUSED(confineBeforeHide); | ||
84 | } | 89 | } | ||
85 | Q_INVOKABLE virtual void undoHideRequest() {} | 90 | Q_INVOKABLE virtual void undoHideRequest() {} | ||
86 | 91 | | |||
87 | Q_SIGNALS: | 92 | Q_SIGNALS: | ||
88 | void confineChanged(bool confined); | 93 | void confineChanged(bool confined); | ||
89 | void lockChanged(bool locked); | 94 | void lockChanged(bool locked); | ||
95 | void lockHintChanged(); | ||||
90 | void errorsAllowedChanged(); | 96 | void errorsAllowedChanged(); | ||
97 | void forceSurfaceCommit(); | ||||
91 | 98 | | |||
92 | protected: | 99 | protected: | ||
93 | enum class Mode { | 100 | enum class Mode { | ||
94 | Wayland = 0, | 101 | Wayland = 0, | ||
95 | X = 1 | 102 | X = 1 | ||
96 | }; | 103 | }; | ||
97 | 104 | | |||
98 | QQuickView* view() const { | 105 | QQuickView* view() const { | ||
99 | return m_view; | 106 | return m_view; | ||
100 | } | 107 | } | ||
101 | void setMode(Mode set) { | 108 | void setMode(Mode set) { | ||
102 | m_mode = set; | 109 | m_mode = set; | ||
103 | } | 110 | } | ||
104 | 111 | | |||
105 | private: | 112 | private: | ||
106 | QQuickView *m_view; | 113 | QQuickView *m_view; | ||
107 | Mode m_mode; | 114 | Mode m_mode; | ||
115 | | ||||
116 | bool m_lockHint = true; | ||||
108 | bool m_errorsAllowed = false; | 117 | bool m_errorsAllowed = false; | ||
109 | }; | 118 | }; | ||
110 | 119 | | |||
111 | class WaylandBackend : public Backend | 120 | class WaylandBackend : public Backend | ||
112 | { | 121 | { | ||
113 | Q_OBJECT | 122 | Q_OBJECT | ||
114 | public: | 123 | public: | ||
115 | WaylandBackend(QObject *parent = nullptr); | 124 | WaylandBackend(QObject *parent = nullptr); | ||
▲ Show 20 Lines • Show All 54 Lines • Show Last 20 Lines |