QWaylandCompositor Class

QWaylandCompositor class manages the Wayland display server. 更多...

头: #include <QWaylandCompositor>
qmake: QT += waylandcompositor
Since: Qt 5.8
继承: QWaylandObject

特性

公共函数

QWaylandCompositor (QObject * parent = nullptr)
virtual ~QWaylandCompositor ()
virtual void create ()
QWaylandView * createSurfaceView (QWaylandSurface * surface )
QWaylandOutput * defaultOutput () const
QWaylandSeat * defaultSeat () const
void destroyClient (QWaylandClient * client )
void destroyClientForSurface (QWaylandSurface * surface )
virtual void grabSurface (QWaylandSurfaceGrabber * grabber , const QWaylandBufferRef & buffer )
bool isCreated () const
QWaylandOutput * outputFor (QWindow * window ) const
bool retainedSelectionEnabled () const
void setDefaultOutput (QWaylandOutput * output )
void setRetainedSelectionEnabled (bool enabled )
void setSocketName (const QByteArray & name )
void setUseHardwareIntegrationExtension (bool use )
QByteArray socketName () const
bool useHardwareIntegrationExtension () const

信号

void createdChanged ()
void defaultOutputChanged ()
void defaultSeatChanged (QWaylandSeat * newDevice , QWaylandSeat * oldDevice )
void outputAdded (QWaylandOutput * output )
void outputRemoved (QWaylandOutput * output )
void retainedSelectionChanged (bool retainedSelection )
void socketNameChanged (const QByteArray & socketName )
void subsurfaceChanged (QWaylandSurface * child , QWaylandSurface * parent )
void surfaceAboutToBeDestroyed (QWaylandSurface * surface )
void surfaceCreated (QWaylandSurface * surface )
void surfaceRequested (QWaylandClient * client , uint id , int version )
void useHardwareIntegrationExtensionChanged ()

额外继承成员

详细描述

QWaylandCompositor class manages the Wayland display server.

QWaylandCompositor manages the connections to the clients, as well as the different outputs and seats .

Normally, a compositor application will have a single WaylandCompositor instance, which can have several outputs as children.

特性文档编制

created : const bool

This property is true if QWaylandCompositor has been initialized, otherwise it's false.

访问函数:

bool isCreated () const

通知程序信号:

void createdChanged ()

defaultOutput : QWaylandOutput *

This property contains the first in the list of outputs added to the QWaylandCompositor , or null if no outputs have been added.

Setting a new default output prepends it to the output list, making it the new default, but the previous default is not removed from the list. If the new default output was already in the list of outputs, it is moved to the beginning of the list.

访问函数:

QWaylandOutput * defaultOutput () const
void setDefaultOutput (QWaylandOutput * output )

通知程序信号:

void defaultOutputChanged ()

defaultSeat : QWaylandSeat * const

This property contains the default seat for this QWaylandCompositor .

访问函数:

QWaylandSeat * defaultSeat () const

通知程序信号:

void defaultSeatChanged (QWaylandSeat * newDevice , QWaylandSeat * oldDevice )

retainedSelection : bool

This property holds whether retained selection is enabled.

访问函数:

bool retainedSelectionEnabled () const
void setRetainedSelectionEnabled (bool enabled )

通知程序信号:

void retainedSelectionChanged (bool retainedSelection )

socketName : QByteArray

This property holds the socket name used by QWaylandCompositor to communicate with clients. This must be set before the QWaylandCompositor is created .

If the socketName is empty (the default), the contents of the start argument --wayland-socket-name are used instead. If the argument is not set, the compositor tries to find a socket name, which is wayland-0 在默认情况下。

访问函数:

QByteArray socketName () const
void setSocketName (const QByteArray & name )

通知程序信号:

void socketNameChanged (const QByteArray & socketName )

useHardwareIntegrationExtension : bool

This property holds whether the hardware integration extension should be enabled for this QWaylandCompositor .

This property must be set before the compositor is created .

访问函数:

bool useHardwareIntegrationExtension () const
void setUseHardwareIntegrationExtension (bool use )

通知程序信号:

void useHardwareIntegrationExtensionChanged ()

成员函数文档编制

QWaylandCompositor:: QWaylandCompositor ( QObject * parent = nullptr)

构造 QWaylandCompositor 采用给定 parent .

[virtual] QWaylandCompositor:: ~QWaylandCompositor ()

销毁 QWaylandCompositor

[virtual] void QWaylandCompositor:: create ()

初始化 QWaylandCompositor . If you override this function in your subclass, be sure to call the base class implementation.

QWaylandView *QWaylandCompositor:: createSurfaceView ( QWaylandSurface * surface )

void QWaylandCompositor:: destroyClient ( QWaylandClient * client )

销毁 client .

void QWaylandCompositor:: destroyClientForSurface ( QWaylandSurface * surface )

Destroys the client for the surface .

[virtual] void QWaylandCompositor:: grabSurface ( QWaylandSurfaceGrabber * grabber , const QWaylandBufferRef & buffer )

Grab the surface content from the given buffer . The default implementation requires a OpenGL context to be bound to the current thread to work. If this is not possible, reimplement this function in your compositor subclass to implement custom logic. The default implementation only grabs shared memory and OpenGL buffers, reimplement this in your compositor subclass to handle more buffer types.

注意: You should not call this manually, but rather use QWaylandSurfaceGrabber ( grabber ).

[signal] void QWaylandCompositor:: outputAdded ( QWaylandOutput * output )

QWaylandOutput *QWaylandCompositor:: outputFor ( QWindow * window ) const

返回 QWaylandOutput that is connected to the given window .

[signal] void QWaylandCompositor:: outputRemoved ( QWaylandOutput * output )

[signal] void QWaylandCompositor:: subsurfaceChanged ( QWaylandSurface * child , QWaylandSurface * parent )

[signal] void QWaylandCompositor:: surfaceAboutToBeDestroyed ( QWaylandSurface * surface )

[signal] void QWaylandCompositor:: surfaceCreated ( QWaylandSurface * surface )

This signal is emitted when a new QWaylandSurface instance has been created.

[signal] void QWaylandCompositor:: surfaceRequested ( QWaylandClient * client , uint id , int version )

This signal is emitted when a client has created a surface. The slot connecting to this signal may create and initialize a QWaylandSurface instance in the scope of the slot. Otherwise a default surface is created.

Connections to this signal must be of Qt::DirectConnection connection type.