• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ currentView函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中currentView函数的典型用法代码示例。如果您正苦于以下问题:C++ currentView函数的具体用法?C++ currentView怎么用?C++ currentView使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: DCHECK

void ValidationMessageClientImpl::checkAnchorStatus(Timer<ValidationMessageClientImpl>*)
{
    DCHECK(m_currentAnchor);
    if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) {
        hideValidationMessage(*m_currentAnchor);
        return;
    }

    // Check the visibility of the element.
    // FIXME: Can we check invisibility by scrollable non-frame elements?
    IntRect newAnchorRectInViewport = currentView()->contentsToViewport(m_currentAnchor->pixelSnappedBoundingBox());

    // FIXME: This intersection eliminates the part of the rect outside the root view.
    // If this is meant as a visiblity test, intersecting it against the viewport rect
    // likely makes more sense.
    newAnchorRectInViewport = intersection(currentView()->convertToRootFrame(currentView()->boundsRect()), newAnchorRectInViewport);
    if (newAnchorRectInViewport.isEmpty()) {
        hideValidationMessage(*m_currentAnchor);
        return;
    }

    IntRect newAnchorRectInViewportInScreen = currentView()->getHostWindow()->viewportToScreen(newAnchorRectInViewport, currentView());
    if (newAnchorRectInViewportInScreen == m_lastAnchorRectInScreen && m_webView.pageScaleFactor() == m_lastPageScaleFactor)
        return;
    m_lastAnchorRectInScreen = newAnchorRectInViewportInScreen;
    m_lastPageScaleFactor = m_webView.pageScaleFactor();
    m_webView.client()->moveValidationMessage(newAnchorRectInViewport);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:28,代码来源:ValidationMessageClientImpl.cpp


示例2: hideValidationMessage

void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message)
{
    if (message.isEmpty()) {
        hideValidationMessage(anchor);
        return;
    }
    if (!anchor.renderBox())
        return;
    if (m_currentAnchor)
        hideValidationMessage(*m_currentAnchor);
    m_currentAnchor = &anchor;
    IntRect anchorInRootView = currentView()->contentsToRootView(anchor.pixelSnappedBoundingBox());
    m_lastAnchorRectInScreen = currentView()->hostWindow()->rootViewToScreen(anchorInRootView);
    m_lastPageScaleFactor = m_webView.pageScaleFactor();
    m_message = message;

    WebTextDirection dir = m_currentAnchor->renderer()->style()->direction() == RTL ? WebTextDirectionRightToLeft : WebTextDirectionLeftToRight;
    AtomicString title = m_currentAnchor->fastGetAttribute(HTMLNames::titleAttr);
    if (m_client)
        m_client->showValidationMessage(anchorInRootView, m_message, title, dir);
    m_webView.client()->showValidationMessage(anchorInRootView, m_message, title, dir);

    const double minimumSecondToShowValidationMessage = 5.0;
    const double secondPerCharacter = 0.05;
    const double statusCheckInterval = 0.1;
    m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, (message.length() + title.length()) * secondPerCharacter);
    // FIXME: We should invoke checkAnchorStatus actively when layout, scroll,
    // or page scale change happen.
    m_timer.startRepeating(statusCheckInterval);
}
开发者ID:ychaim,项目名称:chromium.bb,代码行数:30,代码来源:ValidationMessageClientImpl.cpp


示例3: hideValidationMessage

void ValidationMessageClientImpl::showValidationMessage(const Element& anchor, const String& message, TextDirection messageDir, const String& subMessage, TextDirection subMessageDir)
{
    if (message.isEmpty()) {
        hideValidationMessage(anchor);
        return;
    }
    if (!anchor.layoutBox())
        return;
    if (m_currentAnchor)
        hideValidationMessage(*m_currentAnchor);
    m_currentAnchor = &anchor;
    IntRect anchorInViewport = currentView()->contentsToViewport(anchor.pixelSnappedBoundingBox());
    m_lastAnchorRectInScreen = currentView()->getHostWindow()->viewportToScreen(anchorInViewport, currentView());
    m_lastPageScaleFactor = m_webView.pageScaleFactor();
    m_message = message;
    const double minimumSecondToShowValidationMessage = 5.0;
    const double secondPerCharacter = 0.05;
    const double statusCheckInterval = 0.1;

    m_webView.client()->showValidationMessage(anchorInViewport, m_message, toWebTextDirection(messageDir),
        subMessage, toWebTextDirection(subMessageDir));

    m_finishTime = monotonicallyIncreasingTime() + std::max(minimumSecondToShowValidationMessage, (message.length() + subMessage.length()) * secondPerCharacter);
    // FIXME: We should invoke checkAnchorStatus actively when layout, scroll,
    // or page scale change happen.
    m_timer.startRepeating(statusCheckInterval, BLINK_FROM_HERE);
}
开发者ID:endlessm,项目名称:chromium-browser,代码行数:27,代码来源:ValidationMessageClientImpl.cpp


