KWaylandServer

outputconfiguration_v2_interface.h
1 /*
2  SPDX-FileCopyrightText: 2015 Sebastian Kügler <[email protected]>
3  SPDX-FileCopyrightText: 2021 Méven Car <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #pragma once
8 
9 #include "outputmanagement_v2_interface.h"
10 #include "outputdevice_v2_interface.h"
11 #include "outputchangeset_v2.h"
12 
13 #include <KWaylandServer/kwaylandserver_export.h>
14 
15 namespace KWaylandServer
16 {
17 
18 class OutputConfigurationV2InterfacePrivate;
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  */
44 class KWAYLANDSERVER_EXPORT OutputConfigurationV2Interface : public QObject
45 {
46  Q_OBJECT
47 public:
48  ~OutputConfigurationV2Interface() override;
49 
50  /**
51  * Accessor for the changes made to OutputDevices. The data returned from this call
52  * will be deleted by the OutputConfigurationInterface when
53  * OutputManagementInterface::setApplied() or OutputManagementInterface::setFailed()
54  * is called, and on destruction of the OutputConfigurationInterface, so make sure you
55  * do not keep these pointers around.
56  * @returns A QHash of ChangeSets per outputdevice.
57  * @see ChangeSet
58  * @see OutputDeviceInterface
59  * @see OutputManagement
60  */
62 
63 public Q_SLOTS:
64  /**
65  * Called by the compositor once the changes have successfully been applied.
66  * The compositor is responsible for updating the OutputDevices. After having
67  * done so, calling this function sends applied() through the client.
68  * @see setFailed
69  * @see OutputConfiguration::applied
70  */
71  void setApplied();
72  /**
73  * Called by the compositor when the changes as a whole are rejected or
74  * failed to apply. This function results in the client OutputConfiguration emitting
75  * failed().
76  * @see setApplied
77  * @see OutputConfiguration::failed
78  */
79  void setFailed();
80 
81 private:
82  explicit OutputConfigurationV2Interface(OutputManagementV2Interface *parent, wl_resource *resource);
83  friend class OutputManagementV2InterfacePrivate;
84 
86 };
87 
88 
89 }
90 
91 Q_DECLARE_METATYPE(KWaylandServer::OutputConfigurationV2Interface*)
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 16 2021 23:10:14 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.