KWayland::Client::ShellSurface

#include <shell.h>

Inheritance diagram for KWayland::Client::ShellSurface:

Public Types

enum  TransientFlag { TransientFlag::Default = 0x0, TransientFlag::NoFocus = 0x1 }
 
typedef QFlags< TransientFlagTransientFlags
 

Properties

QSize size
 
- Properties inherited from QObject
 objectName
 

Signals

void pinged ()
 
void popupDone ()
 
void sizeChanged (const QSize &)
 

Public Member Functions

 ShellSurface (QObject *parent)
 
void destroy ()
 
bool isValid () const
 
 operator wl_shell_surface * ()
 
 operator wl_shell_surface * () const
 
void release ()
 
void requestMove (Seat *seat, quint32 serial)
 
void requestResize (Seat *seat, quint32 serial, Qt::Edges edges)
 
void setFullscreen (Output *output=nullptr)
 
void setMaximized (Output *output=nullptr)
 
void setSize (const QSize &size)
 
void setTitle (const QString &title)
 
void setToplevel ()
 
void setTransient (Surface *parent, const QPoint &offset=QPoint(), TransientFlags flags=TransientFlag::Default)
 
void setTransientPopup (Surface *parent, Seat *grabbedSeat, quint32 grabSerial, const QPoint &offset=QPoint(), TransientFlags flags=TransientFlag::Default)
 
void setup (wl_shell_surface *surface)
 
void setWindowClass (const QByteArray &windowClass)
 
QSize size () const
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static ShellSurfacefromQtWinId (WId wid)
 
static ShellSurfacefromWindow (QWindow *window)
 
static ShellSurfaceget (wl_shell_surface *native)
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Public Attributes inherited from QObject
typedef QObjectList
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

Wrapper for the wl_shell_surface interface.

This class is a convenient wrapper for the wl_shell_surface interface.

To create an instance use Shell::createSurface.

See also
Shell
Surface

Definition at line 166 of file shell.h.

Member Enumeration Documentation

Flags which can be passed to a transient surface.

See also
setTransient
Since
5.5
Enumerator
Default 

Default: transient surface accepts keyboard focus.

NoFocus 

Transient surface does not accept keyboard focus.

Definition at line 221 of file shell.h.

Property Documentation

QSize KWayland::Client::ShellSurface::size
readwrite

The size of the ShellSurface.

Definition at line 172 of file shell.h.

Member Function Documentation

void KWayland::Client::ShellSurface::destroy ( )

Destroys the data held by this ShellSurface.

This method is supposed to be used when the connection to the Wayland server goes away. If the connection is not valid anymore, it's not possible to call release anymore as that calls into the Wayland connection and the call would fail. This method cleans up the data, so that the instance can be deleted or set up to a new wl_shell_surface interface once there is a new connection available.

This method is automatically invoked when the Shell which created this ShellSurface gets destroyed.

See also
release

Definition at line 217 of file shell.cpp.

ShellSurface * KWayland::Client::ShellSurface::fromQtWinId ( WId  wid)
static

Creates a ShellSurface for the given winId.

This is an integration feature for QtWayland. On non-wayland platforms this method returns nullptr as well as for not created QWindows.

The returned ShellSurface will be fully setup, but won't be released. It gets automatically destroyed together with the QWindow corresponding the wid.

Since
5.28

Definition at line 169 of file shell.cpp.

ShellSurface * KWayland::Client::ShellSurface::fromWindow ( QWindow window)
static

Creates a ShellSurface for the given window.

This is an integration feature for QtWayland. On non-wayland platforms this method returns nullptr as well as for not created QWindows.

The returned ShellSurface will be fully setup, but won't be released. It gets automatically destroyed together with the window.

Since
5.28

Definition at line 147 of file shell.cpp.

ShellSurface * KWayland::Client::ShellSurface::get ( wl_shell_surface *  native)
static
Returns
The Surface referencing the native wl_surface or null if there is no such Surface.
Since
5.28

Definition at line 186 of file shell.cpp.

void KWayland::Client::ShellSurface::pinged ( )
signal

Signal is emitted when the ShellSurface received a ping request.

The ShellSurface automatically responds to the ping.

void KWayland::Client::ShellSurface::popupDone ( )
signal

The popupDone signal is sent out when a popup grab is broken, that is, when the user clicks a surface that doesn't belong to the client owning the popup surface.

See also
setTransientPopup
Since
5.33
void KWayland::Client::ShellSurface::release ( )

Releases the wl_shell_surface interface.

After the interface has been released the ShellSurface instance is no longer valid and can be setup with another wl_shell_surface interface.

This method is automatically invoked when the Shell which created this ShellSurface gets released.

Definition at line 212 of file shell.cpp.

void KWayland::Client::ShellSurface::requestMove ( Seat seat,
quint32  serial 
)

Requests a move on the given seat after the pointer button press with the given serial.

Parameters
seatThe seat on which to move the window
serialThe serial of the pointer button press which should trigger the move
Since
5.5

Definition at line 312 of file shell.cpp.

void KWayland::Client::ShellSurface::requestResize ( Seat seat,
quint32  serial,
Qt::Edges  edges 
)

Requests a resize on the given seat after the pointer button press with the given serial.

Parameters
seatThe seat on which to resize the window
serialThe serial of the pointer button press which should trigger the resize
edgesA hint for the compositor to set e.g. an appropriate cursor image
Since
5.5

Definition at line 320 of file shell.cpp.

void KWayland::Client::ShellSurface::setFullscreen ( Output output = nullptr)

Sets the ShellSurface fullscreen on output.

Definition at line 272 of file shell.cpp.

void KWayland::Client::ShellSurface::setTitle ( const QString title)

Sets a short title for the surface.

This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor.

Since
5.55

Definition at line 351 of file shell.cpp.

void KWayland::Client::ShellSurface::setTransient ( Surface parent,
const QPoint offset = QPoint(),
TransientFlags  flags = TransientFlag::Default 
)

Sets this Surface as a transient for parent.

Parameters
parentThe parent Surface of this surface
offsetThe offset of this Surface in the parent coordinate system
flagsThe flags for the transient
Since
5.5

Definition at line 290 of file shell.cpp.

void KWayland::Client::ShellSurface::setTransientPopup ( Surface parent,
Seat grabbedSeat,
quint32  grabSerial,
const QPoint offset = QPoint(),
TransientFlags  flags = TransientFlag::Default 
)

Sets this Surface as a popup transient for parent.

A popup is a transient with an added pointer grab on the grabbedSeat.

The popup grab can be created if the client has an implicit grab (e.g. button press) on the grabbedSeat. It needs to pass the grabSerial indicating the implicit grab to the request for setting the surface. The implicit grab is turned into a popup grab which will persist after the implicit grab ends. The popup grab ends when the ShellSurface gets destroyed or when the compositor breaks the grab through the popupDone signal.

Parameters
parentThe parent Surface of this ShellSurface
grabbedSeatThe Seat on which an implicit grab exists
grabSerialThe serial of the implicit grab
offsetThe offset of this Surface in the parent coordinate system
flagsThe flags for the transient
Since
5.33

Definition at line 300 of file shell.cpp.

void KWayland::Client::ShellSurface::setup ( wl_shell_surface *  surface)

Setup this ShellSurface to manage the surface.

There is normally no need to call this method as it's invoked by Shell::createSurface.

Definition at line 252 of file shell.cpp.

void KWayland::Client::ShellSurface::setWindowClass ( const QByteArray windowClass)

Sets a window class for the surface.

The surface class identifies the general class of applications to which the surface belongs. A common convention is to use the file name (or the full path if it is a non-standard location) of the application's .desktop file as the class.

Since
5.55

Definition at line 356 of file shell.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Nov 21 2020 22:50:43 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.