コード例 #1
0
ファイル: fsapi.c プロジェクト: beartan/liteOS
int   fmove(char *source, char *target)
{
    //if ((ret = fexist(pathname))==-1)
    int ret1, ret2;
    int state1, state2;
    uint8_t parent;
    char *p, *q;
    uint8_t namelength;

    p = extractLastName(target);

    q = target + strlen(target);

    namelength = q-p ;

    ret1 = locateFileName(source, &state1);

    parent = read8uint(ret1, FILE_PARENTOFFSET);

    removeChildNode(parent, ret1);

    ret2 = locateFileName(target, &state2);

    write8uint(ret1, FILE_PARENTOFFSET, ret2);

    writeBytes(ret1, FILENAMEOFFSET, namelength, p);

    write8uint(ret1, FILENAMEOFFSET+namelength, 0);

    addChildNode(ret2, ret1);

    return 0;

}
コード例 #2
0
ファイル: qsgnode.cpp プロジェクト: OniLink/Qt5-Rehost
/*!
 * \internal
 *
 * Reparents all nodes of this node to \a newParent.
 */
void QSGNode::reparentChildNodesTo(QSGNode *newParent)
{
    for (QSGNode *c = firstChild(); c; c = firstChild()) {
        removeChildNode(c);
        newParent->appendChildNode(c);
    }
}
コード例 #3
0
ファイル: qquicktextnode.cpp プロジェクト: RobinWuDev/Qt
void QQuickTextNode::clearCursor()
{
    if (m_cursorNode)
        removeChildNode(m_cursorNode);
    delete m_cursorNode;
    m_cursorNode = 0;
}
コード例 #4
0
void RenderSVGContainer::removeChild(RenderObject* oldChild)
{
    // We do this here instead of in removeChildNode, since the only extremely low-level uses of remove/appendChildNode
    // cannot affect the positioned object list, and the floating object list is irrelevant (since the list gets cleared on
    // layout anyway).
    oldChild->removeFromObjectLists();

    removeChildNode(oldChild);
}
コード例 #5
0
ファイル: Node.cpp プロジェクト: EternalWind/ducttape-engine
void Node::deinitialize() {
    onDeinitialize();

    // clear all children
    while(mChildren.size() > 0) {
        removeChildNode(mChildren.begin()->first);
    }

    // clear all components
    while(mComponents.size() > 0) {
        removeComponent(mComponents.begin()->second->getName());
    }
}
コード例 #6
0
ファイル: qsgnode.cpp プロジェクト: OniLink/Qt5-Rehost
void QSGNode::destroy()
{
    if (m_parent) {
        m_parent->removeChildNode(this);
        Q_ASSERT(m_parent == 0);
    }
    while (m_firstChild) {
        QSGNode *child = m_firstChild;
        removeChildNode(child);
        Q_ASSERT(child->m_parent == 0);
        if (child->flags() & OwnedByParent)
            delete child;
    }

    Q_ASSERT(m_firstChild == 0 && m_lastChild == 0);
}
コード例 #7
0
ファイル: Node.cpp プロジェクト: EternalWind/ducttape-engine
void Node::_updateAllChildren(double time_diff) {
    mIsUpdatingAfterChange = (time_diff == 0);

    for(auto iter = mChildren.begin(); iter != mChildren.end();) {
        if(iter->second->mDeathMark) {
            //Kill it if the death mark is set.
            Node* node = iter->second.get();
            ++iter;
            QString name = node->getName();
            removeChildNode(name);
        }
        else {
            iter->second->onUpdate(time_diff);
            ++iter;
        }
    }

    mIsUpdatingAfterChange = false;
}
コード例 #8
0
ファイル: RenderInline.cpp プロジェクト: acss/owb-mirror
void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
                                RenderBlock* middleBlock,
                                RenderObject* beforeChild, RenderFlow* oldCont)
{
    // Create a clone of this inline.
    RenderInline* clone = cloneInline(this);
    clone->setContinuation(oldCont);

    // Now take all of the children from beforeChild to the end and remove
    // them from |this| and place them in the clone.
    RenderObject* o = beforeChild;
    while (o) {
        RenderObject* tmp = o;
        o = tmp->nextSibling();
        clone->addChildToFlow(removeChildNode(tmp), 0);
        tmp->setNeedsLayoutAndPrefWidthsRecalc();
    }

    // Hook |clone| up as the continuation of the middle block.
    middleBlock->setContinuation(clone);

    // We have been reparented and are now under the fromBlock.  We need
    // to walk up our inline parent chain until we hit the containing block.
    // Once we hit the containing block we're done.
    RenderFlow* curr = static_cast<RenderFlow*>(parent());
    RenderFlow* currChild = this;
    
    // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap the depth at which we're willing to clone.
    // There will eventually be a better approach to this problem that will let us nest to a much
    // greater depth (see bugzilla bug 13430) but for now we have a limit.  This *will* result in
    // incorrect rendering, but the alternative is to hang forever.
    unsigned splitDepth = 1;
    const unsigned cMaxSplitDepth = 200; 
    while (curr && curr != fromBlock) {
        if (splitDepth < cMaxSplitDepth) {
            // Create a new clone.
            RenderInline* cloneChild = clone;
            clone = cloneInline(curr);

            // Insert our child clone as the first child.
            clone->addChildToFlow(cloneChild, 0);

            // Hook the clone up as a continuation of |curr|.
            RenderFlow* oldCont = curr->continuation();
            curr->setContinuation(clone);
            clone->setContinuation(oldCont);

            // Someone may have indirectly caused a <q> to split.  When this happens, the :after content
            // has to move into the inline continuation.  Call updateBeforeAfterContent to ensure that the inline's :after
            // content gets properly destroyed.
            curr->updateBeforeAfterContent(RenderStyle::AFTER);

            // Now we need to take all of the children starting from the first child
            // *after* currChild and append them all to the clone.
            o = currChild->nextSibling();
            while (o) {
                RenderObject* tmp = o;
                o = tmp->nextSibling();
                clone->addChildToFlow(curr->removeChildNode(tmp), 0);
                tmp->setNeedsLayoutAndPrefWidthsRecalc();
            }
        }
        
        // Keep walking up the chain.
        currChild = curr;
        curr = static_cast<RenderFlow*>(curr->parent());
        splitDepth++;
    }

    // Now we are at the block level. We need to put the clone into the toBlock.
    toBlock->appendChildNode(clone);

    // Now take all the children after currChild and remove them from the fromBlock
    // and put them in the toBlock.
    o = currChild->nextSibling();
    while (o) {
        RenderObject* tmp = o;
        o = tmp->nextSibling();
        toBlock->appendChildNode(fromBlock->removeChildNode(tmp));
    }
}