KWayland

xdgoutput_interface.h
1 /*
2  SPDX-FileCopyrightText: 2018 David Edmundson <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H
7 #define KWAYLAND_SERVER_XDGOUTPUT_INTERFACE_H
8 
9 #include "global.h"
10 #include "resource.h"
11 
12 
13 #include <KWayland/Server/kwaylandserver_export.h>
14 
15 
16 /*
17  * In terms of protocol XdgOutputInterface are a resource
18  * but for the sake of sanity, we should treat XdgOutputs as globals like Output is
19  * Hence this doesn't match most of kwayland API paradigms.
20  */
21 
22 namespace KWayland
23 {
24 namespace Server
25 {
26 
27 class Display;
28 class OutputInterface;
29 class XdgOutputInterface;
30 
31 /**
32  * Global manager for XdgOutputs
33  * @since 5.47
34  */
35 class KWAYLANDSERVER_EXPORT XdgOutputManagerInterface : public Global
36 {
37  Q_OBJECT
38 public:
39  virtual ~XdgOutputManagerInterface();
40  /**
41  * Creates an XdgOutputInterface object for an existing Output
42  * which exposes XDG specific properties of outputs
43  *
44  * @arg output the wl_output interface this XDG output is for
45  * @parent the parent of the newly created object
46  */
47  XdgOutputInterface* createXdgOutput(OutputInterface *output, QObject *parent);
48 private:
49  explicit XdgOutputManagerInterface(Display *display, QObject *parent = nullptr);
50  friend class Display;
51  class Private;
52  Private *d_func() const;
53 };
54 
55 /**
56  * Extension to Output
57  * Users should set all relevant values on creation and on future changes.
58  * done() should be explicitly called after change batches including initial setting.
59  * @since 5.47
60  */
61 class KWAYLANDSERVER_EXPORT XdgOutputInterface : public QObject
62 {
63  Q_OBJECT
64 public:
65  virtual ~XdgOutputInterface();
66 
67  /**
68  * Sets the size of this output in logical co-ordinates.
69  * Users should call done() after setting all values
70  */
71  void setLogicalSize(const QSize &size);
72 
73  /**
74  * Returns the last set logical size on this output
75  */
76  QSize logicalSize() const;
77 
78  /**
79  * Sets the topleft position of this output in logical co-ordinates.
80  * Users should call done() after setting all values
81  * @see OutputInterface::setPosition
82  */
83  void setLogicalPosition(const QPoint &pos);
84 
85  /**
86  * Returns the last set logical position on this output
87  */
88  QPoint logicalPosition() const;
89 
90  /**
91  * @brief Sets a short name of the output
92  * This should be consistent across reboots for the same monitor
93  * It should be set once before the first done call
94  * @since 5.XDGOUTPUT
95  */
96  void setName(const QString &name);
97  /**
98  * The last set name
99  * @since 5.XDGOUTPUT
100  */
101  void name() const;
102 
103  /**
104  * @brief Sets a longer description of the output
105  * This should be consistent across reboots for the same monitor
106  * It should be set once before the first done call
107  * @since 5.XDGOUTPUT
108  */
109  void setDescription(const QString &description);
110  /**
111  * The last set description
112  * @since 5.XDGOUTPUT
113  */
114  void description() const;
115 
116  /**
117  * Submit changes to all clients
118  */
119  void done();
120 
121 private:
122  explicit XdgOutputInterface(QObject *parent);
123  friend class XdgOutputManagerInterface;
124 
125  class Private;
127 };
128 
129 
130 }
131 }
132 
133 #endif
Global for the wl_output interface.
Class holding the Wayland server display loop.
Definition: display.h:89
Base class for all Globals.
Definition: global.h:46
Extension to Output Users should set all relevant values on creation and on future changes...
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Mar 8 2021 22:50:09 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.