Changeset View
Changeset View
Standalone View
Standalone View
src/client/registry.cpp
Show First 20 Lines • Show All 72 Lines • ▼ Show 20 Line(s) | |||||
73 | #include <wayland-contrast-client-protocol.h> | 73 | #include <wayland-contrast-client-protocol.h> | ||
74 | #include <wayland-slide-client-protocol.h> | 74 | #include <wayland-slide-client-protocol.h> | ||
75 | #include <wayland-dpms-client-protocol.h> | 75 | #include <wayland-dpms-client-protocol.h> | ||
76 | #include <wayland-server-decoration-client-protocol.h> | 76 | #include <wayland-server-decoration-client-protocol.h> | ||
77 | #include <wayland-text-input-v0-client-protocol.h> | 77 | #include <wayland-text-input-v0-client-protocol.h> | ||
78 | #include <wayland-text-input-v2-client-protocol.h> | 78 | #include <wayland-text-input-v2-client-protocol.h> | ||
79 | #include "../compat/wayland-xdg-shell-v5-client-protocol.h" | 79 | #include "../compat/wayland-xdg-shell-v5-client-protocol.h" | ||
80 | #include <wayland-xdg-shell-v6-client-protocol.h> | 80 | #include <wayland-xdg-shell-v6-client-protocol.h> | ||
81 | #include <wayland-xdg-shell-client-protocol.h> | ||||
81 | #include <wayland-relativepointer-unstable-v1-client-protocol.h> | 82 | #include <wayland-relativepointer-unstable-v1-client-protocol.h> | ||
82 | #include <wayland-pointer-gestures-unstable-v1-client-protocol.h> | 83 | #include <wayland-pointer-gestures-unstable-v1-client-protocol.h> | ||
83 | #include <wayland-pointer-constraints-unstable-v1-client-protocol.h> | 84 | #include <wayland-pointer-constraints-unstable-v1-client-protocol.h> | ||
84 | #include <wayland-xdg-foreign-unstable-v2-client-protocol.h> | 85 | #include <wayland-xdg-foreign-unstable-v2-client-protocol.h> | ||
85 | #include <wayland-appmenu-client-protocol.h> | 86 | #include <wayland-appmenu-client-protocol.h> | ||
86 | #include <wayland-server-decoration-palette-client-protocol.h> | 87 | #include <wayland-server-decoration-palette-client-protocol.h> | ||
87 | #include <wayland-xdg-output-unstable-v1-client-protocol.h> | 88 | #include <wayland-xdg-output-unstable-v1-client-protocol.h> | ||
88 | 89 | | |||
romangg: nitpick: put this include directly below the other xdg-shell ones above. | |||||
89 | /***** | 90 | /***** | ||
90 | * How to add another interface: | 91 | * How to add another interface: | ||
91 | * * define a new enum value in Registry::Interface | 92 | * * define a new enum value in Registry::Interface | ||
92 | * * define the bind<InterfaceName> method | 93 | * * define the bind<InterfaceName> method | ||
93 | * * define the create<InterfaceName> method | 94 | * * define the create<InterfaceName> method | ||
94 | * * define the <interfaceName>Announced signal | 95 | * * define the <interfaceName>Announced signal | ||
95 | * * define the <interfaceName>Removed signal | 96 | * * define the <interfaceName>Removed signal | ||
96 | * * add a block to s_interfaces | 97 | * * add a block to s_interfaces | ||
▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Line(s) | 341 | {Registry::Interface::ServerSideDecorationPalette, { | |||
345 | &Registry::serverSideDecorationPaletteManagerRemoved | 346 | &Registry::serverSideDecorationPaletteManagerRemoved | ||
346 | }}, | 347 | }}, | ||
347 | {Registry::Interface::XdgOutputUnstableV1, { | 348 | {Registry::Interface::XdgOutputUnstableV1, { | ||
348 | 1, | 349 | 1, | ||
349 | QByteArrayLiteral("zxdg_output_manager_v1"), | 350 | QByteArrayLiteral("zxdg_output_manager_v1"), | ||
350 | &zxdg_output_manager_v1_interface, | 351 | &zxdg_output_manager_v1_interface, | ||
351 | &Registry::xdgOutputAnnounced, | 352 | &Registry::xdgOutputAnnounced, | ||
352 | &Registry::xdgOutputRemoved | 353 | &Registry::xdgOutputRemoved | ||
354 | }}, | ||||
355 | {Registry::Interface::XdgShellStable, { | ||||
356 | 1, | ||||
357 | QByteArrayLiteral("xdg_wm_base"), | ||||
358 | &xdg_wm_base_interface, | ||||
359 | &Registry::xdgShellStableAnnounced, | ||||
360 | &Registry::xdgShellStableRemoved | ||||
353 | }} | 361 | }} | ||
354 | }; | 362 | }; | ||
355 | 363 | | |||
356 | static quint32 maxVersion(const Registry::Interface &interface) | 364 | static quint32 maxVersion(const Registry::Interface &interface) | ||
357 | { | 365 | { | ||
358 | auto it = s_interfaces.find(interface); | 366 | auto it = s_interfaces.find(interface); | ||
359 | if (it != s_interfaces.end()) { | 367 | if (it != s_interfaces.end()) { | ||
360 | return it.value().maxVersion; | 368 | return it.value().maxVersion; | ||
▲ Show 20 Lines • Show All 283 Lines • ▼ Show 20 Line(s) | |||||
644 | BIND(FakeInput, org_kde_kwin_fake_input) | 652 | BIND(FakeInput, org_kde_kwin_fake_input) | ||
645 | BIND(OutputManagement, org_kde_kwin_outputmanagement) | 653 | BIND(OutputManagement, org_kde_kwin_outputmanagement) | ||
646 | BIND(OutputDevice, org_kde_kwin_outputdevice) | 654 | BIND(OutputDevice, org_kde_kwin_outputdevice) | ||
647 | BIND(ServerSideDecorationManager, org_kde_kwin_server_decoration_manager) | 655 | BIND(ServerSideDecorationManager, org_kde_kwin_server_decoration_manager) | ||
648 | BIND(TextInputManagerUnstableV0, wl_text_input_manager) | 656 | BIND(TextInputManagerUnstableV0, wl_text_input_manager) | ||
649 | BIND(TextInputManagerUnstableV2, zwp_text_input_manager_v2) | 657 | BIND(TextInputManagerUnstableV2, zwp_text_input_manager_v2) | ||
650 | BIND(XdgShellUnstableV5, xdg_shell) | 658 | BIND(XdgShellUnstableV5, xdg_shell) | ||
651 | BIND(XdgShellUnstableV6, zxdg_shell_v6) | 659 | BIND(XdgShellUnstableV6, zxdg_shell_v6) | ||
660 | BIND(XdgShellStable, xdg_wm_base) | ||||
652 | BIND(RelativePointerManagerUnstableV1, zwp_relative_pointer_manager_v1) | 661 | BIND(RelativePointerManagerUnstableV1, zwp_relative_pointer_manager_v1) | ||
653 | BIND(PointerGesturesUnstableV1, zwp_pointer_gestures_v1) | 662 | BIND(PointerGesturesUnstableV1, zwp_pointer_gestures_v1) | ||
654 | BIND(PointerConstraintsUnstableV1, zwp_pointer_constraints_v1) | 663 | BIND(PointerConstraintsUnstableV1, zwp_pointer_constraints_v1) | ||
655 | BIND(XdgExporterUnstableV2, zxdg_exporter_v2) | 664 | BIND(XdgExporterUnstableV2, zxdg_exporter_v2) | ||
656 | BIND(XdgImporterUnstableV2, zxdg_importer_v2) | 665 | BIND(XdgImporterUnstableV2, zxdg_importer_v2) | ||
657 | BIND(IdleInhibitManagerUnstableV1, zwp_idle_inhibit_manager_v1) | 666 | BIND(IdleInhibitManagerUnstableV1, zwp_idle_inhibit_manager_v1) | ||
658 | BIND2(ShadowManager, Shadow, org_kde_kwin_shadow_manager) | 667 | BIND2(ShadowManager, Shadow, org_kde_kwin_shadow_manager) | ||
659 | BIND2(BlurManager, Blur, org_kde_kwin_blur_manager) | 668 | BIND2(BlurManager, Blur, org_kde_kwin_blur_manager) | ||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | |||||
745 | 754 | | |||
746 | XdgShell *Registry::createXdgShell(quint32 name, quint32 version, QObject *parent) | 755 | XdgShell *Registry::createXdgShell(quint32 name, quint32 version, QObject *parent) | ||
747 | { | 756 | { | ||
748 | switch (d->interfaceForName(name)) { | 757 | switch (d->interfaceForName(name)) { | ||
749 | case Interface::XdgShellUnstableV5: | 758 | case Interface::XdgShellUnstableV5: | ||
750 | return d->create<XdgShellUnstableV5>(name, version, parent, &Registry::bindXdgShellUnstableV5); | 759 | return d->create<XdgShellUnstableV5>(name, version, parent, &Registry::bindXdgShellUnstableV5); | ||
751 | case Interface::XdgShellUnstableV6: | 760 | case Interface::XdgShellUnstableV6: | ||
752 | return d->create<XdgShellUnstableV6>(name, version, parent, &Registry::bindXdgShellUnstableV6); | 761 | return d->create<XdgShellUnstableV6>(name, version, parent, &Registry::bindXdgShellUnstableV6); | ||
762 | case Interface::XdgShellStable: | ||||
763 | return d->create<XdgShellStable>(name, version, parent, &Registry::bindXdgShellStable); | ||||
753 | default: | 764 | default: | ||
754 | return nullptr; | 765 | return nullptr; | ||
755 | } | 766 | } | ||
756 | } | 767 | } | ||
757 | 768 | | |||
758 | RelativePointerManager *Registry::createRelativePointerManager(quint32 name, quint32 version, QObject *parent) | 769 | RelativePointerManager *Registry::createRelativePointerManager(quint32 name, quint32 version, QObject *parent) | ||
759 | { | 770 | { | ||
760 | switch (d->interfaceForName(name)) { | 771 | switch (d->interfaceForName(name)) { | ||
▲ Show 20 Lines • Show All 97 Lines • Show Last 20 Lines |
nitpick: put this include directly below the other xdg-shell ones above.