示例4: ASSERT

void ValidationMessageClientImpl::checkAnchorStatus(Timer<ValidationMessageClientImpl>*)
{
    ASSERT(m_currentAnchor);
    if (monotonicallyIncreasingTime() >= m_finishTime || !currentView()) {
        hideValidationMessage(*m_currentAnchor);
        return;
    }

    // Check the visibility of the element.
    // FIXME: Can we check invisibility by scrollable non-frame elements?
    IntRect newAnchorRect = currentView()->contentsToRootView(m_currentAnchor->pixelSnappedBoundingBox());
    newAnchorRect = intersection(currentView()->convertToRootView(currentView()->boundsRect()), newAnchorRect);
    if (newAnchorRect.isEmpty()) {
        hideValidationMessage(*m_currentAnchor);
        return;
    }

    IntRect newAnchorRectInScreen = currentView()->hostWindow()->rootViewToScreen(newAnchorRect);
    if (newAnchorRectInScreen == m_lastAnchorRectInScreen && m_webView.pageScaleFactor() == m_lastPageScaleFactor)
        return;
    m_lastAnchorRectInScreen = newAnchorRectInScreen;
    m_lastPageScaleFactor = m_webView.pageScaleFactor();
    if (m_client)
        m_client->moveValidationMessage(newAnchorRect);
    m_webView.client()->moveValidationMessage(newAnchorRect);
}
开发者ID:ychaim,项目名称:chromium.bb,代码行数:26,代码来源:ValidationMessageClientImpl.cpp


示例5: loadBufferIntoView

void Notepad_plus::fileNew()
{
    BufferID newBufID = MainFileManager->newEmptyDocument();
	
    loadBufferIntoView(newBufID, currentView(), true);	//true, because we want multiple new files if possible
    activateBuffer(newBufID, currentView());
}
开发者ID:basvodde,项目名称:notepad-plusplus-refactoring,代码行数:7,代码来源:NppIO.cpp


示例6: setUseCurrentView

void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
{
    bool hadUseCurrentView = m_useCurrentView;
    if (fragmentIdentifier.startsWith("xpointer(")) {
        // FIXME: XPointer references are ignored (https://bugs.webkit.org/show_bug.cgi?id=17491)
        setUseCurrentView(false);
    } else if (fragmentIdentifier.startsWith("svgView(")) {
        if (currentView()->parseViewSpec(fragmentIdentifier))
            setUseCurrentView(true);
    } else if (anchorNode && anchorNode->hasTagName(SVGNames::viewTag)) {
        if (SVGViewElement* viewElement = anchorNode->hasTagName(SVGNames::viewTag) ? static_cast<SVGViewElement*>(anchorNode) : 0) {
            SVGElement* element = SVGLocatable::nearestViewportElement(viewElement);
            if (element->hasTagName(SVGNames::svgTag)) {
                SVGSVGElement* svg = static_cast<SVGSVGElement*>(element);
                svg->inheritViewAttributes(viewElement);
                setUseCurrentView(true);
            }
        }
    }

    if (!hadUseCurrentView) {
        if (!m_useCurrentView)
            return;
    } else if (!m_useCurrentView)
        currentView()->setTransform(emptyString());

    // Force a layout, otherwise RenderSVGRoots localToBorderBoxTransform won't be rebuild.
    if (RenderObject* object = renderer())
        RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);

    // FIXME: We need to decide which <svg> to focus on, and zoom to it.
    // FIXME: We need to actually "highlight" the viewTarget(s).
}
开发者ID:sohocoke,项目名称:webkit,代码行数:33,代码来源:SVGSVGElement.cpp


示例7: currentView

int AMBrowseScansView::numberOfSelectedItems()
{
	if(!currentView())
		return 0;

	return currentView()->selectionModel()->selectedRows().count();
}
开发者ID:acquaman,项目名称:acquaman,代码行数:7,代码来源:AMBrowseScansView.cpp


示例8: currentView

