KWayland

outputconfiguration_interface.h
1 /*
2  SPDX-FileCopyrightText: 2015 Sebastian K├╝gler <[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_OUTPUTCONFIGURATION_INTERFACE_H
7 #define KWAYLAND_SERVER_OUTPUTCONFIGURATION_INTERFACE_H
8 
9 #include "outputchangeset.h"
10 #include "outputdevice_interface.h"
11 #include "outputmanagement_interface.h"
12 #include "resource.h"
13 
14 #include <KWayland/Server/kwaylandserver_export.h>
15 
16 namespace KWayland
17 {
18 namespace Server
19 {
20 /** @class OutputConfigurationInterface
21  *
22  * Holds a new configuration for the outputs.
23  *
24  * The overall mechanism is to get a new OutputConfiguration from the OutputManagement global and
25  * apply changes through the OutputConfiguration::set* calls. When all changes are set, the client
26  * calls apply, which asks the server to look at the changes and apply them. The server will then
27  * signal back whether the changes have been applied successfully (@c setApplied()) or were rejected
28  * or failed to apply (@c setFailed()).
29  *
30  * Once the client has called applied, the OutputManagementInterface send the configuration object
31  * to the compositor through the OutputManagement::configurationChangeRequested(OutputConfiguration*)
32  * signal, the compositor can then decide what to do with the changes.
33  *
34  * These KWayland classes will not apply changes to the OutputDevices, this is the compositor's
35  * task. As such, the configuration set through this interface can be seen as a hint what the
36  * compositor should set up, but whether or not the compositor does it (based on hardware or
37  * rendering policies, for example), is up to the compositor. The mode setting is passed on to
38  * the DRM subsystem through the compositor. The compositor also saves this configuration and reads
39  * it on startup, this interface is not involved in that process.
40  *
41  * @see OutputManagementInterface
42  * @see OutputConfiguration
43  * @since 5.5
44  */
45 class KWAYLANDSERVER_EXPORT OutputConfigurationInterface : public Resource
46 {
47  Q_OBJECT
48 public:
49  ~OutputConfigurationInterface() override;
50 
51  /**
52  * Accessor for the changes made to OutputDevices. The data returned from this call
53  * will be deleted by the OutputConfigurationInterface when
54  * OutputManagementInterface::setApplied() or OutputManagementInterface::setFailed()
55  * is called, and on destruction of the OutputConfigurationInterface, so make sure you
56  * do not keep these pointers around.
57  * @returns A QHash of ChangeSets per outputdevice.
58  * @see ChangeSet
59  * @see OutputDeviceInterface
60  * @see OutputManagement
61  */
63 
64 public Q_SLOTS:
65  /**
66  * Called by the compositor once the changes have successfully been applied.
67  * The compositor is responsible for updating the OutputDevices. After having
68  * done so, calling this function sends applied() through the client.
69  * @see setFailed
70  * @see OutputConfiguration::applied
71  */
72  void setApplied();
73  /**
74  * Called by the compositor when the changes as a whole are rejected or
75  * failed to apply. This function results in the client OutputConfiguration emitting
76  * failed().
77  * @see setApplied
78  * @see OutputConfiguration::failed
79  */
80  void setFailed();
81 
82 private:
83  explicit OutputConfigurationInterface(OutputManagementInterface *parent, wl_resource *parentResource);
84  friend class OutputManagementInterface;
85 
86  class Private;
87  Private *d_func() const;
88 };
89 
90 }
91 }
92 
93 Q_DECLARE_METATYPE(KWayland::Server::OutputConfigurationInterface *)
94 
95 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Feb 7 2023 03:56:21 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.