Changeset View
Changeset View
Standalone View
Standalone View
src/client/xdgshell.cpp
Show First 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | 42 | { | |||
---|---|---|---|---|---|
43 | release(); | 43 | release(); | ||
44 | } | 44 | } | ||
45 | 45 | | |||
46 | void XdgShell::setup(xdg_shell *xdgshellv5) | 46 | void XdgShell::setup(xdg_shell *xdgshellv5) | ||
47 | { | 47 | { | ||
48 | d->setupV5(xdgshellv5); | 48 | d->setupV5(xdgshellv5); | ||
49 | } | 49 | } | ||
50 | 50 | | |||
51 | void XdgShell::setup(zxdg_shell_v6 *xdgshellv6) | ||||
52 | { | ||||
53 | d->setupV6(xdgshellv6); | ||||
54 | } | ||||
55 | | ||||
56 | | ||||
51 | void XdgShell::release() | 57 | void XdgShell::release() | ||
52 | { | 58 | { | ||
53 | d->release(); | 59 | d->release(); | ||
54 | } | 60 | } | ||
55 | 61 | | |||
56 | void XdgShell::destroy() | 62 | void XdgShell::destroy() | ||
57 | { | 63 | { | ||
58 | d->destroy(); | 64 | d->destroy(); | ||
Show All 12 Lines | |||||
71 | XdgShell::operator xdg_shell*() { | 77 | XdgShell::operator xdg_shell*() { | ||
72 | return *(d.data()); | 78 | return *(d.data()); | ||
73 | } | 79 | } | ||
74 | 80 | | |||
75 | XdgShell::operator xdg_shell*() const { | 81 | XdgShell::operator xdg_shell*() const { | ||
76 | return *(d.data()); | 82 | return *(d.data()); | ||
77 | } | 83 | } | ||
78 | 84 | | |||
85 | XdgShell::operator zxdg_shell_v6*() { | ||||
86 | return *(d.data()); | ||||
87 | } | ||||
88 | | ||||
89 | XdgShell::operator zxdg_shell_v6*() const { | ||||
90 | return *(d.data()); | ||||
91 | } | ||||
92 | | ||||
79 | bool XdgShell::isValid() const | 93 | bool XdgShell::isValid() const | ||
80 | { | 94 | { | ||
81 | return d->isValid(); | 95 | return d->isValid(); | ||
82 | } | 96 | } | ||
83 | 97 | | |||
84 | XdgShellSurface *XdgShell::createSurface(Surface *surface, QObject *parent) | 98 | XdgShellSurface *XdgShell::createSurface(Surface *surface, QObject *parent) | ||
85 | { | 99 | { | ||
86 | return d->getXdgSurface(surface, parent); | 100 | return d->getXdgSurface(surface, parent); | ||
87 | } | 101 | } | ||
88 | 102 | | |||
89 | XdgShellPopup *XdgShell::createPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) | 103 | XdgShellPopup *XdgShell::createPopup(Surface *surface, Surface *parentSurface, Seat *seat, quint32 serial, const QPoint &parentPos, QObject *parent) | ||
90 | { | 104 | { | ||
91 | return d->getXdgPopup(surface, parentSurface, seat, serial, parentPos, parent); | 105 | return d->getXdgPopup(surface, parentSurface, seat, serial, parentPos, parent); | ||
92 | } | 106 | } | ||
93 | 107 | | |||
108 | XdgShellPopup *XdgShell::createPopup(Surface *surface, XdgShellSurface *parentSurface, const XdgPositioner &positioner, QObject *parent) | ||||
109 | { | ||||
110 | return d->getXdgPopup(surface, parentSurface, positioner, parent); | ||||
111 | } | ||||
112 | | ||||
113 | XdgShellPopup *XdgShell::createPopup(Surface *surface, XdgShellPopup *parentSurface, const XdgPositioner &positioner, QObject *parent) | ||||
114 | { | ||||
115 | return d->getXdgPopup(surface, parentSurface, positioner, parent); | ||||
116 | } | ||||
117 | | ||||
94 | XdgShellSurface::Private::Private(XdgShellSurface *q) | 118 | XdgShellSurface::Private::Private(XdgShellSurface *q) | ||
95 | : q(q) | 119 | : q(q) | ||
96 | { | 120 | { | ||
97 | } | 121 | } | ||
98 | 122 | | |||
99 | XdgShellSurface::Private::~Private() = default; | 123 | XdgShellSurface::Private::~Private() = default; | ||
100 | 124 | | |||
101 | XdgShellSurface::XdgShellSurface(Private *p, QObject *parent) | 125 | XdgShellSurface::XdgShellSurface(Private *p, QObject *parent) | ||
102 | : QObject(parent) | 126 | : QObject(parent) | ||
103 | , d(p) | 127 | , d(p) | ||
104 | { | 128 | { | ||
105 | } | 129 | } | ||
106 | 130 | | |||
107 | XdgShellSurface::~XdgShellSurface() | 131 | XdgShellSurface::~XdgShellSurface() | ||
108 | { | 132 | { | ||
109 | release(); | 133 | release(); | ||
110 | } | 134 | } | ||
111 | 135 | | |||
112 | void XdgShellSurface::setup(xdg_surface *xdgsurfacev5) | 136 | void XdgShellSurface::setup(xdg_surface *xdgsurfacev5) | ||
113 | { | 137 | { | ||
114 | d->setupV5(xdgsurfacev5); | 138 | d->setupV5(xdgsurfacev5); | ||
115 | } | 139 | } | ||
116 | 140 | | |||
141 | void XdgShellSurface::setup(zxdg_surface_v6 *xdgsurfacev6, zxdg_toplevel_v6 *xdgtoplevelv6) | ||||
142 | { | ||||
143 | d->setupV6(xdgsurfacev6, xdgtoplevelv6); | ||||
144 | } | ||||
145 | | ||||
117 | void XdgShellSurface::release() | 146 | void XdgShellSurface::release() | ||
118 | { | 147 | { | ||
119 | d->release(); | 148 | d->release(); | ||
120 | } | 149 | } | ||
121 | 150 | | |||
122 | void XdgShellSurface::destroy() | 151 | void XdgShellSurface::destroy() | ||
123 | { | 152 | { | ||
124 | d->destroy(); | 153 | d->destroy(); | ||
Show All 12 Lines | |||||
137 | XdgShellSurface::operator xdg_surface*() { | 166 | XdgShellSurface::operator xdg_surface*() { | ||
138 | return *(d.data()); | 167 | return *(d.data()); | ||
139 | } | 168 | } | ||
140 | 169 | | |||
141 | XdgShellSurface::operator xdg_surface*() const { | 170 | XdgShellSurface::operator xdg_surface*() const { | ||
142 | return *(d.data()); | 171 | return *(d.data()); | ||
143 | } | 172 | } | ||
144 | 173 | | |||
174 | XdgShellSurface::operator zxdg_surface_v6*() { | ||||
175 | return *(d.data()); | ||||
176 | } | ||||
177 | | ||||
178 | XdgShellSurface::operator zxdg_surface_v6*() const { | ||||
179 | return *(d.data()); | ||||
180 | } | ||||
181 | | ||||
182 | XdgShellSurface::operator zxdg_toplevel_v6*() { | ||||
183 | return *(d.data()); | ||||
184 | } | ||||
185 | | ||||
186 | XdgShellSurface::operator zxdg_toplevel_v6*() const { | ||||
187 | return *(d.data()); | ||||
188 | } | ||||
189 | | ||||
145 | bool XdgShellSurface::isValid() const | 190 | bool XdgShellSurface::isValid() const | ||
146 | { | 191 | { | ||
147 | return d->isValid(); | 192 | return d->isValid(); | ||
148 | } | 193 | } | ||
149 | 194 | | |||
150 | void XdgShellSurface::setTransientFor(XdgShellSurface *parent) | 195 | void XdgShellSurface::setTransientFor(XdgShellSurface *parent) | ||
151 | { | 196 | { | ||
152 | d->setTransientFor(parent); | 197 | d->setTransientFor(parent); | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
195 | { | 240 | { | ||
196 | if (set) { | 241 | if (set) { | ||
197 | d->setFullscreen(output); | 242 | d->setFullscreen(output); | ||
198 | } else { | 243 | } else { | ||
199 | d->unsetFullscreen(); | 244 | d->unsetFullscreen(); | ||
200 | } | 245 | } | ||
201 | } | 246 | } | ||
202 | 247 | | |||
248 | void XdgShellSurface::setMaxSize(const QSize &size) | ||||
249 | { | ||||
250 | d->setMaxSize(size); | ||||
251 | } | ||||
252 | | ||||
253 | void XdgShellSurface::setMinSize(const QSize &size) | ||||
254 | { | ||||
255 | d->setMinSize(size); | ||||
256 | } | ||||
257 | | ||||
203 | void XdgShellSurface::requestMinimize() | 258 | void XdgShellSurface::requestMinimize() | ||
204 | { | 259 | { | ||
205 | d->setMinimized(); | 260 | d->setMinimized(); | ||
206 | } | 261 | } | ||
207 | 262 | | |||
208 | void XdgShellSurface::setSize(const QSize &size) | 263 | void XdgShellSurface::setSize(const QSize &size) | ||
209 | { | 264 | { | ||
210 | if (d->size == size) { | 265 | if (d->size == size) { | ||
Show All 27 Lines | 292 | { | |||
238 | release(); | 293 | release(); | ||
239 | } | 294 | } | ||
240 | 295 | | |||
241 | void XdgShellPopup::setup(xdg_popup *xdgpopupv5) | 296 | void XdgShellPopup::setup(xdg_popup *xdgpopupv5) | ||
242 | { | 297 | { | ||
243 | d->setupV5(xdgpopupv5); | 298 | d->setupV5(xdgpopupv5); | ||
244 | } | 299 | } | ||
245 | 300 | | |||
301 | void XdgShellPopup::setup(zxdg_surface_v6 *xdgsurfacev6, zxdg_popup_v6 *xdgpopupv6) | ||||
302 | { | ||||
303 | d->setupV6(xdgsurfacev6, xdgpopupv6); | ||||
304 | } | ||||
305 | | ||||
246 | void XdgShellPopup::release() | 306 | void XdgShellPopup::release() | ||
247 | { | 307 | { | ||
248 | d->release(); | 308 | d->release(); | ||
249 | } | 309 | } | ||
250 | 310 | | |||
251 | void XdgShellPopup::destroy() | 311 | void XdgShellPopup::destroy() | ||
252 | { | 312 | { | ||
253 | d->destroy(); | 313 | d->destroy(); | ||
254 | } | 314 | } | ||
255 | 315 | | |||
256 | void XdgShellPopup::setEventQueue(EventQueue *queue) | 316 | void XdgShellPopup::setEventQueue(EventQueue *queue) | ||
257 | { | 317 | { | ||
258 | d->queue = queue; | 318 | d->queue = queue; | ||
259 | } | 319 | } | ||
260 | 320 | | |||
261 | EventQueue *XdgShellPopup::eventQueue() | 321 | EventQueue *XdgShellPopup::eventQueue() | ||
262 | { | 322 | { | ||
263 | return d->queue; | 323 | return d->queue; | ||
264 | } | 324 | } | ||
265 | 325 | | |||
326 | void XdgShellPopup::requestGrab(KWayland::Client::Seat* seat, quint32 serial) | ||||
327 | { | ||||
328 | d->requestGrab(seat, serial); | ||||
329 | } | ||||
330 | | ||||
266 | XdgShellPopup::operator xdg_popup*() { | 331 | XdgShellPopup::operator xdg_popup*() { | ||
267 | return *(d.data()); | 332 | return *(d.data()); | ||
268 | } | 333 | } | ||
269 | 334 | | |||
270 | XdgShellPopup::operator xdg_popup*() const { | 335 | XdgShellPopup::operator xdg_popup*() const { | ||
271 | return *(d.data()); | 336 | return *(d.data()); | ||
272 | } | 337 | } | ||
273 | 338 | | |||
339 | XdgShellPopup::operator zxdg_surface_v6*() { | ||||
340 | return *(d.data()); | ||||
341 | } | ||||
342 | | ||||
343 | XdgShellPopup::operator zxdg_surface_v6*() const { | ||||
344 | return *(d.data()); | ||||
345 | } | ||||
346 | | ||||
347 | XdgShellPopup::operator zxdg_popup_v6*() { | ||||
348 | return *(d.data()); | ||||
349 | } | ||||
350 | | ||||
351 | XdgShellPopup::operator zxdg_popup_v6*() const { | ||||
352 | return *(d.data()); | ||||
353 | } | ||||
354 | | ||||
274 | bool XdgShellPopup::isValid() const | 355 | bool XdgShellPopup::isValid() const | ||
275 | { | 356 | { | ||
276 | return d->isValid(); | 357 | return d->isValid(); | ||
277 | } | 358 | } | ||
278 | 359 | | |||
360 | XdgPositioner::XdgPositioner(const QSize& initialSize, const QRect& anchor) | ||||
361 | :d (new Private) | ||||
362 | { | ||||
363 | d->initialSize = initialSize; | ||||
364 | d->anchorRect = anchor; | ||||
365 | } | ||||
366 | | ||||
367 | | ||||
368 | XdgPositioner::XdgPositioner(const XdgPositioner &other) | ||||
369 | :d (new Private) | ||||
370 | { | ||||
371 | *d = *other.d; | ||||
372 | } | ||||
373 | | ||||
374 | XdgPositioner::~XdgPositioner() | ||||
375 | { | ||||
376 | } | ||||
377 | | ||||
378 | void XdgPositioner::setInitialSize(const QSize& size) | ||||
379 | { | ||||
380 | d->initialSize = size; | ||||
381 | } | ||||
382 | | ||||
383 | QSize XdgPositioner::initialSize() const | ||||
384 | { | ||||
385 | return d->initialSize; | ||||
386 | } | ||||
387 | | ||||
388 | void XdgPositioner::setAnchorRect(const QRect& anchor) | ||||
389 | { | ||||
390 | d->anchorRect = anchor; | ||||
391 | } | ||||
392 | | ||||
393 | QRect XdgPositioner::anchorRect() const | ||||
394 | { | ||||
395 | return d->anchorRect; | ||||
396 | } | ||||
397 | | ||||
398 | void XdgPositioner::setAnchorEdge(Qt::Edges edge) | ||||
399 | { | ||||
400 | d->anchorEdge = edge; | ||||
401 | } | ||||
402 | | ||||
403 | Qt::Edges XdgPositioner::anchorEdge() const | ||||
404 | { | ||||
405 | return d->anchorEdge; | ||||
406 | } | ||||
407 | | ||||
408 | void XdgPositioner::setAnchorOffset(const QPoint& offset) | ||||
409 | { | ||||
410 | d->anchorOffset = offset; | ||||
411 | } | ||||
412 | | ||||
413 | QPoint XdgPositioner::anchorOffset() const | ||||
414 | { | ||||
415 | return d->anchorOffset; | ||||
416 | } | ||||
417 | | ||||
418 | void XdgPositioner::setGravity(Qt::Edges edge) | ||||
419 | { | ||||
420 | d->gravity = edge; | ||||
421 | } | ||||
422 | | ||||
423 | Qt::Edges XdgPositioner::gravity() const | ||||
424 | { | ||||
425 | return d->gravity; | ||||
426 | } | ||||
427 | | ||||
428 | void XdgPositioner::setConstraints(Constraints constraints) | ||||
429 | { | ||||
430 | d->constraints = constraints; | ||||
431 | } | ||||
432 | | ||||
433 | XdgPositioner::Constraints XdgPositioner::constraints() const | ||||
434 | { | ||||
435 | return d->constraints; | ||||
436 | } | ||||
437 | | ||||
438 | | ||||
279 | } | 439 | } | ||
280 | } | 440 | } | ||
281 | 441 | |