![]() |
Qt 6.x
The Qt SDK
|
#include <qxcbscreen.h>
Public Member Functions | |
QXcbScreen (QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo) | |
QXcbScreen (QXcbConnection *connection, QXcbVirtualDesktop *virtualDesktop, xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp=XCB_NONE) | |
~QXcbScreen () | |
QString | getOutputName (xcb_randr_get_output_info_reply_t *outputInfo) |
QString | getName (xcb_randr_monitor_info_t *monitorInfo) |
QPixmap | grabWindow (WId window, 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. | |
QWindow * | topLevelAt (const QPoint &point) const override |
Return the given top level window for a given position. | |
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. | |
QRect | geometry () const override |
Reimplement in subclass to return the pixel geometry of the screen. | |
QRect | availableGeometry () const override |
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. | |
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. | |
QColorSpace | colorSpace () const override |
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. | |
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. | |
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. | |
QList< QPlatformScreen * > | virtualSiblings () const override |
Returns a list of all the platform screens that are part of the same virtual desktop. | |
QXcbVirtualDesktop * | virtualDesktop () const |
void | setPrimary (bool primary) |
bool | isPrimary () const |
int | screenNumber () const |
int | virtualDesktopNumber () const override |
xcb_screen_t * | screen () const |
xcb_window_t | root () const |
xcb_randr_output_t | output () const |
xcb_randr_crtc_t | crtc () const |
xcb_randr_mode_t | mode () const |
QList< xcb_randr_output_t > | outputs () const |
QList< xcb_randr_crtc_t > | crtcs () const |
void | setOutput (xcb_randr_output_t outputId, xcb_randr_get_output_info_reply_t *outputInfo) |
void | setCrtc (xcb_randr_crtc_t crtc) |
void | setMonitor (xcb_randr_monitor_info_t *monitorInfo, xcb_timestamp_t timestamp=XCB_NONE) |
QString | defaultName () |
bool | isPrimaryInXScreen () |
void | windowShown (QXcbWindow *window) |
QString | windowManagerName () const |
QSurfaceFormat | surfaceFormatFor (const QSurfaceFormat &format) const |
const xcb_visualtype_t * | visualForFormat (const QSurfaceFormat &format) const |
const xcb_visualtype_t * | visualForId (xcb_visualid_t visualid) const |
xcb_colormap_t | colormapForVisual (xcb_visualid_t visualid) const |
quint8 | depthOfVisual (xcb_visualid_t visualid) const |
QString | name () const override |
void | updateGeometry (const QRect &geometry, uint8_t rotation) |
void | updateGeometry (xcb_timestamp_t timestamp=XCB_TIME_CURRENT_TIME) |
void | updateAvailableGeometry () |
void | updateRefreshRate (xcb_randr_mode_t mode) |
QFontEngine::HintStyle | hintStyle () const |
QFontEngine::SubpixelAntialiasingType | subpixelType () const |
int | antialiasingEnabled () const |
QXcbXSettings * | xSettings () const |
![]() | |
QXcbObject (QXcbConnection *connection=nullptr) | |
void | setConnection (QXcbConnection *connection) |
QXcbConnection * | connection () const |
xcb_atom_t | atom (QXcbAtom::Atom atom) const |
xcb_connection_t * | xcb_connection () const |
![]() | |
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. | |
Friends | |
class | QXcbConnection |
class | QXcbVirtualDesktop |
Definition at line 111 of file qxcbscreen.h.
QXcbScreen::QXcbScreen | ( | QXcbConnection * | connection, |
QXcbVirtualDesktop * | virtualDesktop, | ||
xcb_randr_output_t | outputId, | ||
xcb_randr_get_output_info_reply_t * | outputInfo | ||
) |
Definition at line 493 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::availableGeometry(), QXcbObject::connection(), crtc(), QXcbBasicConnection::isAtLeastXRandR12(), QRect::isEmpty(), QSizeF::isEmpty(), output(), QXcbVirtualDesktop::physicalSize(), Q_XCB_REPLY_UNCHECKED, root(), screen(), QXcbVirtualDesktop::size(), updateGeometry(), updateRefreshRate(), virtualDesktop(), and QXcbObject::xcb_connection().
QXcbScreen::QXcbScreen | ( | QXcbConnection * | connection, |
QXcbVirtualDesktop * | virtualDesktop, | ||
xcb_randr_monitor_info_t * | monitorInfo, | ||
xcb_timestamp_t | timestamp = XCB_NONE |
||
) |
Definition at line 582 of file qxcbscreen.cpp.
References setMonitor().
QXcbScreen::~QXcbScreen | ( | ) |
Definition at line 714 of file qxcbscreen.cpp.
|
inline |
Definition at line 187 of file qxcbscreen.h.
Referenced by QXcbNativeInterface::nativeResourceForScreen().
|
overridevirtual |
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.
Reimplemented from QPlatformScreen.
Definition at line 839 of file qxcbscreen.cpp.
References qEnvironmentVariableIsEmpty(), QList< T >::size(), and virtualSiblings().
Referenced by updateAvailableGeometry().
|
inline |
Definition at line 175 of file qxcbscreen.h.
Referenced by QXcbWindow::create().
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 136 of file qxcbscreen.h.
|
inline |
Definition at line 155 of file qxcbscreen.h.
Referenced by QXcbScreen(), setMonitor(), and updateGeometry().
|
inline |
Definition at line 159 of file qxcbscreen.h.
|
overridevirtual |
Reimplement this function in subclass to return the cursor of the screen.
The default implementation returns \nullptr.
Reimplemented from QPlatformScreen.
Definition at line 880 of file qxcbscreen.cpp.
Referenced by QXcbWindow::hide().
QString QXcbScreen::defaultName | ( | ) |
Definition at line 691 of file qxcbscreen.cpp.
References QXcbObject::connection(), QXcbBasicConnection::displayName(), displayName(), QString::fromLocal8Bit(), QString::lastIndexOf(), name(), QXcbVirtualDesktop::number(), QString::number(), and QString::truncate().
Referenced by getOutputName(), and setMonitor().
|
inlineoverridevirtual |
Reimplement in subclass to return current depth of the screen.
Implements QPlatformScreen.
Definition at line 134 of file qxcbscreen.h.
References screen.
|
inline |
Definition at line 176 of file qxcbscreen.h.
Referenced by QXcbSystemTrayBackingStore::QXcbSystemTrayBackingStore(), and QXcbWindow::create().
|
overridevirtual |
Reimplement in subclass to return the image format which corresponds to the screen format.
Implements QPlatformScreen.
Definition at line 847 of file qxcbscreen.cpp.
References QXcbObject::connection(), format(), QImage::Format_Invalid, QImage::Format_RGB32, qt_xcb_imageFormatForVisual(), screen(), and visualForId().
Referenced by format().
|
inlineoverridevirtual |
Reimplement in subclass to return the pixel geometry of the screen.
Implements QPlatformScreen.
Definition at line 132 of file qxcbscreen.h.
Referenced by updateGeometry().
QString QXcbScreen::getName | ( | xcb_randr_monitor_info_t * | monitorInfo | ) |
Definition at line 730 of file qxcbscreen.cpp.
References QXcbBasicConnection::atomName(), ba, QXcbObject::connection(), QByteArray::constData(), QXcbBasicConnection::displayName(), displayName(), QString::fromLatin1(), QString::fromLocal8Bit(), QByteArray::isEmpty(), QString::lastIndexOf(), name(), QXcbVirtualDesktop::number(), QString::number(), and QString::truncate().
Referenced by setMonitor().
QString QXcbScreen::getOutputName | ( | xcb_randr_get_output_info_reply_t * | outputInfo | ) |
Definition at line 718 of file qxcbscreen.cpp.
References defaultName(), QString::fromUtf8(), and name().
Referenced by setOutput().
|
overridevirtual |
This function is called when Qt needs to be able to grab the content of a window.
Returns the content of the window specified with the WId handle within the boundaries of QRect(x,y,width,height).
Reimplemented from QPlatformScreen.
Definition at line 997 of file qxcbscreen.cpp.
References QXcbObject::connection(), QSize::height(), pixmap, Q_XCB_REPLY_UNCHECKED, qt_xcb_pixmapFromXPixmap(), root(), screen(), QRect::size(), translate(), QSize::width(), window(), QRect::x(), QXcbObject::xcb_connection(), and QRect::y().
|
inline |
Definition at line 185 of file qxcbscreen.h.
Referenced by QXcbNativeInterface::nativeResourceForScreen().
|
inline |
Definition at line 147 of file qxcbscreen.h.
Referenced by isPrimaryInXScreen().
bool QXcbScreen::isPrimaryInXScreen | ( | ) |
Definition at line 703 of file qxcbscreen.cpp.
References QXcbObject::connection(), QListSpecialMethodsBase< T >::contains(), isPrimary(), Q_XCB_REPLY, qWarning, root(), and QXcbObject::xcb_connection().
Referenced by setMonitor().
|
inlineoverridevirtual |
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 139 of file qxcbscreen.h.
|
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 866 of file qxcbscreen.cpp.
|
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 747 of file qxcbscreen.cpp.
References QEdidParser::manufacturer.
|
inline |
Definition at line 156 of file qxcbscreen.h.
Referenced by setMonitor(), and updateRefreshRate().
|
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 752 of file qxcbscreen.cpp.
References QEdidParser::model.
|
inlineoverridevirtual |
Reimplemented from QPlatformScreen.
Definition at line 178 of file qxcbscreen.h.
Referenced by defaultName(), getName(), and getOutputName().
|
inlineoverridevirtual |
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 142 of file qxcbscreen.h.
|
inline |
Definition at line 154 of file qxcbscreen.h.
Referenced by QXcbScreen(), and setMonitor().
|
inline |
Definition at line 158 of file qxcbscreen.h.
Referenced by setMonitor().
|
inlineoverridevirtual |
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 137 of file qxcbscreen.h.
|
inlineoverridevirtual |
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 141 of file qxcbscreen.h.
|
inline |
Definition at line 153 of file qxcbscreen.h.
References screen.
Referenced by QXcbScreen(), QXcbWindow::create(), grabWindow(), QXcbWindow::handleClientMessageEvent(), QXcbWindow::hide(), isPrimaryInXScreen(), QXcbNativeInterface::nativeResourceForScreen(), setMonitor(), QXcbWindow::setParent(), topLevelAt(), and updateRefreshRate().
|
inline |
Definition at line 152 of file qxcbscreen.h.
Referenced by QXcbScreen(), QXcbWindow::create(), QXcbEglWindow::createVisual(), format(), grabWindow(), QXcbClipboard::requestor(), setMonitor(), topLevelAt(), QXcbCursor::updateContext(), updateRefreshRate(), and QXcbSystemTrayTracker::visualId().
|
inline |
Definition at line 149 of file qxcbscreen.h.
Referenced by QGLXPbuffer::QGLXPbuffer(), QXcbGlxWindow::createVisual(), and QXcbConnection::primaryScreen().
|
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 757 of file qxcbscreen.cpp.
References QEdidParser::serialNumber.
|
inline |
Definition at line 163 of file qxcbscreen.h.
void QXcbScreen::setMonitor | ( | xcb_randr_monitor_info_t * | monitorInfo, |
xcb_timestamp_t | timestamp = XCB_NONE |
||
) |
Definition at line 592 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::availableGeometry(), QList< T >::clear(), QXcbObject::connection(), crtc(), defaultName(), QString::fromUtf8(), getName(), i, QRect::isEmpty(), QSizeF::isEmpty(), isPrimaryInXScreen(), mode(), number, output(), outputs(), QXcbVirtualDesktop::physicalSize(), Q_XCB_REPLY, Q_XCB_REPLY_UNCHECKED, qCDebug, qPrintable, root(), screen(), QList< T >::size(), updateGeometry(), updateRefreshRate(), virtualDesktop(), and QXcbObject::xcb_connection().
Referenced by QXcbScreen().
void QXcbScreen::setOutput | ( | xcb_randr_output_t | outputId, |
xcb_randr_get_output_info_reply_t * | outputInfo | ||
) |
Definition at line 885 of file qxcbscreen.cpp.
References getOutputName().
|
inline |
Definition at line 146 of file qxcbscreen.h.
|
inline |
Definition at line 186 of file qxcbscreen.h.
Referenced by QXcbNativeInterface::nativeResourceForScreen().
QSurfaceFormat QXcbScreen::surfaceFormatFor | ( | const QSurfaceFormat & | format | ) | const |
Definition at line 803 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::surfaceFormatFor().
Referenced by QXcbWindow::create().
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 762 of file qxcbscreen.cpp.
References child, QXcbObject::connection(), parent, QXcbConnection::platformWindowFromId(), Q_XCB_REPLY_UNCHECKED, root(), screen(), QPlatformWindow::window(), and QXcbObject::xcb_connection().
void QXcbScreen::updateAvailableGeometry | ( | ) |
Definition at line 947 of file qxcbscreen.cpp.
References availableGeometry(), QXcbVirtualDesktop::availableGeometry(), QWindowSystemInterface::handleScreenGeometryChange(), and QPlatformScreen::screen().
Definition at line 907 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::availableGeometry(), QXcbVirtualDesktop::dpi(), geometry(), QWindowSystemInterface::handleScreenGeometryChange(), QWindowSystemInterface::handleScreenOrientationChange(), Qt::InvertedLandscapeOrientation, Qt::InvertedPortraitOrientation, QSizeF::isEmpty(), Qt::LandscapeOrientation, Qt::PortraitOrientation, QPlatformScreen::screen(), QRect::size(), sizeInMillimeters(), and QSizeF::transposed().
Referenced by QXcbScreen(), setMonitor(), and updateGeometry().
void QXcbScreen::updateGeometry | ( | xcb_timestamp_t | timestamp = XCB_TIME_CURRENT_TIME | ) |
Definition at line 896 of file qxcbscreen.cpp.
References QXcbObject::connection(), crtc(), Q_XCB_REPLY_UNCHECKED, updateGeometry(), and QXcbObject::xcb_connection().
void QXcbScreen::updateRefreshRate | ( | xcb_randr_mode_t | mode | ) |
Definition at line 956 of file qxcbscreen.cpp.
References QXcbObject::connection(), QWindowSystemInterface::handleScreenRefreshRateChange(), mode(), Q_XCB_REPLY_UNCHECKED, root(), QPlatformScreen::screen(), screen(), and QXcbObject::xcb_connection().
Referenced by QXcbScreen(), and setMonitor().
|
inline |
Definition at line 144 of file qxcbscreen.h.
Referenced by QXcbScreen(), QXcbNativeInterface::nativeResourceForScreen(), and setMonitor().
|
inlineoverride |
Definition at line 150 of file qxcbscreen.h.
|
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 143 of file qxcbscreen.h.
Referenced by availableGeometry(), and QXcbWindow::hide().
|
inline |
Definition at line 173 of file qxcbscreen.h.
Referenced by QXcbWindow::createVisual().
const xcb_visualtype_t * QXcbScreen::visualForId | ( | xcb_visualid_t | visualid | ) | const |
Definition at line 808 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::visualForId().
Referenced by QXcbWindow::create(), QXcbEglWindow::createVisual(), QXcbGlxWindow::createVisual(), and format().
|
inline |
Definition at line 169 of file qxcbscreen.h.
void QXcbScreen::windowShown | ( | QXcbWindow * | window | ) |
Definition at line 794 of file qxcbscreen.cpp.
References QXcbObject::connection(), QByteArrayLiteral, QXcbConnection::setStartupId(), and window().
Referenced by QXcbWindow::handleXEmbedMessage(), and QXcbWindow::show().
QXcbXSettings * QXcbScreen::xSettings | ( | ) | const |
Definition at line 1070 of file qxcbscreen.cpp.
References QXcbVirtualDesktop::xSettings().
Referenced by QXcbCursor::~QXcbCursor(), and QXcbIntegration::initialize().
|
friend |
Definition at line 222 of file qxcbscreen.h.
|
friend |
Definition at line 223 of file qxcbscreen.h.