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


C++ FrameTree类代码示例

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


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

示例1: retrieveCachedResource

// SAMSUNG CHANGE : CopyImage >>
// Copy Image Issue on Nested Frame
CachedResource *retrieveCachedResource(Frame* frame,  String imageUrl)
{
	if (NULL == frame || imageUrl.isEmpty())
		return NULL;

	FrameTree *frameTree = frame->tree();
	if (!frameTree)
		return frame->document()->cachedResourceLoader()->cachedResource(imageUrl);
	
	WebCore::Frame *childFrame = frameTree->firstChild();
	Document *childFrameDocument = NULL;
	CachedResource* cachedResource = NULL;
	while (childFrame)
	{
		childFrameDocument = 	childFrame->document();
		if (childFrameDocument)
		{
			cachedResource = childFrameDocument->cachedResourceLoader()->cachedResource(imageUrl);
			if (cachedResource)
				break;
		}
		cachedResource = retrieveCachedResource(childFrame, imageUrl);
		if (cachedResource)
			break;
		childFrame = childFrame->tree()->nextSibling();
	}

	if (cachedResource)
		return cachedResource;
	else
		return frame->document()->cachedResourceLoader()->cachedResource(imageUrl);
}
开发者ID:johnwpoliver,项目名称:Samsung-GT-P3113-AOSP-CM-Kernel-and-Ramdisk,代码行数:34,代码来源:PasteBoardAndroid.cpp

示例2: parentFrame

/*!
  Returns a list of all frames that are direct children of this frame.

  \sa parentFrame()
*/
QList<QWebFrame*> QWebFrame::childFrames() const
{
    QList<QWebFrame*> rc;
    if (d->frame) {
        FrameTree *tree = d->frame->tree();
        for (Frame *child = tree->firstChild(); child; child = child->tree()->nextSibling()) {
            FrameLoader *loader = child->loader();
            FrameLoaderClientQt *client = static_cast<FrameLoaderClientQt*>(loader->client());
            if (client)
                rc.append(client->webFrame());
        }

    }
    return rc;
}
开发者ID:UIKit0,项目名称:WebkitAIR,代码行数:20,代码来源:qwebframe.cpp

示例3:

std::vector<WebFrame*>* WebFrame::children()
{
    m_rc.clear();
    if (Frame* frame = core(this)) {
        FrameTree *tree = frame->tree();
        for (Frame *child = tree->firstChild(); child; child = child->tree()->nextSibling()) {
            FrameLoader *loader = child->loader();
            WebFrameLoaderClient *client = static_cast<WebFrameLoaderClient*>(loader->client());
            if (client)
                m_rc.push_back(client->webFrame());
        }

    }
    return &m_rc;
}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:15,代码来源:WebFrame.cpp

示例4: document

float SVGSVGElement::currentScale() const
{
    if (!inDocument() || !isOutermostSVG())
        return 1;

    Frame* frame = document()->frame();
    if (!frame)
        return 1;

    FrameTree* frameTree = frame->tree();
    ASSERT(frameTree);

    // The behaviour of currentScale() is undefined, when we're dealing with non-standalone SVG documents.
    // If the svg is embedded, the scaling is handled by the host renderer, so when asking from inside
    // the SVG document, a scale value of 1 seems reasonable, as it doesn't know anything about the parent scale.
    return frameTree->parent() ? 1 : frame->pageZoomFactor();
}
开发者ID:sohocoke,项目名称:webkit,代码行数:17,代码来源:SVGSVGElement.cpp

示例5: CreateTimeline

static bool CreateTimeline(Body* body,
                           PlanetarySystem* system,
                           Universe& universe,
                           Hash* planetData,
                           const string& path,
                           Disposition disposition,
                           BodyType bodyType)
{
    FrameTree* parentFrameTree = NULL;
    Selection parentObject = GetParentObject(system);
    bool orbitsPlanet = false;
    if (parentObject.body())
    {
        parentFrameTree = parentObject.body()->getOrCreateFrameTree();
        orbitsPlanet = true;
    }
    else if (parentObject.star())
    {
        SolarSystem* solarSystem = universe.getSolarSystem(parentObject.star());
        if (solarSystem == NULL)
            solarSystem = universe.createSolarSystem(parentObject.star());
        parentFrameTree = solarSystem->getFrameTree();
    }
    else
    {
        // Bad orbit barycenter specified
        return false;
    }

    ReferenceFrame* defaultOrbitFrame = NULL;
    ReferenceFrame* defaultBodyFrame = NULL;
    if (bodyType == SurfaceObject)
    {
        defaultOrbitFrame = new BodyFixedFrame(parentObject, parentObject);
        defaultBodyFrame = CreateTopocentricFrame(parentObject, parentObject, Selection(body));
        defaultOrbitFrame->addRef();
        defaultBodyFrame->addRef();
    }
    else
    {
        defaultOrbitFrame = parentFrameTree->getDefaultReferenceFrame();
        defaultBodyFrame = parentFrameTree->getDefaultReferenceFrame();
    }
    
    // If there's an explicit timeline definition, parse that. Otherwise, we'll do
    // things the old way.
    Value* value = planetData->getValue("Timeline");
    if (value != NULL)
    {
        if (value->getType() != Value::ArrayType)
        {
            clog << "Error: Timeline must be an array\n";
            return false;
        }

        Timeline* timeline = CreateTimelineFromArray(body, universe, value->getArray(), path,
                                                     defaultOrbitFrame, defaultBodyFrame);
        if (timeline == NULL)
        {
            return false;
        }
        else
        {
            body->setTimeline(timeline);
            return true;
        }
    }

    // Information required for the object timeline.
    ReferenceFrame* orbitFrame   = NULL;
    ReferenceFrame* bodyFrame    = NULL;
    Orbit* orbit                 = NULL;
    RotationModel* rotationModel = NULL;
    double beginning             = -numeric_limits<double>::infinity();
    double ending                =  numeric_limits<double>::infinity();

    // If any new timeline values are specified, we need to overrideOldTimeline will
    // be set to true.
    bool overrideOldTimeline = false;

    // The interaction of Modify with timelines is slightly complicated. If the timeline
    // is specified by putting the OrbitFrame, Orbit, BodyFrame, or RotationModel directly
    // in the object definition (i.e. not inside a Timeline structure), it will completely
    // replace the previous timeline if it contained more than one phase. Otherwise, the
    // properties of the single phase will be modified individually, for compatibility with
    // Celestia versions 1.5.0 and earlier.
    if (disposition == ModifyObject)
    {
        const Timeline* timeline = body->getTimeline();
        if (timeline->phaseCount() == 1)
        {
            const TimelinePhase* phase = timeline->getPhase(0);
            orbitFrame    = phase->orbitFrame();
            bodyFrame     = phase->bodyFrame();
            orbit         = phase->orbit();
            rotationModel = phase->rotationModel();
            beginning     = phase->startTime();
            ending        = phase->endTime();
        }
    }
//.........这里部分代码省略.........
开发者ID:nisselarsson,项目名称:Celestia,代码行数:101,代码来源:solarsys.cpp


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