Exemplo n.º 1
0
QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());
#if defined(XCB_USE_GLX)
    return new QGLXContext(screen, context->format(), context->shareHandle());
#elif defined(XCB_USE_EGL)
    return new QEGLXcbPlatformContext(context->format(), context->shareHandle(),
        screen->connection()->egl_display(), screen->connection());
#else
    Q_UNUSED(screen);
    qWarning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");
    return 0;
#endif
}
Exemplo n.º 2
0
QXcbWindowSurface::QXcbWindowSurface(QWidget *widget, bool setDefaultSurface)
    : QWindowSurface(widget, setDefaultSurface)
    , m_image(0)
    , m_syncingResize(false)
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(QPlatformScreen::platformScreenForWidget(widget));
    setConnection(screen->connection());
}
Exemplo n.º 3
0
QXcbBackingStore::QXcbBackingStore(QWindow *window)
    : QPlatformBackingStore(window)
    , m_image(0)
    , m_syncingResize(false)
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
    setConnection(screen->connection());
}
Exemplo n.º 4
0
void *QXcbNativeInterface::eglDisplayForWidget(QWidget *widget)
{
#if defined(XCB_USE_DRI2) || defined(XCB_USE_EGL)
    QXcbScreen *screen = qPlatformScreenForWidget(widget);
    return screen->connection()->egl_display();
#else
    Q_UNUSED(widget)
    return 0;
#endif
}
Exemplo n.º 5
0
void *QXcbNativeInterface::displayForWidget(QWidget *widget)
{
#if defined(XCB_USE_XLIB)
    QXcbScreen *screen = qPlatformScreenForWidget(widget);
    return screen->connection()->xlib_display();
#else
    Q_UNUSED(widget);
    return 0;
#endif
}
Exemplo n.º 6
0
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());
    QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
    if (!glIntegration) {
        qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
        return Q_NULLPTR;
    }
    return glIntegration->createPlatformOffscreenSurface(surface);
}
Exemplo n.º 7
0
QPlatformOpenGLContext *QXcbIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());
    QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
    if (!glIntegration) {
        qWarning("QXcbIntegration: Cannot create platform OpenGL context, neither GLX nor EGL are enabled");
        return Q_NULLPTR;
    }
    return glIntegration->createPlatformOpenGLContext(context);
}
Exemplo n.º 8
0
QPlatformOpenGLContext *QXcbEglIntegration::createPlatformOpenGLContext(QOpenGLContext *context) const
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(context->screen()->handle());
    QXcbEglContext *platformContext = new QXcbEglContext(context->format(),
                                                         context->shareHandle(),
                                                         eglDisplay(),
                                                         screen->connection(),
                                                         context->nativeHandle());
    context->setNativeHandle(platformContext->nativeHandle());
    return platformContext;
}
Exemplo n.º 9
0
void *QXcbNativeInterface::graphicsDeviceForWidget(QWidget *widget)
{
#if defined(XCB_USE_DRI2)
    QXcbScreen *screen = qPlatformScreenForWidget(widget);
    QByteArray deviceName = screen->connection()->dri2DeviceName();
    return deviceName.data();
#else
    Q_UNUSED(widget);
    return 0;
#endif

}
Exemplo n.º 10
0
QPlatformOffscreenSurface *QXcbIntegration::createPlatformOffscreenSurface(QOffscreenSurface *surface) const
{
#if defined(XCB_USE_GLX)
    return new QGLXPbuffer(surface);
#elif defined(XCB_USE_EGL)
    QXcbScreen *screen = static_cast<QXcbScreen *>(surface->screen()->handle());
    return new QEGLPbuffer(screen->connection()->egl_display(), surface->requestedFormat(), surface);
#else
    Q_UNUSED(surface);
    qWarning("QXcbIntegration: Cannot create platform offscreen surface, neither GLX nor EGL are enabled");
    return 0;
#endif
}
Exemplo n.º 11
0
void QIrrlichtWidget::setAutoRepeatKeys(bool mode)
{
	qDebug() << "QIrrlichtWidget::setAutoRepeatKeys";

	XKeyboardControl control;
	control.auto_repeat_mode = (mode ? 1 : 0);   // Set mode to 1 for
	                                             // autorepeat, 0 to disable
	control.key = -1; // We want to change the behaviour for all keys

	QList<QScreen*> screens = QGuiApplication::screens();
	QXcbScreen *xcbscreen = static_cast<QXcbScreen*>(screens.at(0)->handle());
	Display *display = static_cast<Display*>(xcbscreen->connection()->xlib_display());

	XChangeKeyboardControl(display, KBAutoRepeatMode, &control);
}
Exemplo n.º 12
0
QPlatformWindow *QXcbIntegration::createPlatformWindow(QWindow *window) const
{
    QXcbScreen *screen = static_cast<QXcbScreen *>(window->screen()->handle());
    QXcbGlIntegration *glIntegration = screen->connection()->glIntegration();
    if (window->type() != Qt::Desktop) {
        if (glIntegration) {
            QXcbWindow *xcbWindow = glIntegration->createWindow(window);
            xcbWindow->create();
            return xcbWindow;
        }
    }

    Q_ASSERT(window->type() == Qt::Desktop || !window->supportsOpenGL()
             || (!glIntegration && window->surfaceType() == QSurface::RasterGLSurface)); // for VNC
    QXcbWindow *xcbWindow = new QXcbWindow(window);
    xcbWindow->create();
    return xcbWindow;
}