KWaylandServer

surface_interface.h
1 /*
2  SPDX-FileCopyrightText: 2014 Martin Gräßlin <[email protected]>
3  SPDX-FileCopyrightText: 2020 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 #ifndef WAYLAND_SERVER_SURFACE_INTERFACE_H
8 #define WAYLAND_SERVER_SURFACE_INTERFACE_H
9 
10 #include "output_interface.h"
11 
12 #include <QMatrix4x4>
13 #include <QObject>
14 #include <QPointer>
15 #include <QRegion>
16 
17 #include <KWaylandServer/kwaylandserver_export.h>
18 
19 namespace KWaylandServer
20 {
21 class BlurInterface;
22 class BufferInterface;
23 class ConfinedPointerInterface;
24 class ContrastInterface;
25 class CompositorInterface;
26 class LockedPointerInterface;
27 class ShadowInterface;
28 class SlideInterface;
29 class SubSurfaceInterface;
30 class SurfaceInterfacePrivate;
31 
57 class KWAYLANDSERVER_EXPORT SurfaceInterface : public QObject
58 {
59  Q_OBJECT
63  Q_PROPERTY(QRegion damage READ damage NOTIFY damaged)
67  Q_PROPERTY(QRegion opaque READ opaque NOTIFY opaqueChanged)
71  Q_PROPERTY(QRegion input READ input NOTIFY inputChanged)
72  Q_PROPERTY(qint32 bufferScale READ bufferScale NOTIFY bufferScaleChanged)
73  Q_PROPERTY(KWaylandServer::OutputInterface::Transform bufferTransform READ bufferTransform NOTIFY bufferTransformChanged)
74  Q_PROPERTY(QSize size READ size NOTIFY sizeChanged)
75 public:
76  explicit SurfaceInterface(CompositorInterface *compositor, wl_resource *resource);
77  ~SurfaceInterface() override;
78 
82  uint32_t id() const;
86  ClientConnection *client() const;
90  wl_resource *resource() const;
94  CompositorInterface *compositor() const;
95 
99  static QList<SurfaceInterface *> surfaces();
100 
113  QPointF mapToBuffer(const QPointF &point) const;
126  QPointF mapFromBuffer(const QPointF &point) const;
139  QRegion mapToBuffer(const QRegion &region) const;
152  QRegion mapFromBuffer(const QRegion &region) const;
159  QMatrix4x4 surfaceToBufferMatrix() const;
160 
161  void frameRendered(quint32 msec);
162 
163  QRegion damage() const;
164  QRegion opaque() const;
165  QRegion input() const;
166  bool inputIsInfinite() const;
167  qint32 bufferScale() const;
175  OutputInterface::Transform bufferTransform() const;
179  BufferInterface *buffer();
180  QPoint offset() const;
187  QSize size() const;
195  QRect boundingRect() const;
201  QSize bufferSize() const;
202 
206  QPointer<SubSurfaceInterface> subSurface() const;
210  QList<QPointer<SubSurfaceInterface>> childSubSurfaces() const;
211 
216  QPointer<ShadowInterface> shadow() const;
217 
222  QPointer<BlurInterface> blur() const;
223 
228  QPointer<SlideInterface> slideOnShowHide() const;
229 
234  QPointer<ContrastInterface> contrast() const;
235 
245  bool isMapped() const;
246 
265  QRegion trackedDamage() const;
266 
273  void resetTrackedDamage();
274 
287  SurfaceInterface *surfaceAt(const QPointF &position);
288 
302  SurfaceInterface *inputSurfaceAt(const QPointF &position);
303 
313  void setOutputs(const QVector<OutputInterface *> &outputs);
314 
320  QVector<OutputInterface *> outputs() const;
321 
327  QPointer<ConfinedPointerInterface> confinedPointer() const;
328 
334  QPointer<LockedPointerInterface> lockedPointer() const;
335 
341  bool inhibitsIdle() const;
342 
346  static SurfaceInterface *get(wl_resource *native);
351  static SurfaceInterface *get(quint32 id, const ClientConnection *client);
352 
361  void setDataProxy(SurfaceInterface *surface);
367  SurfaceInterface* dataProxy() const;
368 
369 Q_SIGNALS:
379  void aboutToBeDestroyed();
387  void surfaceToBufferMatrixChanged();
396  void damaged(const QRegion&);
397  void opaqueChanged(const QRegion&);
398  void inputChanged(const QRegion&);
402  void bufferScaleChanged(qint32);
406  void bufferTransformChanged(KWaylandServer::OutputInterface::Transform);
410  void bufferSizeChanged();
414  void mapped();
418  void unmapped();
422  void sizeChanged();
426  void shadowChanged();
430  void blurChanged();
434  void slideOnShowHideChanged();
438  void contrastChanged();
443  void subSurfaceTreeChanged();
448  void childSubSurfaceAdded(SubSurfaceInterface *subSurface);
453  void childSubSurfaceRemoved(SubSurfaceInterface *subSurface);
454 
465  void pointerConstraintsChanged();
466 
472  void inhibitsIdleChanged();
473 
481  void committed();
482 
483 private:
484  QScopedPointer<SurfaceInterfacePrivate> d;
485  friend class SurfaceInterfacePrivate;
486 };
487 
488 }
489 
490 Q_DECLARE_METATYPE(KWaylandServer::SurfaceInterface*)
491 
492 #endif
Global for the wl_output interface.
Represents the Resource for the org_kde_kwin_blur interface.
The ConfinedPointerInterface gets installed on a SurfaceInterface.
Represents the Resource for the org_kde_kwin_contrast interface.
Reference counted representation of a Wayland buffer on Server side.
The LockedPointerInterface lets the client request to disable movements of the virtual pointer (i...
Convenient Class which represents a wl_client.
Resource representing a wl_surface.
The CompositorInterface global allows clients to create surfaces and region objects.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Oct 19 2020 23:13:15 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.