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