Ejemplo n.º 1
0
void Widget::setCursor(const Cursor& cursor)
{
    // This is set by PluginViewWin so it can ignore the setCursor call made by
    // EventHandler.cpp.
    if (ignoreNextSetCursor) {
        ignoreNextSetCursor = false;
        return;
    }

    if (!cursor.impl()->nativeCursor())
        return;

    lastSetCursor = cursor.impl()->nativeCursor();

    ScrollView* view = root();
    if (!view || !view->isFrameView()) {
        SetCursor(lastSetCursor);
        return;
    }

    Frame* frame = static_cast<FrameView*>(view)->frame();
    if (!frame) {
        SetCursor(lastSetCursor);
        return;
    }

    Page* page = frame->page();
    if (!page) {
        SetCursor(lastSetCursor);
        return;
    }

    page->chrome()->setCursor(lastSetCursor);
}
    virtual void frameRectsChanged()
    {
        if (!platformWidget())
            return;

        IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height()));
        platformWidget()->setGeometry(windowRect);

        ScrollView* parentScrollView = parent();
        if (!parentScrollView)
            return;

        ASSERT(parentScrollView->isFrameView());
        IntRect clipRect(static_cast<FrameView*>(parentScrollView)->windowClipRect());
        clipRect.move(-windowRect.x(), -windowRect.y());
        clipRect.intersect(platformWidget()->rect());
        platformWidget()->setMask(QRegion(clipRect.x(), clipRect.y(), clipRect.width(), clipRect.height()));
    }
Ejemplo n.º 3
0
    virtual void frameRectsChanged()
    {
        if (!platformWidget())
            return;

        IntRect windowRect = convertToContainingWindow(IntRect(0, 0, frameRect().width(), frameRect().height()));
        platformWidget()->setGeometry(windowRect);

        ScrollView* parentScrollView = parent();
        if (!parentScrollView)
            return;

        ASSERT(parentScrollView->isFrameView());
        IntRect clipRect(static_cast<FrameView*>(parentScrollView)->windowClipRect());
        clipRect.move(-windowRect.x(), -windowRect.y());
        clipRect.intersect(platformWidget()->rect());

        QRegion clipRegion = QRegion(clipRect);
        platformWidget()->setMask(clipRegion);

        // if setMask is set with an empty QRegion, no clipping will
        // be performed, so in that case we hide the platformWidget
        platformWidget()->setVisible(!clipRegion.isEmpty());
    }