![]() |
Qt 6.x
The Qt SDK
|
#include <qxcbintegration.h>
Public Member Functions | |
QXcbIntegration (const QStringList ¶meters, int &argc, char **argv) | |
~QXcbIntegration () | |
QPlatformPixmap * | createPlatformPixmap (QPlatformPixmap::PixelType type) const override |
Factory function for QPlatformPixmap. | |
QPlatformWindow * | createPlatformWindow (QWindow *window) const override |
Factory function for QPlatformWindow. | |
QPlatformWindow * | createForeignWindow (QWindow *window, WId nativeHandle) const override |
QPlatformOpenGLContext * | createPlatformOpenGLContext (QOpenGLContext *context) const override |
Factory function for QPlatformOpenGLContext. | |
QPlatformBackingStore * | createPlatformBackingStore (QWindow *window) const override |
Factory function for QPlatformBackingStore. | |
QPlatformOffscreenSurface * | createPlatformOffscreenSurface (QOffscreenSurface *surface) const override |
Factory function for QOffscreenSurface. | |
bool | hasCapability (Capability cap) const override |
QAbstractEventDispatcher * | createEventDispatcher () const override |
Factory function for the GUI event dispatcher. | |
void | initialize () override |
Performs initialization steps that depend on having an event dispatcher available. | |
void | moveToScreen (QWindow *window, int screen) |
QPlatformFontDatabase * | fontDatabase () const override |
Accessor for the platform integration's fontdatabase. | |
QPlatformNativeInterface * | nativeInterface () const override |
QPlatformClipboard * | clipboard () const override |
Accessor for the platform integration's clipboard. | |
QPlatformInputContext * | inputContext () const override |
Returns the platforms input context. | |
QPlatformServices * | services () const override |
Qt::KeyboardModifiers | queryKeyboardModifiers () const override |
QList< int > | possibleKeys (const QKeyEvent *e) const override |
Should be used to obtain a list of possible shortcuts for the given key event. | |
QStringList | themeNames () const override |
QPlatformTheme * | createPlatformTheme (const QString &name) const override |
QVariant | styleHint (StyleHint hint) const override |
bool | hasConnection () const |
QXcbConnection * | connection () const |
QByteArray | wmClass () const |
void | sync () override |
void | beep () const override |
bool | nativePaintingEnabled () const |
void | setApplicationBadge (qint64 number) override |
![]() | |
virtual | ~QPlatformIntegration () |
virtual bool | hasCapability (Capability cap) const |
virtual QPlatformPixmap * | createPlatformPixmap (QPlatformPixmap::PixelType type) const |
Factory function for QPlatformPixmap. | |
virtual QPlatformWindow * | createPlatformWindow (QWindow *window) const =0 |
Factory function for QPlatformWindow. | |
virtual QPlatformWindow * | createForeignWindow (QWindow *, WId) const |
virtual QPlatformBackingStore * | createPlatformBackingStore (QWindow *window) const =0 |
Factory function for QPlatformBackingStore. | |
virtual QPlatformOpenGLContext * | createPlatformOpenGLContext (QOpenGLContext *context) const |
Factory function for QPlatformOpenGLContext. | |
virtual QPlatformSharedGraphicsCache * | createPlatformSharedGraphicsCache (const char *cacheId) const |
Factory function for QPlatformSharedGraphicsCache. | |
virtual QPaintEngine * | createImagePaintEngine (QPaintDevice *paintDevice) const |
Factory function for QPaintEngine. | |
virtual QAbstractEventDispatcher * | createEventDispatcher () const =0 |
Factory function for the GUI event dispatcher. | |
virtual void | initialize () |
Performs initialization steps that depend on having an event dispatcher available. | |
virtual void | destroy () |
Called before the platform integration is deleted. | |
virtual QPlatformFontDatabase * | fontDatabase () const |
Accessor for the platform integration's fontdatabase. | |
virtual QPlatformClipboard * | clipboard () const |
Accessor for the platform integration's clipboard. | |
virtual QPlatformInputContext * | inputContext () const |
Returns the platforms input context. | |
virtual QPlatformNativeInterface * | nativeInterface () const |
virtual QPlatformServices * | services () const |
virtual QVariant | styleHint (StyleHint hint) const |
virtual Qt::WindowState | defaultWindowState (Qt::WindowFlags) const |
virtual Qt::KeyboardModifiers | queryKeyboardModifiers () const |
virtual QList< int > | possibleKeys (const QKeyEvent *) const |
Should be used to obtain a list of possible shortcuts for the given key event. | |
virtual QStringList | themeNames () const |
virtual QPlatformTheme * | createPlatformTheme (const QString &name) const |
virtual QPlatformOffscreenSurface * | createPlatformOffscreenSurface (QOffscreenSurface *surface) const |
Factory function for QOffscreenSurface. | |
virtual QPlatformSessionManager * | createPlatformSessionManager (const QString &id, const QString &key) const |
virtual void | sync () |
virtual QOpenGLContext::OpenGLModuleType | openGLModuleType () |
Platform integration function for querying the OpenGL implementation type. | |
virtual void | setApplicationIcon (const QIcon &icon) const |
virtual void | setApplicationBadge (qint64 number) |
virtual void | beep () const |
virtual void | quit () const |
template<auto func, typename... Args> | |
auto | call (Args... args) |
Static Public Member Functions | |
static QXcbIntegration * | instance () |
Definition at line 22 of file qxcbintegration.h.
QXcbIntegration::QXcbIntegration | ( | const QStringList & | parameters, |
int & | argc, | ||
char ** | argv | ||
) |
Definition at line 105 of file qxcbintegration.cpp.
References Qt::AA_CompressHighFrequencyEvents, arg, connection(), QScopedPointer< T, Cleanup >::data(), displayName(), i, QXcbBasicConnection::isConnected(), j, nativePaintingEnabled(), ok, Q_UNUSED, qApp, qCDebug, qEnvironmentVariableIsSet(), qt_xcb_native_x11_info_init(), qWarning, QScopedPointer< T, Cleanup >::reset(), runningUnderDebugger(), and QByteArray::toUInt().
QXcbIntegration::~QXcbIntegration | ( | ) |
Definition at line 187 of file qxcbintegration.cpp.
|
overridevirtual |
Should sound a bell, using the default volume and sound.
Reimplemented from QPlatformIntegration.
Definition at line 567 of file qxcbintegration.cpp.
References connection(), QScreen::handle(), QGuiApplication::primaryScreen, and screen.
|
overridevirtual |
Accessor for the platform integration's clipboard.
Default implementation returns a default QPlatformClipboard.
Reimplemented from QPlatformIntegration.
Definition at line 385 of file qxcbintegration.cpp.
References QXcbConnection::clipboard().
|
inline |
Definition at line 85 of file qxcbintegration.h.
Referenced by QXcbIntegration(), QXcbNativeInterface::atspiBus(), beep(), QXcbNativeInterface::connection(), createEventDispatcher(), createPlatformWindow(), QXcbNativeInterface::display(), QXcbNativeInterface::generatePeekerId(), hasCapability(), initialize(), QXcbNativeInterface::peekEventQueue(), QXcbNativeInterface::removePeekerId(), QXcbNativeInterface::rootWindow(), QXcbNativeInterface::setStartupId(), QXcbNativeInterface::startupId(), styleHint(), and QXcbNativeInterface::x11Screen().
|
overridevirtual |
Factory function for the GUI event dispatcher.
The platform plugin should create and return a QAbstractEventDispatcher subclass when this function is called.
If the platform plugin for some reason creates the event dispatcher outside of this function (for example in the constructor), it needs to handle the case where this function is never called, ensuring that the event dispatcher is still deleted at some point (typically in the destructor).
Note that the platform plugin should never explicitly set the event dispatcher itself, using QCoreApplication::setEventDispatcher(), but let QCoreApplication decide when and which event dispatcher to create.
Implements QPlatformIntegration.
Definition at line 330 of file qxcbintegration.cpp.
References connection(), and QXcbEventDispatcher::createEventDispatcher().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 232 of file qxcbintegration.cpp.
References window().
|
overridevirtual |
Factory function for QPlatformBackingStore.
The QWindow parameter is a pointer to the top level widget(tlw) the window surface is created for. A QPlatformWindow is always created before the QPlatformBackingStore for tlw where the widget also requires a backing store.
Implements QPlatformIntegration.
Definition at line 272 of file qxcbintegration.cpp.
References QXcbWindow::isTrayIconWindow(), nativePaintingEnabled(), Q_ASSERT, and window().
|
overridevirtual |
Factory function for QOffscreenSurface.
An offscreen surface will typically be implemented with a pixel buffer (pbuffer). If the platform doesn't support offscreen surfaces, an invisible window will be used by QOffscreenSurface instead.
Reimplemented from QPlatformIntegration.
Definition at line 290 of file qxcbintegration.cpp.
References QXcbGlIntegration::createPlatformOffscreenSurface(), QScreen::handle(), qWarning, QOffscreenSurface::screen(), and screen.
|
overridevirtual |
Factory function for QPlatformOpenGLContext.
The context parameter is a pointer to the context for which a platform-specific context backend needs to be created. Configuration settings like the format, share context and screen have to be taken from this QOpenGLContext and the resulting platform context is expected to be backed by a native context that fulfills these criteria.
If the context has native handles set, no new native context is expected to be created. Instead, the provided handles have to be used. In this case the ownership of the handle must not be taken and the platform implementation is not allowed to destroy the native context. Configuration parameters like the format are also to be ignored. Instead, the platform implementation is responsible for querying the configuriation from the provided native context.
Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created.
Reimplemented from QPlatformIntegration.
Definition at line 238 of file qxcbintegration.cpp.
References context, QXcbGlIntegration::createPlatformOpenGLContext(), QXcbConnection::glIntegration(), and qWarning.
|
overridevirtual |
Factory function for QPlatformPixmap.
PixelType can be either PixmapType or BitmapType.
Reimplemented from QPlatformIntegration.
Definition at line 194 of file qxcbintegration.cpp.
References QPlatformIntegration::createPlatformPixmap(), and nativePaintingEnabled().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 447 of file qxcbintegration.cpp.
References QGenericUnixTheme::createUnixTheme().
|
overridevirtual |
Factory function for QPlatformWindow.
The window parameter is a pointer to the window which the QPlatformWindow is supposed to be created for.
All windows have to have a QPlatformWindow, and it will be created on-demand when the QWindow is made visible for the first time, or explicitly through calling QWindow::create().
In the constructor, of the QPlatformWindow, the window flags, state, title and geometry of the window should be applied to the underlying window. If the resulting flags or state differs, the resulting values should be set on the window using QWindow::setWindowFlags() or QWindow::setWindowState(), respectively.
Implements QPlatformIntegration.
Definition at line 204 of file qxcbintegration.cpp.
References connection(), QXcbWindow::create(), QXcbGlIntegration::createWindow(), Qt::Desktop, QXcbConnection::glIntegration(), QXcbWindow::isTrayIconWindow(), Q_ASSERT, QSurface::RasterGLSurface, QSurface::VulkanSurface, and window().
|
overridevirtual |
Accessor for the platform integration's fontdatabase.
Default implementation returns a default QPlatformFontDatabase.
Reimplemented from QPlatformIntegration.
Definition at line 374 of file qxcbintegration.cpp.
References QScopedPointer< T, Cleanup >::data().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 301 of file qxcbintegration.cpp.
References connection(), QPlatformIntegration::ForeignWindows, QXcbConnection::glIntegration(), QPlatformIntegration::hasCapability(), QPlatformIntegration::MultipleWindows, QPlatformIntegration::OpenGL, QPlatformIntegration::RasterGLSurface, QXcbGlIntegration::supportsSwitchableWidgetComposition(), QPlatformIntegration::SwitchableWidgetComposition, QPlatformIntegration::SyncState, QPlatformIntegration::ThreadedOpenGL, QPlatformIntegration::ThreadedPixmaps, and QPlatformIntegration::WindowMasks.
|
inline |
Definition at line 84 of file qxcbintegration.h.
|
overridevirtual |
Performs initialization steps that depend on having an event dispatcher available.
Called after the event dispatcher has been created.
Tasks that require an event dispatcher, for example creating socket notifiers, cannot be performed in the constructor. Instead, they should be performed here. The default implementation does nothing.
Reimplemented from QPlatformIntegration.
Definition at line 342 of file qxcbintegration.cpp.
References connection(), QPlatformInputContextFactory::create(), QWindowSystemInterface::handleThemeChange(), QXcbKeyboard::initialize(), QString::isNull(), QXcbConnection::keyboard(), QXcbConnection::primaryScreen(), QXcbXSettings::registerCallbackForProperty(), QPlatformInputContextFactory::requested(), QScopedPointer< T, Cleanup >::reset(), QXcbScreen::xSettings(), xsNetCursorBlink, xsNetCursorBlinkTime, xsNetDndDragThreshold, xsNetDoubleClickDistance, and xsNetDoubleClickTime.
|
overridevirtual |
Returns the platforms input context.
The default implementation returns \nullptr, implying no input method support.
Reimplemented from QPlatformIntegration.
Definition at line 407 of file qxcbintegration.cpp.
References QScopedPointer< T, Cleanup >::data().
|
inlinestatic |
Definition at line 103 of file qxcbintegration.h.
Referenced by QXcbNativeInterface::connection(), QXcbWindow::create(), QXcbNativeInterface::display(), QXcbNativeInterface::dumpNativeWindows(), QXcbNativeInterface::generatePeekerId(), QXcbNativeInterface::peekEventQueue(), qt_xcb_imageFormatForVisual(), QXcbNativeInterface::removePeekerId(), QXcbNativeInterface::rootWindow(), QXcbNativeInterface::setStartupId(), QXcbNativeInterface::startupId(), and QXcbNativeInterface::x11Screen().
Definition at line 368 of file qxcbintegration.cpp.
References Q_UNUSED, screen, and window().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 379 of file qxcbintegration.cpp.
References QScopedPointer< T, Cleanup >::data().
bool QXcbIntegration::nativePaintingEnabled | ( | ) | const |
Definition at line 580 of file qxcbintegration.cpp.
References enabled, and qEnvironmentVariableIsSet().
Referenced by QXcbIntegration(), createPlatformBackingStore(), and createPlatformPixmap().
Should be used to obtain a list of possible shortcuts for the given key event.
Shortcuts should be encoded as int(Qt::Key + Qt::KeyboardModifiers).
One example for more than one possibility is the key combination of Shift+5. That one might trigger a shortcut which is set as "Shift+5" as well as one using %. These combinations depend on the currently set keyboard layout.
Reimplemented from QPlatformIntegration.
Definition at line 437 of file qxcbintegration.cpp.
References e, QXcbConnection::keyboard(), and QXcbKeyboard::possibleKeys().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 432 of file qxcbintegration.cpp.
References QXcbConnection::queryKeyboardModifiers().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 427 of file qxcbintegration.cpp.
References QScopedPointer< T, Cleanup >::data().
Referenced by setApplicationBadge().
Should set the application's badge to number.
If the number is 0 the badge should be cleared.
Reimplemented from QPlatformIntegration.
Definition at line 597 of file qxcbintegration.cpp.
References number, services(), and QGenericUnixServices::setApplicationBadge().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 457 of file qxcbintegration.cpp.
References connection(), QPlatformIntegration::CursorFlashTime, QPlatformIntegration::FlickDeceleration, QPlatformIntegration::FlickMaximumVelocity, QPlatformIntegration::FlickStartDistance, hint(), QPlatformIntegration::KeyboardAutoRepeatRate, QPlatformIntegration::KeyboardInputInterval, QPlatformIntegration::MouseDoubleClickDistance, QPlatformIntegration::MouseDoubleClickInterval, ok, QPlatformIntegration::PasswordMaskCharacter, QPlatformIntegration::PasswordMaskDelay, QPlatformIntegration::ReplayMousePressOutsidePopup, RETURN_VALID_XSETTINGS, screen, QPlatformIntegration::ShowIsFullScreen, QPlatformIntegration::StartDragDistance, QPlatformIntegration::StartDragTime, QPlatformIntegration::StartDragVelocity, QPlatformIntegration::styleHint(), toInt(), QPlatformIntegration::UseRtlExtensions, xsNetCursorBlink, xsNetCursorBlinkTime, xsNetDndDragThreshold, xsNetDoubleClickDistance, and xsNetDoubleClickTime.
|
overridevirtual |
Function to sync the platform integrations state with the window system.
This is often implemented as a roundtrip from the platformintegration to the window system.
This function should not call QWindowSystemInterface::flushWindowSystemEvents() or QCoreApplication::processEvents()
Reimplemented from QPlatformIntegration.
Definition at line 561 of file qxcbintegration.cpp.
References QXcbConnection::sync().
|
overridevirtual |
Reimplemented from QPlatformIntegration.
Definition at line 442 of file qxcbintegration.cpp.
References QGenericUnixTheme::themeNames().
QByteArray QXcbIntegration::wmClass | ( | ) | const |
Definition at line 527 of file qxcbintegration.cpp.
References QCoreApplication::applicationName, argv0BaseName(), className, QString::fromLocal8Bit(), QByteArray::isEmpty(), qEnvironmentVariableIsSet(), qgetenv(), and resourceNameVar.
Referenced by QXcbWindow::create().