KWaylandServer

xdgforeign_v2_interface.h
1 /*
2  SPDX-FileCopyrightText: 2017 Marco Martin <[email protected]>
3  SPDX-FileCopyrightText: 2021 Vlad Zahorodnii <[email protected]>
4 
5  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6 */
7 #pragma once
8 
9 #include <QObject>
10 
11 #include <KWaylandServer/kwaylandserver_export.h>
12 
13 namespace KWaylandServer
14 {
15 class Display;
16 class SurfaceInterface;
17 class XdgForeignV2InterfacePrivate;
18 
19 /**
20  * This class encapsulates the server side logic of the XdgForeign protocol.
21  * a process can export a surface to be identifiable by a server-wide unique
22  * string handle, and another process can in turn import that surface, and set it
23  * as transient parent for one of its own surfaces.
24  * This parent relationship is traced by the transientChanged signal and the
25  * transientFor method.
26  */
27 class KWAYLANDSERVER_EXPORT XdgForeignV2Interface : public QObject
28 {
29  Q_OBJECT
30 public:
31  XdgForeignV2Interface(Display *display, QObject *parent = nullptr);
32  ~XdgForeignV2Interface() override;
33 
34  /**
35  * If a client did import a surface and set one of its own as child of the
36  * imported one, this returns the mapping.
37  * @param surface the child surface we want to search an imported transientParent for.
38  * @returns the transient parent of the surface, if found, nullptr otherwise.
39  */
40  SurfaceInterface *transientFor(SurfaceInterface *surface);
41 
42 Q_SIGNALS:
43  /**
44  * A surface got a new imported transient parent
45  * @param parent is the surface exported by one client and imported into another, which will act as parent.
46  * @param child is the surface that the importer client did set as child of the surface
47  * that it imported.
48  * If one of the two paramenters is nullptr, it means that a previously relation is not
49  * valid anymore and either one of the surfaces has been unmapped, or the parent surface
50  * is not exported anymore.
51  */
52  void transientChanged(KWaylandServer::SurfaceInterface *child, KWaylandServer::SurfaceInterface *parent);
53 
54 private:
55  friend class XdgExporterV2Interface;
56  friend class XdgImporterV2Interface;
58 };
59 
60 }
Class holding the Wayland server display loop.
Definition: display.h:47
This class encapsulates the server side logic of the XdgForeign protocol.
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Mon Oct 25 2021 23:08:44 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.