void ZLApplication::resetWindowCaption() {
    if (!myWindow.isNull()) {
        if ((currentView() == 0) || (currentView()->caption().empty())) {
            myWindow->setCaption(ZLibrary::ApplicationName());
        } else {
            myWindow->setCaption(ZLibrary::ApplicationName() + " - " + currentView()->caption());
        }
    }
}
开发者ID:frostfeng,项目名称:FBReader,代码行数:9,代码来源:ZLApplication.cpp


示例9: makeActive

void KateViewSpace::makeActive(bool focusCurrentView)
{
    if (! isActiveSpace()) {
        m_viewManager->setActiveSpace(this);
        if (focusCurrentView && currentView()) {
            m_viewManager->activateView(currentView()->document());
        }
    }
    Q_ASSERT(isActiveSpace());
}
开发者ID:cmacq2,项目名称:kate,代码行数:10,代码来源:kateviewspace.cpp


示例10: preserveAspectRatio

AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
{
    AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(currentViewBoxRect(), preserveAspectRatio(), viewWidth, viewHeight);
    if (useCurrentView() && currentView()) {
        AffineTransform transform;
        if (currentView()->transform().concatenate(transform))
            ctm *= transform;
    }

    return ctm;
}
开发者ID:sohocoke,项目名称:webkit,代码行数:11,代码来源:SVGSVGElement.cpp


示例11: currentView

AffineTransform SVGSVGElement::viewBoxToViewTransform(float viewWidth, float viewHeight) const
{
    FloatRect viewBoxRect;
    if (useCurrentView()) {
        if (currentView()) // what if we should use it but it is not set?
            viewBoxRect = currentView()->viewBox();
    } else
        viewBoxRect = viewBox();

    AffineTransform ctm = SVGFitToViewBox::viewBoxToViewTransform(viewBoxRect, preserveAspectRatio(), viewWidth, viewHeight);
    if (useCurrentView() && currentView())
        return currentView()->transform()->concatenate().matrix() * ctm;

    return ctm;
}
开发者ID:azrul2202,项目名称:WebKit-Smartphone,代码行数:15,代码来源:SVGSVGElement.cpp


示例12: getView

void ViewController::addView(ControllableView *view,bool destroyOld) {
    ControllableView *tmpView = getView(view->type());
    if(tmpView == view) return;
    ControllableView * cView = currentView();
    if(tmpView) removeView(tmpView,destroyOld);
    m_views.append(view);

    m_currentViewIndex = -1; // reset index because it can be not valid
    if(cView) setCurrent(cView);
    // Check if the old current view was replaced by a new one and set new to current
    if(cView && !currentView()) setCurrent(view);

    if(view->jsObject())
        view->jsObject()->setParent(this);  // for javascript access.
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:15,代码来源:viewcontroller.cpp


示例13: currentView

void ViewController::hideCurrentView() {
    ControllableView *view = currentView();
    if(view) {
        qDebug() << "ViewController::hideCurrentView: " + view->objectName();
        view->hide();
    }
}
开发者ID:cdaffara,项目名称:symbiandump-ossapps,代码行数:7,代码来源:viewcontroller.cpp


示例14: currentView

void SVGSVGElement::inheritViewAttributes(SVGViewElement* viewElement)
{
    SVGViewSpec* view = currentView();
    m_useCurrentView = true;
    view->inheritViewAttributesFromElement(this);
    view->inheritViewAttributesFromElement(viewElement);
}
开发者ID:OctiumBrowser,项目名称:octium-main,代码行数:7,代码来源:SVGSVGElement.cpp


示例15: currentView

void WebRenderMainWindow::handleDownloadRequest(QNetworkReply *reply) {
    DownloadListItem *item = new DownloadListItem;
    QNetworkAccessManager *qNam = currentView()->getWebView()->page()->networkAccessManager();
    item->setNetworkAccessManager(qNam);
    item->startDownload(reply);
    item->show();
}
开发者ID:anandbose,项目名称:WebRender,代码行数:7,代码来源:WebRenderMainWindow.cpp


示例16: currentViewBoxRect

FloatRect SVGSVGElement::currentViewBoxRect() const
{
    if (useCurrentView()) {
        if (SVGViewSpec* view = currentView()) // what if we should use it but it is not set?
            return view->viewBox();
        return FloatRect();
    }

    FloatRect useViewBox = viewBox();
    if (!useViewBox.isEmpty())
        return useViewBox;
    if (!renderer() || !renderer()->isSVGRoot())
        return FloatRect();
    if (!toRenderSVGRoot(renderer())->isEmbeddedThroughSVGImage())
        return FloatRect();

    Length intrinsicWidth = this->intrinsicWidth();
    Length intrinsicHeight = this->intrinsicHeight();
    if (!intrinsicWidth.isFixed() || !intrinsicHeight.isFixed())
        return FloatRect();

    // If no viewBox is specified but non-relative width/height values, then we
    // should always synthesize a viewBox if we're embedded through a SVGImage.    
    return FloatRect(FloatPoint(), FloatSize(intrinsicWidth.calcFloatValue(0), intrinsicHeight.calcFloatValue(0)));
}
开发者ID:sohocoke,项目名称:webkit,代码行数:25,代码来源:SVGSVGElement.cpp


示例17: currentView

/*!
    Returns the toolId of the currently-visible toolview,
    or VGTOOL::ID_NULL if there's none visible.
*/
VGTOOL::ToolID ToolViewStack::currentToolId()
{
   if ( widgetStack->currentIndex() >= 0 ) {
      return currentView()->getToolId();
   }
   
   return VGTOOL::ID_NULL;
}
开发者ID:Grindland,项目名称:valkyrie,代码行数:12,代码来源:toolview.cpp


示例18: currentView

bool KYSession::guiPromptYesNo(const QString& title, const QString& message)
{
    int v = KMessageBox::questionYesNo( static_cast< KYView* >( currentView() ), message, title );
    if ( v == KMessageBox::Yes )
        return true;
    else
        return false;
}
开发者ID:Gerardwx,项目名称:Yzis,代码行数:8,代码来源:kysession.cpp


示例19: currentView

const QString ViewManager::currentCategory() const
{
    QString curCategory = "";
    QuartzView *curView = currentView();
    if( curView != nullptr ) {
        curCategory = curView->viewCategoryId();
    }
    return curCategory;
}
开发者ID:varunamachi,项目名称:quartz,代码行数:9,代码来源:ViewManager.cpp


示例20: currentView

void SVGSVGElement::setupInitialView(const String& fragmentIdentifier, Element* anchorNode)
{
    LayoutObject* layoutObject = this->layoutObject();
    SVGViewSpec* view = m_viewSpec.get();
    if (view)
        view->reset();

    bool hadUseCurrentView = m_useCurrentView;
    m_useCurrentView = false;

    if (fragmentIdentifier.startsWith("svgView(")) {
        if (!view)
            view = currentView(); // Create the SVGViewSpec.

        view->inheritViewAttributesFromElement(this);

        if (view->parseViewSpec(fragmentIdentifier)) {
            UseCounter::count(document(), UseCounter::SVGSVGElementFragmentSVGView);
            m_useCurrentView = true;
        } else {
            view->reset();
        }

        if (layoutObject && (hadUseCurrentView || m_useCurrentView))
            markForLayoutAndParentResourceInvalidation(layoutObject);
        return;
    }

    // Spec: If the SVG fragment identifier addresses a 'view' element within an SVG document (e.g., MyDrawing.svg#MyView
    // or MyDrawing.svg#xpointer(id('MyView'))) then the closest ancestor 'svg' element is displayed in the viewport.
    // Any view specification attributes included on the given 'view' element override the corresponding view specification
    // attributes on the closest ancestor 'svg' element.
    // TODO(ed): The spec text above is a bit unclear.
    // Should the transform from outermost svg to nested svg be applied to "display"
    // the inner svg in the viewport, then let the view element override the inner
    // svg's view specification attributes. Should it fill/override the outer viewport?
    if (isSVGViewElement(anchorNode)) {
        SVGViewElement& viewElement = toSVGViewElement(*anchorNode);

        if (SVGSVGElement* svg = viewElement.ownerSVGElement()) {
            svg->inheritViewAttributes(&viewElement);

            if (LayoutObject* layoutObject = svg->layoutObject())
                markForLayoutAndParentResourceInvalidation(layoutObject);

            return;
        }
    }

    // If we previously had a view and didn't get a new one, we need to
    // layout again.
    if (layoutObject && hadUseCurrentView)
        markForLayoutAndParentResourceInvalidation(layoutObject);

    // FIXME: We need to decide which <svg> to focus on, and zoom to it.
    // FIXME: We need to actually "highlight" the viewTarget(s).
}
开发者ID:aobzhirov,项目名称:ChromiumGStreamerBackend,代码行数:57,代码来源:SVGSVGElement.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ current_cpu_datap函数代码示例发布时间:2022-05-30
下一篇:
C++ currentValue函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap