Changeset View
Changeset View
Standalone View
Standalone View
src/server/plasmawindowmanagement_interface.cpp
Show All 10 Lines | |||||
11 | 11 | | |||
12 | This library is distributed in the hope that it will be useful, | 12 | This library is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | Lesser General Public License for more details. | 15 | Lesser General Public License for more details. | ||
16 | 16 | | |||
17 | You should have received a copy of the GNU Lesser General Public | 17 | You should have received a copy of the GNU Lesser General Public | ||
18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 18 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
graesslin: close added | |||||
20 | #include "plasmawindowmanagement_interface.h" | 20 | #include "plasmawindowmanagement_interface.h" | ||
21 | #include "global_p.h" | 21 | #include "global_p.h" | ||
22 | #include "resource_p.h" | 22 | #include "resource_p.h" | ||
23 | #include "display.h" | 23 | #include "display.h" | ||
24 | #include "surface_interface.h" | 24 | #include "surface_interface.h" | ||
25 | 25 | | |||
26 | #include <QList> | 26 | #include <QList> | ||
27 | #include <QVector> | 27 | #include <QVector> | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 65 | public: | |||
83 | QHash<SurfaceInterface*, QRect> minimizedGeometries; | 83 | QHash<SurfaceInterface*, QRect> minimizedGeometries; | ||
84 | 84 | | |||
85 | private: | 85 | private: | ||
86 | static void unbind(wl_resource *resource); | 86 | static void unbind(wl_resource *resource); | ||
87 | static void destroyListenerCallback(wl_listener *listener, void *data); | 87 | static void destroyListenerCallback(wl_listener *listener, void *data); | ||
88 | static void setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state); | 88 | static void setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state); | ||
89 | static void setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number); | 89 | static void setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number); | ||
90 | static void closeCallback(wl_client *client, wl_resource *resource); | 90 | static void closeCallback(wl_client *client, wl_resource *resource); | ||
91 | static void requestMoveCallback(wl_client *client, wl_resource *resource); | ||||
92 | static void requestResizeCallback(wl_client *client, wl_resource *resource); | ||||
91 | static void setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height); | 93 | static void setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height); | ||
92 | static void unsetMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel); | 94 | static void unsetMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel); | ||
93 | static Private *cast(wl_resource *resource) { | 95 | static Private *cast(wl_resource *resource) { | ||
94 | return reinterpret_cast<Private*>(wl_resource_get_user_data(resource)); | 96 | return reinterpret_cast<Private*>(wl_resource_get_user_data(resource)); | ||
95 | } | 97 | } | ||
96 | 98 | | |||
97 | PlasmaWindowInterface *q; | 99 | PlasmaWindowInterface *q; | ||
98 | PlasmaWindowManagementInterface *wm; | 100 | PlasmaWindowManagementInterface *wm; | ||
▲ Show 20 Lines • Show All 145 Lines • ▼ Show 20 Line(s) | |||||
244 | } | 246 | } | ||
245 | 247 | | |||
246 | #ifndef DOXYGEN_SHOULD_SKIP_THIS | 248 | #ifndef DOXYGEN_SHOULD_SKIP_THIS | ||
247 | const struct org_kde_plasma_window_interface PlasmaWindowInterface::Private::s_interface = { | 249 | const struct org_kde_plasma_window_interface PlasmaWindowInterface::Private::s_interface = { | ||
248 | setStateCallback, | 250 | setStateCallback, | ||
249 | setVirtualDesktopCallback, | 251 | setVirtualDesktopCallback, | ||
250 | setMinimizedGeometryCallback, | 252 | setMinimizedGeometryCallback, | ||
251 | unsetMinimizedGeometryCallback, | 253 | unsetMinimizedGeometryCallback, | ||
252 | closeCallback | 254 | closeCallback, | ||
255 | requestMoveCallback, | ||||
256 | requestResizeCallback | ||||
253 | }; | 257 | }; | ||
254 | #endif | 258 | #endif | ||
255 | 259 | | |||
256 | PlasmaWindowInterface::Private::Private(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q) | 260 | PlasmaWindowInterface::Private::Private(PlasmaWindowManagementInterface *wm, PlasmaWindowInterface *q) | ||
257 | : q(q) | 261 | : q(q) | ||
258 | , wm(wm) | 262 | , wm(wm) | ||
259 | { | 263 | { | ||
260 | } | 264 | } | ||
▲ Show 20 Lines • Show All 132 Lines • ▼ Show 20 Line(s) | |||||
393 | 397 | | |||
394 | void PlasmaWindowInterface::Private::closeCallback(wl_client *client, wl_resource *resource) | 398 | void PlasmaWindowInterface::Private::closeCallback(wl_client *client, wl_resource *resource) | ||
395 | { | 399 | { | ||
396 | Q_UNUSED(client) | 400 | Q_UNUSED(client) | ||
397 | Private *p = cast(resource); | 401 | Private *p = cast(resource); | ||
398 | emit p->q->closeRequested(); | 402 | emit p->q->closeRequested(); | ||
399 | } | 403 | } | ||
400 | 404 | | |||
405 | void PlasmaWindowInterface::Private::requestMoveCallback(wl_client *client, wl_resource *resource) | ||||
406 | { | ||||
407 | Q_UNUSED(client) | ||||
408 | Private *p = cast(resource); | ||||
409 | emit p->q->moveRequested(); | ||||
410 | } | ||||
411 | | ||||
412 | void PlasmaWindowInterface::Private::requestResizeCallback(wl_client *client, wl_resource *resource) | ||||
413 | { | ||||
414 | Q_UNUSED(client) | ||||
415 | Private *p = cast(resource); | ||||
416 | emit p->q->resizeRequested(); | ||||
417 | } | ||||
418 | | ||||
401 | void PlasmaWindowInterface::Private::setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number) | 419 | void PlasmaWindowInterface::Private::setVirtualDesktopCallback(wl_client *client, wl_resource *resource, uint32_t number) | ||
402 | { | 420 | { | ||
403 | Q_UNUSED(client) | 421 | Q_UNUSED(client) | ||
404 | Private *p = cast(resource); | 422 | Private *p = cast(resource); | ||
405 | emit p->q->virtualDesktopRequested(number); | 423 | emit p->q->virtualDesktopRequested(number); | ||
406 | } | 424 | } | ||
407 | 425 | | |||
408 | void PlasmaWindowInterface::Private::setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state) | 426 | void PlasmaWindowInterface::Private::setStateCallback(wl_client *client, wl_resource *resource, uint32_t flags, uint32_t state) | ||
Show All 37 Lines | 463 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR) { | |||
446 | emit p->q->skipTaskbarRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR); | 464 | emit p->q->skipTaskbarRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SKIPTASKBAR); | ||
447 | } | 465 | } | ||
448 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE) { | 466 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE) { | ||
449 | emit p->q->shadeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE); | 467 | emit p->q->shadeableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE); | ||
450 | } | 468 | } | ||
451 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED) { | 469 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED) { | ||
452 | emit p->q->shadedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); | 470 | emit p->q->shadedRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED); | ||
453 | } | 471 | } | ||
472 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE) { | ||||
473 | emit p->q->movableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE); | ||||
474 | } | ||||
475 | if (flags & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE) { | ||||
476 | emit p->q->resizableRequested(state & ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE); | ||||
477 | } | ||||
graesslin: as said abode: I don't think we need that. | |||||
454 | } | 478 | } | ||
455 | 479 | | |||
456 | void PlasmaWindowInterface::Private::setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) | 480 | void PlasmaWindowInterface::Private::setMinimizedGeometryCallback(wl_client *client, wl_resource *resource, wl_resource *panel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) | ||
457 | { | 481 | { | ||
458 | Q_UNUSED(client) | 482 | Q_UNUSED(client) | ||
459 | Private *p = cast(resource); | 483 | Private *p = cast(resource); | ||
460 | SurfaceInterface *panelSurface = SurfaceInterface::get(panel); | 484 | SurfaceInterface *panelSurface = SurfaceInterface::get(panel); | ||
461 | 485 | | |||
▲ Show 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | 623 | { | |||
600 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE, set); | 624 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADEABLE, set); | ||
601 | } | 625 | } | ||
602 | 626 | | |||
603 | void PlasmaWindowInterface::setShaded(bool set) | 627 | void PlasmaWindowInterface::setShaded(bool set) | ||
604 | { | 628 | { | ||
605 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, set); | 629 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_SHADED, set); | ||
606 | } | 630 | } | ||
607 | 631 | | |||
632 | void PlasmaWindowInterface::setMovable(bool set) | ||||
633 | { | ||||
634 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_MOVABLE, set); | ||||
635 | } | ||||
636 | | ||||
637 | void PlasmaWindowInterface::setResizable(bool set) | ||||
638 | { | ||||
639 | d->setState(ORG_KDE_PLASMA_WINDOW_MANAGEMENT_STATE_RESIZABLE, set); | ||||
640 | } | ||||
641 | | ||||
608 | } | 642 | } | ||
609 | } | 643 | } |
close added