void *QXcbNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); if (!qXcbResourceMap()->contains(lowerCaseResource)) return 0; ResourceType resource = qXcbResourceMap()->value(lowerCaseResource); void *result = 0; switch(resource) { case Display: result = displayForWindow(window); break; case EglDisplay: result = eglDisplayForWindow(window); break; case Connection: result = connectionForWindow(window); break; case Screen: result = qPlatformScreenForWindow(window); break; default: break; } return result; }
void * QXlibNativeInterface::nativeResourceForWindow(const QByteArray &resourceString, QWindow *window) { QByteArray lowerCaseResource = resourceString.toLower(); ResourceType resource = qXlibResourceMap()->value(lowerCaseResource); void *result = 0; switch(resource) { case Display: result = displayForWindow(window); break; case EglDisplay: result = eglDisplayForWindow(window); break; case Connection: result = connectionForWindow(window); break; case Screen: result = reinterpret_cast<void *>(qPlatformScreenForWindow(window)->xScreenNumber()); break; case GraphicsDevice: result = graphicsDeviceForWindow(window); break; case EglContext: result = eglContextForWindow(window); break; default: result = 0; } return result; }
void *QKmsNativeInterface::eglDisplayForWindow(QWindow *window) { QKmsScreen *screen = qPlatformScreenForWindow(window); if (!screen) return 0; QKmsDevice *device = screen->device(); if (!device) return 0; return device->eglDisplay(); }
void *QXcbNativeInterface::eglDisplayForWindow(QWindow *window) { #if defined(XCB_USE_EGL) QXcbScreen *screen = qPlatformScreenForWindow(window); return screen->connection()->egl_display(); #else Q_UNUSED(window) return 0; #endif }
void *QXcbNativeInterface::screenForWindow(QWindow *window) { QXcbScreen *screen = qPlatformScreenForWindow(window); return screen->screen(); }
void *QXcbNativeInterface::connectionForWindow(QWindow *window) { QXcbScreen *screen = qPlatformScreenForWindow(window); return screen->xcb_connection(); }
void * QXlibNativeInterface::displayForWindow(QWindow *window) { return qPlatformScreenForWindow(window)->display()->nativeDisplay(); }