QWaylandOutput Class

The QWaylandOutput class represents a displayable area managed by the compositor. 更多...

头文件: #include <QWaylandOutput>
qmake: QT += waylandcompositor
开始支持版本: Qt 5.8
基类: QWaylandObject

公有类型

enum Subpixel { SubpixelUnknown, SubpixelNone, SubpixelHorizontalRgb, SubpixelHorizontalBgr, SubpixelVerticalRgb, SubpixelVerticalBgr }
enum Transform { TransformNormal, Transform90, Transform180, Transform270, ..., TransformFlipped270 }

属性

公有函数

QWaylandOutput()
QWaylandOutput(QWaylandCompositor *compositor, QWindow *window)
~QWaylandOutput()
void addMode(const QWaylandOutputMode &mode, bool preferred = false)
QRect availableGeometry() const
QWaylandCompositor *compositor() const
QWaylandOutputMode currentMode() const
void frameStarted()
QRect geometry() const
QString manufacturer() const
QString model() const
QList<QWaylandOutputMode> modes() const
QSize physicalSize() const
bool physicalSizeFollowsSize() const
QPoint position() const
int scaleFactor() const
void sendFrameCallbacks()
void setAvailableGeometry(const QRect &availableGeometry)
void setCurrentMode(const QWaylandOutputMode &mode)
void setManufacturer(const QString &manufacturer)
void setModel(const QString &model)
void setPhysicalSize(const QSize &size)
void setPhysicalSizeFollowsSize(bool follow)
void setPosition(const QPoint &pt)
void setScaleFactor(int scale)
void setSizeFollowsWindow(bool follow)
void setSubpixel(const Subpixel &subpixel)
void setTransform(const Transform &transform)
void setWindow(QWindow *window)
bool sizeFollowsWindow() const
Subpixel subpixel() const
Transform transform() const
virtual void update()
QWindow *window() const

信号

静态公有成员

QWaylandOutput *fromResource(wl_resource *resource)

详细描述

The QWaylandOutput class represents a displayable area managed by the compositor.

The QWaylandOutput manages a rectangular area within bounds of the compositor's geometry, to use it for displaying client content. This could, for instance, be a screen managed by the WaylandCompositor.

The class corresponds to the wl_output interface in the Wayland protocol.

成员类型

enum QWaylandOutput::Subpixel

This enum type is used to specify the subpixel arrangement of a QWaylandOutput.

ConstantValueDescription
QWaylandOutput::SubpixelUnknown0The subpixel arrangement is not set.
QWaylandOutput::SubpixelNone1There are no subpixels.
QWaylandOutput::SubpixelHorizontalRgb2The subpixels are arranged horizontally in red, green, blue order.
QWaylandOutput::SubpixelHorizontalBgr3The subpixels are arranged horizontally in blue, green, red order.
QWaylandOutput::SubpixelVerticalRgb4The subpixels are arranged vertically in red, green, blue order.
QWaylandOutput::SubpixelVerticalBgr5The subpixels are arranged vertically in blue, green, red order.

参见 QWaylandOutput::subpixel.

enum QWaylandOutput::Transform

* * This enum type is used to specify the orientation of a QWaylandOutput. * *

ConstantValueDescription
QWaylandOutput::TransformNormal0The orientation is normal. *
QWaylandOutput::Transform901The orientation is rotated 90 degrees. *
QWaylandOutput::Transform1802The orientation is rotated 180 degrees. *
QWaylandOutput::Transform2703The orientation is rotated 270 degrees. *
QWaylandOutput::TransformFlipped4The orientation is mirrored. *
QWaylandOutput::TransformFlipped905The orientation is mirrored, and rotated 90 degrees. *
QWaylandOutput::TransformFlipped1806The orientation is mirrored, and rotated 180 degrees. *
QWaylandOutput::TransformFlipped2707The orientation is mirrored, and rotated 270 degrees. * *

参见 QWaylandOutput::transform.

属性

availableGeometry : QRect

This property holds the geometry of the QWaylandOutput available for displaying content. The available geometry is in output coordinates space, starts from 0,0 and it's as big as the output by default.

访问函数:

QRect availableGeometry() const
void setAvailableGeometry(const QRect &availableGeometry)

Notifier signal:

void availableGeometryChanged()

参见 QWaylandOutput::currentMode and QWaylandOutput::geometry.

compositor : QWaylandCompositor * const

访问函数:

QWaylandCompositor *compositor() const

Notifier signal:

void compositorChanged()

geometry : const QRect

This property holds the geometry of the QWaylandOutput.

访问函数:

QRect geometry() const

Notifier signal:

void geometryChanged()

参见 QWaylandOutput::currentMode.

manufacturer : QString

This property holds a textual description of the manufacturer of this QWaylandOutput.

访问函数:

QString manufacturer() const
void setManufacturer(const QString &manufacturer)

