Ejemplo n.º 1
0
void QQnxNativeInterface::setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value)
{
    if (name == QStringLiteral("mmRendererWindowName")) {
        QQnxWindow *qnxWindow = static_cast<QQnxWindow*>(window);
        qnxWindow->setMMRendererWindowName(value.toString());
    }
}
Ejemplo n.º 2
0
void QQnxWindow::setVisible(bool visible)
{
    qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;

    if (m_visible == visible || window()->type() == Qt::Desktop)
        return;

    // The first time through we join a window group if appropriate.
    if (m_parentGroupName.isNull() && !m_isTopLevel) {
        joinWindowGroup(parent() ? static_cast<QQnxWindow*>(parent())->groupName()
                                 : QByteArray(m_screen->windowGroupName()));
    }

    m_visible = visible;

    QQnxWindow *root = this;
    while (root->m_parentWindow)
        root = root->m_parentWindow;

    root->updateVisibility(root->m_visible);

    QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), window()->geometry().size()));

    if (visible) {
        applyWindowState();
    } else {
        // Flush the context, otherwise it won't disappear immediately
        screen_flush_context(m_screenContext, 0);
    }
}
Ejemplo n.º 3
0
QPaintDevice *QQnxRasterBackingStore::paintDevice()
{
    QQnxWindow *platformWindow = this->platformWindow();
    if (platformWindow->hasBuffers())
        return platformWindow->renderBuffer().image();

    return 0;
}
Ejemplo n.º 4
0
void QQnxIntegration::moveToScreen(QWindow *window, int screen)
{
    qIntegrationDebug() << Q_FUNC_INFO << "w =" << window << ", s =" << screen;

    // get platform window used by widget
    QQnxWindow *platformWindow = static_cast<QQnxWindow *>(window->handle());

    // lookup platform screen by index
    QQnxScreen *platformScreen = m_screens.at(screen);

    // move the platform window to the platform screen
    platformWindow->setScreen(platformScreen);
}
Ejemplo n.º 5
0
QT_BEGIN_NAMESPACE

void *QQnxNativeInterface::nativeResourceForWindow(const QByteArray &resource, QWindow *window)
{
    if (resource == "windowGroup" && window && window->screen()) {
        QQnxScreen * const screen = static_cast<QQnxScreen *>(window->screen()->handle());
        if (screen) {
            screen_window_t screenWindow = reinterpret_cast<screen_window_t>(window->winId());
            QQnxWindow *qnxWindow = screen->findWindow(screenWindow);
            // We can't just call data() instead of constData() here, since that would detach
            // and the lifetime of the char * would not be long enough. Therefore the const_cast.
            return qnxWindow ? const_cast<char *>(qnxWindow->groupName().constData()) : 0;
        }
    }

    return 0;
}
Ejemplo n.º 6
0
void QQnxWindow::setVisible(bool visible)
{
    qWindowDebug() << Q_FUNC_INFO << "window =" << window() << "visible =" << visible;

    m_visible = visible;

    QQnxWindow *root = this;
    while (root->m_parentWindow)
        root = root->m_parentWindow;

    root->updateVisibility(root->m_visible);

    window()->requestActivate();

    if (window()->isTopLevel()) {
        QWindowSystemInterface::handleExposeEvent(window(), window()->geometry());

        if (!visible) {
            // Flush the context, otherwise it won't disappear immediately
            screen_flush_context(m_screenContext, 0);
        }
    }
}
Ejemplo n.º 7
0
void QQnxRasterBackingStore::flush(QWindow *window, const QRegion &region, const QPoint &offset)
{
    qRasterBackingStoreDebug() << Q_FUNC_INFO << "w =" << this->window();

    QQnxWindow *targetWindow = 0;
    if (window)
        targetWindow = static_cast<QQnxWindow *>(window->handle());

    QQnxWindow *platformWindow = this->platformWindow();
    if (!targetWindow || targetWindow == platformWindow) {

        // visit all pending scroll operations
        for (int i = m_scrollOpList.size() - 1; i >= 0; i--) {

            // do the scroll operation
            ScrollOp &op = m_scrollOpList[i];
            QRegion srcArea = op.totalArea.intersected( op.totalArea.translated(-op.dx, -op.dy) );
            platformWindow->scroll(srcArea, op.dx, op.dy);
        }

        // clear all pending scroll operations
        m_scrollOpList.clear();

        // update the display with newly rendered content
        platformWindow->post(region);
    } else if (targetWindow) {

        // The contents of the backing store should be flushed to a different window than the
        // window which owns the buffer.
        // This typically happens for child windows, since child windows share a backing store with
        // their top-level window (TLW).
        // Simply copy the buffer over to the child window, to emulate a painting operation, and
        // then post the window.
        //
        // ### Note that because of the design in the QNX QPA plugin, each window has its own buffers,
        // even though they might share a backing store. This is unneeded overhead, but I don't think
        // libscreen allows to have windows without buffers, or does it?

        // We assume that the TLW has been flushed previously and that no changes were made to the
        // backing store inbetween (### does Qt guarantee this?)
        Q_ASSERT(!m_hasUnflushedPaintOperations);

        targetWindow->adjustBufferSize();
        targetWindow->blitFrom(platformWindow, offset, region);
        targetWindow->post(region);

    } else {
        qWarning() << Q_FUNC_INFO << "flush() called without a valid window!";
    }

    m_hasUnflushedPaintOperations = false;
}