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


C++ SPObject::getNext方法代码示例

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


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

示例1: while

Inkscape::XML::Node* SPDefs::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
    if (flags & SP_OBJECT_WRITE_BUILD) {

        if (!repr) {
            repr = xml_doc->createElement("svg:defs");
        }

        GSList *l = NULL;
        for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) {
            Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
            if (crepr) {
                l = g_slist_prepend(l, crepr);
            }
        }

        while (l) {
            repr->addChild((Inkscape::XML::Node *) l->data, NULL);
            Inkscape::GC::release((Inkscape::XML::Node *) l->data);
            l = g_slist_remove(l, l->data);
        }

    } else {
        for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) {
            child->updateRepr(flags);
        }
    }

    SPObject::write(xml_doc, repr, flags);

    return repr;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:31,代码来源:sp-defs.cpp

示例2: while

Inkscape::XML::Node *SPObjectGroup::write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
    SP_OBJECTGROUP(object); // Ensure we have the right type of SPObject

    if (flags & SP_OBJECT_WRITE_BUILD) {
        if (!repr) {
            repr = xml_doc->createElement("svg:g");
        }
        GSList *l = 0;
        for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) {
            Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
            if (crepr) {
                l = g_slist_prepend(l, crepr);
            }
        }
        while (l) {
            repr->addChild((Inkscape::XML::Node *) l->data, NULL);
            Inkscape::GC::release((Inkscape::XML::Node *) l->data);
            l = g_slist_remove(l, l->data);
        }
    } else {
        for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) {
            child->updateRepr(flags);
        }
    }

    if (((SPObjectClass *) (SPObjectGroupClass::static_parent_class))->write) {
        ((SPObjectClass *) (SPObjectGroupClass::static_parent_class))->write(object, xml_doc, repr, flags);
    }

    return repr;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:32,代码来源:sp-object-group.cpp

示例3:

SPItem *SPFlowtext::get_frame(SPItem *after)
{
    SPItem *frame = 0;

    SPObject *region = 0;
    for (SPObject *o = firstChild() ; o ; o = o->getNext() ) {
        if (SP_IS_FLOWREGION(o)) {
            region = o;
            break;
        }
    }

    if (region) {
        bool past = false;

        for (SPObject *o = region->firstChild() ; o ; o = o->getNext() ) {
            if (SP_IS_ITEM(o)) {
                if ( (after == NULL) || past ) {
                    frame = SP_ITEM(o);
                } else {
                    if (SP_ITEM(o) == after) {
                        past = true;
                    }
                }
            }
        }

        if ( frame && SP_IS_USE(frame) ) {
            frame = SP_USE(frame)->get_original();
        }
    }
    return frame;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:33,代码来源:sp-flowtext.cpp

示例4:

SPObject *SPObject::getPrev()
{
    SPObject *prev = 0;
    for ( SPObject *obj = parent->firstChild(); obj && !prev; obj = obj->getNext() ) {
        if (obj->getNext() == this) {
            prev = obj;
        }
    }
    return prev;
}
开发者ID:asitti,项目名称:inkscape,代码行数:10,代码来源:sp-object.cpp

示例5: while

static Inkscape::XML::Node * sp_group_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags)
{
    SPGroup *group = SP_GROUP(object);

    if (flags & SP_OBJECT_WRITE_BUILD) {
        GSList *l;
        if (!repr) {
            if (SP_IS_SWITCH(object)) {
                repr = xml_doc->createElement("svg:switch");
            } else {
                repr = xml_doc->createElement("svg:g");
            }
        }
        l = NULL;
        for (SPObject *child = object->firstChild(); child; child = child->getNext() ) {
            if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) {
                Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
                if (crepr) {
                    l = g_slist_prepend (l, crepr);
                }
            }
        }
        while (l) {
            repr->addChild((Inkscape::XML::Node *) l->data, NULL);
            Inkscape::GC::release((Inkscape::XML::Node *) l->data);
            l = g_slist_remove (l, l->data);
        }
    } else {
        for (SPObject *child = object->firstChild() ; child ; child = child->getNext() ) {
            if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) {
                child->updateRepr(flags);
            }
        }
    }

    if ( flags & SP_OBJECT_WRITE_EXT ) {
        const char *value;
        if ( group->_layer_mode == SPGroup::LAYER ) {
            value = "layer";
        } else if ( group->_layer_mode == SPGroup::MASK_HELPER ) {
            value = "maskhelper";
        } else if ( flags & SP_OBJECT_WRITE_ALL ) {
            value = "group";
        } else {
            value = NULL;
        }
        repr->setAttribute("inkscape:groupmode", value);
    }

    if (((SPObjectClass *) (parent_class))->write) {
        ((SPObjectClass *) (parent_class))->write (object, xml_doc, repr, flags);
    }

    return repr;
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:55,代码来源:sp-item-group.cpp

示例6:

Inkscape::DrawingItem *SPClipPath::show(Inkscape::Drawing &drawing, unsigned int key) {
    Inkscape::DrawingGroup *ai = new Inkscape::DrawingGroup(drawing);
    display = sp_clippath_view_new_prepend(display, key, ai);

    for ( SPObject *child = firstChild() ; child ; child = child->getNext() ) {
        if (SP_IS_ITEM(child)) {
            Inkscape::DrawingItem *ac = SP_ITEM(child)->invoke_show(drawing, key, SP_ITEM_REFERENCE_FLAGS);

            if (ac) {
                /* The order is not important in clippath */
                ai->appendChild(ac);
            }
        }
    }

    if (clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX && display->bbox) {
        Geom::Affine t = Geom::Scale(display->bbox->dimensions());
        t.setTranslation(display->bbox->min());
        ai->setChildTransform(t);
    }

    ai->setStyle(this->style);

    return ai;
}
开发者ID:myutwo,项目名称:inkscape,代码行数:25,代码来源:sp-clippath.cpp

示例7: remove_child

/**
 * Callback for remove_child event.
 */
void SPGradient::remove_child(Inkscape::XML::Node *child)
{
    this->invalidateVector();

    SPPaintServer::remove_child(child);

    this->has_stops = FALSE;
    for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) {
        if (SP_IS_STOP(ochild)) {
            this->has_stops = TRUE;
            break;
        }
    }

    if ( this->getStopCount() == 0 ) {
        gchar const * attr = this->getAttribute("osb:paint");

        if ( attr && strcmp(attr, "solid") ) {
            this->setAttribute( "osb:paint", "solid", 0 );
        }
    }

    /* Fixme: should we schedule "modified" here? */
    this->requestModified(SP_OBJECT_MODIFIED_FLAG);
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:28,代码来源:sp-gradient.cpp

示例8: modified

void SPClipPath::modified(unsigned int flags) {
    if (flags & SP_OBJECT_MODIFIED_FLAG) {
        flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
    }

    flags &= SP_OBJECT_MODIFIED_CASCADE;

    GSList *l = NULL;
    for (SPObject *child = this->firstChild(); child; child = child->getNext()) {
        sp_object_ref(child);
        l = g_slist_prepend(l, child);
    }

    l = g_slist_reverse(l);

    while (l) {
        SPObject *child = SP_OBJECT(l->data);
        l = g_slist_remove(l, child);

        if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
            child->emitModified(flags);
        }

        sp_object_unref(child);
    }
}
开发者ID:myutwo,项目名称:inkscape,代码行数:26,代码来源:sp-clippath.cpp

示例9: sp_root_build

/**
 * Fills in the data for an SPObject from its Inkscape::XML::Node object.
 * It fills in data such as version, x, y, width, height, etc.
 * It then calls the object's parent class object's build function.
 */
static void sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
{
    SPGroup *group = (SPGroup *) object;
    SPRoot *root = (SPRoot *) object;

    //XML Tree being used directly here while it shouldn't be.
    if ( !object->getRepr()->attribute("version") ) {
        repr->setAttribute("version", SVG_VERSION);
    }

    object->readAttr( "version" );
    object->readAttr( "inkscape:version" );
    /* It is important to parse these here, so objects will have viewport build-time */
    object->readAttr( "x" );
    object->readAttr( "y" );
    object->readAttr( "width" );
    object->readAttr( "height" );
    object->readAttr( "viewBox" );
    object->readAttr( "preserveAspectRatio" );
    object->readAttr( "onload" );

    if (((SPObjectClass *) parent_class)->build)
        (* ((SPObjectClass *) parent_class)->build) (object, document, repr);

    // Search for first <defs> node
    for (SPObject *o = group->firstChild() ; o ; o = o->getNext() ) {
        if (SP_IS_DEFS(o)) {
            root->defs = SP_DEFS(o);
            break;
        }
    }

    // clear transform, if any was read in - SVG does not allow transform= on <svg>
    SP_ITEM(object)->transform = Geom::identity();
}
开发者ID:Spin0za,项目名称:inkscape,代码行数:40,代码来源:sp-root.cpp

示例10: _buildExclusionShape

