![]() |
Qt 6.x
The Qt SDK
|
#include <qeglfskmsscreen_p.h>
Public Member Functions | |
QEglFSKmsScreen (QEglFSKmsDevice *device, const QKmsOutput &output, bool headless=false) | |
~QEglFSKmsScreen () | |
void | setVirtualPosition (const QPoint &pos) |
QRect | rawGeometry () const override |
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. | |
QDpi | logicalBaseDpi () const override |
Reimplement to return the base logical DPI for the platform. | |
Qt::ScreenOrientation | nativeOrientation () const override |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
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. | |
QString | name () const override |
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. | |
QString | serialNumber () const override |
Reimplement this function in subclass to return the serial number of this screen. | |
qreal | refreshRate () const override |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
QList< QPlatformScreen * > | virtualSiblings () const override |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
void | setVirtualSiblings (QList< QPlatformScreen * > sl) |
QList< QPlatformScreen::Mode > | modes () const override |
Reimplement this function in subclass to return the list of modes for this screen. | |
int | currentMode () const override |
Reimplement this function in subclass to return the index of the current mode from the modes list. | |
int | preferredMode () const override |
Reimplement this function in subclass to return the preferred mode index from the modes list. | |
QEglFSKmsDevice * | device () const |
virtual void | waitForFlip () |
QKmsOutput & | output () |
void | restoreMode () |
SubpixelAntialiasingType | subpixelAntialiasingTypeHint () const override |
Returns a hint about this screen's subpixel layout structure. | |
QPlatformScreen::PowerState | powerState () const override |
Returns the current power state. | |
void | setPowerState (QPlatformScreen::PowerState state) override |
Sets the power state for this screen. | |
bool | isCursorOutOfRange () const |
void | setCursorOutOfRange (bool b) |
virtual void | pageFlipped (unsigned int sequence, unsigned int tv_sec, unsigned int tv_usec) |
![]() | |
QEglFSScreen (EGLDisplay display) | |
~QEglFSScreen () | |
QRect | geometry () const override |
Reimplement in subclass to return the pixel geometry of the screen. | |
virtual QRect | rawGeometry () const |
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. | |
QDpi | logicalBaseDpi () const override |
Reimplement to return the base logical DPI for the platform. | |
Qt::ScreenOrientation | nativeOrientation () const override |
Reimplement this function in subclass to return the native orientation of the screen, e.g. | |
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. | |
QPlatformCursor * | cursor () const override |
Reimplement this function in subclass to return the cursor of the screen. | |
qreal | refreshRate () const override |
Reimplement this function in subclass to return the vertical refresh rate of the screen, in Hz. | |
QPixmap | grabWindow (WId wid, int x, int y, int width, int height) const override |
This function is called when Qt needs to be able to grab the content of a window. | |
EGLSurface | primarySurface () const |
EGLDisplay | display () const |
void | handleCursorMove (const QPoint &pos) |
QWindow * | topLevelAt (const QPoint &point) const override |
Return the given top level window for a given position. | |
![]() | |
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. | |
Protected Attributes | |
QEglFSKmsDevice * | m_device |
QKmsOutput | m_output |
QEdidParser | m_edid |
QPoint | m_pos |
bool | m_cursorOutOfRange |
QList< QPlatformScreen * > | m_siblings |
PowerState | m_powerState |
QEglFSKmsInterruptHandler * | m_interruptHandler |
bool | m_headless |
![]() | |
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 } |
![]() | |
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) |
![]() | |
void | resizeMaximizedWindows () |
Convenience method to resize all the maximized and fullscreen windows of this platform screen. | |
Definition at line 32 of file qeglfskmsscreen_p.h.
QEglFSKmsScreen::QEglFSKmsScreen | ( | QEglFSKmsDevice * | device, |
const QKmsOutput & | output, | ||
bool | headless = false |
||
) |
Definition at line 36 of file qeglfskmsscreen.cpp.
References QByteArray::constData(), QKmsOutput::edid_blob, QSizeF::height(), QEdidParser::identifier, m_edid, m_output, m_siblings, QEdidParser::manufacturer, QEdidParser::model, name(), QEdidParser::parse(), QEdidParser::physicalSize, qCDebug, QEdidParser::serialNumber, QString::toLatin1(), and QSizeF::width().
QEglFSKmsScreen::~QEglFSKmsScreen | ( | ) |
Definition at line 64 of file qeglfskmsscreen.cpp.
References QKmsOutput::cleanup(), m_device, m_interruptHandler, and m_output.
|
overridevirtual |
Reimplement this function in subclass to return the index of the current mode from the modes list.
The default implementation returns 0.
Reimplemented from QPlatformScreen.
Definition at line 195 of file qeglfskmsscreen.cpp.
References m_output, and QKmsOutput::mode.
Referenced by QEglFSKmsGbmScreen::ensureModeSet(), and QEglFSKmsEglDeviceScreen::waitForFlip().
|
overridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 87 of file qeglfskmsscreen.cpp.
References format(), and QImage::Format_RGB16.
|
inline |
Definition at line 67 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsEglDeviceScreen::~QEglFSKmsEglDeviceScreen(), QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor(), QEglFSKmsGbmScreen::~QEglFSKmsGbmScreen(), QEglFSKmsVsp2Screen::blendAndFlipDrm(), QEglFSKmsGbmScreen::bufferDestroyedHandler(), QEglFSKmsGbmCursor::changeCursor(), QEglFSKmsVsp2Screen::createSurface(), QEglFSKmsGbmScreen::createSurface(), QEglFSKmsGbmScreen::cursor(), QEglFSKmsEglDeviceScreen::cursor(), QEglFSKmsGbmScreen::ensureModeSet(), QEglFSKmsGbmScreen::flip(), QEglFSKmsGbmScreen::framebufferForBufferObject(), QEglFSKmsGbmCursor::setPos(), QEglFSKmsGbmScreen::waitForFlip(), QEglFSKmsEglDeviceScreen::waitForFlip(), and QEglFSKmsGbmScreen::waitForFlipWithEventReader().
|
overridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 92 of file qeglfskmsscreen.cpp.
References QKmsOutput::drm_format, DRM_FORMAT_ABGR8888, DRM_FORMAT_RGB565, QImage::Format_A2BGR30_Premultiplied, QImage::Format_A2RGB30_Premultiplied, QImage::Format_ARGB32, QImage::Format_BGR30, QImage::Format_RGB16, QImage::Format_RGB30, QImage::Format_RGB32, and m_output.
Referenced by depth().
|
inline |
Definition at line 79 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsGbmCursor::changeCursor(), and QEglFSKmsGbmCursor::setPos().
|
overridevirtual |
Reimplement to return the base logical DPI for the platform.
This DPI value should correspond to a standard-DPI (1x) display. The default implementation returns 96.
QtGui will use this value (together with logicalDpi) to compute the scale factor when high-DPI scaling is enabled, as follows: factor = logicalDPI / baseDPI
Reimplemented from QPlatformScreen.
Definition at line 130 of file qeglfskmsscreen.cpp.
Referenced by logicalDpi().
|
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 125 of file qeglfskmsscreen.cpp.
References logicalBaseDpi().
|
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 150 of file qeglfskmsscreen.cpp.
References m_edid, and QEdidParser::manufacturer.
|
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 155 of file qeglfskmsscreen.cpp.
References QEdidParser::identifier, QString::isEmpty(), m_edid, and QEdidParser::model.
|
overridevirtual |
Reimplement this function in subclass to return the list of modes for this screen.
The default implementation returns a list with only one mode from the current screen size and refresh rate.
Reimplemented from QPlatformScreen.
Definition at line 183 of file qeglfskmsscreen.cpp.
References QList< T >::append(), info, list, m_output, QKmsOutput::modes, QList< T >::reserve(), and QList< T >::size().
|
overridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 145 of file qeglfskmsscreen.cpp.
References m_headless, m_output, QKmsOutput::name, and QStringLiteral.
Referenced by QEglFSKmsScreen(), QEglFSKmsGbmCursor::changeCursor(), QEglFSKmsVsp2Screen::createSurface(), QEglFSKmsGbmScreen::createSurface(), QEglFSKmsGbmScreen::ensureModeSet(), QEglFSKmsGbmScreen::flip(), QEglFSKmsGbmScreen::initCloning(), and QEglFSKmsGbmCursor::setPos().
|
overridevirtual |
Reimplement this function in subclass to return the native orientation of the screen, e.g.
the orientation where the logo sticker of the device appears the right way up.
The default implementation returns Qt::PrimaryOrientation.
Reimplemented from QPlatformScreen.
Definition at line 135 of file qeglfskmsscreen.cpp.
References Qt::PrimaryOrientation.
|
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 140 of file qeglfskmsscreen.cpp.
References Qt::PrimaryOrientation.
|
inline |
Definition at line 71 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor(), QEglFSKmsGbmCursor::changeCursor(), QEglFSKmsGbmScreen::ensureModeSet(), QEglFSKmsGbmScreen::flip(), QEglFSKmsIntegration::nativeResourceForScreen(), QEglFSKmsEglDeviceWindow::resetSurface(), QEglFSKmsGbmCursor::setPos(), and QEglFSKmsEglDeviceScreen::waitForFlip().
|
virtual |
Definition at line 223 of file qeglfskmsscreen.cpp.
References Q_UNUSED.
|
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 115 of file qeglfskmsscreen.cpp.
References QEglFSScreen::geometry(), QSizeF::isEmpty(), m_output, QKmsOutput::physical_size, and QRect::size().
|
overridevirtual |
Returns the current power state.
The default implementation always returns PowerStateOn.
Reimplemented from QPlatformScreen.
Definition at line 210 of file qeglfskmsscreen.cpp.
References m_powerState.
|
overridevirtual |
Reimplement this function in subclass to return the preferred mode index from the modes list.
The default implementation returns 0.
Reimplemented from QPlatformScreen.
Definition at line 200 of file qeglfskmsscreen.cpp.
References m_output, and QKmsOutput::preferred_mode.
|
overridevirtual |
Reimplemented from QEglFSScreen.
Definition at line 77 of file qeglfskmsscreen.cpp.
References QKmsScreenConfig::headlessSize(), QSize::height(), m_device, m_headless, m_output, m_pos, QKmsDevice::screenConfig(), QKmsOutput::size, QSize::width(), QPoint::x(), and QPoint::y().
Referenced by QEglFSKmsVsp2Screen::createSurface(), QEglFSKmsGbmScreen::createSurface(), QEglFSKmsVsp2Screen::initQtLayer(), QEglFSKmsVsp2Screen::initVsp2(), and QEglFSKmsEglDeviceWindow::resetSurface().
|
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 174 of file qeglfskmsscreen.cpp.
References m_headless, m_output, QKmsOutput::mode, and QKmsOutput::modes.
void QEglFSKmsScreen::restoreMode | ( | ) |
Definition at line 169 of file qeglfskmsscreen.cpp.
References m_device, m_output, and QKmsOutput::restoreMode().
|
overridevirtual |
Reimplement this function in subclass to return the serial number of this screen.
The default implementation returns an empty string.
Reimplemented from QPlatformScreen.
Definition at line 160 of file qeglfskmsscreen.cpp.
References m_edid, and QEdidParser::serialNumber.
|
inline |
Definition at line 80 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsGbmCursor::setPos().
|
overridevirtual |
Sets the power state for this screen.
Reimplemented from QPlatformScreen.
Definition at line 215 of file qeglfskmsscreen.cpp.
References m_device, m_output, m_powerState, QKmsOutput::setPowerState(), and state.
Referenced by QEglFSKmsGbmScreen::ensureModeSet().
Definition at line 70 of file qeglfskmsscreen.cpp.
Referenced by QEglFSKmsDevice::registerScreen().
|
inline |
Definition at line 60 of file qeglfskmsscreen_p.h.
|
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 205 of file qeglfskmsscreen.cpp.
References m_output, and QKmsOutput::subpixelAntialiasingTypeHint().
|
inlineoverridevirtual |
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 59 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsGbmCursor::~QEglFSKmsGbmCursor(), QEglFSKmsGbmCursor::changeCursor(), and QEglFSKmsGbmCursor::setPos().
|
virtual |
Reimplemented in QEglFSKmsGbmScreen, and QEglFSKmsEglDeviceScreen.
Definition at line 165 of file qeglfskmsscreen.cpp.
|
protected |
Definition at line 89 of file qeglfskmsscreen_p.h.
|
protected |
Definition at line 84 of file qeglfskmsscreen_p.h.
Referenced by ~QEglFSKmsScreen(), rawGeometry(), restoreMode(), and setPowerState().
|
protected |
Definition at line 87 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsScreen(), manufacturer(), model(), and serialNumber().
|
protected |
Definition at line 97 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsGbmScreen::flip(), name(), rawGeometry(), refreshRate(), and QEglFSKmsGbmScreen::waitForFlip().
|
protected |
Definition at line 95 of file qeglfskmsscreen_p.h.
Referenced by ~QEglFSKmsScreen().
|
protected |
Definition at line 86 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsScreen(), ~QEglFSKmsScreen(), QEglFSKmsVsp2Screen::createSurface(), QEglFSKmsGbmScreen::createSurface(), currentMode(), format(), QEglFSKmsVsp2Screen::initQtLayer(), modes(), name(), physicalSize(), preferredMode(), rawGeometry(), refreshRate(), restoreMode(), setPowerState(), and subpixelAntialiasingTypeHint().
|
protected |
Definition at line 88 of file qeglfskmsscreen_p.h.
Referenced by rawGeometry(), and setVirtualPosition().
|
protected |
Definition at line 93 of file qeglfskmsscreen_p.h.
Referenced by powerState(), and setPowerState().
|
protected |
Definition at line 91 of file qeglfskmsscreen_p.h.
Referenced by QEglFSKmsScreen().