void WebKitPart::initView(QWidget* parentWidget, GUIProfile prof)
{
    if (prof == DefaultGUI)
        setXMLFile("WebKitPart.rc");
    else if (prof == BrowserViewGUI)
        setXMLFile("WebKitPartBrowser.rc");

    m_client = new WebKitPartClient(this);
 
    // Initialize WebCore in Qt platform mode...
    Page* page = new Page(new ChromeClientQt(), new ContextMenuClientQt(), new EditorClientQt(), new DragClientQt(), new InspectorClientQt());
    Frame* frame = new FrameQt(page, 0, m_client);

    m_frame = frame;
    frame->deref(); // Frames are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr

    page->setMainFrame(frame);

    FrameView* frameView = new FrameView(frame);
    m_frameView = frameView;
    frameView->deref(); // FrameViews are created with a refcount of 1.  Release this ref, since we've assigned it to a RefPtr

    m_frame->setView(frameView);
    m_frameView->setParentWidget(parentWidget);

    m_frame->init();

    // Initialize KParts widget...
    setWidget(m_frame->view()->qwidget());
}
void FrameLoaderClientWx::transitionToCommittedForNewPage()
{ 
    ASSERT(m_frame);
    ASSERT(m_webView);
    
    Page* page = m_frame->page();
    ASSERT(page);

    bool isMainFrame = m_frame == page->mainFrame();

    m_frame->setView(0);

    FrameView* frameView;
    if (isMainFrame)
        frameView = new FrameView(m_frame, IntRect(m_webView->GetRect()).size());
    else
        frameView = new FrameView(m_frame);

    ASSERT(frameView);
    m_frame->setView(frameView);
    frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.

    frameView->setPlatformWidget(m_webView);

    if (m_frame->ownerRenderer())
        m_frame->ownerRenderer()->setWidget(frameView);

    if (HTMLFrameOwnerElement* owner = m_frame->ownerElement())
        m_frame->view()->setScrollbarModes(owner->scrollingMode(), owner->scrollingMode());
}
Exemplo n.º 3
0
void FrameLoaderClient::transitionToCommittedForNewPage(Frame* frame,
                                                        const IntSize& viewportSize,
                                                        const Color& backgroundColor, bool transparent,
                                                        const IntSize& fixedLayoutSize, bool useFixedLayout,
                                                        ScrollbarMode horizontalScrollbarMode, ScrollbarMode verticalScrollbarMode)
{
    ASSERT(frame);

    Page* page = frame->page();
    ASSERT(page);

    bool isMainFrame = frame == page->mainFrame();

    if (isMainFrame && frame->view())
        frame->view()->setParentVisible(false);

    frame->setView(0);

    FrameView* frameView;
    if (isMainFrame) {
        frameView = new FrameView(frame, viewportSize);
        frameView->setFixedLayoutSize(fixedLayoutSize);
        frameView->setUseFixedLayout(useFixedLayout);
    } else
        frameView = new FrameView(frame);

    frameView->setScrollbarModes(horizontalScrollbarMode, verticalScrollbarMode);
    frameView->updateDefaultScrollbarState();

    frame->setView(frameView);
    // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
    frameView->deref();

    if (backgroundColor.isValid())
        frameView->updateBackgroundRecursively(backgroundColor, transparent);

    if (isMainFrame)
        frameView->setParentVisible(true);

    if (frame->ownerRenderer())
        frame->ownerRenderer()->setWidget(frameView);

    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
        frame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
}
Exemplo n.º 4
0
GObject* webkit_gtk_frame_init_with_page(WebKitGtkPage* page, HTMLFrameOwnerElement* element)
{
    WebKitGtkFrame* frame = WEBKIT_GTK_FRAME(g_object_new(WEBKIT_GTK_TYPE_FRAME, NULL));
    WebKitGtkFramePrivate* frameData = WEBKIT_GTK_FRAME_GET_PRIVATE(frame);
    WebKitGtkPagePrivate* pageData = WEBKIT_GTK_PAGE_GET_PRIVATE(page);

    frameData->client = new WebKit::FrameLoaderClient(frame);
    frameData->frame = new Frame(pageData->page, element, frameData->client);

    FrameView* frameView = new FrameView(frameData->frame);
    frameView->setContainingWindow(GTK_CONTAINER(page));
    frameData->frame->setView(frameView);
    frameView->deref();
    frameData->frame->init();
    frameData->page = page;

    return G_OBJECT(frame);
} 
Exemplo n.º 5
0
void WebFrameLoaderClient::transitionToCommittedForNewPage()
{
    Frame* frame = core(m_webFrame);
    ASSERT(frame);

    Page* page = frame->page();
    ASSERT(page);

    bool isMainFrame = frame == page->mainFrame();

/*    if (isMainFrame && frame->view())
        frame->view()->detachFromWindow();*/

    frame->setView(0);

    m_webFrame->updateBackground();

    WebView* webView = m_webFrame->webView();

    FrameView* frameView;
    if (isMainFrame) {
        IntRect rect = webView->frameRect();
        frameView = new FrameView(frame, rect.size());
    } else
        frameView = new FrameView(frame);

    frame->setView(frameView);
    frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.

    BalWidget* viewWindow = webView->viewWindow();
    if (viewWindow)
        frameView->setContainingWindow(viewWindow);

    /*if (isMainFrame)
        frameView->attachToWindow();*/

    if (frame->ownerRenderer())
        frame->ownerRenderer()->setWidget(frameView);

    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
        frame->view()->setScrollbarsMode(owner->scrollingMode());
}
Exemplo n.º 6
0
void WebFrameLoaderClient::transitionToCommittedForNewPage()
{
    Frame* frame = core(m_webFrame);
    ASSERT(frame);

    Page* page = frame->page();
    ASSERT(page);

    bool isMainFrame = frame == page->mainFrame();

    if (isMainFrame && frame->view())
        frame->view()->setParentVisible(false);

    frame->setView(0);

    WebView* webView = m_webFrame->webView();

    FrameView* frameView;
    if (isMainFrame) {
        RECT rect;
        webView->frameRect(&rect);
        frameView = new FrameView(frame, IntRect(rect).size());
    } else
        frameView = new FrameView(frame);

    frame->setView(frameView);
    frameView->deref(); // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.

    m_webFrame->updateBackground();

    if (isMainFrame)
        frameView->setParentVisible(true);

    if (frame->ownerRenderer())
        frame->ownerRenderer()->setWidget(frameView);

    if (HTMLFrameOwnerElement* owner = frame->ownerElement())
        frame->view()->setCanHaveScrollbars(owner->scrollingMode() != ScrollbarAlwaysOff);
}
Exemplo n.º 7
0
void FrameLoaderClientQt::transitionToCommittedForNewPage()
{
    ASSERT(m_frame);
    ASSERT(m_webFrame);

    Page* page = m_frame->page();
    ASSERT(page);

    bool isMainFrame = m_frame == page->mainFrame();

    m_frame->setView(0);

    FrameView* frameView;
    if (isMainFrame)
        frameView = new FrameView(m_frame, m_webFrame->page()->viewportSize());
    else
        frameView = new FrameView(m_frame);

    if (!m_webFrame->d->allowsScrolling)
        frameView->setScrollbarsMode(ScrollbarAlwaysOff);
    if (m_webFrame->d->marginWidth != -1)
        frameView->setMarginWidth(m_webFrame->d->marginWidth);
    if (m_webFrame->d->marginHeight != -1)
        frameView->setMarginHeight(m_webFrame->d->marginHeight);
    if (m_webFrame->d->horizontalScrollBarPolicy != Qt::ScrollBarAsNeeded)
        frameView->setHScrollbarMode((ScrollbarMode)m_webFrame->d->horizontalScrollBarPolicy);
    if (m_webFrame->d->verticalScrollBarPolicy != Qt::ScrollBarAsNeeded)
        frameView->setVScrollbarMode((ScrollbarMode)m_webFrame->d->verticalScrollBarPolicy);

    m_frame->setView(frameView);
    // FrameViews are created with a ref count of 1. Release this ref since we've assigned it to frame.
    frameView->deref();

    if (m_webFrame && m_webFrame->page())
        m_webFrame->d->updateBackground();

    if (m_frame->ownerRenderer())
        m_frame->ownerRenderer()->setWidget(frameView);
}