KWayland

fullscreen_shell.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_FULLSCREEN_SHELL_H
7 #define WAYLAND_FULLSCREEN_SHELL_H
8 
9 #include <QObject>
10 
11 #include "KWayland/Client/kwaylandclient_export.h"
12 
13 struct _wl_fullscreen_shell;
14 struct wl_output;
15 struct wl_surface;
16 
17 namespace KWayland
18 {
19 namespace Client
20 {
21 class EventQueue;
22 class Surface;
23 class Output;
24 
25 /**
26  * @short Wrapper for the _wl_fullscreen_shell interface.
27  *
28  * This class provides a convenient wrapper for the _wl_fullscreen_shell interface.
29  *
30  * To use this class one needs to interact with the Registry. There are two
31  * possible ways to create the FullscreenShell interface:
32  * @code
33  * FullscreenShell *f = registry->createFullscreenShell(name, version);
34  * @endcode
35  *
36  * This creates the FullscreenShell and sets it up directly. As an alternative this
37  * can also be done in a more low level way:
38  * @code
39  * FullscreenShell *f = new FullscreenShell;
40  * f->setup(registry->bindFullscreenShell(name, version));
41  * @endcode
42  *
43  * The FullscreenShell can be used as a drop-in replacement for any _wl_fullscreen_shell
44  * pointer as it provides matching cast operators.
45  *
46  * @see Registry
47  **/
48 class KWAYLANDCLIENT_EXPORT FullscreenShell : public QObject
49 {
50  Q_OBJECT
51  Q_PROPERTY(bool capabilityArbitraryModes READ hasCapabilityArbitraryModes NOTIFY capabilityArbitraryModesChanged)
52  Q_PROPERTY(bool capabilityCursorPlane READ hasCapabilityCursorPlane NOTIFY capabilityCursorPlaneChanged)
53 public:
54  explicit FullscreenShell(QObject *parent = nullptr);
55  ~FullscreenShell() override;
56 
57  bool isValid() const;
58  void release();
59  void destroy();
60  bool hasCapabilityArbitraryModes() const;
61  bool hasCapabilityCursorPlane() const;
62  void setup(_wl_fullscreen_shell *shell);
63  void present(wl_surface *surface, wl_output *output);
64  void present(Surface *surface, Output *output);
65 
66  /**
67  * Sets the @p queue to use for bound proxies.
68  **/
69  void setEventQueue(EventQueue *queue);
70  /**
71  * @returns The event queue to use for bound proxies.
72  **/
73  EventQueue *eventQueue() const;
74 
75 Q_SIGNALS:
76  void capabilityArbitraryModesChanged(bool);
77  void capabilityCursorPlaneChanged(bool);
78 
79  /**
80  * The corresponding global for this interface on the Registry got removed.
81  *
82  * This signal gets only emitted if the Compositor got created by
83  * Registry::createFullscreenShell
84  *
85  * @since 5.5
86  **/
87  void removed();
88 
89 private:
90  class Private;
92 };
93 
94 }
95 }
96 
97 #endif
Wrapper for the wl_output interface.
Definition: output.h:54
virtual void release(quint64 objid)
Wrapper for the wl_surface interface.
Definition: surface.h:43
Wrapper for the _wl_fullscreen_shell interface.
Wrapper class for wl_event_queue interface.
Definition: event_queue.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Thu Mar 23 2023 04:18:39 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.