KWayland

subcompositor_interface.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 #ifndef WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H
7 #define WAYLAND_SERVER_SUBCOMPOSITOR_INTERFACE_H
8 
9 #include <QObject>
10 #include <QPointer>
11 
12 #include <KWayland/Server/kwaylandserver_export.h>
13 
14 #include "global.h"
15 #include "resource.h"
16 
17 struct wl_resource;
18 
19 namespace KWayland
20 {
21 namespace Server
22 {
23 
24 class Display;
25 class SurfaceInterface;
26 class SubSurfaceInterface;
27 
31 class KWAYLANDSERVER_EXPORT SubCompositorInterface : public Global
32 {
33  Q_OBJECT
34 public:
35  virtual ~SubCompositorInterface();
36 
37 Q_SIGNALS:
38  void subSurfaceCreated(KWayland::Server::SubSurfaceInterface*);
39 
40 private:
41  explicit SubCompositorInterface(Display *display, QObject *parent = nullptr);
42  friend class Display;
43  class Private;
44 };
45 
49 class KWAYLANDSERVER_EXPORT SubSurfaceInterface : public Resource
50 {
51  Q_OBJECT
52  Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
53  Q_PROPERTY(KWayland::Server::SubSurfaceInterface::Mode mode READ mode NOTIFY modeChanged)
54 public:
55  virtual ~SubSurfaceInterface();
56 
57  QPoint position() const;
58 
59  enum class Mode {
60  Synchronized,
61  Desynchronized
62  };
63  Mode mode() const;
64 
75  bool isSynchronized() const;
76 
77  // TODO: remove with ABI break (KF6)
83  QPointer<SurfaceInterface> surface() const;
84  // TODO: remove with ABI break (KF6)
85  QPointer<SurfaceInterface> parentSurface();
90  QPointer<SurfaceInterface> parentSurface() const;
91 
96  QPointer<SurfaceInterface> mainSurface() const;
97 
98 Q_SIGNALS:
99  void positionChanged(const QPoint&);
100  void modeChanged(KWayland::Server::SubSurfaceInterface::Mode);
101 
102 private:
103  friend class SubCompositorInterface;
104  friend class SurfaceInterface;
105  explicit SubSurfaceInterface(SubCompositorInterface *parent, wl_resource *parentResource);
106 
107  class Private;
108  Private *d_func() const;
109 };
110 
111 }
112 }
113 
114 Q_DECLARE_METATYPE(KWayland::Server::SubSurfaceInterface::Mode)
115 
116 #endif
Resource representing a wl_surface.
Class holding the Wayland server display loop.
Definition: display.h:89
Base class for all Globals.
Definition: global.h:46
Represents a bound Resource.
Definition: resource.h:32
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.