Notifier signal:

void manufacturerChanged()

model : QString

This property holds a textual description of the model of this QWaylandOutput.

访问函数:

QString model() const
void setModel(const QString &model)

Notifier signal:

void modelChanged()

physicalSize : QSize

This property holds the physical size of the QWaylandOutput in millimeters.

访问函数:

QSize physicalSize() const
void setPhysicalSize(const QSize &size)

Notifier signal:

void physicalSizeChanged()

参见 QWaylandOutput::geometry and QWaylandOutput::currentMode.

position : QPoint

This property holds the position of this QWaylandOutput in the compositor's coordinate system.

访问函数:

QPoint position() const
void setPosition(const QPoint &pt)

Notifier signal:

void positionChanged()

scaleFactor : int

This property holds the factor by which the QWaylandCompositor scales surface buffers before they are displayed. This is used on high density output devices where unscaled content would be too small to be practical. The client can in turn set the scale factor of its buffer to match the output if it prefers to provide high resolution content that is suitable for the output device.

The default is 1 (no scaling).

访问函数:

int scaleFactor() const
void setScaleFactor(int scale)

Notifier signal:

void scaleFactorChanged()

sizeFollowsWindow : bool

This property controls whether the size of the QWaylandOutput matches the size of its window.

If this property is true, all modes previously added are replaced by a mode that matches window size and screen refresh rate.

The default is false.

访问函数:

bool sizeFollowsWindow() const
void setSizeFollowsWindow(bool follow)

Notifier signal:

void sizeFollowsWindowChanged()

subpixel : QWaylandOutput::Subpixel

This property holds the subpixel arrangement of this QWaylandOutput. The default is QWaylandOutput::SubpixelUnknown.

访问函数:

Subpixel subpixel() const
void setSubpixel(const Subpixel &subpixel)

Notifier signal:

void subpixelChanged()

transform : QWaylandOutput::Transform

This property holds the transformation that the QWaylandCompositor applies to a surface to compensate for the orientation of the QWaylandOutput.

The default is QWaylandOutput::TransformNormal.

访问函数:

Transform transform() const
void setTransform(const Transform &transform)

Notifier signal:

void transformChanged()

window : QWindow *

This property holds the QWindow for this QWaylandOutput.

访问函数:

QWindow *window() const
void setWindow(QWindow *window)

Notifier signal:

void windowChanged()

成员函数

QWaylandOutput::QWaylandOutput()

Default constructs an instance of QWaylandOutput.

QWaylandOutput::QWaylandOutput(QWaylandCompositor *compositor, QWindow *window)

Constructs a QWaylandOutput in compositor and with the specified window. The create() function must be called on the compositor before constructing a QWaylandOutput for it.

The QWaylandOutput object is initialized later, in reaction to an event. At this point it is added as an output for the compositor. If it is the first QWaylandOutput object created for this compositor, it becomes the default output.

QWaylandOutput::~QWaylandOutput()

Destroys the QWaylandOutput.

void QWaylandOutput::addMode(const QWaylandOutputMode &mode, bool preferred = false)

Adds the mode mode to the output and mark it as preferred if preferred is true. Please note there can only be one preferred mode.

QWaylandCompositor *QWaylandOutput::compositor() const

Returns the compositor for this QWaylandOutput.

Note: Getter function for property compositor.

QWaylandOutputMode QWaylandOutput::currentMode() const

Returns the output's size in pixels and refresh rate in mHz. If the current mode is not set it will return an invalid mode.

参见 setCurrentMode(), QWaylandOutput::modes, and QWaylandOutputMode.

[signal] void QWaylandOutput::currentModeChanged()

void QWaylandOutput::frameStarted()

Informs QWaylandOutput that a frame has started.

[static] QWaylandOutput *QWaylandOutput::fromResource(wl_resource *resource)

Returns the QWaylandOutput corresponding to resource.

[signal] void QWaylandOutput::modeAdded()

QList<QWaylandOutputMode> QWaylandOutput::modes() const

Returns the list of modes.

bool QWaylandOutput::physicalSizeFollowsSize() const

参见 setPhysicalSizeFollowsSize().

[signal] void QWaylandOutput::physicalSizeFollowsSizeChanged()

void QWaylandOutput::sendFrameCallbacks()

Sends pending frame callbacks.

void QWaylandOutput::setCurrentMode(const QWaylandOutputMode &mode)

Sets the current mode. The mode mode must have been previously added.

参见 currentMode(), QWaylandOutput::modes, and QWaylandOutputMode.

void QWaylandOutput::setPhysicalSizeFollowsSize(bool follow)

参见 physicalSizeFollowsSize().

[virtual] void QWaylandOutput::update()

Schedules a QEvent::UpdateRequest to be delivered to the QWaylandOutput's window.

参见 QWindow::requestUpdate().

[signal] void QWaylandOutput::windowDestroyed()