Changeset View
Changeset View
Standalone View
Standalone View
src/client/registry.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | |||||
64 | #include <wayland-blur-client-protocol.h> | 64 | #include <wayland-blur-client-protocol.h> | ||
65 | #include <wayland-contrast-client-protocol.h> | 65 | #include <wayland-contrast-client-protocol.h> | ||
66 | #include <wayland-slide-client-protocol.h> | 66 | #include <wayland-slide-client-protocol.h> | ||
67 | #include <wayland-dpms-client-protocol.h> | 67 | #include <wayland-dpms-client-protocol.h> | ||
68 | #include <wayland-server-decoration-client-protocol.h> | 68 | #include <wayland-server-decoration-client-protocol.h> | ||
69 | #include <wayland-text-input-v0-client-protocol.h> | 69 | #include <wayland-text-input-v0-client-protocol.h> | ||
70 | #include <wayland-text-input-v2-client-protocol.h> | 70 | #include <wayland-text-input-v2-client-protocol.h> | ||
71 | #include <wayland-xdg-shell-v5-client-protocol.h> | 71 | #include <wayland-xdg-shell-v5-client-protocol.h> | ||
72 | #include <wayland-xdg-shell-v6-client-protocol.h> | ||||
72 | #include <wayland-relativepointer-unstable-v1-client-protocol.h> | 73 | #include <wayland-relativepointer-unstable-v1-client-protocol.h> | ||
73 | #include <wayland-pointer-gestures-unstable-v1-client-protocol.h> | 74 | #include <wayland-pointer-gestures-unstable-v1-client-protocol.h> | ||
74 | #include <wayland-pointer-constraints-unstable-v1-client-protocol.h> | 75 | #include <wayland-pointer-constraints-unstable-v1-client-protocol.h> | ||
75 | 76 | | |||
76 | /***** | 77 | /***** | ||
77 | * How to add another interface: | 78 | * How to add another interface: | ||
78 | * * define a new enum value in Registry::Interface | 79 | * * define a new enum value in Registry::Interface | ||
79 | * * define the bind<InterfaceName> method | 80 | * * define the bind<InterfaceName> method | ||
▲ Show 20 Lines • Show All 196 Lines • ▼ Show 20 Line(s) | 272 | {Registry::Interface::PointerGesturesUnstableV1, { | |||
276 | &Registry::pointerGesturesUnstableV1Removed | 277 | &Registry::pointerGesturesUnstableV1Removed | ||
277 | }}, | 278 | }}, | ||
278 | {Registry::Interface::PointerConstraintsUnstableV1, { | 279 | {Registry::Interface::PointerConstraintsUnstableV1, { | ||
279 | 1, | 280 | 1, | ||
280 | QByteArrayLiteral("zwp_pointer_constraints_v1"), | 281 | QByteArrayLiteral("zwp_pointer_constraints_v1"), | ||
281 | &zwp_pointer_constraints_v1_interface, | 282 | &zwp_pointer_constraints_v1_interface, | ||
282 | &Registry::pointerConstraintsUnstableV1Announced, | 283 | &Registry::pointerConstraintsUnstableV1Announced, | ||
283 | &Registry::pointerConstraintsUnstableV1Removed | 284 | &Registry::pointerConstraintsUnstableV1Removed | ||
285 | }}, | ||||
286 | {Registry::Interface::XdgShellUnstableV6, { | ||||
287 | 1, | ||||
288 | QByteArrayLiteral("zxdg_shell_v6"), | ||||
289 | &zxdg_shell_v6_interface, | ||||
290 | &Registry::xdgShellUnstableV6Announced, | ||||
291 | &Registry::xdgShellUnstableV6Removed | ||||
284 | }} | 292 | }} | ||
285 | }; | 293 | }; | ||
286 | 294 | | |||
287 | static quint32 maxVersion(const Registry::Interface &interface) | 295 | static quint32 maxVersion(const Registry::Interface &interface) | ||
288 | { | 296 | { | ||
289 | auto it = s_interfaces.find(interface); | 297 | auto it = s_interfaces.find(interface); | ||
290 | if (it != s_interfaces.end()) { | 298 | if (it != s_interfaces.end()) { | ||
291 | return it.value().maxVersion; | 299 | return it.value().maxVersion; | ||
▲ Show 20 Lines • Show All 281 Lines • ▼ Show 20 Line(s) | |||||
573 | BIND(Idle, org_kde_kwin_idle) | 581 | BIND(Idle, org_kde_kwin_idle) | ||
574 | BIND(FakeInput, org_kde_kwin_fake_input) | 582 | BIND(FakeInput, org_kde_kwin_fake_input) | ||
575 | BIND(OutputManagement, org_kde_kwin_outputmanagement) | 583 | BIND(OutputManagement, org_kde_kwin_outputmanagement) | ||
576 | BIND(OutputDevice, org_kde_kwin_outputdevice) | 584 | BIND(OutputDevice, org_kde_kwin_outputdevice) | ||
577 | BIND(ServerSideDecorationManager, org_kde_kwin_server_decoration_manager) | 585 | BIND(ServerSideDecorationManager, org_kde_kwin_server_decoration_manager) | ||
578 | BIND(TextInputManagerUnstableV0, wl_text_input_manager) | 586 | BIND(TextInputManagerUnstableV0, wl_text_input_manager) | ||
579 | BIND(TextInputManagerUnstableV2, zwp_text_input_manager_v2) | 587 | BIND(TextInputManagerUnstableV2, zwp_text_input_manager_v2) | ||
580 | BIND(XdgShellUnstableV5, xdg_shell) | 588 | BIND(XdgShellUnstableV5, xdg_shell) | ||
589 | BIND(XdgShellUnstableV6, zxdg_shell_v6) | ||||
581 | BIND(RelativePointerManagerUnstableV1, zwp_relative_pointer_manager_v1) | 590 | BIND(RelativePointerManagerUnstableV1, zwp_relative_pointer_manager_v1) | ||
582 | BIND(PointerGesturesUnstableV1, zwp_pointer_gestures_v1) | 591 | BIND(PointerGesturesUnstableV1, zwp_pointer_gestures_v1) | ||
583 | BIND(PointerConstraintsUnstableV1, zwp_pointer_constraints_v1) | 592 | BIND(PointerConstraintsUnstableV1, zwp_pointer_constraints_v1) | ||
584 | BIND2(ShadowManager, Shadow, org_kde_kwin_shadow_manager) | 593 | BIND2(ShadowManager, Shadow, org_kde_kwin_shadow_manager) | ||
585 | BIND2(BlurManager, Blur, org_kde_kwin_blur_manager) | 594 | BIND2(BlurManager, Blur, org_kde_kwin_blur_manager) | ||
586 | BIND2(ContrastManager, Contrast, org_kde_kwin_contrast_manager) | 595 | BIND2(ContrastManager, Contrast, org_kde_kwin_contrast_manager) | ||
587 | BIND2(SlideManager, Slide, org_kde_kwin_slide_manager) | 596 | BIND2(SlideManager, Slide, org_kde_kwin_slide_manager) | ||
588 | BIND2(DpmsManager, Dpms, org_kde_kwin_dpms_manager) | 597 | BIND2(DpmsManager, Dpms, org_kde_kwin_dpms_manager) | ||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Line(s) | 652 | { | |||
651 | } | 660 | } | ||
652 | } | 661 | } | ||
653 | 662 | | |||
654 | XdgShell *Registry::createXdgShell(quint32 name, quint32 version, QObject *parent) | 663 | XdgShell *Registry::createXdgShell(quint32 name, quint32 version, QObject *parent) | ||
655 | { | 664 | { | ||
656 | switch (d->interfaceForName(name)) { | 665 | switch (d->interfaceForName(name)) { | ||
657 | case Interface::XdgShellUnstableV5: | 666 | case Interface::XdgShellUnstableV5: | ||
658 | return d->create<XdgShellUnstableV5>(name, version, parent, &Registry::bindXdgShellUnstableV5); | 667 | return d->create<XdgShellUnstableV5>(name, version, parent, &Registry::bindXdgShellUnstableV5); | ||
668 | case Interface::XdgShellUnstableV6: | ||||
669 | return d->create<XdgShellUnstableV6>(name, version, parent, &Registry::bindXdgShellUnstableV6); | ||||
659 | default: | 670 | default: | ||
660 | return nullptr; | 671 | return nullptr; | ||
661 | } | 672 | } | ||
662 | } | 673 | } | ||
663 | 674 | | |||
664 | RelativePointerManager *Registry::createRelativePointerManager(quint32 name, quint32 version, QObject *parent) | 675 | RelativePointerManager *Registry::createRelativePointerManager(quint32 name, quint32 version, QObject *parent) | ||
665 | { | 676 | { | ||
666 | switch (d->interfaceForName(name)) { | 677 | switch (d->interfaceForName(name)) { | ||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |