Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/kwin_wayland_test.h
Show First 20 Lines • Show All 136 Lines • ▼ Show 20 Line(s) | |||||
137 | KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface, | 137 | KWayland::Client::SubSurface *createSubSurface(KWayland::Client::Surface *surface, | ||
138 | KWayland::Client::Surface *parentSurface, QObject *parent = nullptr); | 138 | KWayland::Client::Surface *parentSurface, QObject *parent = nullptr); | ||
139 | enum class ShellSurfaceType { | 139 | enum class ShellSurfaceType { | ||
140 | WlShell, | 140 | WlShell, | ||
141 | XdgShellV5, | 141 | XdgShellV5, | ||
142 | XdgShellV6, | 142 | XdgShellV6, | ||
143 | XdgShellStable | 143 | XdgShellStable | ||
144 | }; | 144 | }; | ||
145 | | ||||
146 | enum class CreationSetup { | ||||
147 | CreateOnly, | ||||
148 | CreateAndConfigure, /// commit and wait for the configure event, making this surface ready to commit buffers | ||||
149 | }; | ||||
150 | | ||||
151 | /** | ||||
152 | * Creates either a ShellSurface * or XdgShellSurface * as defined by @arg type | ||||
153 | * For XDG top levels this method will block for a configure event, make this surface ready to commit buffers | ||||
154 | */ | ||||
145 | QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent = nullptr); | 155 | QObject *createShellSurface(ShellSurfaceType type, KWayland::Client::Surface *surface, QObject *parent = nullptr); | ||
146 | KWayland::Client::ShellSurface *createShellSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr); | 156 | | ||
147 | KWayland::Client::XdgShellSurface *createXdgShellV5Surface(KWayland::Client::Surface *surface, QObject *parent = nullptr); | 157 | KWayland::Client::XdgShellSurface *createXdgShellSurface(ShellSurfaceType type, | ||
148 | KWayland::Client::XdgShellSurface *createXdgShellV6Surface(KWayland::Client::Surface *surface, QObject *parent = nullptr); | 158 | KWayland::Client::Surface *surface, | ||
149 | KWayland::Client::XdgShellSurface *createXdgShellStableSurface(KWayland::Client::Surface *surface, QObject *parent = nullptr); | 159 | QObject *parent = nullptr, | ||
150 | KWayland::Client::XdgShellPopup *createXdgShellStablePopup(KWayland::Client::Surface *surface, KWayland::Client::XdgShellSurface *parentSurface, const KWayland::Client::XdgPositioner &positioner, QObject *parent = nullptr); | 160 | CreationSetup creationSetup = CreationSetup::CreateAndConfigure); | ||
161 | | ||||
162 | KWayland::Client::ShellSurface *createShellSurface(KWayland::Client::Surface *surface, | ||||
163 | QObject *parent = nullptr); | ||||
164 | KWayland::Client::XdgShellSurface *createXdgShellV5Surface(KWayland::Client::Surface *surface, | ||||
165 | QObject *parent = nullptr, | ||||
166 | CreationSetup = CreationSetup::CreateAndConfigure); | ||||
167 | KWayland::Client::XdgShellSurface *createXdgShellV6Surface(KWayland::Client::Surface *surface, | ||||
168 | QObject *parent = nullptr, | ||||
169 | CreationSetup = CreationSetup::CreateAndConfigure); | ||||
170 | KWayland::Client::XdgShellSurface *createXdgShellStableSurface(KWayland::Client::Surface *surface, | ||||
171 | QObject *parent = nullptr, | ||||
172 | CreationSetup = CreationSetup::CreateAndConfigure); | ||||
173 | KWayland::Client::XdgShellPopup *createXdgShellStablePopup(KWayland::Client::Surface *surface, | ||||
174 | KWayland::Client::XdgShellSurface *parentSurface, | ||||
175 | const KWayland::Client::XdgPositioner &positioner, | ||||
176 | QObject *parent = nullptr, | ||||
177 | CreationSetup = CreationSetup::CreateAndConfigure); | ||||
178 | | ||||
179 | | ||||
180 | /** | ||||
181 | * Commits the XdgShellSurface to the given surface, and waits for the configure event from the compositor | ||||
182 | */ | ||||
183 | void initXdgShellSurface(KWayland::Client::Surface *surface, KWayland::Client::XdgShellSurface *shellSurface); | ||||
184 | void initXdgShellPopup(KWayland::Client::Surface *surface, KWayland::Client::XdgShellPopup *popup); | ||||
185 | | ||||
186 | | ||||
151 | 187 | | |||
152 | /** | 188 | /** | ||
153 | * Creates a shared memory buffer of @p size in @p color and attaches it to the @p surface. | 189 | * Creates a shared memory buffer of @p size in @p color and attaches it to the @p surface. | ||
154 | * The @p surface gets damaged and committed, thus it's rendered. | 190 | * The @p surface gets damaged and committed, thus it's rendered. | ||
155 | **/ | 191 | **/ | ||
156 | void render(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format = QImage::Format_ARGB32_Premultiplied); | 192 | void render(KWayland::Client::Surface *surface, const QSize &size, const QColor &color, const QImage::Format &format = QImage::Format_ARGB32_Premultiplied); | ||
157 | 193 | | |||
158 | /** | 194 | /** | ||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |