KWaylandServer

xdgoutput_v1_interface.h
1 /*
2  SPDX-FileCopyrightText: 2018 David Edmundson <[email protected]>
3  SPDX-FileCopyrightText: 2020 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 KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H
8 #define KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H
9 
10 #include <QObject>
11 
12 #include <KWaylandServer/kwaylandserver_export.h>
13 
14 /*
15  * In terms of protocol XdgOutputInterface are a resource
16  * but for the sake of sanity, we should treat XdgOutputs as globals like Output is
17  * Hence this doesn't match most of kwayland API paradigms.
18  */
19 
20 namespace KWaylandServer
21 {
22 class Display;
23 class OutputInterface;
24 class XdgOutputV1Interface;
25 
26 class XdgOutputManagerV1InterfacePrivate;
27 class XdgOutputV1InterfacePrivate;
28 
29 /**
30  * Global manager for XdgOutputs
31  */
32 class KWAYLANDSERVER_EXPORT XdgOutputManagerV1Interface : public QObject
33 {
34  Q_OBJECT
35 
36 public:
37  explicit XdgOutputManagerV1Interface(Display *display, QObject *parent = nullptr);
38  ~XdgOutputManagerV1Interface() override;
39  /**
40  * Creates an XdgOutputInterface object for an existing Output
41  * which exposes XDG specific properties of outputs
42  *
43  * @arg output the wl_output interface this XDG output is for
44  * @parent the parent of the newly created object
45  */
46  XdgOutputV1Interface *createXdgOutput(OutputInterface *output, QObject *parent);
47 
48 private:
50 };
51 
52 /**
53  * Extension to Output
54  * Users should set all relevant values on creation and on future changes.
55  * done() should be explicitly called after change batches including initial setting.
56  */
57 class KWAYLANDSERVER_EXPORT XdgOutputV1Interface : public QObject
58 {
59  Q_OBJECT
60 public:
61  ~XdgOutputV1Interface() override;
62 
63  /**
64  * Sets the size of this output in logical co-ordinates.
65  * Users should call done() after setting all values
66  */
67  void setLogicalSize(const QSize &size);
68 
69  /**
70  * Returns the last set logical size on this output
71  */
72  QSize logicalSize() const;
73 
74  /**
75  * Sets the topleft position of this output in logical co-ordinates.
76  * Users should call done() after setting all values
77  * @see OutputInterface::setPosition
78  */
79  void setLogicalPosition(const QPoint &pos);
80 
81  /**
82  * Returns the last set logical position on this output
83  */
84  QPoint logicalPosition() const;
85 
86  /**
87  * @brief Sets a short name of the output
88  * This should be consistent across reboots for the same monitor
89  * It should be set once before the first done call
90  */
91  void setName(const QString &name);
92  /**
93  * The last set name
94  */
95  void name() const;
96 
97  /**
98  * @brief Sets a longer description of the output
99  * This should be consistent across reboots for the same monitor
100  * It should be set once before the first done call
101  */
102  void setDescription(const QString &description);
103  /**
104  * The last set description
105  */
106  void description() const;
107 
108  /**
109  * Submit changes to all clients
110  */
111  void done();
112 
113 private:
114  explicit XdgOutputV1Interface(OutputInterface *output, QObject *parent);
115  friend class XdgOutputManagerV1Interface;
116  friend class XdgOutputManagerV1InterfacePrivate;
117 
119 };
120 
121 }
122 
123 #endif
The OutputInterface class represents a screen.
Extension to Output Users should set all relevant values on creation and on future changes...
Class holding the Wayland server display loop.
Definition: display.h:47
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.