KWayland

surface_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_SURFACE_INTERFACE_H
7 #define WAYLAND_SERVER_SURFACE_INTERFACE_H
8 
9 #include "resource.h"
10 #include "output_interface.h"
11 
12 #include <QObject>
13 #include <QPointer>
14 #include <QRegion>
15 
16 #include <KWayland/Server/kwaylandserver_export.h>
17 
18 namespace KWayland
19 {
20 namespace Server
21 {
22 class BlurManagerInterface;
23 class BlurInterface;
24 class BufferInterface;
25 class ConfinedPointerInterface;
26 class ContrastInterface;
27 class ContrastManagerInterface;
28 class CompositorInterface;
29 class IdleInhibitManagerUnstableV1Interface;
30 class LockedPointerInterface;
31 class PointerConstraintsUnstableV1Interface;
32 class ShadowManagerInterface;
33 class ShadowInterface;
34 class SlideInterface;
35 class SubSurfaceInterface;
36 
62 class KWAYLANDSERVER_EXPORT SurfaceInterface : public Resource
63 {
64  Q_OBJECT
68  Q_PROPERTY(QRegion damage READ damage NOTIFY damaged)
72  Q_PROPERTY(QRegion opaque READ opaque NOTIFY opaqueChanged)
76  Q_PROPERTY(QRegion input READ input NOTIFY inputChanged)
77  Q_PROPERTY(qint32 scale READ scale NOTIFY scaleChanged)
78  Q_PROPERTY(KWayland::Server::OutputInterface::Transform transform READ transform NOTIFY transformChanged)
79  Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
80 public:
81  virtual ~SurfaceInterface();
82 
83  void frameRendered(quint32 msec);
84 
85  QRegion damage() const;
86  QRegion opaque() const;
87  QRegion input() const;
88 #if KWAYLANDSERVER_ENABLE_DEPRECATED_SINCE(5, 5)
89 
93  KWAYLANDSERVER_DEPRECATED_VERSION(5, 5, "Use SurfaceInterface::inputIsInfinite()")
94  bool inputIsInfitine() const;
95 #endif
96 
100  bool inputIsInfinite() const;
101  qint32 scale() const;
102  OutputInterface::Transform transform() const;
106  BufferInterface *buffer();
107  QPoint offset() const;
114  QSize size() const;
122  QRect boundingRect() const;
123 
127  QPointer<SubSurfaceInterface> subSurface() const;
131  QList<QPointer<SubSurfaceInterface>> childSubSurfaces() const;
132 
137  QPointer<ShadowInterface> shadow() const;
138 
143  QPointer<BlurInterface> blur() const;
144 
149  QPointer<SlideInterface> slideOnShowHide() const;
150 
155  QPointer<ContrastInterface> contrast() const;
156 
166  bool isMapped() const;
167 
186  QRegion trackedDamage() const;
187 
194  void resetTrackedDamage();
195 
208  SurfaceInterface *surfaceAt(const QPointF &position);
209 
223  SurfaceInterface *inputSurfaceAt(const QPointF &position);
224 
234  void setOutputs(const QVector<OutputInterface *> &outputs);
235 
241  QVector<OutputInterface *> outputs() const;
242 
248  QPointer<ConfinedPointerInterface> confinedPointer() const;
249 
255  QPointer<LockedPointerInterface> lockedPointer() const;
256 
262  bool inhibitsIdle() const;
263 
267  static SurfaceInterface *get(wl_resource *native);
272  static SurfaceInterface *get(quint32 id, const ClientConnection *client);
273 
282  void setDataProxy(SurfaceInterface *surface);
288  SurfaceInterface* dataProxy() const;
289 
290 Q_SIGNALS:
299  void damaged(const QRegion&);
300  void opaqueChanged(const QRegion&);
301  void inputChanged(const QRegion&);
302  void scaleChanged(qint32);
303  void transformChanged(KWayland::Server::OutputInterface::Transform);
307  void unmapped();
311  void sizeChanged();
315  void shadowChanged();
319  void blurChanged();
323  void slideOnShowHideChanged();
327  void contrastChanged();
332  void subSurfaceTreeChanged();
337  void childSubSurfaceAdded(SubSurfaceInterface *subSurface);
342  void childSubSurfaceRemoved(SubSurfaceInterface *subSurface);
343 
354  void pointerConstraintsChanged();
355 
361  void inhibitsIdleChanged();
362 
370  void committed();
371 
372 private:
373  friend class CompositorInterface;
374  friend class SubSurfaceInterface;
375  friend class ShadowManagerInterface;
376  friend class BlurManagerInterface;
377  friend class SlideManagerInterface;
378  friend class ContrastManagerInterface;
379  friend class IdleInhibitManagerUnstableV1Interface;
380  friend class PointerConstraintsUnstableV1Interface;
381  friend class SurfaceRole;
382  explicit SurfaceInterface(CompositorInterface *parent, wl_resource *parentResource);
383 
384  class Private;
385  Private *d_func() const;
386 };
387 
388 }
389 }
390 
391 Q_DECLARE_METATYPE(KWayland::Server::SurfaceInterface*)
392 
393 #endif
Global for the wl_output interface.
Resource representing a wl_surface.
Represents the Global for org_kde_kwin_contrast_manager interface.
Reference counted representation of a Wayland buffer on Server side.
Represents the Global for org_kde_kwin_blur_manager interface.
Represents the Global for wl_compositor interface.
Represents a bound Resource.
Definition: resource.h:32
Convenient Class which represents a wl_client.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Aug 8 2020 22:48:58 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.