KWayland

xdgforeign_interface.cpp
1 /*
2  SPDX-FileCopyrightText: 2017 Marco Martin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #include "xdgforeign_interface.h"
8 #include "display.h"
9 #include "global_p.h"
10 #include "resource_p.h"
11 #include "surface_interface_p.h"
12 #include "xdgforeign_v2_interface_p.h"
13 
14 #include "wayland-xdg-foreign-unstable-v2-server-protocol.h"
15 
16 #include <QDebug>
17 #include <QUuid>
18 
19 namespace KWayland
20 {
21 namespace Server
22 {
23 XdgForeignInterface::Private::Private(Display *display, XdgForeignInterface *q)
24  : q(q)
25 {
26  exporter = new XdgExporterUnstableV2Interface(display, q);
27  importer = new XdgImporterUnstableV2Interface(display, q);
28 
29  connect(importer, &XdgImporterUnstableV2Interface::transientChanged, q, &XdgForeignInterface::transientChanged);
30 }
31 
32 XdgForeignInterface::XdgForeignInterface(Display *display, QObject *parent)
33  : QObject(parent)
34  , d(new Private(display, this))
35 {
36 }
37 
38 XdgForeignInterface::~XdgForeignInterface()
39 {
40  delete d->exporter;
41  delete d->importer;
42  delete d;
43 }
44 
45 void XdgForeignInterface::create()
46 {
47  d->exporter->create();
48  d->importer->create();
49 }
50 
51 bool XdgForeignInterface::isValid()
52 {
53  return d->exporter->isValid() && d->importer->isValid();
54 }
55 
56 SurfaceInterface *XdgForeignInterface::transientFor(SurfaceInterface *surface)
57 {
58  return d->importer->transientFor(surface);
59 }
60 
61 }
62 }
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Wed Feb 8 2023 03:59:22 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.