Shape* SPFlowtext::_buildExclusionShape() const
{
    Shape *shape = new Shape();
    Shape *shape_temp = new Shape();

    for (SPObject *child = children ; child ; child = child->getNext() ) {
        // RH: is it right that this shouldn't be recursive?
        if ( SP_IS_FLOWREGIONEXCLUDE(child) ) {
            SPFlowregionExclude *c_child = SP_FLOWREGIONEXCLUDE(child);

            if ( c_child->computed && c_child->computed->hasEdges() ) {
                if (shape->hasEdges()) {
                    shape_temp->Booleen(shape, c_child->computed, bool_op_union);
                    std::swap(shape, shape_temp);
                } else {
                    shape->Copy(c_child->computed);
                }
            }
        }
    }

    delete shape_temp;

    return shape;
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:25,代码来源:sp-flowtext.cpp

示例11: build

/**
 * Virtual build: set gradient attributes from its associated repr.
 */
void SPGradient::build(SPDocument *document, Inkscape::XML::Node *repr)
{
    // Work-around in case a swatch had been marked for immediate collection:
    if ( repr->attribute("osb:paint") && repr->attribute("inkscape:collect") ) {
        repr->setAttribute("inkscape:collect", 0);
    }

    SPPaintServer::build(document, repr);

    for ( SPObject *ochild = this->firstChild() ; ochild ; ochild = ochild->getNext() ) {
        if (SP_IS_STOP(ochild)) {
            this->has_stops = TRUE;
            break;
        }
    }

    this->readAttr( "gradientUnits" );
    this->readAttr( "gradientTransform" );
    this->readAttr( "spreadMethod" );
    this->readAttr( "xlink:href" );
    this->readAttr( "osb:paint" );

    // Register ourselves
    document->addResource("gradient", this);
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:28,代码来源:sp-gradient.cpp

示例12: modified

void SPFlowtext::modified(unsigned int flags) {
    SPObject *region = NULL;

    if (flags & SP_OBJECT_MODIFIED_FLAG) {
    	flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
    }

    flags &= SP_OBJECT_MODIFIED_CASCADE;

    // FIXME: the below stanza is copied over from sp_text_modified, consider factoring it out
    if (flags & ( SP_OBJECT_STYLE_MODIFIED_FLAG )) {
        SPFlowtext *text = SP_FLOWTEXT(this);
        Geom::OptRect pbox = text->geometricBounds();

        for (SPItemView* v = text->display; v != NULL; v = v->next) {
            Inkscape::DrawingGroup *g = dynamic_cast<Inkscape::DrawingGroup *>(v->arenaitem);
            text->_clearFlow(g);
            g->setStyle(this->style);
            text->layout.show(g, pbox);
        }
    }

    for ( SPObject *o = this->firstChild() ; o ; o = o->getNext() ) {
        if (SP_IS_FLOWREGION(o)) {
            region = o;
            break;
        }
    }

    if (region) {
        if (flags || (region->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
            region->emitModified(flags); // pass down to the region only
        }
    }
}
开发者ID:Grandrogue,项目名称:inkscape_metal,代码行数:35,代码来源:sp-flowtext.cpp

示例13: if

Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) {
    if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) {
        repr = xml_doc->createElement("svg:tspan");
    }

    this->attributes.writeTo(repr);

    if ( flags&SP_OBJECT_WRITE_BUILD ) {
        GSList *l = NULL;

        for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) {
            Inkscape::XML::Node* c_repr=NULL;

            if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
                c_repr = child->updateRepr(xml_doc, NULL, flags);
            } else if ( SP_IS_TEXTPATH(child) ) {
                //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
            } else if ( SP_IS_STRING(child) ) {
                c_repr = xml_doc->createTextNode(SP_STRING(child)->string.c_str());
            }

            if ( c_repr ) {
                l = g_slist_prepend(l, c_repr);
            }
        }

        while ( l ) {
            repr->addChild((Inkscape::XML::Node *) l->data, NULL);
            Inkscape::GC::release((Inkscape::XML::Node *) l->data);
            l = g_slist_remove(l, l->data);
        }
    } else {
        for (SPObject* child = this->firstChild() ; child ; child = child->getNext() ) {
            if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
                child->updateRepr(flags);
            } else if ( SP_IS_TEXTPATH(child) ) {
                //c_repr = child->updateRepr(xml_doc, NULL, flags); // shouldn't happen
            } else if ( SP_IS_STRING(child) ) {
                child->getRepr()->setContent(SP_STRING(child)->string.c_str());
            }
        }
    }

    SPItem::write(xml_doc, repr, flags);

    return repr;
}
开发者ID:myutwo,项目名称:inkscape,代码行数:47,代码来源:sp-tspan.cpp

示例14: persp3d_print_debugging_info_all

void persp3d_print_debugging_info_all(SPDocument *document)
{
    for ( SPObject *child = document->getDefs()->firstChild(); child; child = child->getNext() ) {
        if (SP_IS_PERSP3D(child)) {
            persp3d_print_debugging_info(SP_PERSP3D(child));
        }
    }
    persp3d_print_all_selected();
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:9,代码来源:persp3d.cpp

示例15: getFirstStop

SPStop* SPGradient::getFirstStop()
{
    SPStop* first = 0;
    for (SPObject *ochild = firstChild(); ochild && !first; ochild = ochild->getNext()) {
        if (SP_IS_STOP(ochild)) {
            first = SP_STOP(ochild);
        }
    }
    return first;
}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:10,代码来源:sp-gradient.cpp


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