![]() |
Qt 6.x
The Qt SDK
|
#include <qwaylandscreen_p.h>
Public Member Functions | |
QWaylandScreen (QWaylandDisplay *waylandDisplay, int version, uint32_t id) | |
~QWaylandScreen () override | |
void | maybeInitialize () |
void | initXdgOutput (QWaylandXdgOutputManagerV1 *xdgOutputManager) |
QWaylandDisplay * | display () const |
QString | manufacturer () const override |
Reimplement this function in subclass to return the manufacturer of this screen. | |
QString | model () const override |
Reimplement this function in subclass to return the model of this screen. | |
QRect | geometry () const override |
Reimplement in subclass to return the pixel geometry of the screen. | |
int | depth () const override |
Reimplement in subclass to return current depth of the screen. | |
QImage::Format | format () const override |
Reimplement in subclass to return the image format which corresponds to the screen format. | |
QSizeF | physicalSize () const override |
Reimplement this function in subclass to return the physical size of the screen, in millimeters. | |
QDpi | logicalDpi () const override |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen. | |
QList< QPlatformScreen * > | virtualSiblings () const override |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
Qt::ScreenOrientation | orientation () const override |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation. | |
int | scale () const |
qreal | devicePixelRatio () const override |
Reimplement this function in subclass to return the device pixel ratio for the screen. | |
qreal | refreshRate () const override |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
QString | name () const override |
uint32_t | outputId () const |
::wl_output * | output () const override |
![]() | |
QPlatformScreen () | |
virtual | ~QPlatformScreen () |
virtual bool | isPlaceholder () const |
virtual QPixmap | grabWindow (WId window, int x, int y, int width, int height) const |
This function is called when Qt needs to be able to grab the content of a window. | |
virtual QRect | geometry () const =0 |
Reimplement in subclass to return the pixel geometry of the screen. | |
virtual QRect | availableGeometry () const |
Reimplement in subclass to return the pixel geometry of the available space This normally is the desktop screen minus the task manager, global menubar etc. | |
virtual int | depth () const =0 |
Reimplement in subclass to return current depth of the screen. | |
virtual QImage::Format | format () const =0 |
Reimplement in subclass to return the image format which corresponds to the screen format. | |
virtual QColorSpace | colorSpace () const |
virtual QSizeF | physicalSize () const |
Reimplement this function in subclass to return the physical size of the screen, in millimeters. | |
virtual QDpi | logicalDpi () const |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen. | |
virtual QDpi | logicalBaseDpi () const |
Reimplement to return the base logical DPI for the platform. | |
virtual qreal | devicePixelRatio () const |
Reimplement this function in subclass to return the device pixel ratio for the screen. | |
virtual qreal | refreshRate () const |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
virtual Qt::ScreenOrientation | nativeOrientation () const |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
virtual Qt::ScreenOrientation | orientation () const |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation. | |
virtual QWindow * | topLevelAt (const QPoint &point) const |
Return the given top level window for a given position. | |
QWindowList | windows () const |
Return all windows residing on this screen. | |
virtual QList< QPlatformScreen * > | virtualSiblings () const |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
const QPlatformScreen * | screenForPosition (const QPoint &point) const |
Find the sibling screen corresponding to globalPos. | |
QScreen * | screen () const |
virtual QString | name () const |
virtual QString | manufacturer () const |
Reimplement this function in subclass to return the manufacturer of this screen. | |
virtual QString | model () const |
Reimplement this function in subclass to return the model of this screen. | |
virtual QString | serialNumber () const |
Reimplement this function in subclass to return the serial number of this screen. | |
virtual QPlatformCursor * | cursor () const |
Reimplement this function in subclass to return the cursor of the screen. | |
virtual SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const |
Returns a hint about this screen's subpixel layout structure. | |
virtual PowerState | powerState () const |
Returns the current power state. | |
virtual void | setPowerState (PowerState state) |
Sets the power state for this screen. | |
virtual QList< Mode > | modes () const |
Reimplement this function in subclass to return the list of modes for this screen. | |
virtual int | currentMode () const |
Reimplement this function in subclass to return the index of the current mode from the modes list. | |
virtual int | preferredMode () const |
Reimplement this function in subclass to return the preferred mode index from the modes list. | |
Static Public Member Functions | |
static QWaylandScreen * | waylandScreenFromWindow (QWindow *window) |
static QWaylandScreen * | fromWlOutput (::wl_output *output) |
![]() | |
static QPlatformScreen * | platformScreenForWindow (const QWindow *window) |
static int | angleBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b) |
static QTransform | transformBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &target) |
static QRect | mapBetween (Qt::ScreenOrientation a, Qt::ScreenOrientation b, const QRect &rect) |
static QDpi | overrideDpi (const QDpi &in) |
Protected Types | |
enum | Event : uint { XdgOutputDoneEvent = 0x1 , OutputDoneEvent = 0x2 , XdgOutputNameEvent = 0x4 } |
Protected Member Functions | |
uint | requiredEvents () const |
void | output_mode (uint32_t flags, int width, int height, int refresh) override |
void | output_geometry (int32_t x, int32_t y, int32_t width, int32_t height, int subpixel, const QString &make, const QString &model, int32_t transform) override |
void | output_scale (int32_t factor) override |
void | output_done () override |
void | updateOutputProperties () |
void | zxdg_output_v1_logical_position (int32_t x, int32_t y) override |
void | zxdg_output_v1_logical_size (int32_t width, int32_t height) override |
void | zxdg_output_v1_done () override |
void | zxdg_output_v1_name (const QString &name) override |
void | updateXdgOutputProperties () |
![]() | |
void | resizeMaximizedWindows () |
Convenience method to resize all the maximized and fullscreen windows of this platform screen. | |
Protected Attributes | |
int | m_outputId |
QWaylandDisplay * | mWaylandDisplay = nullptr |
QString | mManufacturer |
QString | mModel |
QRect | mGeometry |
QRect | mXdgGeometry |
int | mScale = 1 |
int | mDepth = 32 |
int | mRefreshRate = 60000 |
int | mTransform = -1 |
QImage::Format | mFormat = QImage::Format_ARGB32_Premultiplied |
QSize | mPhysicalSize |
QString | mOutputName |
Qt::ScreenOrientation | m_orientation = Qt::PrimaryOrientation |
uint | mProcessedEvents = 0 |
bool | mInitialized = false |
![]() | |
QScopedPointer< QPlatformScreenPrivate > | d_ptr |
Additional Inherited Members | |
![]() | |
enum | SubpixelAntialiasingType { Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB , Subpixel_VBGR } |
enum | PowerState { PowerStateOn , PowerStateStandby , PowerStateSuspend , PowerStateOff } |
Definition at line 38 of file qwaylandscreen_p.h.
|
protected |
Enumerator | |
---|---|
XdgOutputDoneEvent | |
OutputDoneEvent | |
XdgOutputNameEvent |
Definition at line 86 of file qwaylandscreen_p.h.
QtWaylandClient::QWaylandScreen::QWaylandScreen | ( | QWaylandDisplay * | waylandDisplay, |
int | version, | ||
uint32_t | id | ||
) |
Definition at line 25 of file qwaylandscreen.cpp.
References QtWaylandClient::QWaylandDisplay::forceRoundTrip(), initXdgOutput(), maybeInitialize(), mProcessedEvents, mWaylandDisplay, OutputDoneEvent, qCWarning, and QtWaylandClient::QWaylandDisplay::xdgOutputManager().
|
override |
Definition at line 43 of file qwaylandscreen.cpp.
|
overridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 116 of file qwaylandscreen.cpp.
References mDepth.
|
overridevirtual |
Reimplement this function in subclass to return the device pixel ratio for the screen.
This is the ratio between physical pixels and the device-independent pixels of the windowing system. The default implementation returns 1.0.
Reimplemented from QPlatformScreen.
Definition at line 176 of file qwaylandscreen.cpp.
References mScale.
QWaylandDisplay * QtWaylandClient::QWaylandScreen::display | ( | ) | const |
Definition at line 90 of file qwaylandscreen.cpp.
References mWaylandDisplay.
|
overridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 121 of file qwaylandscreen.cpp.
References mFormat.
|
static |
Definition at line 201 of file qwaylandscreen.cpp.
Referenced by QtWaylandClient::QWaylandSurface::surface_enter(), and QtWaylandClient::QWaylandSurface::surface_leave().
|
overridevirtual |
Reimplement in subclass to return the pixel geometry of the screen.
Implements QPlatformScreen.
Definition at line 105 of file qwaylandscreen.cpp.
References mGeometry, mScale, mXdgGeometry, QRect::size(), and QRect::topLeft().
Referenced by updateOutputProperties(), and updateXdgOutputProperties().
void QtWaylandClient::QWaylandScreen::initXdgOutput | ( | QWaylandXdgOutputManagerV1 * | xdgOutputManager | ) |
Definition at line 81 of file qwaylandscreen.cpp.
References Q_ASSERT.
Referenced by QWaylandScreen().
|
overridevirtual |
Reimplement this function in subclass to return the logical horizontal and vertical dots per inch metrics of the screen.
The logical dots per inch metrics are used by Qt to scale the user interface.
The default implementation returns logicalBaseDpi(), which results in a UI scale factor of 1.0.
Reimplemented from QPlatformScreen.
Definition at line 134 of file qwaylandscreen.cpp.
References QPlatformScreen::logicalDpi(), qEnvironmentVariable(), qgetenv(), QStringLiteral, and QByteArray::toInt().
|
overridevirtual |
Reimplement this function in subclass to return the manufacturer of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 95 of file qwaylandscreen.cpp.
References mManufacturer.
void QtWaylandClient::QWaylandScreen::maybeInitialize | ( | ) |
Definition at line 65 of file qwaylandscreen.cpp.
References QtWaylandClient::QWaylandDisplay::handleScreenInitialized(), mInitialized, mProcessedEvents, mWaylandDisplay, Q_ASSERT, requiredEvents(), updateOutputProperties(), and updateXdgOutputProperties().
Referenced by QWaylandScreen(), output_done(), and zxdg_output_v1_done().
|
overridevirtual |
Reimplement this function in subclass to return the model of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 100 of file qwaylandscreen.cpp.
References mModel.
Referenced by output_geometry().
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 70 of file qwaylandscreen_p.h.
Referenced by zxdg_output_v1_name().
|
overridevirtual |
Reimplement this function in subclass to return the current orientation of the screen, for example based on accelerometer data to determine the device orientation.
The default implementation returns Qt::PrimaryOrientation.
Reimplemented from QPlatformScreen.
Definition at line 166 of file qwaylandscreen.cpp.
References m_orientation.
|
inlineoverride |
Definition at line 77 of file qwaylandscreen_p.h.
Referenced by fromWlOutput().
|
overrideprotected |
Definition at line 244 of file qwaylandscreen.cpp.
References maybeInitialize(), mInitialized, mProcessedEvents, OutputDoneEvent, updateOutputProperties(), and updateXdgOutputProperties().
|
overrideprotected |
Definition at line 221 of file qwaylandscreen.cpp.
References mGeometry, mManufacturer, mModel, model(), QRect::moveTopLeft(), mPhysicalSize, mTransform, and Q_UNUSED.
|
overrideprotected |
Definition at line 208 of file qwaylandscreen.cpp.
References mGeometry, mRefreshRate, QRect::setSize(), and QRect::size().
|
overrideprotected |
Definition at line 239 of file qwaylandscreen.cpp.
References mScale.
|
inline |
Definition at line 76 of file qwaylandscreen_p.h.
|
overridevirtual |
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
The physical size represents the actual physical dimensions of the display.
The default implementation takes the pixel size of the screen, considers a resolution of 100 dots per inch, and returns the calculated physical size. A device with a screen that has different resolutions will need to be supported by a suitable reimplementation of this function.
Reimplemented from QPlatformScreen.
Definition at line 126 of file qwaylandscreen.cpp.
References QSize::isEmpty(), mPhysicalSize, and QPlatformScreen::physicalSize().
|
overridevirtual |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz.
The default returns 60, a sensible default for modern displays.
Reimplemented from QPlatformScreen.
Definition at line 181 of file qwaylandscreen.cpp.
References mRefreshRate.
Referenced by updateOutputProperties().
|
protected |
Definition at line 51 of file qwaylandscreen.cpp.
References mWaylandDisplay, OutputDoneEvent, ret, XdgOutputDoneEvent, QtWaylandClient::QWaylandDisplay::xdgOutputManager(), and XdgOutputNameEvent.
Referenced by maybeInitialize().
int QtWaylandClient::QWaylandScreen::scale | ( | ) | const |
Definition at line 171 of file qwaylandscreen.cpp.
References mScale.
|
protected |
Definition at line 257 of file qwaylandscreen.cpp.
References geometry(), QWindowSystemInterface::handleScreenGeometryChange(), QWindowSystemInterface::handleScreenOrientationChange(), QWindowSystemInterface::handleScreenRefreshRateChange(), QRect::height(), Qt::InvertedLandscapeOrientation, Qt::InvertedPortraitOrientation, Qt::LandscapeOrientation, m_orientation, mGeometry, mTransform, Qt::PortraitOrientation, refreshRate(), QPlatformScreen::screen(), and QRect::width().
Referenced by maybeInitialize(), and output_done().
|
protected |
Definition at line 324 of file qwaylandscreen.cpp.
References geometry(), QWindowSystemInterface::handleScreenGeometryChange(), Q_ASSERT, and QPlatformScreen::screen().
Referenced by maybeInitialize(), output_done(), and zxdg_output_v1_done().
|
overridevirtual |
Returns a list of all the platform screens that are part of the same virtual desktop.
Screens part of the same virtual desktop share a common coordinate system, and windows can be freely moved between them.
Reimplemented from QPlatformScreen.
Definition at line 147 of file qwaylandscreen.cpp.
References list, mWaylandDisplay, QtWaylandClient::QWaylandDisplay::placeholderScreen(), QList< T >::reserve(), QPlatformScreen::screen(), QtWaylandClient::QWaylandDisplay::screens(), and QList< T >::size().
|
static |
Definition at line 193 of file qwaylandscreen.cpp.
References QPlatformScreen::isPlaceholder(), QPlatformScreen::platformScreenForWindow(), and window().
|
overrideprotected |
Definition at line 303 of file qwaylandscreen.cpp.
References maybeInitialize(), mInitialized, mProcessedEvents, mWaylandDisplay, Q_UNLIKELY, qWarning, updateXdgOutputProperties(), XdgOutputDoneEvent, and QtWaylandClient::QWaylandDisplay::xdgOutputManager().
|
overrideprotected |
Definition at line 293 of file qwaylandscreen.cpp.
References QRect::moveTopLeft(), and mXdgGeometry.
|
overrideprotected |
Definition at line 298 of file qwaylandscreen.cpp.
References mXdgGeometry, and QRect::setSize().
Definition at line 315 of file qwaylandscreen.cpp.
References mInitialized, mOutputName, mProcessedEvents, name(), Q_UNLIKELY, qWarning, and XdgOutputNameEvent.
|
protected |
Definition at line 124 of file qwaylandscreen_p.h.
Referenced by orientation(), and updateOutputProperties().
|
protected |
Definition at line 111 of file qwaylandscreen_p.h.
|
protected |
Definition at line 118 of file qwaylandscreen_p.h.
Referenced by depth().
|
protected |
Definition at line 121 of file qwaylandscreen_p.h.
Referenced by format().
|
protected |
Definition at line 115 of file qwaylandscreen_p.h.
Referenced by geometry(), output_geometry(), output_mode(), and updateOutputProperties().
|
protected |
Definition at line 126 of file qwaylandscreen_p.h.
Referenced by maybeInitialize(), output_done(), zxdg_output_v1_done(), and zxdg_output_v1_name().
|
protected |
Definition at line 113 of file qwaylandscreen_p.h.
Referenced by manufacturer(), and output_geometry().
|
protected |
Definition at line 114 of file qwaylandscreen_p.h.
Referenced by model(), and output_geometry().
|
protected |
Definition at line 123 of file qwaylandscreen_p.h.
Referenced by zxdg_output_v1_name().
|
protected |
Definition at line 122 of file qwaylandscreen_p.h.
Referenced by output_geometry(), and physicalSize().
|
protected |
Definition at line 125 of file qwaylandscreen_p.h.
Referenced by QWaylandScreen(), maybeInitialize(), output_done(), zxdg_output_v1_done(), and zxdg_output_v1_name().
|
protected |
Definition at line 119 of file qwaylandscreen_p.h.
Referenced by output_mode(), and refreshRate().
|
protected |
Definition at line 117 of file qwaylandscreen_p.h.
Referenced by devicePixelRatio(), geometry(), output_scale(), and scale().
|
protected |
Definition at line 120 of file qwaylandscreen_p.h.
Referenced by output_geometry(), and updateOutputProperties().
|
protected |
Definition at line 112 of file qwaylandscreen_p.h.
Referenced by QWaylandScreen(), display(), maybeInitialize(), requiredEvents(), virtualSiblings(), and zxdg_output_v1_done().
|
protected |
Definition at line 116 of file qwaylandscreen_p.h.
Referenced by geometry(), zxdg_output_v1_logical_position(), and zxdg_output_v1_logical_size().