summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e1a030)
raw | patch | inline | side by side (parent: 5e1a030)
author | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Sat, 3 Jul 2010 17:20:36 +0000 (22:50 +0530) | ||
committer | Abhishek Sharma Public <spyzerdotabhishek0at-signgmaildotcom> | |
Sat, 3 Jul 2010 17:20:36 +0000 (22:50 +0530) |
53 files changed:
diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp
index 88763e1835c5a7360395fcfb947575d0ac8ba6a0..354fa1234213c7191d023702b460d170416bfe74 100644 (file)
--- a/src/box3d-context.cpp
+++ b/src/box3d-context.cpp
SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
bool has_persp = false;
- for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = defs->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_PERSP3D(child)) {
has_persp = true;
break;
diff --git a/src/box3d.cpp b/src/box3d.cpp
index bdbbbfa7ee3271d0e3113c7d2fd6135762cd351b..7985640cdfcd9845b96db2c34e52efaf386d1c25 100644 (file)
--- a/src/box3d.cpp
+++ b/src/box3d.cpp
{
/* This draws the curve and calls requestDisplayUpdate() for each side (the latter is done in
box3d_side_position_set() to avoid update conflicts with the parent box) */
- for (SPObject *child = sp_object_first_child(SP_OBJECT (box)); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT (box)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_BOX3D_SIDE(child))
box3d_side_position_set(SP_BOX3D_SIDE(child));
}
gdouble const sw = hypot(ret[0], ret[1]);
gdouble const sh = hypot(ret[2], ret[3]);
- for (SPObject *child = sp_object_first_child(box); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = box->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
if (SP_IS_ITEM(child)) {
SPItem *childitem = SP_ITEM(child);
static std::map<int, Box3DSide *>
box3d_get_sides (SPBox3D *box) {
std::map<int, Box3DSide *> sides;
- for (SPObject *side = sp_object_first_child(box); side != NULL; side = SP_OBJECT_NEXT(side)) {
+ for (SPObject *side = box->first_child(); side != NULL; side = SP_OBJECT_NEXT(side)) {
if (SP_IS_BOX3D_SIDE(side))
sides[Box3D::face_to_int(sp_repr_get_int_attribute(SP_OBJECT_REPR(side),
"inkscape:box3dsidetype", -1))] = SP_BOX3D_SIDE(side);
if (SP_IS_BOX3D(obj)) {
boxes.push_back(SP_BOX3D(obj));
} else if (SP_IS_GROUP(obj)) {
- for (SPObject *child = sp_object_first_child(obj); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = obj->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
box3d_extract_boxes_rec(child, boxes);
}
}
Inkscape::XML::Node *grepr = xml_doc->createElement("svg:g");
Inkscape::XML::Node *repr;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(box)); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(box)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_BOX3D_SIDE(child)) {
repr = box3d_side_convert_to_path(SP_BOX3D_SIDE(child));
grepr->appendChild(repr);
diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp
index 70e0c38562aff65722356b4d35ee516c779bfbb5..a6ac2387a89c9eed7a91832fd619574fe6066dc2 100644 (file)
--- a/src/conn-avoid-ref.cpp
+++ b/src/conn-avoid-ref.cpp
GSList *get_avoided_items(GSList *list, SPObject *from, SPDesktop *desktop,
bool initialised)
{
- for (SPObject *child = sp_object_first_child(SP_OBJECT(from)) ;
+ for (SPObject *child = SP_OBJECT(from)->first_child() ;
child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child) &&
!desktop->isLayer(SP_ITEM(child)) &&
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index 19a45a2852f3e629dd206cf79f89fca9b585ba48..9a8725fac7054ebc7bb5c8934ef95020e0a3540c 100644 (file)
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
if (SP_IS_USE(o))
return;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(o)) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(o)->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (sp_repr_css_property(css, "opacity", NULL) != NULL) {
// Unset properties which are accumulating and thus should not be set recursively.
// For example, setting opacity 0.5 on a group recursively would result in the visible opacity of 0.25 for an item in the group.
index b1c1cf74a6ccc29523834e0b8b2dc6ead30aec7b..e25f2602b70cc6a709cdf03639148b6be2a94a29 100644 (file)
if (!trace_arena)
return;
- for (SPObject *o = sp_object_first_child(from); o != NULL; o = SP_OBJECT_NEXT(o)) {
+ for (SPObject *o = from->first_child(); o != NULL; o = SP_OBJECT_NEXT(o)) {
if (SP_IS_ITEM(o) && clonetiler_is_a_clone_of (o, NULL))
SP_ITEM(o)->invoke_hide(trace_visionkey); // FIXME: hide each tiled clone's original too!
clonetiler_trace_hide_tiled_clones_recursively (o);
GSList *to_unclump = NULL; // not including the original
- for (SPObject *child = sp_object_first_child(parent); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = parent->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
if (clonetiler_is_a_clone_of (child, obj)) {
to_unclump = g_slist_prepend (to_unclump, child);
}
guint n = 0;
- for (SPObject *child = sp_object_first_child(parent); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = parent->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
if (clonetiler_is_a_clone_of (child, obj)) {
n ++;
}
// remove old tiling
GSList *to_delete = NULL;
- for (SPObject *child = sp_object_first_child(parent); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = parent->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
if (clonetiler_is_a_clone_of (child, obj)) {
to_delete = g_slist_prepend (to_delete, child);
}
diff --git a/src/dialogs/find.cpp b/src/dialogs/find.cpp
index ed693f6edaeda5a5c0bb9133e06f5f00c55f8b0c..89b389d441f0c2da3d512e4417b7fe46ff59b0ee 100644 (file)
--- a/src/dialogs/find.cpp
+++ b/src/dialogs/find.cpp
if (!strcmp (SP_OBJECT_REPR (r)->name(), "svg:metadata"))
return l; // we're not interested in metadata
- for (SPObject *child = sp_object_first_child(r); child; child = SP_OBJECT_NEXT (child)) {
+ for (SPObject *child = r->first_child(); child; child = SP_OBJECT_NEXT (child)) {
if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !desktop->isLayer(SP_ITEM(child))) {
if ((hidden || !desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) {
l = g_slist_prepend (l, child);
index 5372a8bb5ee6c1aa802024754a3f303536324cba..f95dce0e6d7a969f738ce2262dc0fa971588e9d4 100644 (file)
if (!strcmp (SP_OBJECT_REPR (r)->name(), "svg:metadata"))
return l; // we're not interested in metadata
- for (SPObject *child = sp_object_first_child(r); child; child = SP_OBJECT_NEXT (child)) {
+ for (SPObject *child = r->first_child(); child; child = SP_OBJECT_NEXT (child)) {
if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !_desktop->isLayer(SP_ITEM(child))) {
if ((hidden || !_desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) {
if (SP_IS_TEXT(child) || SP_IS_FLOWTEXT(child))
diff --git a/src/document.cpp b/src/document.cpp
index e68bc1f947bb46d7bc0d93d0b9dea223972e9179..6b72f0bb802faed78125f390ae6558c7860f0571 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
void
SPDocument::getPerspectivesInDefs(std::vector<Persp3D*> &list) {
SPDefs *defs = SP_ROOT(this->root)->defs;
- for (SPObject *i = sp_object_first_child(SP_OBJECT(defs)); i != NULL; i = SP_OBJECT_NEXT(i) ) {
+ for (SPObject *i = SP_OBJECT(defs)->first_child(); i != NULL; i = SP_OBJECT_NEXT(i) ) {
if (SP_IS_PERSP3D(i))
list.push_back(SP_PERSP3D(i));
}
@@ -1118,7 +1118,7 @@ static GSList *find_items_in_area(GSList *s, SPGroup *group, unsigned int dkey,
{
g_return_val_if_fail(SP_IS_GROUP(group), s);
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (!SP_IS_ITEM(o)) {
continue;
}
*/
bool item_is_in_group(SPItem *item, SPGroup *group)
{
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (!SP_IS_ITEM(o)) continue;
if (SP_ITEM(o) == item)
return true;
@@ -1162,7 +1162,7 @@ SPDocument::item_from_list_at_point_bottom(unsigned int dkey, SPGroup *group, GS
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gdouble delta = prefs->getDouble("/options/cursortolerance/value", 1.0);
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (!SP_IS_ITEM(o)) continue;
@@ -1199,7 +1199,7 @@ find_item_at_point(unsigned int dkey, SPGroup *group, Geom::Point const p, gbool
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gdouble delta = prefs->getDouble("/options/cursortolerance/value", 1.0);
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (!SP_IS_ITEM(o)) continue;
if (upto && SP_ITEM(o) == upto)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
gdouble delta = prefs->getDouble("/options/cursortolerance/value", 1.0);
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (!SP_IS_ITEM(o)) continue;
if (SP_IS_GROUP(o) && SP_GROUP(o)->effectiveLayerMode(dkey) == SPGroup::LAYER) {
SPItem *newseen = find_group_at_point(dkey, SP_GROUP(o), p);
{
count++; // obj itself
- for (SPObject *i = sp_object_first_child(obj); i != NULL; i = SP_OBJECT_NEXT(i)) {
+ for (SPObject *i = obj->first_child(); i != NULL; i = SP_OBJECT_NEXT(i)) {
count = count_objects_recursive(i, count);
}
def->requestOrphanCollection();
}
} else {
- for (SPObject *i = sp_object_first_child(obj); i != NULL; i = SP_OBJECT_NEXT(i)) {
+ for (SPObject *i = obj->first_child(); i != NULL; i = SP_OBJECT_NEXT(i)) {
vacuum_document_recursive(i);
}
}
diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp
index 5849230bf4d1cdeb3c5dff264b4b9881971dabbc..b6b411e0e59fac1f4eeb3b1f13831e5e7dee2804 100644 (file)
static bool pattern_hasItemChildren (SPPattern *pat)
{
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pat)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(pat)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
return true;
}
@@ -1068,7 +1068,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// show items and render them
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pat_i)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(pat_i)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
SP_ITEM (child)->invoke_show (arena, dkey, SP_ITEM_REFERENCE_FLAGS);
_renderer->renderItem(pattern_ctx, SP_ITEM (child));
@@ -1097,7 +1097,7 @@ CairoRenderContext::_createPatternPainter(SPPaintServer const *const paintserver
// hide all items
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pat_i)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(pat_i)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
SP_ITEM (child)->invoke_hide (dkey);
}
index 81531b2db915b8661355497b30ce2265a860998c..3c5cfc7c18934e85d6ed9d3111f42876a3837ec4 100644 (file)
TRACE(("BEGIN clip\n"));
SPObject *co = SP_OBJECT(cp);
- for (SPObject *child = sp_object_first_child(co) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = co->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
SPItem *item = SP_ITEM(child);
TRACE(("BEGIN mask\n"));
SPObject *co = SP_OBJECT(mask);
- for (SPObject *child = sp_object_first_child(co) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = co->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
SPItem *item = SP_ITEM(child);
renderItem(ctx, item);
diff --git a/src/file.cpp b/src/file.cpp
index 2344c67f211e012fbcc458b6aa937a00da857964..15e5bbe721e59549b5cb88042cb868299d937b1a 100644 (file)
--- a/src/file.cpp
+++ b/src/file.cpp
// Count the number of top-level items in the imported document.
guint items_count = 0;
- for (SPObject *child = sp_object_first_child(SP_DOCUMENT_ROOT(doc));
+ for (SPObject *child = SP_DOCUMENT_ROOT(doc)->first_child();
child != NULL; child = SP_OBJECT_NEXT(child))
{
if (SP_IS_ITEM(child)) items_count++;
// Construct a new object representing the imported image,
// and insert it into the current document.
SPObject *new_obj = NULL;
- for (SPObject *child = sp_object_first_child(SP_DOCUMENT_ROOT(doc));
+ for (SPObject *child = SP_DOCUMENT_ROOT(doc)->first_child();
child != NULL; child = SP_OBJECT_NEXT(child) )
{
if (SP_IS_ITEM(child)) {
else if (SP_OBJECT_REPR(child)->type() == Inkscape::XML::ELEMENT_NODE) {
const gchar *tag = SP_OBJECT_REPR(child)->name();
if (!strcmp(tag, "svg:defs")) {
- for (SPObject *x = sp_object_first_child(child);
+ for (SPObject *x = child->first_child();
x != NULL; x = SP_OBJECT_NEXT(x))
{
SP_OBJECT_REPR(in_defs)->addChild(SP_OBJECT_REPR(x)->duplicate(xml_in_doc), last_def);
index 3d5a795c7cc8140cc1a3bfb7d7cad07d38774d05..f180dc661198402a8e5a0281457b73cde121dee1 100644 (file)
--- a/src/filter-chemistry.cpp
+++ b/src/filter-chemistry.cpp
i ++;
}
- for (SPObject *child = sp_object_first_child(o);
+ for (SPObject *child = o->first_child();
child != NULL; child = SP_OBJECT_NEXT(child)) {
i += count_filter_hrefs(child, filter);
}
index 76b29bb0959eed217702a67b1a2e7ad4e3a927b6..0d99e7fa6d4aee14c729e4edb36c73e87d5f68a1 100644 (file)
i ++;
}
- for (SPObject *child = sp_object_first_child(o);
+ for (SPObject *child = o->first_child();
child != NULL; child = SP_OBJECT_NEXT(child)) {
i += count_gradient_hrefs(child, gr);
}
GSList *child_reprs = NULL;
GSList *child_objects = NULL;
std::vector<double> offsets;
- for (SPObject *child = sp_object_first_child(vector);
+ for (SPObject *child = vector->first_child();
child != NULL; child = SP_OBJECT_NEXT(child)) {
child_reprs = g_slist_prepend (child_reprs, SP_OBJECT_REPR(child));
child_objects = g_slist_prepend (child_objects, child);
diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp
index 5fb490b8b87b219ea07679257f2329c14fec0336..e6dc22cea61f4e7761c7134cd97214ae17c20b55 100644 (file)
--- a/src/gradient-drag.cpp
+++ b/src/gradient-drag.cpp
// cannot use vector->vector.stops.size() because the vector might be invalidated by deletion of a midstop
// manually count the children, don't know if there already exists a function for this...
int len = 0;
- for ( SPObject *child = sp_object_first_child(stopinfo->vector) ;
+ for ( SPObject *child = (stopinfo->vector)->first_child() ;
child != NULL ;
child = SP_OBJECT_NEXT(child) )
{
index 2b0d5781a6e1442078a87fd1c93634c228d49ef8..b5630edd399b4be89c06ca1ee3b272a340e62391 100644 (file)
// recurse
if (!g_slist_find(list, o)) {
- for (SPObject *child = sp_object_first_child(o) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = o->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
hide_other_items_recursively(child, list, dkey);
}
}
index f8321cc03ab7d73d287168d1267bf7229645228e..5ccb6c7fac2533d68fd1754840ea5c5a9df93a0e 100644 (file)
--- a/src/helper/png-write.cpp
+++ b/src/helper/png-write.cpp
// recurse
if (!g_slist_find(list, o)) {
- for (SPObject *child = sp_object_first_child(o) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = o->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
hide_other_items_recursively(child, list, dkey);
}
}
index cb2769c8ee83c3ec1299abe510cd31e9df40db3d..6cdb50c351aaa8fad669b1d8ee4fbf4cce074d3d 100644 (file)
SPObject *object = NULL;
if (!strcmp(base, "marker")) {
- for (SPObject *child = sp_object_first_child(SP_OBJECT(defs));
+ for (SPObject *child = SP_OBJECT(defs)->first_child();
child != NULL;
child = SP_OBJECT_NEXT(child))
{
}
else if (!strcmp(base,"pattern")) {
- for (SPObject *child = sp_object_first_child(SP_OBJECT(defs)) ;
+ for (SPObject *child = SP_OBJECT(defs)->first_child() ;
child != NULL;
child = SP_OBJECT_NEXT(child) )
{
}
else if (!strcmp(base,"gradient")) {
- for (SPObject *child = sp_object_first_child(SP_OBJECT(defs));
+ for (SPObject *child = SP_OBJECT(defs)->first_child();
child != NULL;
child = SP_OBJECT_NEXT(child))
{
diff --git a/src/id-clash.cpp b/src/id-clash.cpp
index 43ce393ddf6c82fa2999797b10664b8e2625a9d7..7572e6a42269a79cf5d71db604075f80bf08e3d1 100644 (file)
--- a/src/id-clash.cpp
+++ b/src/id-clash.cpp
}
/* recurse */
- for (SPObject *child = sp_object_first_child(elem);
+ for (SPObject *child = elem->first_child();
child; child = SP_OBJECT_NEXT(child) )
{
find_references(child, refmap);
}
/* recurse */
- for (SPObject *child = sp_object_first_child(elem);
+ for (SPObject *child = elem->first_child();
child; child = SP_OBJECT_NEXT(child) )
{
change_clashing_ids(imported_doc, current_doc, child, refmap, id_changes);
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 379626683445fcb9a5612ece6b9eab46874ce7bd..00bd10fe2c97319af9c31f7940f29e09d9d99f2b 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
Geom::Rect bbox_to_snap_incl = bbox_to_snap; // _incl means: will include the snapper tolerance
bbox_to_snap_incl.expandBy(getSnapperTolerance()); // see?
- for (SPObject* o = sp_object_first_child(parent); o != NULL; o = SP_OBJECT_NEXT(o)) {
+ for (SPObject* o = parent->first_child(); o != NULL; o = SP_OBJECT_NEXT(o)) {
g_assert(_snapmanager->getDesktop() != NULL);
if (SP_IS_ITEM(o) && !(_snapmanager->getDesktop()->itemIsHidden(SP_ITEM(o)) && !clip_or_mask)) {
// Snapping to items in a locked layer is allowed
diff --git a/src/persp3d.cpp b/src/persp3d.cpp
index 817bb97d7b4126c82ca3b48d9787a7390280fa3a..4b2e55b9d250fc9f7562490a5085fa583dc5503b 100644 (file)
--- a/src/persp3d.cpp
+++ b/src/persp3d.cpp
@@ -246,14 +246,14 @@ persp3d_create_xml_element (SPDocument *document, Persp3DImpl *dup) {// if dup i
SP_OBJECT_REPR(defs)->addChild(repr, NULL);
Inkscape::GC::release(repr);
- return (Persp3D *) sp_object_get_child_by_repr (SP_OBJECT(defs), repr);
+ return (Persp3D *) SP_OBJECT(defs)->get_child_by_repr (repr);
}
Persp3D *
persp3d_document_first_persp (SPDocument *document) {
SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
Inkscape::XML::Node *repr;
- for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = defs->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
repr = SP_OBJECT_REPR(child);
if (SP_IS_PERSP3D(child)) {
return SP_PERSP3D(child);
persp3d_print_debugging_info_all(SPDocument *document) {
SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document);
Inkscape::XML::Node *repr;
- for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = defs->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
repr = SP_OBJECT_REPR(child);
if (SP_IS_PERSP3D(child)) {
persp3d_print_debugging_info(SP_PERSP3D(child));
index 066b86ddf74fb2071a5b84e4c025ac11c5f82c82..7b0f353ab4e5611c30c53b8348109e5a8ab2eb26 100644 (file)
ids.push_back(obj->getId());
if (SP_IS_GROUP(obj)) {
- for (SPObject *child = sp_object_first_child(obj) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = obj->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
add_ids_recursive(ids, child);
}
}
GSList *
get_all_items(GSList *list, SPObject *from, SPDesktop *desktop, bool onlyvisible, bool onlysensitive, GSList const *exclude)
{
- for (SPObject *child = sp_object_first_child(SP_OBJECT(from)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(from)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child) &&
!desktop->isLayer(SP_ITEM(child)) &&
(!onlysensitive || !SP_ITEM(child)->isLocked()) &&
if (!SP_IS_GROUP(parent)) {
return NULL;
}
- for ( SPObject *i = sp_object_first_child(parent) ; i; i = SP_OBJECT_NEXT(i) ) {
+ for ( SPObject *i = parent->first_child() ; i; i = SP_OBJECT_NEXT(i) ) {
if (i->next == child)
return i;
}
pp = document->getObjectByRepr(sp_repr_parent(repr));
minpos = 0;
g_assert(SP_IS_GROUP(pp));
- pc = sp_object_first_child(pp);
+ pc = pp->first_child();
while (!SP_IS_ITEM(pc)) {
minpos += 1;
pc = pc->next;
@@ -1339,7 +1339,7 @@ void sp_selection_apply_affine(Inkscape::Selection *selection, Geom::Matrix cons
// we're moving both a clone and its original or any ancestor in clone chain?
bool transform_clone_with_original = selection_contains_original(item, selection);
// ...both a text-on-path and its path?
- bool transform_textpath_with_path = (SP_IS_TEXT_TEXTPATH(item) && selection->includes( sp_textpath_get_path_item(SP_TEXTPATH(sp_object_first_child(SP_OBJECT(item)))) ));
+ bool transform_textpath_with_path = (SP_IS_TEXT_TEXTPATH(item) && selection->includes( sp_textpath_get_path_item(SP_TEXTPATH(SP_OBJECT(item)->first_child())) ));
// ...both a flowtext and its frame?
bool transform_flowtext_with_frame = (SP_IS_FLOWTEXT(item) && selection->includes( SP_FLOWTEXT(item)->get_frame(NULL))); // (only the first frame is checked so far)
// ...both an offset and its source?
@@ -1743,7 +1743,7 @@ SPItem *next_item_from_list(SPDesktop *desktop, GSList const *items, SPObject *r
struct Forward {
typedef SPObject *Iterator;
- static Iterator children(SPObject *o) { return sp_object_first_child(o); }
+ static Iterator children(SPObject *o) { return o->first_child(); }
static Iterator siblings_after(SPObject *o) { return SP_OBJECT_NEXT(o); }
static void dispose(Iterator /*i*/) {}
} else if (SP_IS_OFFSET(item) && SP_OFFSET(item)->sourceHref) {
original = sp_offset_get_source(SP_OFFSET(item));
} else if (SP_IS_TEXT_TEXTPATH(item)) {
- original = sp_textpath_get_path_item(SP_TEXTPATH(sp_object_first_child(SP_OBJECT(item))));
+ original = sp_textpath_get_path_item(SP_TEXTPATH(SP_OBJECT(item)->first_child()));
} else if (SP_IS_FLOWTEXT(item)) {
original = SP_FLOWTEXT(item)->get_frame(NULL); // first frame only
} else { // it's an object that we don't know what to do with
Geom::Matrix pat_transform = to_2geom(pattern_patternTransform(SP_PATTERN(server)));
pat_transform *= item->transform;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pattern)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(pattern)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *copy = SP_OBJECT_REPR(child)->duplicate(xml_doc);
SPItem *i = SP_ITEM(desktop->currentLayer()->appendChildRepr(copy));
for ( std::map<SPObject*,SPItem*>::iterator it = referenced_objects.begin() ; it != referenced_objects.end() ; ++it) {
SPObject *obj = (*it).first; // Group containing the clipped paths or masks
GSList *items_to_move = NULL;
- for (SPObject *child = sp_object_first_child(obj) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = obj->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
// Collect all clipped paths and masks within a single group
Inkscape::XML::Node *copy = SP_OBJECT_REPR(child)->duplicate(xml_doc);
items_to_move = g_slist_prepend(items_to_move, copy);
diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp
index bae5f5e56bf017f4c75b123d567d34fe6c9dc1c0..a36d9b44330f01a56e937b3c4ed4c4ebdf46f0a3 100644 (file)
--- a/src/sp-clippath.cpp
+++ b/src/sp-clippath.cpp
SPObjectGroup *og = SP_OBJECTGROUP(object);
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
g_object_ref(G_OBJECT(child));
l = g_slist_prepend(l, child);
}
SPObjectGroup *og = SP_OBJECTGROUP(object);
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
g_object_ref(G_OBJECT(child));
l = g_slist_prepend(l, child);
}
NRArenaItem *ai = NRArenaGroup::create(arena);
cp->display = sp_clippath_view_new_prepend(cp->display, key, ai);
- for (SPObject *child = sp_object_first_child(SP_OBJECT(cp)) ; child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(cp)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) {
if (SP_IS_ITEM(child)) {
NRArenaItem *ac = SP_ITEM(child)->invoke_show(arena, key, SP_ITEM_REFERENCE_FLAGS);
if (ac) {
g_return_if_fail(cp != NULL);
g_return_if_fail(SP_IS_CLIPPATH(cp));
- for (SPObject *child = sp_object_first_child(SP_OBJECT(cp)) ; child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(cp)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) {
if (SP_IS_ITEM(child)) {
SP_ITEM(child)->invoke_hide(key);
}
sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, Geom::Matrix const &transform, unsigned const /*flags*/)
{
SPObject *i;
- for (i = sp_object_first_child(SP_OBJECT(cp)); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i)){};
+ for (i = SP_OBJECT(cp)->first_child(); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i)){};
if (!i) return;
SP_ITEM(i)->invoke_bbox_full( bbox, Geom::Matrix(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE);
diff --git a/src/sp-defs.cpp b/src/sp-defs.cpp
index aa0cb0be7643f285f71af3c052fa78cb4596c24e..76cb2e1d9e71d6320f49ab763ebdb8a6d18e40d9 100644 (file)
--- a/src/sp-defs.cpp
+++ b/src/sp-defs.cpp
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList *l = NULL;
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
g_object_ref(G_OBJECT(child));
l = g_slist_prepend(l, child);
}
@@ -130,7 +130,7 @@ static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Docum
}
GSList *l = NULL;
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
@@ -142,7 +142,7 @@ static Inkscape::XML::Node *sp_defs_write(SPObject *object, Inkscape::XML::Docum
}
} else {
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
}
}
diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp
index 1ac8a67331c44d7f7a1882cf161ca619c29291e1..2464b73a56d1cf83dabd71d33cec18dc46642416 100644 (file)
--- a/src/sp-filter.cpp
+++ b/src/sp-filter.cpp
@@ -294,7 +294,7 @@ sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N
repr = doc->createElement("svg:filter");
}
l = NULL;
- for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
crepr = child->updateRepr(doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
}
@@ -304,7 +304,7 @@ sp_filter_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::N
l = g_slist_remove (l, l->data);
}
} else {
- for (child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
}
}
diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp
index 6d679701fdc098836244aa32d3a4be38644d7c79..41df696092a71024973e6ebbaba11f9ef4f21565 100644 (file)
--- a/src/sp-flowdiv.cpp
+++ b/src/sp-flowdiv.cpp
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList* l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
@@ -200,7 +200,7 @@ sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
if ( flags&SP_OBJECT_WRITE_BUILD ) {
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowDiv");
GSList *l = NULL;
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -217,7 +217,7 @@ sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
l = g_slist_remove (l, l->data);
}
} else {
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_FLOWTSPAN (child) ) {
child->updateRepr(flags);
} else if ( SP_IS_FLOWPARA(child) ) {
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList* l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
@@ -371,7 +371,7 @@ sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape
if ( flags&SP_OBJECT_WRITE_BUILD ) {
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowSpan");
GSList *l = NULL;
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -388,7 +388,7 @@ sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape
l = g_slist_remove (l, l->data);
}
} else {
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_FLOWTSPAN (child) ) {
child->updateRepr(flags);
} else if ( SP_IS_FLOWPARA (child) ) {
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList* l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
@@ -544,7 +544,7 @@ sp_flowpara_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape:
if ( flags&SP_OBJECT_WRITE_BUILD ) {
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowPara");
GSList *l = NULL;
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_FLOWTSPAN (child) ) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -561,7 +561,7 @@ sp_flowpara_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape:
l = g_slist_remove (l, l->data);
}
} else {
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_FLOWTSPAN (child) ) {
child->updateRepr(flags);
} else if ( SP_IS_FLOWPARA (child) ) {
diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp
index 79007cac7735a7494fb43db723ef5395de4f491c..29ee05f5e536442fdc55d4542c19c0cdc25c6d29 100644 (file)
--- a/src/sp-flowregion.cpp
+++ b/src/sp-flowregion.cpp
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
delete *it;
computed.clear();
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Shape *shape = NULL;
GetDest(child,&shape);
computed.push_back(shape);
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
@@ -238,7 +238,7 @@ sp_flowregion_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscap
}
GSList *l = NULL;
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
@@ -251,7 +251,7 @@ sp_flowregion_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscap
}
} else {
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
child->updateRepr(flags);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
computed = NULL;
}
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
GetDest(child,&computed);
}
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
l = NULL;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
}
GSList *l = NULL;
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
}
}
} else {
- for ( SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for ( SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
}
}
diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp
index b18b7296800bc3237a505e3a8d12c0a072ef4c82..b18d6f182e1a38a1cb409ac9b31c12720ef8ddb2 100644 (file)
--- a/src/sp-flowtext.cpp
+++ b/src/sp-flowtext.cpp
flags &= SP_OBJECT_MODIFIED_CASCADE;
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
g_object_ref(G_OBJECT(child));
l = g_slist_prepend(l, child);
}
}
}
- for (SPObject *o = sp_object_first_child(SP_OBJECT(ft)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(ft)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_FLOWREGION(o)) {
region = o;
break;
@@ -297,7 +297,7 @@ sp_flowtext_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
if ( flags & SP_OBJECT_WRITE_BUILD ) {
if ( repr == NULL ) repr = xml_doc->createElement("svg:flowRoot");
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node *c_repr = NULL;
if ( SP_IS_FLOWDIV(child) || SP_IS_FLOWPARA(child) || SP_IS_FLOWREGION(child) || SP_IS_FLOWREGIONEXCLUDE(child)) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -310,7 +310,7 @@ sp_flowtext_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
l = g_slist_remove(l, l->data);
}
} else {
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_FLOWDIV(child) || SP_IS_FLOWPARA(child) || SP_IS_FLOWREGION(child) || SP_IS_FLOWREGIONEXCLUDE(child) ) {
child->updateRepr(flags);
}
@@ -456,7 +456,7 @@ void SPFlowtext::_buildLayoutInput(SPObject *root, Shape const *exclusion_shape,
*pending_line_break_object = NULL;
}
- for (SPObject *child = sp_object_first_child(root) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = root->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_STRING(child)) {
if (*pending_line_break_object) {
if (SP_IS_FLOWREGIONBREAK(*pending_line_break_object))
SPObject *ft = SP_OBJECT (this);
SPObject *region = NULL;
- for (SPObject *o = sp_object_first_child(SP_OBJECT(ft)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(ft)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_FLOWREGION(o)) {
region = o;
break;
bool past = false;
SPItem *frame = NULL;
- for (SPObject *o = sp_object_first_child(SP_OBJECT(region)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(region)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_ITEM(o)) {
if (after == NULL || past) {
frame = SP_ITEM(o);
diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp
index bc86e21359e88b62c82c89d6cd53dbf4c826856c..604da3b7cfffb5c4337750ac8efd40d91ba681ab 100644 (file)
--- a/src/sp-gradient.cpp
+++ b/src/sp-gradient.cpp
@@ -426,7 +426,7 @@ void SPGradientImpl::build(SPObject *object, SPDocument *document, Inkscape::XML
(* ((SPObjectClass *) gradient_parent_class)->build)(object, document, repr);
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (SP_IS_STOP(ochild)) {
gradient->has_stops = TRUE;
break;
@@ -585,7 +585,7 @@ void SPGradientImpl::childAdded(SPObject *object, Inkscape::XML::Node *child, In
if (((SPObjectClass *) gradient_parent_class)->child_added)
(* ((SPObjectClass *) gradient_parent_class)->child_added)(object, child, ref);
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if ( ochild && SP_IS_STOP(ochild) ) {
gr->has_stops = TRUE;
}
gr->has_stops = FALSE;
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (SP_IS_STOP(ochild)) {
gr->has_stops = TRUE;
break;
// FIXME: climb up the ladder of hrefs
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
g_object_ref(G_OBJECT(child));
l = g_slist_prepend(l, child);
}
SPStop* SPGradient::getFirstStop()
{
SPStop* first = 0;
- for (SPObject *ochild = sp_object_first_child(this); ochild && !first; ochild = SP_OBJECT_NEXT(ochild)) {
+ for (SPObject *ochild = this->first_child(); ochild && !first; ochild = SP_OBJECT_NEXT(ochild)) {
if (SP_IS_STOP(ochild)) {
first = SP_STOP(ochild);
}
@@ -689,7 +689,7 @@ Inkscape::XML::Node *SPGradientImpl::write(SPObject *object, Inkscape::XML::Docu
if (flags & SP_OBJECT_WRITE_BUILD) {
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object); child; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = object->first_child(); child; child = SP_OBJECT_NEXT(child)) {
Inkscape::XML::Node *crepr;
crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend(l, crepr);
void SPGradient::rebuildVector()
{
gint len = 0;
- for ( SPObject *child = sp_object_first_child(SP_OBJECT(this)) ;
+ for ( SPObject *child = SP_OBJECT(this)->first_child() ;
child != NULL ;
child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_STOP(child)) {
}
}
- for (SPObject *child = sp_object_first_child(SP_OBJECT(this)) ;
+ for (SPObject *child = SP_OBJECT(this)->first_child() ;
child != NULL;
child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_STOP(child)) {
diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp
index 1d38771bc4ed8b29b759ac22f8dba1b48fb35b07..79a673e053b1da9b9c20f56256ac62e7bcd00d77 100644 (file)
--- a/src/sp-item-group.cpp
+++ b/src/sp-item-group.cpp
@@ -237,7 +237,7 @@ sp_group_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XM
repr = xml_doc->createElement("svg:g");
}
l = NULL;
- for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
@@ -248,7 +248,7 @@ sp_group_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XM
l = g_slist_remove (l, l->data);
}
} else {
- for (child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
child->updateRepr(flags);
}
static void sp_group_snappoints (SPItem const *item, std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs)
{
- for (SPObject const *o = sp_object_first_child(SP_OBJECT(item));
+ for (SPObject const *o = SP_OBJECT(item)->first_child();
o != NULL;
o = SP_OBJECT_NEXT(o))
{
/* Step 1 - generate lists of children objects */
GSList *items = NULL;
GSList *objects = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(group)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(group)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
GSList *s = NULL;
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_ITEM (o)) {
s = g_slist_prepend (s, o);
}
sp_item_group_get_child_by_name (SPGroup *group, SPObject *ref, const gchar *name)
{
SPObject *child;
- child = (ref) ? SP_OBJECT_NEXT(ref) : sp_object_first_child(SP_OBJECT(group));
+ child = (ref) ? SP_OBJECT_NEXT(ref) : SP_OBJECT(group)->first_child();
while ( child && strcmp (SP_OBJECT_REPR(child)->name(), name) ) {
child = SP_OBJECT_NEXT(child);
}
if (this->hasChildren())
{
SPObject *o = NULL;
- for (o = sp_object_first_child(SP_OBJECT(this)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (o = SP_OBJECT(this)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_ITEM (o)) {
sp_item_move_rel(static_cast<SPItem *>(o), tr);
}
}
}
} else { // general case
- SPObject *ochild = sp_object_get_child_by_repr(_group, child);
+ SPObject *ochild = _group->get_child_by_repr(child);
if ( ochild && SP_IS_ITEM(ochild) ) {
/* TODO: this should be moved into SPItem somehow */
SPItemView *v;
gint CGroup::getItemCount() {
gint len = 0;
- for (SPObject *o = sp_object_first_child(SP_OBJECT(_group)) ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(_group)->first_child() ; o != NULL ; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_ITEM(o)) {
len++;
}
void CGroup::onOrderChanged (Inkscape::XML::Node *child, Inkscape::XML::Node *, Inkscape::XML::Node *)
{
- SPObject *ochild = sp_object_get_child_by_repr(_group, child);
+ SPObject *ochild = _group->get_child_by_repr(child);
if ( ochild && SP_IS_ITEM(ochild) ) {
/* TODO: this should be moved into SPItem somehow */
SPItemView *v;
diff --git a/src/sp-item.cpp b/src/sp-item.cpp
index 72f318a257ad6e5f2cf3dcbae726569f0f6a10ba..7f67caee830d326447f7b750b0d6019fad307fe9 100644 (file)
--- a/src/sp-item.cpp
+++ b/src/sp-item.cpp
Inkscape::XML::Node *crepr;
GSList *l;
l = NULL;
- for (child = sp_object_first_child(object); child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child(); child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (!SP_IS_TITLE(child) && !SP_IS_DESC(child)) continue;
crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
l = g_slist_remove (l, l->data);
}
} else {
- for (child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (!SP_IS_TITLE(child) && !SP_IS_DESC(child)) continue;
child->updateRepr(flags);
}
SPObject *object = SP_OBJECT(this);
unsigned pos=0;
- for ( SPObject *iter = sp_object_first_child(parent) ; iter ; iter = SP_OBJECT_NEXT(iter)) {
+ for ( SPObject *iter = parent->first_child() ; iter ; iter = SP_OBJECT_NEXT(iter)) {
if ( iter == object ) {
return pos;
}
SPItem *
sp_item_first_item_child (SPObject *obj)
{
- for ( SPObject *iter = sp_object_first_child(obj) ; iter ; iter = SP_OBJECT_NEXT(iter)) {
+ for ( SPObject *iter = obj->first_child() ; iter ; iter = SP_OBJECT_NEXT(iter)) {
if (SP_IS_ITEM (iter))
return SP_ITEM (iter);
}
diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp
index 71352ed98992c2c6105c989f274e862c1c3de3ce..6c49b79c15cb14af20535b8188332767ec341585 100644 (file)
--- a/src/sp-lpe-item.cpp
+++ b/src/sp-lpe-item.cpp
@@ -681,7 +681,7 @@ sp_lpe_item_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape:
(* ((SPObjectClass *) (parent_class))->child_added) (object, child, ref);
if (SP_IS_LPE_ITEM(object) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(object))) {
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if ( ochild && SP_IS_LPE_ITEM(ochild) ) {
sp_lpe_item_create_original_path_recursive(SP_LPE_ITEM(ochild));
}
sp_lpe_item_remove_child (SPObject * object, Inkscape::XML::Node * child)
{
if (SP_IS_LPE_ITEM(object) && sp_lpe_item_has_path_effect_recursive(SP_LPE_ITEM(object))) {
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if ( ochild && SP_IS_LPE_ITEM(ochild) ) {
sp_lpe_item_cleanup_original_path_recursive(SP_LPE_ITEM(ochild));
}
diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp
index e57b5cc47aef3992bb3e2dc55c83593166b6cc7b..0c28cd014f7fd121f2a4c3fe10959190a41dbfc5 100644 (file)
--- a/src/sp-mask.cpp
+++ b/src/sp-mask.cpp
SPObjectGroup *og = SP_OBJECTGROUP (object);
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
SPObjectGroup *og = SP_OBJECTGROUP (object);
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(og)); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(og)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
g_object_ref (G_OBJECT (child));
l = g_slist_prepend (l, child);
}
NRArenaItem *ai = NRArenaGroup::create(arena);
mask->display = sp_mask_view_new_prepend (mask->display, key, ai);
- for (SPObject *child = sp_object_first_child(SP_OBJECT(mask)) ; child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(mask)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) {
if (SP_IS_ITEM (child)) {
NRArenaItem *ac = SP_ITEM (child)->invoke_show (arena, key, SP_ITEM_REFERENCE_FLAGS);
if (ac) {
g_return_if_fail (cp != NULL);
g_return_if_fail (SP_IS_MASK (cp));
- for (SPObject *child = sp_object_first_child(SP_OBJECT(cp)); child != NULL; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = SP_OBJECT(cp)->first_child(); child != NULL; child = SP_OBJECT_NEXT(child)) {
if (SP_IS_ITEM (child)) {
SP_ITEM(child)->invoke_hide (key);
}
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 8c750f347066e9e32fea0a8759b930d3fb6eea40..52c42866ea14c45a69d6dd40e960de1a6ce33438 100644 (file)
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -266,7 +266,7 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape:
sp_object_read_attr(object, "inkscape:connector-spacing");
/* Construct guideline list */
- for (SPObject *o = sp_object_first_child(SP_OBJECT(og)) ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(og)->first_child() ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_GUIDE(o)) {
SPGuide * g = SP_GUIDE(o);
nv->guides = g_slist_prepend(nv->guides, g);
}
// if that didn't work out, look for the topmost layer
if (!layer) {
- SPObject *iter = sp_object_first_child(SP_DOCUMENT_ROOT(document));
+ SPObject *iter = SP_DOCUMENT_ROOT(document)->first_child();
for ( ; iter ; iter = SP_OBJECT_NEXT(iter) ) {
if (desktop->isLayer(iter)) {
layer = iter;
index 1d5c0433974a67fdccfd647864aa3886e2920e07..02ae5d29a22cdc3ebf447609cdd4f094fb7d2525 100644 (file)
--- a/src/sp-object-group.cpp
+++ b/src/sp-object-group.cpp
@@ -112,7 +112,7 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inksca
repr = xml_doc->createElement("svg:g");
}
l = NULL;
- for ( child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for ( child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
crepr = child->updateRepr(xml_doc, NULL, flags);
if (crepr) l = g_slist_prepend (l, crepr);
}
@@ -122,7 +122,7 @@ sp_objectgroup_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inksca
l = g_slist_remove (l, l->data);
}
} else {
- for ( child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for ( child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
child->updateRepr(flags);
}
}
diff --git a/src/sp-object-repr.cpp b/src/sp-object-repr.cpp
index 62143e3ab047d458d07f611047ff00cf4935a75b..207d082775ed8b8f3beaf4e810679da58428b8a2 100644 (file)
--- a/src/sp-object-repr.cpp
+++ b/src/sp-object-repr.cpp
g_assert(newobj != NULL);
SPObject *const object = SP_OBJECT(newobj);
g_assert(object != NULL);
- sp_object_invoke_build(object, document, repr, FALSE);
+ object->invoke_build(document, repr, FALSE);
return object;
}
diff --git a/src/sp-object.cpp b/src/sp-object.cpp
index 08d13b2cc08f8be233c4bf72ff7352c7bce90cb0..edcdd60f52a0460636740d9c4200f3a45b8e61b0 100644 (file)
--- a/src/sp-object.cpp
+++ b/src/sp-object.cpp
*/
GSList *SPObject::childList(bool add_ref, Action) {
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(this) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = this->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (add_ref)
g_object_ref (G_OBJECT (child));
/** Sends the delete signal to all children of this object recursively */
void
SPObject::_sendDeleteSignalRecursive() {
- for (SPObject *child = sp_object_first_child(this); child; child = SP_OBJECT_NEXT(child)) {
+ for (SPObject *child = this->first_child(); child; child = SP_OBJECT_NEXT(child)) {
child->_delete_signal.emit(child);
child->_sendDeleteSignalRecursive();
}
* also update object's XML space.
*/
void
-sp_object_attach(SPObject *parent, SPObject *object, SPObject *prev)
+SPObject::attach(SPObject *object, SPObject *prev)
{
- g_return_if_fail(parent != NULL);
- g_return_if_fail(SP_IS_OBJECT(parent));
+ //g_return_if_fail(parent != NULL);
+ //g_return_if_fail(SP_IS_OBJECT(parent));
g_return_if_fail(object != NULL);
g_return_if_fail(SP_IS_OBJECT(object));
g_return_if_fail(!prev || SP_IS_OBJECT(prev));
- g_return_if_fail(!prev || prev->parent == parent);
+ g_return_if_fail(!prev || prev->parent == this);
g_return_if_fail(!object->parent);
- sp_object_ref(object, parent);
- object->parent = parent;
- parent->_updateTotalHRefCount(object->_total_hrefcount);
+ sp_object_ref(object, this);
+ object->parent = this;
+ this->_updateTotalHRefCount(object->_total_hrefcount);
SPObject *next;
if (prev) {
next = prev->next;
prev->next = object;
} else {
- next = parent->children;
- parent->children = object;
+ next = this->children;
+ this->children = object;
}
object->next = next;
if (!next) {
- parent->_last_child = object;
+ this->_last_child = object;
}
if (!object->xml_space.set)
- object->xml_space.value = parent->xml_space.value;
+ object->xml_space.value = this->xml_space.value;
}
/**
* In list of object's siblings, move object behind prev.
*/
void
-sp_object_reorder(SPObject *object, SPObject *prev) {
- g_return_if_fail(object != NULL);
- g_return_if_fail(SP_IS_OBJECT(object));
- g_return_if_fail(object->parent != NULL);
- g_return_if_fail(object != prev);
+SPObject::reorder(SPObject *prev) {
+ //g_return_if_fail(object != NULL);
+ //g_return_if_fail(SP_IS_OBJECT(object));
+ g_return_if_fail(this->parent != NULL);
+ g_return_if_fail(this != prev);
g_return_if_fail(!prev || SP_IS_OBJECT(prev));
- g_return_if_fail(!prev || prev->parent == object->parent);
+ g_return_if_fail(!prev || prev->parent == this->parent);
- SPObject *const parent=object->parent;
+ SPObject *const parent=this->parent;
SPObject *old_prev=NULL;
- for ( SPObject *child = parent->children ; child && child != object ;
+ for ( SPObject *child = parent->children ; child && child != this ;
child = child->next )
{
old_prev = child;
}
- SPObject *next=object->next;
+ SPObject *next=this->next;
if (old_prev) {
old_prev->next = next;
} else {
}
if (prev) {
next = prev->next;
- prev->next = object;
+ prev->next = this;
} else {
next = parent->children;
- parent->children = object;
+ parent->children = this;
}
- object->next = next;
+ this->next = next;
if (!next) {
- parent->_last_child = object;
+ parent->_last_child = this;
}
}
* Remove object from parent's children, release and unref it.
*/
void
-sp_object_detach(SPObject *parent, SPObject *object) {
- g_return_if_fail(parent != NULL);
- g_return_if_fail(SP_IS_OBJECT(parent));
+SPObject::detach(SPObject *object) {
+ //g_return_if_fail(parent != NULL);
+ //g_return_if_fail(SP_IS_OBJECT(parent));
g_return_if_fail(object != NULL);
g_return_if_fail(SP_IS_OBJECT(object));
- g_return_if_fail(object->parent == parent);
+ g_return_if_fail(object->parent == this);
object->releaseReferences();
SPObject *prev=NULL;
- for ( SPObject *child = parent->children ; child && child != object ;
+ for ( SPObject *child = this->children ; child && child != object ;
child = child->next )
{
prev = child;
if (prev) {
prev->next = next;
} else {
- parent->children = next;
+ this->children = next;
}
if (!next) {
- parent->_last_child = prev;
+ this->_last_child = prev;
}
object->next = NULL;
object->parent = NULL;
- parent->_updateTotalHRefCount(-object->_total_hrefcount);
- sp_object_unref(object, parent);
+ this->_updateTotalHRefCount(-object->_total_hrefcount);
+ sp_object_unref(object, this);
}
/**
* Return object's child whose node pointer equals repr.
*/
SPObject *
-sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr)
+SPObject::get_child_by_repr(Inkscape::XML::Node *repr)
{
- g_return_val_if_fail(object != NULL, NULL);
- g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
+ //g_return_val_if_fail(object != NULL, NULL);
+ //g_return_val_if_fail(SP_IS_OBJECT(object), NULL);
g_return_val_if_fail(repr != NULL, NULL);
- if (object->_last_child && SP_OBJECT_REPR(object->_last_child) == repr)
- return object->_last_child; // optimization for common scenario
- for ( SPObject *child = object->children ; child ; child = child->next ) {
+ if (this->_last_child && SP_OBJECT_REPR(this->_last_child) == repr)
+ return this->_last_child; // optimization for common scenario
+ for ( SPObject *child = this->children ; child ; child = child->next ) {
if ( SP_OBJECT_REPR(child) == repr ) {
return child;
}
@@ -750,11 +750,11 @@ sp_object_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XM
return;
}
SPObject *ochild = SP_OBJECT(g_object_new(type, 0));
- SPObject *prev = ref ? sp_object_get_child_by_repr(object, ref) : NULL;
- sp_object_attach(object, ochild, prev);
+ SPObject *prev = ref ? object->get_child_by_repr(ref) : NULL;
+ object->attach(ochild, prev);
sp_object_unref(ochild, NULL);
- sp_object_invoke_build(ochild, object->document, child, SP_OBJECT_IS_CLONED(object));
+ ochild->invoke_build(object->document, child, SP_OBJECT_IS_CLONED(object));
}
/**
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
while (object->children) {
- sp_object_detach(object, object->children);
+ object->detach(object->children);
}
}
sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child)
{
debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
g_return_if_fail (ochild != NULL || !strcmp("comment", child->name())); // comments have no objects
if (ochild)
- sp_object_detach(object, ochild);
+ object->detach(ochild);
}
/**
static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node */*old_ref*/,
Inkscape::XML::Node *new_ref)
{
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
g_return_if_fail(ochild != NULL);
- SPObject *prev = new_ref ? sp_object_get_child_by_repr(object, new_ref) : NULL;
- sp_object_reorder(ochild, prev);
+ SPObject *prev = new_ref ? object->get_child_by_repr(new_ref) : NULL;
+ ochild->reorder(prev);
ochild->_position_changed_signal.emit(ochild);
}
@@ -837,73 +837,73 @@ sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *rep
continue;
}
SPObject *child = SP_OBJECT(g_object_new(type, 0));
- sp_object_attach(object, child, object->lastChild());
+ object->attach(child, object->lastChild());
sp_object_unref(child, NULL);
- sp_object_invoke_build(child, document, rchild, SP_OBJECT_IS_CLONED(object));
+ child->invoke_build(document, rchild, SP_OBJECT_IS_CLONED(object));
}
}
-void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned)
+void SPObject::invoke_build(SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned)
{
- debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));
+ debug("id=%x, typename=%s", this, g_type_name_from_instance((GTypeInstance*)this));
- g_assert(object != NULL);
- g_assert(SP_IS_OBJECT(object));
+ //g_assert(object != NULL);
+ //g_assert(SP_IS_OBJECT(object));
g_assert(document != NULL);
g_assert(repr != NULL);
- g_assert(object->document == NULL);
- g_assert(object->repr == NULL);
- g_assert(object->getId() == NULL);
+ g_assert(this->document == NULL);
+ g_assert(this->repr == NULL);
+ g_assert(this->getId() == NULL);
/* Bookkeeping */
- object->document = document;
- object->repr = repr;
+ this->document = document;
+ this->repr = repr;
if (!cloned)
Inkscape::GC::anchor(repr);
- object->cloned = cloned;
+ this->cloned = cloned;
- if (!SP_OBJECT_IS_CLONED(object)) {
- object->document->bindObjectToRepr(object->repr, object);
+ if (!SP_OBJECT_IS_CLONED(this)) {
+ this->document->bindObjectToRepr(this->repr, this);
- if (Inkscape::XML::id_permitted(object->repr)) {
+ if (Inkscape::XML::id_permitted(this->repr)) {
/* If we are not cloned, and not seeking, force unique id */
- gchar const *id = object->repr->attribute("id");
+ gchar const *id = this->repr->attribute("id");
if (!document->isSeeking()) {
{
- gchar *realid = sp_object_get_unique_id(object, id);
+ gchar *realid = sp_object_get_unique_id(this, id);
g_assert(realid != NULL);
- object->document->bindObjectToId(realid, object);
- SPObjectImpl::setId(object, realid);
+ this->document->bindObjectToId(realid, this);
+ SPObjectImpl::setId(this, realid);
g_free(realid);
}
/* Redefine ID, if required */
- if ((id == NULL) || (strcmp(id, object->getId()) != 0)) {
- object->repr->setAttribute("id", object->getId());
+ if ((id == NULL) || (strcmp(id, this->getId()) != 0)) {
+ this->repr->setAttribute("id", this->getId());
}
} else if (id) {
// bind if id, but no conflict -- otherwise, we can expect
// a subsequent setting of the id attribute
- if (!object->document->getObjectById(id)) {
- object->document->bindObjectToId(id, object);
- SPObjectImpl::setId(object, id);
+ if (!this->document->getObjectById(id)) {
+ this->document->bindObjectToId(id, this);
+ SPObjectImpl::setId(this, id);
}
}
}
} else {
- g_assert(object->getId() == NULL);
+ g_assert(this->getId() == NULL);
}
/* Invoke derived methods, if any */
- if (((SPObjectClass *) G_OBJECT_GET_CLASS(object))->build) {
- (*((SPObjectClass *) G_OBJECT_GET_CLASS(object))->build)(object, document, repr);
+ if (((SPObjectClass *) G_OBJECT_GET_CLASS(this))->build) {
+ (*((SPObjectClass *) G_OBJECT_GET_CLASS(this))->build)(this, document, repr);
}
/* Signalling (should be connected AFTER processing derived methods */
- sp_repr_add_listener(repr, &object_event_vector, object);
+ sp_repr_add_listener(repr, &object_event_vector, this);
}
void SPObject::releaseReferences() {
sp_object_prev(SPObject *child)
{
SPObject *parent = SP_OBJECT_PARENT(child);
- for ( SPObject *i = sp_object_first_child(parent); i; i = SP_OBJECT_NEXT(i) ) {
+ for ( SPObject *i = parent->first_child(); i; i = SP_OBJECT_NEXT(i) ) {
if (SP_OBJECT_NEXT(i) == child)
return i;
}
diff --git a/src/sp-object.h b/src/sp-object.h
index 633091668909baf01e6bb3296136ee2ecd20b449..cb7a5a6ce16d1c93cbf41ea87ead81b4abdeaf90 100644 (file)
--- a/src/sp-object.h
+++ b/src/sp-object.h
CollectionPolicy _collection_policy;
gchar *_label;
mutable gchar *_default_label;
+ void attach(SPObject *object, SPObject *prev);
+ void reorder(SPObject *prev);
+ void detach(SPObject *object);
+ SPObject *get_child_by_repr(Inkscape::XML::Node *repr);
+ SPObject *first_child() {
+ return firstChild();
+ }
+ void invoke_build(SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
private:
// Private member functions used in the definitions of setTitle(),
* Attaching/detaching
*/
-void sp_object_attach(SPObject *parent, SPObject *object, SPObject *prev);
-void sp_object_reorder(SPObject *object, SPObject *prev);
-void sp_object_detach(SPObject *parent, SPObject *object);
+//void sp_object_attach(SPObject *parent, SPObject *object, SPObject *prev);
+//void sp_object_reorder(SPObject *object, SPObject *prev);
+//void sp_object_detach(SPObject *parent, SPObject *object);
-inline SPObject *sp_object_first_child(SPObject *parent) {
+/*inline SPObject *sp_object_first_child(SPObject *parent) {
return parent->firstChild();
-}
-SPObject *sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr);
+}*/
+//SPObject *sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr);
-void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
+//void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned);
void sp_object_set(SPObject *object, unsigned int key, gchar const *value);
diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp
index b076b5701abd9b760f160f5ae89d92c676a6ef0f..3958da66a9579e7e09d9999cd67ee390f8d19cb4 100644 (file)
--- a/src/sp-pattern.cpp
+++ b/src/sp-pattern.cpp
@@ -323,7 +323,7 @@ sp_pattern_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::
if (((SPObjectClass *) (pattern_parent_class))->child_added)
(* ((SPObjectClass *) (pattern_parent_class))->child_added) (object, child, ref);
- SPObject *ochild = sp_object_get_child_by_repr(object, child);
+ SPObject *ochild = object->get_child_by_repr(child);
if (SP_IS_ITEM (ochild)) {
SPPaintServer *ps = SP_PAINT_SERVER (pat);
GSList *l = NULL;
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
- if (sp_object_first_child(SP_OBJECT(pat_i))) { // find the first one with children
- for (SPObject *child = sp_object_first_child(SP_OBJECT (pat)) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ if (SP_OBJECT(pat_i)->first_child()) { // find the first one with children
+ for (SPObject *child = SP_OBJECT (pat)->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
l = g_slist_prepend (l, child);
}
break; // do not go further up the chain if children are found
pattern_getroot (SPPattern *pat)
{
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
- if (sp_object_first_child(SP_OBJECT(pat_i))) { // find the first one with children
+ if (SP_OBJECT (pat_i)->first_child()) { // find the first one with children
return pat_i;
}
}
bool pattern_hasItemChildren (SPPattern *pat)
{
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pat)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT (pat)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
return true;
}
@@ -736,7 +736,7 @@ sp_pattern_painter_new (SPPaintServer *ps, Geom::Matrix const &full_transform, G
pp->_release_connections = new std::map<SPObject *, sigc::connection>;
for (SPPattern *pat_i = pat; pat_i != NULL; pat_i = pat_i->ref ? pat_i->ref->getObject() : NULL) {
if (pat_i && SP_IS_OBJECT (pat_i) && pattern_hasItemChildren(pat_i)) { // find the first one with item children
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pat_i)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT (pat_i)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM (child)) {
// for each item in pattern,
NRArenaItem *cai;
diff --git a/src/sp-root.cpp b/src/sp-root.cpp
index 72c0b6de9690f429e426fa57e9217ff96c54d0ef..c032654ffb319d5d111987f03c7a26c94f0ca8aa 100644 (file)
--- a/src/sp-root.cpp
+++ b/src/sp-root.cpp
@@ -165,7 +165,7 @@ sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr)
(* ((SPObjectClass *) parent_class)->build) (object, document, repr);
/* Search for first <defs> node */
- for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
+ for (SPObject *o = SP_OBJECT(group)->first_child() ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
if (SP_IS_DEFS(o)) {
root->defs = SP_DEFS(o);
break;
@@ -360,7 +360,7 @@ sp_root_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML:
if (co && SP_IS_DEFS(co)) {
SPObject *c;
/* We search for first <defs> node - it is not beautiful, but works */
- for (c = sp_object_first_child(SP_OBJECT(group)) ; c != NULL; c = SP_OBJECT_NEXT(c) ) {
+ for (c = SP_OBJECT(group)->first_child() ; c != NULL; c = SP_OBJECT_NEXT(c) ) {
if (SP_IS_DEFS(c)) {
root->defs = SP_DEFS(c);
break;
if ( root->defs && SP_OBJECT_REPR(root->defs) == child ) {
SPObject *iter;
/* We search for first remaining <defs> node - it is not beautiful, but works */
- for ( iter = sp_object_first_child(object) ; iter ; iter = SP_OBJECT_NEXT(iter) ) {
+ for ( iter = object->first_child() ; iter ; iter = SP_OBJECT_NEXT(iter) ) {
if ( SP_IS_DEFS(iter) && (SPDefs *)iter != root->defs ) {
root->defs = (SPDefs *)iter;
break;
index 6d0b59daa5629fcb55b449623ed369b55863f88c..38dc1d367a68feb62abbbabd63ad204684a88306 100644 (file)
--- a/src/sp-style-elem-test.h
+++ b/src/sp-style-elem-test.h
SPStyleElem &style_elem = *SP_STYLE_ELEM(g_object_new(SP_TYPE_STYLE_ELEM, NULL));
Inkscape::XML::Node *const repr = sp_document_repr_doc(_doc)->createElement("svg:style");
repr->setAttribute("type", "text/css");
- sp_object_invoke_build(&style_elem, _doc, repr, false);
+ (&style_elem)->invoke_build( _doc, repr, false);
TS_ASSERT( style_elem.is_css );
TS_ASSERT( style_elem.media.print );
TS_ASSERT( style_elem.media.screen );
repr->setAttribute("type", "text/css");
Inkscape::XML::Node *const content_repr = sp_document_repr_doc(_doc)->createTextNode(".myclass { }");
repr->addChild(content_repr, NULL);
- sp_object_invoke_build(&style_elem, _doc, repr, false);
+ (&style_elem)->invoke_build(_doc, repr, false);
TS_ASSERT( style_elem.is_css );
TS_ASSERT( _doc->style_cascade );
CRStyleSheet const *const stylesheet = cr_cascade_get_sheet(_doc->style_cascade, ORIGIN_AUTHOR);
diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp
index 07575c4f02c0304df97248b218d7201df62ca3b6..2d67b8637533a0607bdb4f1f86aa46cbf93cbd24 100644 (file)
--- a/src/sp-switch.cpp
+++ b/src/sp-switch.cpp
}
SPObject *CSwitch::_evaluateFirst() {
- for (SPObject *child = sp_object_first_child(_group) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = _group->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child) && sp_item_evaluate(SP_ITEM(child)))
return child;
}
diff --git a/src/sp-text.cpp b/src/sp-text.cpp
index 46e17a75a8ebe21504b535b84ff763caa203d935..7bdd84989825ccf4a79b71be0c4fe7ce62960d5b 100644 (file)
--- a/src/sp-text.cpp
+++ b/src/sp-text.cpp
/* Create temporary list of children */
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
sp_object_ref (SP_OBJECT (child), object);
l = g_slist_prepend (l, child);
}
/* Create temporary list of children */
GSList *l = NULL;
SPObject *child;
- for (child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
sp_object_ref (SP_OBJECT (child), object);
l = g_slist_prepend (l, child);
}
@@ -310,7 +310,7 @@ sp_text_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML
if (!repr)
repr = xml_doc->createElement("svg:text");
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
Inkscape::XML::Node *crepr = NULL;
if (SP_IS_STRING(child)) {
@@ -326,7 +326,7 @@ sp_text_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML
l = g_slist_remove (l, l->data);
}
} else {
- for (SPObject *child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_TITLE(child) || SP_IS_DESC(child)) continue;
if (SP_IS_STRING(child)) {
SP_OBJECT_REPR(child)->setContent(SP_STRING(child)->string.c_str());
@@ -565,7 +565,7 @@ unsigned SPText::_buildLayoutInput(SPObject *root, Inkscape::Text::Layout::Optio
child_attrs_offset--;
}
- for (SPObject *child = sp_object_first_child(root) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = root->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_STRING(child)) {
Glib::ustring const &string = SP_STRING(child)->string;
layout.appendText(string, root->style, child, &optional_attrs, child_attrs_offset + length);
diff --git a/src/sp-textpath.h b/src/sp-textpath.h
index 19319660664365395e4602e46110d6d9568cb0f6..6642587d2776b4ad0f597628c2d0b6b7de8e1cd8 100644 (file)
--- a/src/sp-textpath.h
+++ b/src/sp-textpath.h
GType sp_textpath_get_type();
-#define SP_IS_TEXT_TEXTPATH(obj) (SP_IS_TEXT(obj) && sp_object_first_child(obj) && SP_IS_TEXTPATH(sp_object_first_child(obj)))
+#define SP_IS_TEXT_TEXTPATH(obj) (SP_IS_TEXT(obj) && obj->first_child() && SP_IS_TEXTPATH(obj->first_child()))
SPItem *sp_textpath_get_path_item(SPTextPath *tp);
void sp_textpath_to_text(SPObject *tp);
diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp
index 382b557401bb8460d7b94a243d5683874db9d181..850ebbd423bdbf2ef7f3d25755c46ae74804c0e6 100644 (file)
--- a/src/sp-tref.cpp
+++ b/src/sp-tref.cpp
tref->_delete_connection.disconnect();
if (tref->stringChild) {
- sp_object_detach(SP_OBJECT(tref), tref->stringChild);
+ SP_OBJECT(tref)->detach(tref->stringChild);
tref->stringChild = NULL;
}
build_string_from_root(SP_OBJECT_REPR(tref->getObjectReferredTo()), &charData);
if (tref->stringChild) {
- sp_object_detach(SP_OBJECT(tref), tref->stringChild);
+ SP_OBJECT(tref)->detach(tref->stringChild);
tref->stringChild = NULL;
}
tref->stringChild = SP_OBJECT(g_object_new(sp_repr_type_lookup(newStringRepr), NULL));
// Add this SPString as a child of the tref
- sp_object_attach(SP_OBJECT(tref), tref->stringChild, tref->lastChild());
+ SP_OBJECT(tref)->attach(tref->stringChild, tref->lastChild());
sp_object_unref(tref->stringChild, NULL);
- sp_object_invoke_build(tref->stringChild, SP_OBJECT(tref)->document, newStringRepr, TRUE);
+ (tref->stringChild)->invoke_build(SP_OBJECT(tref)->document, newStringRepr, TRUE);
Inkscape::GC::release(newStringRepr);
}
////////////////////
else {
GSList *l = NULL;
- for (SPObject *child = sp_object_first_child(obj) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = obj->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
sp_object_ref (SP_OBJECT (child), obj);
l = g_slist_prepend (l, child);
}
diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp
index db2fe6feda237ca3a751ea0129c5516d23097d86..a7391ac9862eb901a0cc507ee6852024ee57e07b 100644 (file)
--- a/src/sp-tspan.cpp
+++ b/src/sp-tspan.cpp
flags &= SP_OBJECT_MODIFIED_CASCADE;
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if ( flags || ( ochild->uflags & SP_OBJECT_MODIFIED_FLAG )) {
ochild->updateDisplay(ctx, flags);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (flags || (ochild->mflags & SP_OBJECT_MODIFIED_FLAG)) {
ochild->emitModified(flags);
}
@@ -242,7 +242,7 @@ sp_tspan_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML
if ( flags&SP_OBJECT_WRITE_BUILD ) {
GSList *l = NULL;
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -259,7 +259,7 @@ sp_tspan_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML
l = g_slist_remove(l, l->data);
}
} else {
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
child->updateRepr(flags);
} else if ( SP_IS_TEXTPATH(child) ) {
flags &= SP_OBJECT_MODIFIED_CASCADE;
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if ( flags || ( ochild->uflags & SP_OBJECT_MODIFIED_FLAG )) {
ochild->updateDisplay(ctx, flags);
}
flags &= SP_OBJECT_MODIFIED_CASCADE;
SPObject *ochild;
- for ( ochild = sp_object_first_child(object) ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( ochild = object->first_child() ; ochild ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (flags || (ochild->mflags & SP_OBJECT_MODIFIED_FLAG)) {
ochild->emitModified(flags);
}
@@ -526,7 +526,7 @@ sp_textpath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
if ( flags&SP_OBJECT_WRITE_BUILD ) {
GSList *l = NULL;
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
Inkscape::XML::Node* c_repr=NULL;
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
c_repr = child->updateRepr(xml_doc, NULL, flags);
@@ -543,7 +543,7 @@ sp_textpath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::
l = g_slist_remove(l, l->data);
}
} else {
- for (SPObject* child = sp_object_first_child(object) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject* child = object->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if ( SP_IS_TSPAN(child) || SP_IS_TREF(child) ) {
child->updateRepr(flags);
} else if ( SP_IS_TEXTPATH(child) ) {
diff --git a/src/sp-use.cpp b/src/sp-use.cpp
index 1125550c83a6a6579d65f19383e3a249a581fb50..3770b2324b95340c14406e51d8de403d426e9c72 100644 (file)
--- a/src/sp-use.cpp
+++ b/src/sp-use.cpp
SPUse *use = (SPUse *) obj;
if (use->child) {
- sp_object_detach(SP_OBJECT(obj), use->child);
+ SP_OBJECT(obj)->detach(use->child);
use->child = NULL;
}
SPUse *use = SP_USE(object);
if (use->child) {
- sp_object_detach(object, use->child);
+ object->detach(use->child);
use->child = NULL;
}
use->_transformed_connection.disconnect();
if (use->child) {
- sp_object_detach(SP_OBJECT(use), use->child);
+ SP_OBJECT(use)->detach(use->child);
use->child = NULL;
}
g_return_if_fail(type > G_TYPE_NONE);
if (g_type_is_a(type, SP_TYPE_ITEM)) {
use->child = (SPObject*) g_object_new(type, 0);
- sp_object_attach(SP_OBJECT(use), use->child, use->lastChild());
+ SP_OBJECT(use)->attach(use->child, use->lastChild());
sp_object_unref(use->child, SP_OBJECT(use));
- sp_object_invoke_build(use->child, SP_OBJECT(use)->document, childrepr, TRUE);
+ (use->child)->invoke_build(SP_OBJECT(use)->document, childrepr, TRUE);
for (SPItemView *v = item->display; v != NULL; v = v->next) {
NRArenaItem *ai;
diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp
index 5af97165e8004165da727093cee7dc2469ad647a..9d4c23b258d66ea5f1c468acae1c14f7f3f7d24d 100644 (file)
--- a/src/text-chemistry.cpp
+++ b/src/text-chemistry.cpp
continue;
}
- SPObject *tp = sp_object_first_child(SP_OBJECT(items->data));
+ SPObject *tp = SP_OBJECT(items->data)->first_child();
did = true;
g_strfreev(xa_comma);
}
- for (SPObject *i = sp_object_first_child(o); i != NULL; i = SP_OBJECT_NEXT(i)) {
+ for (SPObject *i = o->first_child(); i != NULL; i = SP_OBJECT_NEXT(i)) {
text_remove_all_kerns_recursively(i);
}
}
diff --git a/src/text-editing.cpp b/src/text-editing.cpp
index 6000593038a597b61913c321390c300a6f5d13ea..2ed5270fdf3ffaced0a0abfa4a8077b85f4c06f8 100644 (file)
--- a/src/text-editing.cpp
+++ b/src/text-editing.cpp
SPObject *object;
bool is_textpath = false;
if (SP_IS_TEXT_TEXTPATH (text)) {
- repr = SP_OBJECT_REPR (sp_object_first_child(SP_OBJECT (text)));
- object = sp_object_first_child(SP_OBJECT (text));
+ repr = SP_OBJECT_REPR (SP_OBJECT (text)->first_child());
+ object = SP_OBJECT (text)->first_child();
is_textpath = true;
} else {
repr = SP_OBJECT_REPR (text);
{
sp_repr_css_change(SP_OBJECT_REPR(o), const_cast<SPCSSAttr*>(css), "style");
- for (SPObject *child = sp_object_first_child(SP_OBJECT(o)) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(o)->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (sp_repr_css_property(const_cast<SPCSSAttr*>(css), "opacity", NULL) != NULL) {
// Unset properties which are accumulating and thus should not be set recursively.
// For example, setting opacity 0.5 on a group recursively would result in the visible opacity of 0.25 for an item in the group.
@@ -1418,7 +1418,7 @@ static void recursively_apply_style(SPObject *common_ancestor, SPCSSAttr const *
child_span->appendChild(text_in_span);
Inkscape::GC::release(text_in_span);
child->deleteObject();
- child = sp_object_get_child_by_repr(common_ancestor, child_span);
+ child = common_ancestor->get_child_by_repr(child_span);
} else
surround_entire_string = true;
@@ -1430,7 +1430,7 @@ static void recursively_apply_style(SPObject *common_ancestor, SPCSSAttr const *
SP_OBJECT_REPR(common_ancestor)->removeChild(child_repr);
child_span->appendChild(child_repr);
Inkscape::GC::release(child_repr);
- child = sp_object_get_child_by_repr(common_ancestor, child_span);
+ child = common_ancestor->get_child_by_repr(child_span);
}
Inkscape::GC::release(child_span);
diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp
index cd6ff325ad87a4cb35ed0181294da9f89f067e0b..775e7aec35c76ddc5b7ec4fd52c7855cf30af1eb 100644 (file)
--- a/src/tweak-context.cpp
+++ b/src/tweak-context.cpp
@@ -425,7 +425,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P
if (SP_IS_GROUP(item) && !SP_IS_BOX3D(item)) {
GSList *children = NULL;
- for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(item)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
children = g_slist_prepend(children, child);
}
double offset_l = 0;
double offset_h = 0;
SPObject *child_prev = NULL;
- for (SPObject *child = sp_object_first_child(vector);
+ for (SPObject *child = vector->first_child();
child != NULL; child = SP_OBJECT_NEXT(child)) {
if (!SP_IS_STOP(child))
continue;
bool did = false;
if (SP_IS_GROUP(item)) {
- for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(item)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
if (SP_IS_ITEM(child)) {
if (sp_tweak_color_recursive (mode, SP_ITEM(child), item_at_point,
fill_goal, do_fill,
diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp
index aa59a7b2344b922dbf3c165b76c2ee3d3204b0ed..e050d69b4b81bc311080c46dfca05d70899aab8a 100644 (file)
--- a/src/ui/clipboard.cpp
+++ b/src/ui/clipboard.cpp
}
// Copy text paths
if (SP_IS_TEXT_TEXTPATH(item)) {
- _copyTextPath(SP_TEXTPATH(sp_object_first_child(SP_OBJECT(item))));
+ _copyTextPath(SP_TEXTPATH(SP_OBJECT(item)->first_child()));
}
// Copy clipping objects
if (item->clip_ref->getObject()) {
_copyNode(SP_OBJECT_REPR(pattern), _doc, _defs);
// items in the pattern may also use gradients and other patterns, so recurse
- for (SPObject *child = sp_object_first_child(SP_OBJECT(pattern)) ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
+ for (SPObject *child = SP_OBJECT(pattern)->first_child() ; child != NULL ; child = SP_OBJECT_NEXT(child) ) {
if (!SP_IS_ITEM (child)) {
continue;
}
diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp
index 837b822913bdc803859c3dbc839bb210d3e2042b..5068e3bf4c91874eb6f08d85c73d1be4aaa613a7 100644 (file)
--- a/src/ui/dialog/find.cpp
+++ b/src/ui/dialog/find.cpp
if (!strcmp (SP_OBJECT_REPR (r)->name(), "svg:metadata"))
return l; // we're not interested in metadata
- for (SPObject *child = sp_object_first_child(r); child; child = SP_OBJECT_NEXT (child)) {
+ for (SPObject *child = r->first_child(); child; child = SP_OBJECT_NEXT (child)) {
if (SP_IS_ITEM (child) && !SP_OBJECT_IS_CLONED (child) && !desktop->isLayer(SP_ITEM(child))) {
if ((hidden || !desktop->itemIsHidden(SP_ITEM(child))) && (locked || !SP_ITEM(child)->isLocked())) {
l = g_slist_prepend (l, child);
index d8bbcd788c31665d977cc0bd52facde59d7fc04c..ffa5b12dd11392c6d56f827e348359fac0d5e56c 100644 (file)
int i = 0;
SPStop *stop = NULL;
/* count stops */
- for ( SPObject *ochild = sp_object_first_child(SP_OBJECT(gradient)) ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( SPObject *ochild = SP_OBJECT(gradient)->first_child() ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (SP_IS_STOP(ochild)) {
i++;
stop = SP_STOP(ochild);
static void select_stop_in_list( GtkWidget *mnu, SPGradient *gradient, SPStop *new_stop)
{
int i = 0;
- for ( SPObject *ochild = sp_object_first_child(SP_OBJECT(gradient)) ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( SPObject *ochild = SP_OBJECT(gradient)->first_child() ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (SP_IS_STOP(ochild)) {
if (SP_OBJECT(ochild) == SP_OBJECT(new_stop)) {
gtk_option_menu_set_history(GTK_OPTION_MENU(mnu), i);
@@ -536,7 +536,7 @@ static void update_stop_list( GtkWidget *mnu, SPGradient *gradient, SPStop *new_
gtk_widget_show(m);
GSList *sl = NULL;
if ( gradient->hasStops() ) {
- for ( SPObject *ochild = sp_object_first_child(SP_OBJECT(gradient)) ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
+ for ( SPObject *ochild = SP_OBJECT(gradient)->first_child() ; ochild != NULL ; ochild = SP_OBJECT_NEXT(ochild) ) {
if (SP_IS_STOP(ochild)) {
sl = g_slist_append(sl, ochild);
}
index 0d7b95f4c5f3c3ec5e16d3ff72a644107800be20..65732d4885312572df5746297d0194c0ddeb3fe3 100644 (file)
GSList *ml = NULL;
SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS (source);
- for ( SPObject *child = sp_object_first_child(SP_OBJECT(defs));
+ for ( SPObject *child = SP_OBJECT(defs)->first_child();
child != NULL;
child = SP_OBJECT_NEXT (child) )
{