Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#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. | |
QWindow * | topLevelAt (const QPoint &point) const override |
Return the given top level window for a given position. | |
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 |
SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const override |
Returns a hint about this screen's subpixel layout structure. | |
uint32_t | outputId () const |
::wl_output * | output () const override |
Qt::ScreenOrientation | toScreenOrientation (int wlTransform, Qt::ScreenOrientation fallback) const |
Public Member Functions inherited from QPlatformScreen | |
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 | 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 QColorSpace | colorSpace () const |
virtual QDpi | logicalBaseDpi () const |
Reimplement to return the base logical DPI for the platform. | |
virtual Qt::ScreenOrientation | nativeOrientation () const |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
QWindowList | windows () const |
Return all windows residing on this screen. | |
const QPlatformScreen * | screenForPosition (const QPoint &point) const |
Find the sibling screen corresponding to globalPos. | |
QScreen * | screen () const |
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 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 Public Member Functions inherited from QPlatformScreen | |
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 () |
Protected Member Functions inherited from QPlatformScreen | |
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 | mSubpixel = -1 |
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 |
Protected Attributes inherited from QPlatformScreen | |
QScopedPointer< QPlatformScreenPrivate > | d_ptr |
Additional Inherited Members | |
Public Types inherited from QPlatformScreen | |
enum | SubpixelAntialiasingType { Subpixel_None , Subpixel_RGB , Subpixel_BGR , Subpixel_VRGB , Subpixel_VBGR } |
enum | PowerState { PowerStateOn , PowerStateStandby , PowerStateSuspend , PowerStateOff } |
Definition at line 39 of file qwaylandscreen_p.h.
|
protected |
Enumerator | |
---|---|
XdgOutputDoneEvent | |
OutputDoneEvent | |
XdgOutputNameEvent |
Definition at line 94 of file qwaylandscreen_p.h.
QtWaylandClient::QWaylandScreen::QWaylandScreen | ( | QWaylandDisplay * | waylandDisplay, |
int | version, | ||
uint32_t | id ) |
Definition at line 30 of file qwaylandscreen.cpp.
References QtWaylandClient::QWaylandDisplay::forceRoundTrip(), initXdgOutput(), maybeInitialize(), mProcessedEvents, mWaylandDisplay, OutputDoneEvent, and qCWarning.
|
override |
Definition at line 48 of file qwaylandscreen.cpp.
|
overridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 123 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 193 of file qwaylandscreen.cpp.
References mScale.
QWaylandDisplay * QtWaylandClient::QWaylandScreen::display | ( | ) | const |
Definition at line 97 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 128 of file qwaylandscreen.cpp.
References mFormat.
|
static |
Definition at line 244 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 112 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 88 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 141 of file qwaylandscreen.cpp.
References QPlatformScreen::logicalDpi(), qEnvironmentVariable(), qgetenv(), and QStringLiteral.
|
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 102 of file qwaylandscreen.cpp.
References mManufacturer.
void QtWaylandClient::QWaylandScreen::maybeInitialize | ( | ) |
Definition at line 72 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 107 of file qwaylandscreen.cpp.
References mModel.
Referenced by output_geometry().
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 73 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 183 of file qwaylandscreen.cpp.
References m_orientation.
Referenced by toScreenOrientation().
|
inlineoverride |
Definition at line 82 of file qwaylandscreen_p.h.
Referenced by fromWlOutput().
|
overrideprotected |
Definition at line 315 of file qwaylandscreen.cpp.
References maybeInitialize(), mInitialized, mProcessedEvents, OutputDoneEvent, updateOutputProperties(), and updateXdgOutputProperties().
|
overrideprotected |
Definition at line 293 of file qwaylandscreen.cpp.
References mGeometry, mManufacturer, mModel, model(), QRect::moveTopLeft(), mPhysicalSize, mSubpixel, and mTransform.
|
overrideprotected |
Definition at line 280 of file qwaylandscreen.cpp.
References mGeometry, mRefreshRate, QRect::setSize(), and QRect::size().
|
overrideprotected |
Definition at line 310 of file qwaylandscreen.cpp.
References mScale.
|
inline |
Definition at line 81 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 133 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 198 of file qwaylandscreen.cpp.
References mRefreshRate.
Referenced by updateOutputProperties().
|
protected |
Definition at line 58 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 188 of file qwaylandscreen.cpp.
References mScale.
|
overridevirtual |
Returns a hint about this screen's subpixel layout structure.
The default implementation queries the {QT_SUBPIXEL_AA_TYPE} env variable. This is just a hint because most platforms don't have a way to retrieve the correct value from hardware and instead rely on font configurations.
Reimplemented from QPlatformScreen.
Definition at line 210 of file qwaylandscreen.cpp.
References mSubpixel, QPlatformScreen::Subpixel_BGR, QPlatformScreen::Subpixel_None, QPlatformScreen::Subpixel_RGB, QPlatformScreen::Subpixel_VBGR, QPlatformScreen::Subpixel_VRGB, and QPlatformScreen::subpixelAntialiasingTypeHint().
Return the given top level window for a given position.
Default implementation retrieves a list of all top level windows and finds the first window which contains point pos
Reimplemented from QPlatformScreen.
Definition at line 173 of file qwaylandscreen.cpp.
References QtWaylandClient::QWaylandWindow::fixedToplevelPositions, pos, Q_UNUSED, and QPlatformScreen::topLevelAt().
Qt::ScreenOrientation QtWaylandClient::QWaylandScreen::toScreenOrientation | ( | int | wlTransform, |
Qt::ScreenOrientation | fallback ) const |
Definition at line 251 of file qwaylandscreen.cpp.
References QRect::height(), Qt::InvertedLandscapeOrientation, Qt::InvertedPortraitOrientation, Qt::LandscapeOrientation, mGeometry, orientation(), Qt::PortraitOrientation, and QRect::width().
Referenced by updateOutputProperties().
|
protected |
Definition at line 328 of file qwaylandscreen.cpp.
References geometry(), QWindowSystemInterface::handleScreenGeometryChange(), QWindowSystemInterface::handleScreenOrientationChange(), QWindowSystemInterface::handleScreenRefreshRateChange(), m_orientation, mTransform, refreshRate(), QPlatformScreen::screen(), and toScreenOrientation().
Referenced by maybeInitialize(), and output_done().
|
protected |
Definition at line 377 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 154 of file qwaylandscreen.cpp.
References list, mWaylandDisplay, QtWaylandClient::QWaylandDisplay::placeholderScreen(), QList< T >::reserve(), QPlatformScreen::screen(), and QtWaylandClient::QWaylandDisplay::screens().
|
static |
Definition at line 236 of file qwaylandscreen.cpp.
References QPlatformScreen::isPlaceholder(), QPlatformScreen::platformScreenForWindow(), and window().
|
overrideprotected |
Definition at line 356 of file qwaylandscreen.cpp.
References maybeInitialize(), mInitialized, mProcessedEvents, mWaylandDisplay, Q_UNLIKELY, qWarning, updateXdgOutputProperties(), XdgOutputDoneEvent, and QtWaylandClient::QWaylandDisplay::xdgOutputManager().
|
overrideprotected |
Definition at line 346 of file qwaylandscreen.cpp.
References QRect::moveTopLeft(), and mXdgGeometry.
|
overrideprotected |
Definition at line 351 of file qwaylandscreen.cpp.
References mXdgGeometry, and QRect::setSize().
Definition at line 368 of file qwaylandscreen.cpp.
References mInitialized, mOutputName, mProcessedEvents, name(), Q_UNLIKELY, qWarning, and XdgOutputNameEvent.
|
protected |
Definition at line 133 of file qwaylandscreen_p.h.
Referenced by orientation(), and updateOutputProperties().
|
protected |
Definition at line 119 of file qwaylandscreen_p.h.
|
protected |
Definition at line 126 of file qwaylandscreen_p.h.
Referenced by depth().
|
protected |
Definition at line 130 of file qwaylandscreen_p.h.
Referenced by format().
|
protected |
Definition at line 123 of file qwaylandscreen_p.h.
Referenced by geometry(), output_geometry(), output_mode(), and toScreenOrientation().
|
protected |
Definition at line 135 of file qwaylandscreen_p.h.
Referenced by maybeInitialize(), output_done(), zxdg_output_v1_done(), and zxdg_output_v1_name().
|
protected |
Definition at line 121 of file qwaylandscreen_p.h.
Referenced by manufacturer(), and output_geometry().
|
protected |
Definition at line 122 of file qwaylandscreen_p.h.
Referenced by model(), and output_geometry().
|
protected |
Definition at line 132 of file qwaylandscreen_p.h.
Referenced by zxdg_output_v1_name().
|
protected |
Definition at line 131 of file qwaylandscreen_p.h.
Referenced by output_geometry(), and physicalSize().
|
protected |
Definition at line 134 of file qwaylandscreen_p.h.
Referenced by QWaylandScreen(), maybeInitialize(), output_done(), zxdg_output_v1_done(), and zxdg_output_v1_name().
|
protected |
Definition at line 127 of file qwaylandscreen_p.h.
Referenced by output_mode(), and refreshRate().
|
protected |
Definition at line 125 of file qwaylandscreen_p.h.
Referenced by devicePixelRatio(), geometry(), output_scale(), and scale().
|
protected |
Definition at line 128 of file qwaylandscreen_p.h.
Referenced by output_geometry(), and subpixelAntialiasingTypeHint().
|
protected |
Definition at line 129 of file qwaylandscreen_p.h.
Referenced by output_geometry(), and updateOutputProperties().
|
protected |
Definition at line 120 of file qwaylandscreen_p.h.
Referenced by QWaylandScreen(), display(), maybeInitialize(), requiredEvents(), virtualSiblings(), and zxdg_output_v1_done().
|
protected |
Definition at line 124 of file qwaylandscreen_p.h.
Referenced by geometry(), zxdg_output_v1_logical_position(), and zxdg_output_v1_logical_size().