1/*
2 SPDX-FileCopyrightText: 2017 Marco Martin <notmart@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6#include "xdgforeign.h"
7#include "event_queue.h"
8#include "wayland_pointer_p.h"
9#include "xdgforeign_p.h"
10
11#include <wayland-xdg-foreign-unstable-v2-client-protocol.h>
12
13#include <QDebug>
14
15namespace KWayland
16{
17namespace Client
18{
19XdgExporter::Private::Private()
20{
21}
22
23XdgExporter::Private::~Private()
24{
25}
26
27XdgExporter::XdgExporter(Private *p, QObject *parent)
28 : QObject(parent)
29 , d(p)
30{
31}
32
33XdgExporter::~XdgExporter()
34{
35 release();
36}
37
38void XdgExporter::setup(zxdg_exporter_v2 *exporter)
39{
40 d->setupV2(exporter);
41}
42
43void XdgExporter::release()
44{
45 d->release();
46}
47
48void XdgExporter::destroy()
49{
50 d->destroy();
51}
52
53XdgExporter::operator zxdg_exporter_v2 *()
54{
55 return d->exporterV2();
56}
57
58XdgExporter::operator zxdg_exporter_v2 *() const
59{
60 return d->exporterV2();
61}
62
63bool XdgExporter::isValid() const
64{
65 return d->isValid();
66}
67
68void XdgExporter::setEventQueue(EventQueue *queue)
69{
70 d->queue = queue;
71}
72
73EventQueue *XdgExporter::eventQueue()
74{
75 return d->queue;
76}
77
78XdgExported *XdgExporter::exportTopLevel(Surface *surface, QObject *parent)
79{
80 return d->exportTopLevelV2(surface, parent);
81}
82
83XdgImporter::Private::Private()
84{
85}
86
87XdgImporter::Private::~Private()
88{
89}
90
91XdgImporter::XdgImporter(Private *p, QObject *parent)
92 : QObject(parent)
93 , d(p)
94{
95}
96
97XdgImporter::~XdgImporter()
98{
99 release();
100}
101
102void XdgImporter::setup(zxdg_importer_v2 *importer)
103{
104 d->setupV2(importer);
105}
106
107void XdgImporter::release()
108{
109 d->release();
110}
111
112void XdgImporter::destroy()
113{
114 d->destroy();
115}
116
117XdgImporter::operator zxdg_importer_v2 *()
118{
119 return d->importerV2();
120}
121
122XdgImporter::operator zxdg_importer_v2 *() const
123{
124 return d->importerV2();
125}
126
127bool XdgImporter::isValid() const
128{
129 return d->isValid();
130}
131
132void XdgImporter::setEventQueue(EventQueue *queue)
133{
134 d->queue = queue;
135}
136
137EventQueue *XdgImporter::eventQueue()
138{
139 return d->queue;
140}
141
142XdgImported *XdgImporter::importTopLevel(const QString &handle, QObject *parent)
143{
144 Q_ASSERT(isValid());
145 return d->importTopLevelV2(handle, parent);
146}
147
148XdgExported::XdgExported(Private *p, QObject *parent)
149 : QObject(parent)
150 , d(p)
151{
152}
153
154XdgExported::Private::Private(XdgExported *q)
155 : q(q)
156{
157}
158
159XdgExported::Private::~Private()
160{
161}
162
163XdgExported::~XdgExported()
164{
165 release();
166}
167
168void XdgExported::setup(zxdg_exported_v2 *exported)
169{
170 d->setupV2(exported);
171}
172
173void XdgExported::release()
174{
175 d->release();
176}
177
178void XdgExported::destroy()
179{
180 d->destroy();
181}
182
183QString XdgExported::handle() const
184{
185 return d->handle;
186}
187
188XdgExported::operator zxdg_exported_v2 *()
189{
190 return d->exportedV2();
191}
192
193XdgExported::operator zxdg_exported_v2 *() const
194{
195 return d->exportedV2();
196}
197
198bool XdgExported::isValid() const
199{
200 return d->isValid();
201}
202
203XdgImported::Private::Private(XdgImported *q)
204 : q(q)
205{
206}
207
208XdgImported::Private::~Private()
209{
210}
211
212XdgImported::XdgImported(Private *p, QObject *parent)
213 : QObject(parent)
214 , d(p)
215{
216}
217
218XdgImported::~XdgImported()
219{
220 release();
221}
222
223void XdgImported::setup(zxdg_imported_v2 *imported)
224{
225 d->setupV2(imported);
226}
227
228void XdgImported::release()
229{
230 d->release();
231}
232
233void XdgImported::destroy()
234{
235 d->destroy();
236}
237
238XdgImported::operator zxdg_imported_v2 *()
239{
240 return d->importedV2();
241}
242
243XdgImported::operator zxdg_imported_v2 *() const
244{
245 return d->importedV2();
246}
247
248bool XdgImported::isValid() const
249{
250 return d->isValid();
251}
252
253void XdgImported::setParentOf(Surface *surface)
254{
255 Q_ASSERT(isValid());
256 d->setParentOf(surface);
257}
258
259}
260}
261
262#include "moc_xdgforeign.cpp"
263

source code of kwayland/src/client/xdgforeign.cpp