KWayland

registry.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2018 David Edmundson <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #ifndef WAYLAND_REGISTRY_H
8 #define WAYLAND_REGISTRY_H
9 
10 #include <QHash>
11 #include <QObject>
12 
13 #include <KWayland/Client/kwaylandclient_export.h>
14 
15 struct wl_compositor;
16 struct wl_data_device_manager;
17 struct wl_display;
18 struct wl_output;
19 struct wl_registry;
20 struct wl_seat;
21 struct wl_shell;
22 struct wl_shm;
23 struct wl_subcompositor;
24 struct wl_text_input_manager;
25 struct zwp_text_input_manager_v2;
26 struct _wl_fullscreen_shell;
27 struct org_kde_kwin_appmenu_manager;
28 struct org_kde_kwin_outputmanagement;
29 struct org_kde_kwin_outputdevice;
30 struct org_kde_kwin_fake_input;
31 struct org_kde_kwin_idle;
32 struct org_kde_kwin_keystate;
33 struct org_kde_kwin_remote_access_manager;
34 struct org_kde_kwin_dpms_manager;
35 struct org_kde_kwin_shadow_manager;
36 struct org_kde_kwin_blur_manager;
37 struct org_kde_kwin_contrast_manager;
38 struct org_kde_kwin_slide_manager;
39 struct org_kde_plasma_shell;
40 struct org_kde_plasma_virtual_desktop_management;
41 struct org_kde_plasma_window_management;
42 struct org_kde_kwin_server_decoration_manager;
43 struct org_kde_kwin_server_decoration_palette_manager;
44 struct xdg_shell;
45 struct zxdg_shell_v6;
46 struct xdg_wm_base;
47 struct zwp_relative_pointer_manager_v1;
48 struct zwp_pointer_gestures_v1;
49 struct zwp_pointer_constraints_v1;
50 struct zxdg_exporter_v2;
51 struct zxdg_importer_v2;
52 struct zwp_idle_inhibit_manager_v1;
53 struct zxdg_output_manager_v1;
54 struct zxdg_decoration_manager_v1;
55 
56 namespace KWayland
57 {
58 namespace Client
59 {
60 
61 class AppMenuManager;
62 class Compositor;
63 class ConnectionThread;
64 class DataDeviceManager;
65 class DpmsManager;
66 class EventQueue;
67 class FakeInput;
68 class FullscreenShell;
69 class OutputManagement;
70 class OutputDevice;
71 class Idle;
72 class IdleInhibitManager;
73 class Keystate;
74 class RemoteAccessManager;
75 class Output;
76 class PlasmaShell;
77 class PlasmaVirtualDesktopManagement;
78 class PlasmaWindowManagement;
79 class PointerConstraints;
80 class PointerGestures;
81 class Seat;
82 class ShadowManager;
83 class BlurManager;
84 class ContrastManager;
85 class SlideManager;
86 class Shell;
87 class ShmPool;
88 class ServerSideDecorationManager;
89 class ServerSideDecorationPaletteManager;
90 class SubCompositor;
91 class TextInputManager;
92 class TextInputManagerUnstableV0;
93 class TextInputManagerUnstableV2;
94 class XdgShell;
95 class RelativePointerManager;
96 class XdgExporterUnstableV2;
97 class XdgImporterUnstableV2;
98 class XdgExporter;
99 class XdgImporter;
100 class XdgOutputManager;
101 class XdgDecorationManager;
102 
128 class KWAYLANDCLIENT_EXPORT Registry : public QObject
129 {
130  Q_OBJECT
131 public:
137  enum class Interface {
138  Unknown,
139  Compositor,
140  Shell,
141  Seat,
142  Shm,
143  Output,
145  SubCompositor,
147  PlasmaShell,
149  Idle,
150  FakeInput,
151  Shadow,
152  Blur,
153  Contrast,
154  Slide,
155  Dpms,
157  OutputDevice,
159  TextInputManagerUnstableV0,
160  TextInputManagerUnstableV2,
161  XdgShellUnstableV5,
162  RelativePointerManagerUnstableV1,
163  PointerGesturesUnstableV1,
164  PointerConstraintsUnstableV1,
167  XdgShellUnstableV6,
168  IdleInhibitManagerUnstableV1,
169  AppMenu,
170  ServerSideDecorationPalette,
173  XdgOutputUnstableV1,
174  XdgShellStable,
175  XdgDecorationUnstableV1,
176  Keystate,
177  };
178  explicit Registry(QObject *parent = nullptr);
179  virtual ~Registry();
180 
186  void release();
203  void destroy();
207  void create(wl_display *display);
211  void create(ConnectionThread *connection);
218  void setup();
219 
229  void setEventQueue(EventQueue *queue);
233  EventQueue *eventQueue();
234 
238  bool isValid() const;
242  bool hasInterface(Interface interface) const;
243 
251  quint32 name;
255  quint32 version;
256  };
271  AnnouncedInterface interface(Interface interface) const;
283  QVector<AnnouncedInterface> interfaces(Interface interface) const;
284 
288 
297  wl_compositor *bindCompositor(uint32_t name, uint32_t version) const;
306  wl_shell *bindShell(uint32_t name, uint32_t version) const;
315  wl_seat *bindSeat(uint32_t name, uint32_t version) const;
324  wl_shm *bindShm(uint32_t name, uint32_t version) const;
333  org_kde_kwin_outputmanagement *bindOutputManagement(uint32_t name, uint32_t version) const;
342  wl_output *bindOutput(uint32_t name, uint32_t version) const;
351  wl_subcompositor *bindSubCompositor(uint32_t name, uint32_t version) const;
361  org_kde_kwin_outputdevice *bindOutputDevice(uint32_t name, uint32_t version) const;
362 
371  _wl_fullscreen_shell *bindFullscreenShell(uint32_t name, uint32_t version) const;
380  wl_data_device_manager *bindDataDeviceManager(uint32_t name, uint32_t version) const;
390  org_kde_plasma_shell *bindPlasmaShell(uint32_t name, uint32_t version) const;
400  org_kde_plasma_virtual_desktop_management *bindPlasmaVirtualDesktopManagement(uint32_t name, uint32_t version) const;
410  org_kde_plasma_window_management *bindPlasmaWindowManagement(uint32_t name, uint32_t version) const;
420  org_kde_kwin_idle *bindIdle(uint32_t name, uint32_t version) const;
430  org_kde_kwin_keystate *bindKeystate(uint32_t name, uint32_t version) const;
440  org_kde_kwin_remote_access_manager *bindRemoteAccessManager(uint32_t name, uint32_t version) const;
450  org_kde_kwin_fake_input *bindFakeInput(uint32_t name, uint32_t version) const;
460  org_kde_kwin_shadow_manager *bindShadowManager(uint32_t name, uint32_t version) const;
470  org_kde_kwin_blur_manager *bindBlurManager(uint32_t name, uint32_t version) const;
480  org_kde_kwin_contrast_manager *bindContrastManager(uint32_t name, uint32_t version) const;
490  org_kde_kwin_slide_manager * bindSlideManager(uint32_t name, uint32_t version) const;
500  org_kde_kwin_dpms_manager *bindDpmsManager(uint32_t name, uint32_t version) const;
510  org_kde_kwin_server_decoration_manager *bindServerSideDecorationManager(uint32_t name, uint32_t version) const;
520  wl_text_input_manager *bindTextInputManagerUnstableV0(uint32_t name, uint32_t version) const;
530  zwp_text_input_manager_v2 *bindTextInputManagerUnstableV2(uint32_t name, uint32_t version) const;
540  xdg_shell *bindXdgShellUnstableV5(uint32_t name, uint32_t version) const;
550  zxdg_shell_v6 *bindXdgShellUnstableV6(uint32_t name, uint32_t version) const;
560  xdg_wm_base *bindXdgShellStable(uint32_t name, uint32_t version) const;
570  zwp_relative_pointer_manager_v1 *bindRelativePointerManagerUnstableV1(uint32_t name, uint32_t version) const;
580  zwp_pointer_gestures_v1 *bindPointerGesturesUnstableV1(uint32_t name, uint32_t version) const;
590  zwp_pointer_constraints_v1 *bindPointerConstraintsUnstableV1(uint32_t name, uint32_t version) const;
591 
601  zxdg_exporter_v2 *bindXdgExporterUnstableV2(uint32_t name, uint32_t version) const;
602 
612  zxdg_importer_v2 *bindXdgImporterUnstableV2(uint32_t name, uint32_t version) const;
613 
622  zwp_idle_inhibit_manager_v1 *bindIdleInhibitManagerUnstableV1(uint32_t name, uint32_t version) const;
623 
633  org_kde_kwin_appmenu_manager *bindAppMenuManager(uint32_t name, uint32_t version) const;
634 
644  org_kde_kwin_server_decoration_palette_manager *bindServerSideDecorationPaletteManager(uint32_t name, uint32_t version) const;
645 
655  zxdg_output_manager_v1 *bindXdgOutputUnstableV1(uint32_t name, uint32_t version) const;
656 
666  zxdg_decoration_manager_v1 *bindXdgDecorationUnstableV1(uint32_t name, uint32_t version) const;
667 
669 
673 
688  Compositor *createCompositor(quint32 name, quint32 version, QObject *parent = nullptr);
703  Shell *createShell(quint32 name, quint32 version, QObject *parent = nullptr);
718  Seat *createSeat(quint32 name, quint32 version, QObject *parent = nullptr);
733  ShmPool *createShmPool(quint32 name, quint32 version, QObject *parent = nullptr);
748  SubCompositor *createSubCompositor(quint32 name, quint32 version, QObject *parent = nullptr);
763  Output *createOutput(quint32 name, quint32 version, QObject *parent = nullptr);
779  OutputManagement *createOutputManagement(quint32 name, quint32 version, QObject *parent = nullptr);
795  OutputDevice *createOutputDevice(quint32 name, quint32 version, QObject *parent = nullptr);
811  FullscreenShell *createFullscreenShell(quint32 name, quint32 version, QObject *parent = nullptr);
826  DataDeviceManager *createDataDeviceManager(quint32 name, quint32 version, QObject *parent = nullptr);
842  PlasmaShell *createPlasmaShell(quint32 name, quint32 version, QObject *parent = nullptr);
858  PlasmaVirtualDesktopManagement *createPlasmaVirtualDesktopManagement(quint32 name, quint32 version, QObject *parent = nullptr);
874  PlasmaWindowManagement *createPlasmaWindowManagement(quint32 name, quint32 version, QObject *parent = nullptr);
890  Idle *createIdle(quint32 name, quint32 version, QObject *parent = nullptr);
906  Keystate *createKeystate(quint32 name, quint32 version, QObject *parent = nullptr);
922  RemoteAccessManager *createRemoteAccessManager(quint32 name, quint32 version, QObject *parent = nullptr);
938  FakeInput *createFakeInput(quint32 name, quint32 version, QObject *parent = nullptr);
954  ShadowManager *createShadowManager(quint32 name, quint32 version, QObject *parent = nullptr);
970  BlurManager *createBlurManager(quint32 name, quint32 version, QObject *parent = nullptr);
986  ContrastManager *createContrastManager(quint32 name, quint32 version, QObject *parent = nullptr);
1002  SlideManager *createSlideManager(quint32 name, quint32 version, QObject *parent = nullptr);
1018  DpmsManager *createDpmsManager(quint32 name, quint32 version, QObject *parent = nullptr);
1034  ServerSideDecorationManager *createServerSideDecorationManager(quint32 name, quint32 version, QObject *parent = nullptr);
1053  TextInputManager *createTextInputManager(quint32 name, quint32 version, QObject *parent = nullptr);
1071  XdgShell *createXdgShell(quint32 name, quint32 version, QObject *parent = nullptr);
1089  RelativePointerManager *createRelativePointerManager(quint32 name, quint32 version, QObject *parent = nullptr);
1107  PointerGestures *createPointerGestures(quint32 name, quint32 version, QObject *parent = nullptr);
1125  PointerConstraints *createPointerConstraints(quint32 name, quint32 version, QObject *parent = nullptr);
1126 
1140  XdgExporter *createXdgExporter(quint32 name, quint32 version, QObject *parent = nullptr);
1141 
1155  XdgImporter *createXdgImporter(quint32 name, quint32 version, QObject *parent = nullptr);
1156 
1170  IdleInhibitManager *createIdleInhibitManager(quint32 name, quint32 version, QObject *parent = nullptr);
1171 
1187  AppMenuManager *createAppMenuManager(quint32 name, quint32 version, QObject *parent = nullptr);
1188 
1204  ServerSideDecorationPaletteManager *createServerSideDecorationPaletteManager(quint32 name, quint32 version, QObject *parent = nullptr);
1205 
1221  XdgOutputManager *createXdgOutputManager(quint32 name, quint32 version, QObject *parent = nullptr);
1222 
1238  XdgDecorationManager *createXdgDecorationManager(quint32 name, quint32 version, QObject *parent = nullptr);
1239 
1241 
1242 
1246  operator wl_registry*();
1250  operator wl_registry*() const;
1254  wl_registry *registry();
1255 
1256 Q_SIGNALS:
1260 
1266  void compositorAnnounced(quint32 name, quint32 version);
1272  void shellAnnounced(quint32 name, quint32 version);
1278  void seatAnnounced(quint32 name, quint32 version);
1284  void shmAnnounced(quint32 name, quint32 version);
1290  void subCompositorAnnounced(quint32 name, quint32 version);
1296  void outputAnnounced(quint32 name, quint32 version);
1302  void fullscreenShellAnnounced(quint32 name, quint32 version);
1308  void dataDeviceManagerAnnounced(quint32 name, quint32 version);
1309 
1310  void outputManagementAnnounced(quint32 name, quint32 version);
1317  void outputDeviceAnnounced(quint32 name, quint32 version);
1324  void plasmaShellAnnounced(quint32 name, quint32 version);
1331  void plasmaVirtualDesktopManagementAnnounced(quint32 name, quint32 version);
1338  void plasmaWindowManagementAnnounced(quint32 name, quint32 version);
1345  void idleAnnounced(quint32 name, quint32 version);
1352  void remoteAccessManagerAnnounced(quint32 name, quint32 version);
1359  void fakeInputAnnounced(quint32 name, quint32 version);
1366  void shadowAnnounced(quint32 name, quint32 version);
1373  void blurAnnounced(quint32 name, quint32 version);
1380  void contrastAnnounced(quint32 name, quint32 version);
1387  void slideAnnounced(quint32 name, quint32 version);
1394  void dpmsAnnounced(quint32 name, quint32 version);
1401  void serverSideDecorationManagerAnnounced(quint32 name, quint32 version);
1408  void textInputManagerUnstableV0Announced(quint32 name, quint32 version);
1415  void textInputManagerUnstableV2Announced(quint32 name, quint32 version);
1422  void xdgShellUnstableV5Announced(quint32 name, quint32 version);
1429  void xdgShellUnstableV6Announced(quint32 name, quint32 version);
1430 
1437  void relativePointerManagerUnstableV1Announced(quint32 name, quint32 version);
1444  void pointerGesturesUnstableV1Announced(quint32 name, quint32 version);
1451  void pointerConstraintsUnstableV1Announced(quint32 name, quint32 version);
1452 
1459  void exporterUnstableV2Announced(quint32 name, quint32 version);
1460 
1467  void importerUnstableV2Announced(quint32 name, quint32 version);
1468 
1475  void idleInhibitManagerUnstableV1Announced(quint32 name, quint32 version);
1476 
1483  void appMenuAnnounced(quint32 name, quint32 version);
1484 
1491  void serverSideDecorationPaletteManagerAnnounced(quint32 name, quint32 version);
1492 
1499  void xdgOutputAnnounced(quint32 name, quint32 version);
1500 
1507  void xdgShellStableAnnounced(quint32 name, quint32 version);
1508 
1515  void xdgDecorationAnnounced(quint32 name, quint32 version);
1516 
1518 
1522 
1527  void compositorRemoved(quint32 name);
1532  void shellRemoved(quint32 name);
1537  void seatRemoved(quint32 name);
1542  void shmRemoved(quint32 name);
1547  void subCompositorRemoved(quint32 name);
1552  void outputRemoved(quint32 name);
1557  void fullscreenShellRemoved(quint32 name);
1562  void dataDeviceManagerRemoved(quint32 name);
1568  void outputManagementRemoved(quint32 name);
1574  void outputDeviceRemoved(quint32 name);
1580  void plasmaShellRemoved(quint32 name);
1586  void plasmaVirtualDesktopManagementRemoved(quint32 name);
1592  void plasmaWindowManagementRemoved(quint32 name);
1598  void idleRemoved(quint32 name);
1604  void remoteAccessManagerRemoved(quint32 name);
1610  void fakeInputRemoved(quint32 name);
1616  void shadowRemoved(quint32 name);
1622  void blurRemoved(quint32 name);
1628  void contrastRemoved(quint32 name);
1634  void slideRemoved(quint32 name);
1640  void dpmsRemoved(quint32 name);
1646  void serverSideDecorationManagerRemoved(quint32 name);
1652  void textInputManagerUnstableV0Removed(quint32 name);
1658  void textInputManagerUnstableV2Removed(quint32 name);
1664  void xdgShellUnstableV5Removed(quint32 name);
1670  void xdgShellUnstableV6Removed(quint32 name);
1676  void relativePointerManagerUnstableV1Removed(quint32 name);
1682  void pointerGesturesUnstableV1Removed(quint32 name);
1688  void pointerConstraintsUnstableV1Removed(quint32 name);
1689 
1695  void exporterUnstableV2Removed(quint32 name);
1696 
1702  void importerUnstableV2Removed(quint32 name);
1703 
1709  void idleInhibitManagerUnstableV1Removed(quint32 name);
1710 
1716  void appMenuRemoved(quint32 name);
1717 
1723  void serverSideDecorationPaletteManagerRemoved(quint32 name);
1724 
1730  void xdgOutputRemoved(quint32 name);
1736  void xdgShellStableRemoved(quint32 name);
1737 
1743  void xdgDecorationRemoved(quint32 name);
1744 
1745  void keystateAnnounced(quint32 name, quint32 version);
1746  void keystateRemoved(quint32 name);
1747 
1749 
1762  void interfaceAnnounced(QByteArray interface, quint32 name, quint32 version);
1770  void interfaceRemoved(quint32 name);
1779  void interfacesAnnounced();
1780 
1781 Q_SIGNALS:
1782  /*
1783  * Emitted when the registry has been destroyed rather than released
1784  */
1785  void registryDestroyed();
1786 
1787 private:
1788  class Private;
1790 };
1791 
1792 }
1793 }
1794 
1795 #endif
Wrapper for the org_kde_kwin_blur interface.
Definition: blur.h:135
Wrapper for the zxdg_exporter_v2 interface.
Definition: xdgforeign.h:53
Wrapper for the zxdg_exporter_v2 interface.
Definition: xdgforeign_v2.h:54
Wrapper for the org_kde_kwin_contrast interface.
Definition: contrast.h:128
Wrapper for the org_kde_kwin_server_decoration_palette_manager interface.
Wrapper for the _wl_fullscreen_shell interface.
Wrapper for the xdg_shell interface.
Definition: xdgshell.h:154
Wrapper for the zwp_pointer_constraints_v1 interface.
quint32 version
The maximum supported version of the announced interface.
Definition: registry.h:255
Wrapper class for wl_shm interface.
Definition: shm_pool.h:116
Wrapper for the zxdg_importer_v2 interface.
Definition: xdgforeign_v2.h:94
Manager class for the TextInputManager interfaces.
Definition: textinput.h:417
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:55
Wrapper for the wl_compositor interface.
Definition: compositor.h:50
Wrapper for the wl_registry interface.
Definition: registry.h:128
Wrapper for the wl_seat interface.
Definition: seat.h:52
Wrapper for the org_kde_kwin_remote_access_manager interface.
Definition: remote_access.h:48
Wrapper for the wl_output interface.
Definition: output.h:55
Wrapper for the org_kde_plasma_virtual_desktop_management interface.
Wrapper for the zxdg_decoration_manager_v1 interface.
Definition: xdgdecoration.h:51
Wrapper for the org_kde_kwin_shadow interface.
Definition: shadow.h:151
Wrapper for the zxdg_importer_v2 interface.
Definition: xdgforeign.h:153
Wrapper for the org_kde_kwin_fake_input interface.
Definition: fakeinput.h:50
Interface
The well-known interfaces this Registry supports.
Definition: registry.h:137
Wrapper for the zxdg_output_manager_v1 interface.
Definition: xdgoutput.h:55
Creates and manages the connection to a Wayland server.
Wrapper for the org_kde_kwin_appmenu_manager interface.
Definition: appmenu.h:49
Wrapper for the zwp_pointer_gestures_v1 interface.
Wrapper for the org_kde_plasma_shell interface.
Definition: plasmashell.h:51
This class is a factory for Dpms instances.
Definition: dpms.h:49
Wrapper for the org_kde_kwin_idle interface.
Definition: idle.h:53
Representation of one announced interface.
Definition: registry.h:247
Wrapper for the zwp_relative_pointer_manager_v1 interface.
Wrapper for the org_kde_kwin_server_decoration_manager interface.
Wrapper for the org_kde_plasma_window_management interface.
quint32 name
The name of the announced interface.
Definition: registry.h:251
Wrapper for the org_kde_kwin_slide_manager interface.
Definition: slide.h:55
Wrapper for the org_kde_kwin_outputmanagement interface.
Wrapper for the wl_subcompositor interface.
Definition: subcompositor.h:35
Wrapper for the org_kde_kwin_outputdevice interface.
Definition: outputdevice.h:58
Wrapper for the wl_data_device_manager interface.
Wrapper for the zwp_idle_inhibit_manager_v1 interface.
Definition: idleinhibit.h:49
Wrapper for the wl_shell interface.
Definition: shell.h:55
Power management for monitors.
Definition: dpms.h:131
Wrapper for the org_kde_kwin_shadow_manager interface.
Definition: shadow.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.