本文整理汇总了C++中webcore::IntSize::width方法的典型用法代码示例。如果您正苦于以下问题:C++ IntSize::width方法的具体用法?C++ IntSize::width怎么用?C++ IntSize::width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webcore::IntSize
的用法示例。
在下文中一共展示了IntSize::width方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: getVideoSizeAndFormatFromCaps
bool getVideoSizeAndFormatFromCaps(GstCaps* caps, WebCore::IntSize& size, GstVideoFormat& format, int& pixelAspectRatioNumerator, int& pixelAspectRatioDenominator, int& stride)
{
#ifdef GST_API_VERSION_1
GstVideoInfo info;
if (!gst_video_info_from_caps(&info, caps))
return false;
format = GST_VIDEO_INFO_FORMAT(&info);
size.setWidth(GST_VIDEO_INFO_WIDTH(&info));
size.setHeight(GST_VIDEO_INFO_HEIGHT(&info));
pixelAspectRatioNumerator = GST_VIDEO_INFO_PAR_N(&info);
pixelAspectRatioDenominator = GST_VIDEO_INFO_PAR_D(&info);
stride = GST_VIDEO_INFO_PLANE_STRIDE(&info, 0);
#else
gint width, height;
if (!GST_IS_CAPS(caps) || !gst_caps_is_fixed(caps)
|| !gst_video_format_parse_caps(caps, &format, &width, &height)
|| !gst_video_parse_caps_pixel_aspect_ratio(caps, &pixelAspectRatioNumerator,
&pixelAspectRatioDenominator))
return false;
size.setWidth(width);
size.setHeight(height);
stride = size.width() * 4;
#endif
return true;
}
示例3: 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;
}
}
}
示例4: 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);
}
示例5: 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);
}
示例6: 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));
}
示例7: numBytesForSize
size_t ShareableBitmap::numBytesForSize(const WebCore::IntSize& size)
{
return cairo_format_stride_for_width(cairoFormat, size.width()) * size.height();
}
示例8: 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.
示例9: 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()));
}
示例10: 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;
}