KWaylandServer

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 <KWaylandServer/kwaylandserver_export.h>
13 
14 #include "global.h"
15 #include "resource.h"
16 
17 struct wl_resource;
18 
19 namespace KWaylandServer
20 {
21 
22 class Display;
23 class SurfaceInterface;
24 class SubSurfaceInterface;
25 
29 class KWAYLANDSERVER_EXPORT SubCompositorInterface : public Global
30 {
31  Q_OBJECT
32 public:
33  virtual ~SubCompositorInterface();
34 
35 Q_SIGNALS:
36  void subSurfaceCreated(KWaylandServer::SubSurfaceInterface*);
37 
38 private:
39  explicit SubCompositorInterface(Display *display, QObject *parent = nullptr);
40  friend class Display;
41  class Private;
42 };
43 
47 class KWAYLANDSERVER_EXPORT SubSurfaceInterface : public Resource
48 {
49  Q_OBJECT
50  Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
51  Q_PROPERTY(KWaylandServer::SubSurfaceInterface::Mode mode READ mode NOTIFY modeChanged)
52 public:
53  virtual ~SubSurfaceInterface();
54 
55  QPoint position() const;
56 
57  enum class Mode {
58  Synchronized,
59  Desynchronized
60  };
61  Mode mode() const;
62 
73  bool isSynchronized() const;
74 
75  // TODO: remove with ABI break (KF6)
81  QPointer<SurfaceInterface> surface() const;
82  // TODO: remove with ABI break (KF6)
83  QPointer<SurfaceInterface> parentSurface();
88  QPointer<SurfaceInterface> parentSurface() const;
89 
94  QPointer<SurfaceInterface> mainSurface() const;
95 
96 Q_SIGNALS:
97  void positionChanged(const QPoint&);
98  void modeChanged(KWaylandServer::SubSurfaceInterface::Mode);
99 
100 private:
101  friend class SubCompositorInterface;
102  friend class SurfaceInterface;
103  friend class SurfaceInterfacePrivate;
104  explicit SubSurfaceInterface(SubCompositorInterface *parent, wl_resource *parentResource);
105 
106  class Private;
107  Private *d_func() const;
108 };
109 
110 }
111 
112 Q_DECLARE_METATYPE(KWaylandServer::SubSurfaceInterface::Mode)
113 
114 #endif
Class holding the Wayland server display loop.
Definition: display.h:89
Represents a bound Resource.
Definition: resource.h:30
Base class for all Globals.
Definition: global.h:44
Resource representing a wl_surface.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 23:08:07 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.