当前位置: 首页>>代码示例>>C++>>正文


C++ IntSize::height方法代码示例

本文整理汇总了C++中webcore::IntSize::height方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSize::height方法的具体用法?C++ IntSize::height怎么用?C++ IntSize::height使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在webcore::IntSize的用法示例。


在下文中一共展示了IntSize::height方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: DBG

static inline void _ewk_view_single_scroll_process_single(Ewk_View_Smart_Data* smartData, void* pixels, Evas_Coord width, Evas_Coord height, const WebCore::IntSize& scrollOffset, const WebCore::IntRect& rectToScroll)
{
    int scrollX = rectToScroll.x();
    int scrollY = rectToScroll.y();
    int scrollWidth = rectToScroll.width();
    int scrollHeight = rectToScroll.height();

    DBG("%d,%d + %d,%d %+03d,%+03d, store: %p %dx%d",
        scrollX, scrollY, scrollWidth, scrollHeight, scrollOffset.width(), scrollOffset.height(), pixels, width, height);

    if (abs(scrollOffset.width()) >= scrollWidth || abs(scrollOffset.height()) >= scrollHeight) {
        ewk_view_repaint_add(smartData->_priv, scrollX, scrollY, scrollWidth, scrollHeight);
        return;
    }

    if (scrollX < 0) {
        scrollWidth += scrollX;
        scrollX = 0;
    }
    if (scrollY < 0) {
        scrollHeight += scrollY;
        scrollY = 0;
    }

    if (scrollX + scrollWidth > width)
        scrollWidth = width - scrollX;
    if (scrollY + scrollHeight > height)
        scrollHeight = height - scrollY;

    if (scrollWidth <= 0 || scrollHeight <= 0)
        return;

    int sourceX = scrollOffset.width() < 0 ? abs(scrollOffset.width()) : 0;
    int sourceY = scrollOffset.height() < 0 ? abs(scrollOffset.height()) : 0;
    int destinationX = scrollOffset.width() < 0 ? 0 : scrollOffset.width();
    int destinationY = scrollOffset.height() < 0 ? 0 : scrollOffset.height();
    int copyWidth = scrollWidth - abs(scrollOffset.width());
    int copyHeight = scrollHeight - abs(scrollOffset.height());
    if (scrollOffset.width() || scrollOffset.height()) {
        _ewk_view_screen_move(static_cast<uint32_t*>(pixels), destinationX, destinationY, sourceX, sourceY, copyWidth, copyHeight, width);
        evas_object_image_data_update_add(smartData->backing_store, destinationX, destinationY, copyWidth, copyHeight);
    }

    Eina_Rectangle verticalUpdate;
    verticalUpdate.x = destinationX ? 0 : copyWidth - 1;
    verticalUpdate.y = 0;
    verticalUpdate.w = abs(scrollOffset.width());
    verticalUpdate.h = scrollHeight;
    if (verticalUpdate.w && verticalUpdate.h)
        ewk_view_repaint_add(smartData->_priv, verticalUpdate.x, verticalUpdate.y, verticalUpdate.w, verticalUpdate.h);

    Eina_Rectangle horizontalUpdate;
    horizontalUpdate.x = destinationX;
    horizontalUpdate.y = destinationY ? 0 : copyHeight - 1;
    horizontalUpdate.w = copyWidth;
    horizontalUpdate.h = abs(scrollOffset.height());
    if (horizontalUpdate.w && horizontalUpdate.h)
        ewk_view_repaint_add(smartData->_priv, horizontalUpdate.x, horizontalUpdate.y, horizontalUpdate.w, horizontalUpdate.h);
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:59,代码来源:ewk_view_single.cpp

示例2: OnPaint

void wxWebView::OnPaint(wxPaintEvent& event)
{
    
    if (m_beingDestroyed || !m_mainFrame)
        return;
    
    WebCore::Frame* frame = m_mainFrame->GetFrame();
    if (!frame || !frame->view())
        return;
    
    wxAutoBufferedPaintDC dc(this);

    if (IsShown() && frame->document()) {
#if USE(WXGC)
        wxGCDC gcdc(dc);
#endif

        if (dc.IsOk()) {
            wxRect paintRect = GetUpdateRegion().GetBox();

            WebCore::IntSize offset = frame->view()->scrollOffset();
#if USE(WXGC)
            gcdc.SetDeviceOrigin(-offset.width(), -offset.height());
#endif
            dc.SetDeviceOrigin(-offset.width(), -offset.height());
            paintRect.Offset(offset.width(), offset.height());

#if USE(WXGC)
            WebCore::GraphicsContext* gc = new WebCore::GraphicsContext(&gcdc);
#else
            WebCore::GraphicsContext* gc = new WebCore::GraphicsContext((wxWindowDC*)&dc);
#endif
            if (gc && frame->contentRenderer()) {
                if (frame->view()->needsLayout())
                    frame->view()->layout();

                frame->view()->paintContents(gc, paintRect);
            }
            delete gc;
        }
    }
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:42,代码来源:WebView.cpp

示例3: didChangeContentsSize

void PageClientLegacyImpl::didChangeContentsSize(const WebCore::IntSize& size)
{
#if USE(TILED_BACKING_STORE)
    m_viewImpl->page()->drawingArea()->coordinatedLayerTreeHostProxy()->setContentsSize(FloatSize(size.width(), size.height()));
    m_viewImpl->update();
#endif

    m_viewImpl->smartCallback<ContentsSizeChanged>().call(size);
}
开发者ID:jiezh,项目名称:h5vcc,代码行数:9,代码来源:PageClientLegacyImpl.cpp

示例4: adoptRef

static inline PassRefPtr<cairo_surface_t> createSurfaceFromData(void* data, const WebCore::IntSize& size)
{
    const int stride = cairo_format_stride_for_width(cairoFormat, size.width());
    return adoptRef(cairo_image_surface_create_for_data(static_cast<unsigned char*>(data), cairoFormat, size.width(), size.height(), stride));
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:5,代码来源:ShareableBitmapCairo.cpp

示例5: numBytesForSize

size_t ShareableBitmap::numBytesForSize(const WebCore::IntSize& size)
{
    return cairo_format_stride_for_width(cairoFormat, size.width()) * size.height();
}
开发者ID:3163504123,项目名称:phantomjs,代码行数:4,代码来源:ShareableBitmapCairo.cpp

示例6: JumpToNearestElement


//.........这里部分代码省略.........
			if (!GetFixedString(mCachedNavigationUpId)->compare("ignore"))
			{
				return false;
			}

			if (JumpToId(GetFixedString(mCachedNavigationUpId)->c_str()))
			{
				return true;
			}
		}
		break;

	default:
		EAW_FAIL_MSG("Should not have got here\n");
	}


	// Iterate over all the frames and find the closest element in any of all the frames.
	WebCore::Frame* pFrame		= mView->GetFrame();
	float currentRadialDistance = FLT_MAX; // A high value to start with so that the max distance between any two elements in the surface is under it.
	WebCore::Node* currentBestNode = NULL;
	while(pFrame)
	{
		WebCore::Document* document = pFrame->document();
		EAW_ASSERT(document);

		if(document)
		{
			WebCore::FrameView* pFrameView = document->view();
			WebCore::IntPoint scrollOffset;
			if(pFrameView)
			{
 				scrollOffset.setX(pFrameView->scrollOffset().width());
 				scrollOffset.setY(pFrameView->scrollOffset().height());
			}

			// We figure out the start position(It is center of the currently hovered element almost all the time but can be slightly different 
			// due to scroll sometimes).
			mCentreX = lastX + scrollOffset.x();
			mCentreY = lastY + scrollOffset.y();

			DocumentNavigator navigator(mView, document, direction, WebCore::IntPoint(mCentreX, mCentreY), mBestNodeX, mBestNodeY, mBestNodeWidth, mBestNodeHeight, mJumpNavigationParams.mNavigationTheta, mJumpNavigationParams.mStrictAxesCheck, currentRadialDistance);
			navigator.FindBestNode(document);

			if(navigator.GetBestNode())
			{
				currentBestNode			= navigator.GetBestNode();
				currentRadialDistance	= navigator.GetBestNodeRadialDistance();
			}

		}

		pFrame = pFrame->tree()->traverseNext();
	}

	bool foundSomething = false;
	if (currentBestNode) //We found the node to navigate. Move the cursor and we are done.
	{
		foundSomething = true;
		MoveMouseCursorToNode(currentBestNode, false);
	}
	else if(scrollIfElementNotFound)// Node is not found. 
	{
		// Based on the intended direction of movement, scroll so that some newer elements are visible.
		
		int cursorPosBeforeScrollX, cursorPosBeforeScrollY;
开发者ID:emuikernel,项目名称:EAWebKit,代码行数:67,代码来源:EAWebKitViewNavigationDelegate.cpp

示例7: didChangeContentsSize

void EflViewportHandler::didChangeContentsSize(const WebCore::IntSize& size)
{
    m_contentsSize = size;
    setVisibleContentsRect(m_visibleContentRect.location(), m_scaleFactor, FloatPoint());
    drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(WebCore::FloatSize(size.width(), size.height()));
}
开发者ID:gobihun,项目名称:webkit,代码行数:6,代码来源:EflViewportHandler.cpp

示例8: paint

void MoviePluginView::paint(GraphicsContext* pGraphicContext, const IntRect& viewRect)
{
    EA::WebKit::View* const pView = EA::WebKit::GetView(GetPluginViewParentFrame());
    ASSERT(pView);
    WebCore::FrameView* const pFrameView = pView->GetFrameView();
    ASSERT(pFrameView);
    if((!getMovieSurface()) || (!pView) || (!pFrameView)) 
        return;

    // Build the source and target rects with scroll offset
    EA::Raster::ISurface* pTargetSurface = pGraphicContext->platformContext();
    WebCore::IntSize scrollOffset = pFrameView->scrollOffset();
    EA::Raster::Rect targetRect(frameGeometry().x() - scrollOffset.width(),frameGeometry().y() - scrollOffset.height(), frameGeometry().width(), frameGeometry().height());
    EA::Raster::Rect clipRect(viewRect.x(),viewRect.y(),viewRect.height(),viewRect.width());
    targetRect.constrainRect(clipRect);

    // Draw to the view surface
    EA::WebKit::GetEARasterInstance()->Blit(getMovieSurface(), &getMovieRect(), pTargetSurface, &targetRect, NULL);
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:19,代码来源:PluginViewSDL.cpp

示例9: notify

bool MoviePluginView::notify(bool terminate)
{
    bool responseFlag = false;

    EA::WebKit::View* const pView = EA::WebKit::GetView(GetPluginViewParentFrame());
    ASSERT(pView);
    EA::WebKit::ViewNotification* const pVN = EA::WebKit::GetViewNotification();
    ASSERT(pVN);
    if((!pView) ||(!pVN))    
        return false;

    // Get the windwo view rect with scroll offset
    EA::Raster::Rect windowRect(0,0,frameGeometry().width(), frameGeometry().height());
    WebCore::FrameView* const pFrameView = pView->GetFrameView();
    ASSERT(pFrameView);
    if(pFrameView)
    {
        WebCore::IntSize scrollOffset = pFrameView->scrollOffset();
        windowRect.x = frameGeometry().x() - scrollOffset.width();
        windowRect.y = frameGeometry().y() - scrollOffset.height();
    }

    // Call the notification
    EA::WebKit::MovieUpdateInfo info ={
        pView,
        m_scrURI.charactersWithNullTermination(),
        getMovieSurface(),
        getMovieRect(),
        windowRect,
        m_triggerDelay,
        terminate,  // Terminate flag
        m_removeSurfaceFlag,
        isMovieLooping(),
        isMoviePaused(),
        isMovieAutoPlay(),
        isMoviePreload()
    };

    responseFlag = pVN->MovieUpdate(info);   

    // Check if should remove the surface
    if(info.mRemoveMovieSurfaceFlag)  
    {
        if(getMovieSurface()) {
            destroyMovieSurface();
            m_removeSurfaceFlag = info.mRemoveMovieSurfaceFlag;
        }
    }
    else if(responseFlag) {
        // Trigger the paint by setting the dirty rect
        WebCore::FrameView* const pFV = pView->GetFrameView();
        ASSERT(pFV);   
        if(pFV) {
            WebCore::IntSize scrollOffset = pFV->scrollOffset();
            const WKAL::IntRect rect(frameGeometry().x() - scrollOffset.width(),frameGeometry().y() - scrollOffset.height(), frameGeometry().width(), frameGeometry().height());
            if(pView->GetWebView()) {
                pView->GetWebView()->addToDirtyRegion(rect);
                pFV->SetDirty(true);
            }
        }
    }

    // Transfer/save time trigger
    m_triggerDelay = info.mTriggerDelay;    

    return info.mTerminateCallbackFlag;
}
开发者ID:Gin-Rye,项目名称:duibrowser,代码行数:67,代码来源:PluginViewSDL.cpp


注:本文中的webcore::IntSize::height方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。