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 "xdgforeign_v2_interface_p.h"
9 #include "display.h"
10 #include "global_p.h"
11 #include "resource_p.h"
12 #include "surface_interface_p.h"
13 
14 #include "wayland-xdg-foreign-unstable-v2-server-protocol.h"
15 
16 #include <QUuid>
17 #include <QDebug>
18 
19 namespace KWayland
20 {
21 namespace Server
22 {
23 
24 XdgForeignInterface::Private::Private(Display *display, XdgForeignInterface *q)
25  : q(q)
26 {
27  exporter = new XdgExporterUnstableV2Interface(display, q);
28  importer = new XdgImporterUnstableV2Interface(display, q);
29 
30  connect(importer, &XdgImporterUnstableV2Interface::transientChanged,
31  q, &XdgForeignInterface::transientChanged);
32 }
33 
34 XdgForeignInterface::XdgForeignInterface(Display *display, QObject *parent)
35  : QObject(parent),
36  d(new Private(display, this))
37 {
38 }
39 
40 XdgForeignInterface::~XdgForeignInterface()
41 {
42  delete d->exporter;
43  delete d->importer;
44  delete d;
45 }
46 
47 void XdgForeignInterface::create()
48 {
49  d->exporter->create();
50  d->importer->create();
51 }
52 
53 bool XdgForeignInterface::isValid()
54 {
55  return d->exporter->isValid() && d->importer->isValid();
56 }
57 
58 SurfaceInterface *XdgForeignInterface::transientFor(SurfaceInterface *surface)
59 {
60  return d->importer->transientFor(surface);
61 }
62 
63 }
64 }
65 
Resource representing a wl_surface.
QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 22:48:20 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.