Ejemplo n.º 1
0
void PlatformScrollbar::updateViewOnMouseHover()
{
    EA::Raster::Surface* const pSurface = containingWindow();
    EA::WebKit::View* pView = static_cast<EA::WebKit::View*>(pSurface->mpUserData);
    const EA::WebKit::ViewParameters& vPm = pView->GetParameters();
    if(vPm.mbRedrawScrollbarOnCursorHover)
    {
        EA::WebKit::ViewNotification* pVN = EA::WebKit::GetViewNotification();
        if(pVN != NULL)
        {
            GraphicsContext context(pSurface);

            IntRect dmgRect;
            switch ((int)m_hoveredPart)
            {
            case BackButtonPart:
                dmgRect = backButtonRect();
                break;
            case ForwardButtonPart:
                 dmgRect = forwardButtonRect();
                break;
            case ThumbPart:
                 dmgRect = thumbRect();
                break;
            }
            paint(&context, dmgRect);
            EA::WebKit::ViewUpdateInfo vui = { pView,  x(), y(), width(), height() };
            pVN->ViewUpdate(vui);
        }
    }
}
Ejemplo n.º 2
0
void WebViewPrivate::onExpose(BalEventExpose eventExpose)
{
    //OWB_PRINTF("WebViewPrivate::onExpose\n");
    Frame* frame = core(m_webView->mainFrame());
    if (!frame)
        return;

    if(!isInitialized) {
        //OWB_PRINTF("not isInitialized\n");
        isInitialized = true;
        frame->view()->resize(m_rect.width(), m_rect.height());
        frame->forceLayout();
        frame->view()->adjustViewSize();
    }

    GraphicsContext ctx(m_webView->viewWindow());
    ctx.setBalExposeEvent(&eventExpose);
    if (frame->contentRenderer() && frame->view() && !m_webView->dirtyRegion().isEmpty()) {
        frame->view()->layoutIfNeededRecursive();
        IntRect dirty = m_webView->dirtyRegion();
        
        // Notify the user of the draw start event.
        EA::WebKit::ViewNotification* pVN = EA::WebKit::GetViewNotification();

        EA::WebKit::View* pView = EA::WebKit::GetView(m_webView);
        
        // Clip to the main view surface and not just the dirty rect for notification.    
        int w=0;
        int h=0;
        if(pView)
            pView->GetSize(w,h);
        IntRect rect(0,0,w,h);
        rect.intersect(dirty);

        EA::WebKit::ViewUpdateInfo vui = { pView, rect.x(), rect.y(), rect.width(), rect.height(), EA::WebKit::ViewUpdateInfo::kViewDrawStart};
        if(pVN)
            pVN->DrawEvent(vui);

        frame->view()->paint(&ctx, dirty);

       // Notify the user of end draw event     
        if(pVN) {
            vui.mDrawEvent = EA::WebKit::ViewUpdateInfo::kViewDrawEnd;
            pVN->DrawEvent(vui);
            
           // TODO: Deprecate this view update 
          pVN->ViewUpdate(vui);
        }

        m_webView->clearDirtyRegion();
    }
}