Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QXcbScreen Class Reference

#include <qxcbscreen.h>

Inheritance diagram for QXcbScreen:
Collaboration diagram for QXcbScreen:

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.
QWindowtopLevelAt (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.
QPlatformCursorcursor () 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.
QXcbVirtualDesktopvirtualDesktop () 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
QXcbXSettingsxSettings () const
Public Member Functions inherited from QXcbObject
 QXcbObject (QXcbConnection *connection=nullptr)
void setConnection (QXcbConnection *connection)
QXcbConnectionconnection () const
xcb_atom_t atom (QXcbAtom::Atom atom) const
xcb_connection_t * xcb_connection () const
Public Member Functions inherited from QPlatformScreen
 QPlatformScreen ()
virtual ~QPlatformScreen ()
virtual bool isPlaceholder () const
virtual qreal devicePixelRatio () const
 Reimplement this function in subclass to return the device pixel ratio for the screen.
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 QPlatformScreenscreenForPosition (const QPoint &point) const
 Find the sibling screen corresponding to globalPos.
QScreenscreen () const
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< Modemodes () 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

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 }
Static Public Member Functions inherited from QPlatformScreen
static QPlatformScreenplatformScreenForWindow (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 Member Functions inherited from QPlatformScreen
void resizeMaximizedWindows ()
 Convenience method to resize all the maximized and fullscreen windows of this platform screen.
Protected Attributes inherited from QPlatformScreen
QScopedPointer< QPlatformScreenPrivated_ptr

Detailed Description

Definition at line 111 of file qxcbscreen.h.

Constructor & Destructor Documentation

◆ QXcbScreen() [1/2]

QXcbScreen::QXcbScreen ( QXcbConnection * connection,
QXcbVirtualDesktop * virtualDesktop,
xcb_randr_output_t outputId,
xcb_randr_get_output_info_reply_t * outputInfo )

Definition at line 491 of file qxcbscreen.cpp.

◆ QXcbScreen() [2/2]

QXcbScreen::QXcbScreen ( QXcbConnection * connection,
QXcbVirtualDesktop * virtualDesktop,
xcb_randr_monitor_info_t * monitorInfo,
xcb_timestamp_t timestamp = XCB_NONE )

Definition at line 579 of file qxcbscreen.cpp.

◆ ~QXcbScreen()

QXcbScreen::~QXcbScreen ( )

Definition at line 713 of file qxcbscreen.cpp.

Member Function Documentation

◆ antialiasingEnabled()

int QXcbScreen::antialiasingEnabled ( ) const
inline

Definition at line 187 of file qxcbscreen.h.

◆ availableGeometry()

QRect QXcbScreen::availableGeometry ( ) const
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 838 of file qxcbscreen.cpp.

◆ colormapForVisual()

xcb_colormap_t QXcbScreen::colormapForVisual ( xcb_visualid_t visualid) const
inline

Definition at line 175 of file qxcbscreen.h.

◆ colorSpace()

QColorSpace QXcbScreen::colorSpace ( ) const
inlineoverridevirtual

Reimplemented from QPlatformScreen.

Definition at line 136 of file qxcbscreen.h.

◆ crtc()

xcb_randr_crtc_t QXcbScreen::crtc ( ) const
inline

Definition at line 155 of file qxcbscreen.h.

◆ crtcs()

QList< xcb_randr_crtc_t > QXcbScreen::crtcs ( ) const
inline

Definition at line 159 of file qxcbscreen.h.

◆ cursor()

QPlatformCursor * QXcbScreen::cursor ( ) const
overridevirtual

Reimplement this function in subclass to return the cursor of the screen.

The default implementation returns \nullptr.

Reimplemented from QPlatformScreen.

Definition at line 879 of file qxcbscreen.cpp.

◆ defaultName()

QString QXcbScreen::defaultName ( )

Definition at line 690 of file qxcbscreen.cpp.

◆ depth()

int QXcbScreen::depth ( ) const
inlineoverridevirtual

Reimplement in subclass to return current depth of the screen.

Implements QPlatformScreen.

Definition at line 134 of file qxcbscreen.h.

◆ depthOfVisual()

quint8 QXcbScreen::depthOfVisual ( xcb_visualid_t visualid) const
inline

Definition at line 176 of file qxcbscreen.h.

◆ format()

QImage::Format QXcbScreen::format ( ) const
overridevirtual

Reimplement in subclass to return the image format which corresponds to the screen format.

Implements QPlatformScreen.

Definition at line 846 of file qxcbscreen.cpp.

◆ geometry()

QRect QXcbScreen::geometry ( ) const
inlineoverridevirtual

Reimplement in subclass to return the pixel geometry of the screen.

Implements QPlatformScreen.

Definition at line 132 of file qxcbscreen.h.

◆ getName()

QString QXcbScreen::getName ( xcb_randr_monitor_info_t * monitorInfo)

Definition at line 729 of file qxcbscreen.cpp.

◆ getOutputName()

QString QXcbScreen::getOutputName ( xcb_randr_get_output_info_reply_t * outputInfo)

Definition at line 717 of file qxcbscreen.cpp.

◆ grabWindow()

QPixmap QXcbScreen::grabWindow ( WId window,
int x,
int y,
int width,
int height ) const
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 996 of file qxcbscreen.cpp.

◆ hintStyle()

QFontEngine::HintStyle QXcbScreen::hintStyle ( ) const
inline

Definition at line 185 of file qxcbscreen.h.

◆ isPrimary()

bool QXcbScreen::isPrimary ( ) const
inline

Definition at line 147 of file qxcbscreen.h.

◆ isPrimaryInXScreen()

bool QXcbScreen::isPrimaryInXScreen ( )

Definition at line 702 of file qxcbscreen.cpp.

◆ logicalBaseDpi()

QDpi QXcbScreen::logicalBaseDpi ( ) const
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.

◆ logicalDpi()

QDpi QXcbScreen::logicalDpi ( ) const
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.

See also
physicalSize

Reimplemented from QPlatformScreen.

Definition at line 865 of file qxcbscreen.cpp.

◆ manufacturer()

QString QXcbScreen::manufacturer ( ) const
overridevirtual

Reimplement this function in subclass to return the manufacturer of this screen.

The default implementation returns an empty string.

Since
5.9

Reimplemented from QPlatformScreen.

Definition at line 746 of file qxcbscreen.cpp.

◆ mode()

xcb_randr_mode_t QXcbScreen::mode ( ) const
inline

Definition at line 156 of file qxcbscreen.h.

◆ model()

QString QXcbScreen::model ( ) const
overridevirtual

Reimplement this function in subclass to return the model of this screen.

The default implementation returns an empty string.

Since
5.9

Reimplemented from QPlatformScreen.

Definition at line 751 of file qxcbscreen.cpp.

◆ name()

QString QXcbScreen::name ( ) const
inlineoverridevirtual

Reimplemented from QPlatformScreen.

Definition at line 178 of file qxcbscreen.h.

◆ orientation()

Qt::ScreenOrientation QXcbScreen::orientation ( ) const
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.

◆ output()

xcb_randr_output_t QXcbScreen::output ( ) const
inline

Definition at line 154 of file qxcbscreen.h.

◆ outputs()

QList< xcb_randr_output_t > QXcbScreen::outputs ( ) const
inline

Definition at line 158 of file qxcbscreen.h.

◆ physicalSize()

QSizeF QXcbScreen::physicalSize ( ) const
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.

See also
logcalDpi

Reimplemented from QPlatformScreen.

Definition at line 137 of file qxcbscreen.h.

◆ refreshRate()

qreal QXcbScreen::refreshRate ( ) const
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.

◆ root()

xcb_window_t QXcbScreen::root ( ) const
inline

Definition at line 153 of file qxcbscreen.h.

◆ screen()

xcb_screen_t * QXcbScreen::screen ( ) const
inline

Definition at line 152 of file qxcbscreen.h.

◆ screenNumber()

int QXcbScreen::screenNumber ( ) const
inline

Definition at line 149 of file qxcbscreen.h.

◆ serialNumber()

QString QXcbScreen::serialNumber ( ) const
overridevirtual

Reimplement this function in subclass to return the serial number of this screen.

The default implementation returns an empty string.

Since
5.9

Reimplemented from QPlatformScreen.

Definition at line 756 of file qxcbscreen.cpp.

◆ setCrtc()

void QXcbScreen::setCrtc ( xcb_randr_crtc_t crtc)
inline

Definition at line 163 of file qxcbscreen.h.

◆ setMonitor()

void QXcbScreen::setMonitor ( xcb_randr_monitor_info_t * monitorInfo,
xcb_timestamp_t timestamp = XCB_NONE )

Definition at line 589 of file qxcbscreen.cpp.

◆ setOutput()

void QXcbScreen::setOutput ( xcb_randr_output_t outputId,
xcb_randr_get_output_info_reply_t * outputInfo )

Definition at line 884 of file qxcbscreen.cpp.

◆ setPrimary()

void QXcbScreen::setPrimary ( bool primary)
inline

Definition at line 146 of file qxcbscreen.h.

◆ subpixelType()

QFontEngine::SubpixelAntialiasingType QXcbScreen::subpixelType ( ) const
inline

Definition at line 186 of file qxcbscreen.h.

◆ surfaceFormatFor()

QSurfaceFormat QXcbScreen::surfaceFormatFor ( const QSurfaceFormat & format) const

Definition at line 802 of file qxcbscreen.cpp.

◆ topLevelAt()

QWindow * QXcbScreen::topLevelAt ( const QPoint & pos) const
overridevirtual

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 761 of file qxcbscreen.cpp.

◆ updateAvailableGeometry()

void QXcbScreen::updateAvailableGeometry ( )

Definition at line 946 of file qxcbscreen.cpp.

◆ updateGeometry() [1/2]

void QXcbScreen::updateGeometry ( const QRect & geometry,
uint8_t rotation )

Definition at line 906 of file qxcbscreen.cpp.

◆ updateGeometry() [2/2]

void QXcbScreen::updateGeometry ( xcb_timestamp_t timestamp = XCB_TIME_CURRENT_TIME)

Definition at line 895 of file qxcbscreen.cpp.

◆ updateRefreshRate()

void QXcbScreen::updateRefreshRate ( xcb_randr_mode_t mode)

Definition at line 955 of file qxcbscreen.cpp.

◆ virtualDesktop()

QXcbVirtualDesktop * QXcbScreen::virtualDesktop ( ) const
inline

Definition at line 144 of file qxcbscreen.h.

◆ virtualDesktopNumber()

int QXcbScreen::virtualDesktopNumber ( ) const
inlineoverride

Definition at line 150 of file qxcbscreen.h.

◆ virtualSiblings()

QList< QPlatformScreen * > QXcbScreen::virtualSiblings ( ) const
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.

◆ visualForFormat()

const xcb_visualtype_t * QXcbScreen::visualForFormat ( const QSurfaceFormat & format) const
inline

Definition at line 173 of file qxcbscreen.h.

◆ visualForId()

const xcb_visualtype_t * QXcbScreen::visualForId ( xcb_visualid_t visualid) const

Definition at line 807 of file qxcbscreen.cpp.

◆ windowManagerName()

QString QXcbScreen::windowManagerName ( ) const
inline

Definition at line 169 of file qxcbscreen.h.

◆ windowShown()

void QXcbScreen::windowShown ( QXcbWindow * window)

Definition at line 793 of file qxcbscreen.cpp.

◆ xSettings()

QXcbXSettings * QXcbScreen::xSettings ( ) const

Definition at line 1069 of file qxcbscreen.cpp.

◆ QXcbConnection

friend class QXcbConnection
friend

Definition at line 222 of file qxcbscreen.h.

◆ QXcbVirtualDesktop

friend class QXcbVirtualDesktop
friend

Definition at line 223 of file qxcbscreen.h.


The documentation for this class was generated from the following files: