KWaylandServer

xdgdecoration_v1_interface.h
1 /*
2  SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #pragma once
8 
9 #include <KWaylandServer/kwaylandserver_export.h>
10 
11 #include <QObject>
12 
13 struct wl_resource;
14 
15 namespace KWaylandServer
16 {
17 class Display;
18 class XdgDecorationManagerV1InterfacePrivate;
19 class XdgToplevelDecorationV1Interface;
20 class XdgToplevelDecorationV1InterfacePrivate;
21 class XdgToplevelInterface;
22 
23 /**
24  * The XdgDecorationManagerV1Interface class provides a way for the compositor and an xdg-shell
25  * client to negotiate the use of server-side window decorations.
26  *
27  * XdgDecorationManagerV1Interface corresponds to the interface \c zxdg_decoration_manager_v1.
28  */
29 class KWAYLANDSERVER_EXPORT XdgDecorationManagerV1Interface : public QObject
30 {
31  Q_OBJECT
32 
33 public:
34  /**
35  * Constructs a decoration manager with the given \a display and \a parent.
36  */
37  XdgDecorationManagerV1Interface(Display *display, QObject *parent = nullptr);
38  /**
39  * Destructs the XdgDecorationManagerV1Interface object.
40  */
42 
43 Q_SIGNALS:
44  /**
45  * This signal is emitted when a new \a decoration has been created.
46  */
47  void decorationCreated(XdgToplevelDecorationV1Interface *decoration);
48 
49 private:
51 };
52 
53 /**
54  * The XdgToplevelDecorationV1Interface class allows the compositor to toggle server-side window
55  * decoration on an xdg-toplevel surface.
56  *
57  * XdgToplevelDecorationV1Interface corresponds to the interface \c zxdg_toplevel_decoration_v1.
58  */
59 class KWAYLANDSERVER_EXPORT XdgToplevelDecorationV1Interface : public QObject
60 {
61  Q_OBJECT
62 
63 public:
64  enum class Mode { Undefined, Client, Server };
65  Q_ENUM(Mode)
66 
67  /**
68  * Constructs a XdgToplevelDecorationV1Interface for the given \a toplevel and initializes
69  * it with \a resource.
70  */
71  XdgToplevelDecorationV1Interface(XdgToplevelInterface *toplevel, ::wl_resource *resource);
72  /**
73  * Destructs the XdgToplevelDecorationV1Interface object.
74  */
76 
77  /**
78  * Returns the toplevel for this XdgToplevelDecorationV1Interface.
79  */
80  XdgToplevelInterface *toplevel() const;
81  /**
82  * Returns the decoration mode preferred by the client.
83  */
84  Mode preferredMode() const;
85  /**
86  * Sends a configure event to the client. \a mode indicates the decoration mode the client
87  * should be using. The client must send an ack_configure in response to this event.
88  *
89  * \see XdgToplevelInterface::sendConfigure
90  */
91  void sendConfigure(Mode mode);
92 
93  /**
94  * Returns the XdgToplevelDecorationV1Interface for the specified \a toplevel.
95  */
97 
98 Q_SIGNALS:
99  /**
100  * This signal is emitted when the client has specified the preferred decoration mode. The
101  * compositor can decide not to use the client's mode and enforce a different mode instead.
102  */
103  void preferredModeChanged(KWaylandServer::XdgToplevelDecorationV1Interface::Mode mode);
104 
105 private:
107 };
108 
109 } // namespace KWaylandServer
The XdgToplevelDecorationV1Interface class allows the compositor to toggle server-side window decorat...
Class holding the Wayland server display loop.
Definition: display.h:47
The XdgToplevelInterface class represents a surface with window-like functionality such as maximize...
The XdgDecorationManagerV1Interface class provides a way for the compositor and an xdg-shell client t...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:28 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.