KWin
|
Resource representing a wl_surface. More...
#include <surface.h>
Signals | |
void | aboutToBeDestroyed () |
void | damaged (const QRegion &) |
void | opaqueChanged (const QRegion &) |
void | inputChanged (const QRegion &) |
void | bufferTransformChanged (KWin::OutputTransform) |
void | bufferSourceBoxChanged () |
void | bufferSizeChanged () |
void | mapped () |
void | unmapped () |
void | sizeChanged () |
void | shadowChanged () |
void | blurChanged () |
void | slideOnShowHideChanged () |
void | contrastChanged () |
void | childSubSurfaceAdded (SubSurfaceInterface *subSurface) |
void | childSubSurfaceRemoved (SubSurfaceInterface *subSurface) |
void | childSubSurfacesChanged () |
void | pointerConstraintsChanged () |
void | inhibitsIdleChanged () |
void | colorDescriptionChanged () |
void | presentationModeHintChanged () |
void | committed () |
void | stateStashed (quint32 serial) |
void | stateApplied (quint32 serial) |
Static Public Member Functions | |
static SurfaceInterface * | get (wl_resource *native) |
static SurfaceInterface * | get (quint32 id, const ClientConnection *client) |
Properties | |
QRegion | opaque |
QRegion | input |
QSizeF | size |
Friends | |
class | SurfaceInterfacePrivate |
Resource representing a wl_surface.
The SurfaceInterface gets created by the CompositorInterface. A SurfaceInterface normally takes up a role by being "attached" to either a ShellSurfaceInterface, a SubSurfaceInterface or a Cursor.
The implementation of the SurfaceInterface does not only wrap the features exposed by wl_surface, but goes further by integrating the information added to a SurfaceInterface by other interfaces. This should make interacting from the server easier, it only needs to monitor the SurfaceInterface and does not need to track each specific interface.
The SurfaceInterface takes care of reference/unreferencing the GraphicsBuffer attached to it. As long as a GraphicsBuffer is attached, the released signal won't be sent. If the GraphicsBuffer is no longer needed by the SurfaceInterface, it will get unreferenced and might be automatically deleted (if it's no longer referenced).
|
explicit |
Definition at line 410 of file surface.cpp.
|
override |
Definition at line 425 of file surface.cpp.
|
signal |
This signal is emitted when the underlying wl_surface resource is about to be freed.
The unbound() signal is emitted either when the client that owns the surface has been destroyed or if the surface has been destroyed due to a destructor request.
The SurfaceInterface object and the associated wl_surface resource are valid when this signal is emitted.
QList< SubSurfaceInterface * > KWin::SurfaceInterface::above | ( | ) | const |
Returns the sub-surfaces that are above this surface. The sub-surfaces are sorted from bottom to top.
Definition at line 840 of file surface.cpp.
QList< SubSurfaceInterface * > KWin::SurfaceInterface::below | ( | ) | const |
Returns the sub-surfaces that are below this surface. The sub-surfaces are sorted from bottom to top.
Definition at line 835 of file surface.cpp.
BlurInterface * KWin::SurfaceInterface::blur | ( | ) | const |
Definition at line 876 of file surface.cpp.
|
signal |
QRectF KWin::SurfaceInterface::boundingRect | ( | ) | const |
Returns the rectangle that bounds this surface and all of its sub-surfaces.
QPoint(0, 0) corresponds to the upper left corner of this surface.
Definition at line 855 of file surface.cpp.
GraphicsBuffer * KWin::SurfaceInterface::buffer | ( | ) | const |
nullptr
. Definition at line 809 of file surface.cpp.
QRegion KWin::SurfaceInterface::bufferDamage | ( | ) | const |
Definition at line 784 of file surface.cpp.
QSize KWin::SurfaceInterface::bufferSize | ( | ) | const |
Returns the size of the attached buffer, in device pixels.
If no buffer is attached to this surface, an invalid QSize will be returned.
Definition at line 1061 of file surface.cpp.
|
signal |
This signal is emitted when the size of the attached buffer has changed.
QRectF KWin::SurfaceInterface::bufferSourceBox | ( | ) | const |
Definition at line 799 of file surface.cpp.
|
signal |
OutputTransform KWin::SurfaceInterface::bufferTransform | ( | ) | const |
Returns the buffer transform that had been applied to the buffer to compensate for output rotation.
If the surface is on an output that is rotated 90 degrees clockwise, the buffer will be rotated 90 degrees counter clockwise.
Definition at line 804 of file surface.cpp.
|
signal |
This signal is emitted when the buffer transform has changed.
|
signal |
Emitted whenever a new child sub-surface subSurface
is added.
|
signal |
Emitted whenver the child sub-surface subSurface
is removed.
|
signal |
This signal is emitted when the list of child subsurfaces changes.
ClientConnection * KWin::SurfaceInterface::client | ( | ) | const |
Returns the Wayland client that owns this SurfaceInterface.
Definition at line 444 of file surface.cpp.
const ColorDescription & KWin::SurfaceInterface::colorDescription | ( | ) | const |
Definition at line 1086 of file surface.cpp.
|
signal |
|
signal |
Emitted when the Surface has been committed.
This signal is emitted after all the relevant damage and xyzChanged signals for this commit are emitted.
CompositorInterface * KWin::SurfaceInterface::compositor | ( | ) | const |
Returns the compositor for this SurfaceInterface.
Definition at line 454 of file surface.cpp.
ConfinedPointerV1Interface * KWin::SurfaceInterface::confinedPointer | ( | ) | const |
Pointer confinement installed on this SurfaceInterface.
Definition at line 1019 of file surface.cpp.
ContentType KWin::SurfaceInterface::contentType | ( | ) | const |
Definition at line 1034 of file surface.cpp.
ContrastInterface * KWin::SurfaceInterface::contrast | ( | ) | const |
Definition at line 881 of file surface.cpp.
|
signal |
|
signal |
Emitted whenever the SurfaceInterface got damaged. The signal is only emitted during the commit of state. A damage means that a new GraphicsBuffer got attached.
LinuxDmaBufV1Feedback * KWin::SurfaceInterface::dmabufFeedbackV1 | ( | ) | const |
dmabuf feedback installed on this SurfaceInterface
Definition at line 1029 of file surface.cpp.
Transaction * KWin::SurfaceInterface::firstTransaction | ( | ) | const |
The first committed transaction that is scheduled to be applied to this surface.
Definition at line 1149 of file surface.cpp.
void KWin::SurfaceInterface::frameRendered | ( | quint32 | msec | ) |
Definition at line 459 of file surface.cpp.
|
static |
id
for client
, if it exists, otherwise nullptr
. Definition at line 827 of file surface.cpp.
|
static |
native
resource. Definition at line 819 of file surface.cpp.
bool KWin::SurfaceInterface::hasFrameCallbacks | ( | ) | const |
Definition at line 479 of file surface.cpp.
uint32_t KWin::SurfaceInterface::id | ( | ) | const |
Returns the object id for this Wayland surface.
Definition at line 439 of file surface.cpp.
bool KWin::SurfaceInterface::inhibitsIdle | ( | ) | const |
Definition at line 1024 of file surface.cpp.
|
signal |
Emitted whenever the SurfaceInterface starts/ends to inhibit idle.
QRegion KWin::SurfaceInterface::input | ( | ) | const |
Definition at line 794 of file surface.cpp.
|
signal |
SurfaceInterface * KWin::SurfaceInterface::inputSurfaceAt | ( | const QPointF & | position | ) |
Finds the input receiving SurfaceInterface at the given position
in surface-local coordinates. This can be either a descendant SurfaceInterface honoring the stacking order or the SurfaceInterface itself if its geometry contains the given position
.
If no such SurfaceInterface is found, e.g. because the SurfaceInterface is unmapped or there is no input region containing the position, nullptr
is returned.
position | The position in surface-local coordinates |
position
or surface itself at the position, might be nullptr
Definition at line 982 of file surface.cpp.
bool KWin::SurfaceInterface::isMapped | ( | ) | const |
Whether the SurfaceInterface is currently considered to be mapped. A SurfaceInterface is mapped if it has a non-null GraphicsBuffer attached. If the SurfaceInterface references a SubSurfaceInterface it is only considered mapped if it has a GraphicsBuffer attached and the parent SurfaceInterface is mapped.
Definition at line 891 of file surface.cpp.
Transaction * KWin::SurfaceInterface::lastTransaction | ( | ) | const |
The last committed transaction that is scheduled to be applied to this surface.
Definition at line 1159 of file surface.cpp.
LockedPointerV1Interface * KWin::SurfaceInterface::lockedPointer | ( | ) | const |
Pointer lock installed on this SurfaceInterface.
Definition at line 1014 of file surface.cpp.
|
signal |
Emitted when the Surface becomes visible, i.e. a non-null buffer has been attached.
QPointF KWin::SurfaceInterface::mapToChild | ( | SurfaceInterface * | child, |
const QPointF & | point ) const |
Maps the specified point in this surface's coordinate system to the equivalent point within the child's coordinate system, and returns the mapped point.
If this surface is not an ancestor of the child, a null point is returned.
Definition at line 1039 of file surface.cpp.
QPoint KWin::SurfaceInterface::offset | ( | ) | const |
Definition at line 814 of file surface.cpp.
QRegion KWin::SurfaceInterface::opaque | ( | ) | const |
Definition at line 789 of file surface.cpp.
|
signal |
QList< OutputInterface * > KWin::SurfaceInterface::outputs | ( | ) | const |
Definition at line 896 of file surface.cpp.
|
signal |
Emitted whenever a pointer constraint get (un)installed on this SurfaceInterface.
The pointer constraint does not get activated, the compositor needs to activate the lock/confinement.
PresentationModeHint KWin::SurfaceInterface::presentationModeHint | ( | ) | const |
Definition at line 1081 of file surface.cpp.
|
signal |
wl_resource * KWin::SurfaceInterface::resource | ( | ) | const |
Returns the Wayland resource corresponding to this SurfaceInterface.
Definition at line 449 of file surface.cpp.
SurfaceRole * KWin::SurfaceInterface::role | ( | ) | const |
Returns the role of this surface, or null
if no role has been assigned to the surface.
Once a role is given to the surface, it is permanent.
Definition at line 429 of file surface.cpp.
qreal KWin::SurfaceInterface::scaleOverride | ( | ) | const |
Definition at line 1066 of file surface.cpp.
void KWin::SurfaceInterface::setFirstTransaction | ( | Transaction * | transaction | ) |
Definition at line 1154 of file surface.cpp.
void KWin::SurfaceInterface::setLastTransaction | ( | Transaction * | transaction | ) |
Definition at line 1164 of file surface.cpp.
void KWin::SurfaceInterface::setOutputs | ( | const QList< OutputInterface * > & | outputs, |
OutputInterface * | primaryOutput ) |
Sets the outputs
this SurfaceInterface overlaps with, may be empty.
The compositor should update whenever the SurfaceInterface becomes visible on an OutputInterface by e.g. getting (un)mapped, resized, moved, etc.
Definition at line 901 of file surface.cpp.
void KWin::SurfaceInterface::setPreferredBufferScale | ( | qreal | scale | ) |
Sets a preferred buffer scale that clients should provide buffers in
scale |
Definition at line 1108 of file surface.cpp.
void KWin::SurfaceInterface::setPreferredBufferTransform | ( | OutputTransform | transform | ) |
Sets the preferred buffer transform for this surface.
This indicates to the client the preferred buffer transform to use when attaching buffers to this surface.
Definition at line 1130 of file surface.cpp.
void KWin::SurfaceInterface::setPreferredColorDescription | ( | const ColorDescription & | descr | ) |
Definition at line 1091 of file surface.cpp.
void KWin::SurfaceInterface::setRole | ( | SurfaceRole * | role | ) |
Definition at line 434 of file surface.cpp.
ShadowInterface * KWin::SurfaceInterface::shadow | ( | ) | const |
Definition at line 871 of file surface.cpp.
|
signal |
QSizeF KWin::SurfaceInterface::size | ( | ) | const |
Returns the current size of the surface, in surface coordinates.
Note that there is no direct relationship between the surface size and the buffer size. In order to determine the size of the currently attached buffer, use buffer()->size().
Definition at line 850 of file surface.cpp.
|
signal |
This signal is emitted when the surface size has changed.
SlideInterface * KWin::SurfaceInterface::slideOnShowHide | ( | ) | const |
Definition at line 886 of file surface.cpp.
|
signal |
|
signal |
This signal is emitted when the state in a surface commit with the specified serial has been applied.
|
signal |
This signal is emitted when a surface commit with the specified serial has been cached to be applied later.
SubSurfaceInterface * KWin::SurfaceInterface::subSurface | ( | ) | const |
Definition at line 845 of file surface.cpp.
SurfaceInterface * KWin::SurfaceInterface::surfaceAt | ( | const QPointF & | position | ) |
Finds the SurfaceInterface at the given position
in surface-local coordinates. This can be either a descendant SurfaceInterface honoring the stacking order or the SurfaceInterface itself if its geometry contains the given position
.
If no such SurfaceInterface is found, e.g. because the SurfaceInterface is unmapped, nullptr
is returned.
position | The position in surface-local coordinates |
position
or surface itself at the position, might be nullptr
Definition at line 953 of file surface.cpp.
std::unique_ptr< PresentationFeedback > KWin::SurfaceInterface::takePresentationFeedback | ( | Output * | output | ) |
Definition at line 471 of file surface.cpp.
QPoint KWin::SurfaceInterface::toSurfaceLocal | ( | const QPoint & | point | ) | const |
Convert a co-ordinate from kwin logical space to surface logical space
Definition at line 1071 of file surface.cpp.
QPointF KWin::SurfaceInterface::toSurfaceLocal | ( | const QPointF & | point | ) | const |
Convert a co-ordinate from kwin logical space to surface logical space
Definition at line 1076 of file surface.cpp.
void KWin::SurfaceInterface::traverseTree | ( | std::function< void(SurfaceInterface *surface)> | callback | ) |
Traverses the surface sub-tree with this surface as the root.
Definition at line 1169 of file surface.cpp.
|
signal |
Emitted when the Surface removes its content
|
friend |
|
read |
|
read |