KWaylandServer

outputmanagement_v2_interface.cpp
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2015 Sebastian Kügler <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #include "display.h"
8 #include "outputmanagement_v2_interface.h"
9 #include "outputconfiguration_v2_interface.h"
10 
11 #include <wayland-server.h>
12 #include "qwayland-server-kde-output-management-v2.h"
13 
14 #include <QHash>
15 
16 namespace KWaylandServer
17 {
18 
19 static const quint32 s_version = 1;
20 
21 class OutputManagementV2InterfacePrivate : public QtWaylandServer::kde_output_management_v2
22 {
23 public:
24  OutputManagementV2InterfacePrivate(OutputManagementV2Interface *_q, Display *display);
25 
26 private:
27  OutputManagementV2Interface *q;
28 
29 protected:
30  void kde_output_management_v2_create_configuration(Resource *resource, uint32_t id) override;
31 };
32 
33 OutputManagementV2InterfacePrivate::OutputManagementV2InterfacePrivate(OutputManagementV2Interface *_q, Display *display)
34  : QtWaylandServer::kde_output_management_v2(*display, s_version)
35  , q(_q)
36 {
37 }
38 
39 void OutputManagementV2InterfacePrivate::kde_output_management_v2_create_configuration(Resource *resource, uint32_t id)
40 {
41  wl_resource *config_resource = wl_resource_create(resource->client(), &kde_output_configuration_v2_interface, resource->version(), id);
42  if (!config_resource) {
43  wl_client_post_no_memory(resource->client());
44  return;
45  }
46  new OutputConfigurationV2Interface(q, config_resource);
47 }
48 
49 OutputManagementV2Interface::OutputManagementV2Interface(Display *display, QObject *parent)
50  : QObject(parent)
51  , d(new OutputManagementV2InterfacePrivate(this, display))
52 {
53 }
54 
55 OutputManagementV2Interface::~OutputManagementV2Interface() = default;
56 
57 }
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Sat Oct 23 2021 23:08:27 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.