From 1e25ba03dddd007b9849ce31bcc365fa39102a2d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 19 Aug 2012 22:12:31 +0200 Subject: Added "virtual pad" to - SPFlowregion - SPFlowregionExclude (bzr r11608.1.24) --- src/sp-flowregion.cpp | 160 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 112 insertions(+), 48 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 649193c33..8dc8ebf8a 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -101,9 +101,20 @@ sp_flowregion_class_init (SPFlowregionClass *klass) item_class->description = sp_flowregion_description; } +CFlowregion::CFlowregion(SPFlowregion* flowregion) : CItem(flowregion) { + this->spflowregion = flowregion; +} + +CFlowregion::~CFlowregion() { +} + static void sp_flowregion_init (SPFlowregion *group) { + group->cflowregion = new CFlowregion(group); + group->citem = group->cflowregion; + group->cobject = group->cflowregion; + new (&group->computed) std::vector; } @@ -116,39 +127,44 @@ sp_flowregion_dispose(GObject *object) group->computed.~vector(); } -static void sp_flowregion_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) -{ - SP_ITEM(object); +void CFlowregion::onChildAdded(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { + SPFlowregion* object = this->spflowregion; - if (((SPObjectClass *) (flowregion_parent_class))->child_added) { - (* ((SPObjectClass *) (flowregion_parent_class))->child_added) (object, child, ref); - } + CItem::onChildAdded(child, ref); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } +static void sp_flowregion_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) +{ + ((SPFlowregion*)object)->cflowregion->onChildAdded(child, ref); +} + /* fixme: hide (Lauris) */ +void CFlowregion::onRemoveChild(Inkscape::XML::Node * child) { + SPFlowregion* object = this->spflowregion; + + CItem::onRemoveChild(child); + + object->requestModified(SP_OBJECT_MODIFIED_FLAG); +} + static void sp_flowregion_remove_child (SPObject * object, Inkscape::XML::Node * child) { - if (((SPObjectClass *) (flowregion_parent_class))->remove_child) - (* ((SPObjectClass *) (flowregion_parent_class))->remove_child) (object, child); - - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + ((SPFlowregion*)object)->cflowregion->onRemoveChild(child); } +void CFlowregion::onUpdate(SPCtx *ctx, unsigned int flags) { + SPFlowregion* object = this->spflowregion; -static void sp_flowregion_update(SPObject *object, SPCtx *ctx, unsigned int flags) -{ SPFlowregion *group = SP_FLOWREGION(object); SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - if (((SPObjectClass *) (flowregion_parent_class))->update) { - ((SPObjectClass *) (flowregion_parent_class))->update (object, ctx, flags); - } + CItem::onUpdate(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -180,6 +196,11 @@ static void sp_flowregion_update(SPObject *object, SPCtx *ctx, unsigned int flag group->UpdateComputed(); } +static void sp_flowregion_update(SPObject *object, SPCtx *ctx, unsigned int flags) +{ + ((SPFlowregion*)object)->cflowregion->onUpdate(ctx, flags); +} + void SPFlowregion::UpdateComputed(void) { for (std::vector::iterator it = computed.begin() ; it != computed.end() ; ++it) { @@ -194,9 +215,8 @@ void SPFlowregion::UpdateComputed(void) } } -static void sp_flowregion_modified(SPObject *object, guint flags) -{ - SP_FLOWREGION(object); // ensure it is the proper type. +void CFlowregion::onModified(guint flags) { + SPFlowregion* object = this->spflowregion; if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -219,8 +239,14 @@ static void sp_flowregion_modified(SPObject *object, guint flags) } } -static Inkscape::XML::Node *sp_flowregion_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +static void sp_flowregion_modified(SPObject *object, guint flags) { + ((SPFlowregion*)object)->cflowregion->onModified(flags); +} + +Inkscape::XML::Node *CFlowregion::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPFlowregion* object = this->spflowregion; + if (flags & SP_OBJECT_WRITE_BUILD) { if ( repr == NULL ) { repr = xml_doc->createElement("svg:flowRegion"); @@ -250,20 +276,26 @@ static Inkscape::XML::Node *sp_flowregion_write(SPObject *object, Inkscape::XML: } } - if (((SPObjectClass *) (flowregion_parent_class))->write) { - ((SPObjectClass *) (flowregion_parent_class))->write (object, xml_doc, repr, flags); - } + CItem::onWrite(xml_doc, repr, flags); return repr; } - -static gchar *sp_flowregion_description(SPItem */*item*/) +static Inkscape::XML::Node *sp_flowregion_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + return ((SPFlowregion*)object)->cflowregion->onWrite(xml_doc, repr, flags); +} + +gchar* CFlowregion::onDescription() { // TRANSLATORS: "Flow region" is an area where text is allowed to flow return g_strdup_printf(_("Flow region")); } +static gchar *sp_flowregion_description(SPItem *item) +{ + return ((SPFlowregion*)item)->cflowregion->onDescription(); +} + /* * */ @@ -314,9 +346,20 @@ sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) item_class->description = sp_flowregionexclude_description; } +CFlowregionExclude::CFlowregionExclude(SPFlowregionExclude* flowregionexclude) : CItem(flowregionexclude) { + this->spflowregionexclude = flowregionexclude; +} + +CFlowregionExclude::~CFlowregionExclude() { +} + static void sp_flowregionexclude_init (SPFlowregionExclude *group) { + group->cflowregionexclude = new CFlowregionExclude(group); + group->citem = group->cflowregionexclude; + group->cobject = group->cflowregionexclude; + group->computed = NULL; } @@ -330,39 +373,44 @@ sp_flowregionexclude_dispose(GObject *object) } } -static void sp_flowregionexclude_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) -{ - SP_ITEM(object); +void CFlowregionExclude::onChildAdded(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { + SPFlowregionExclude* object = this->spflowregionexclude; - if (((SPObjectClass *) (flowregionexclude_parent_class))->child_added) { - (* ((SPObjectClass *) (flowregionexclude_parent_class))->child_added) (object, child, ref); - } + CItem::onChildAdded(child, ref); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } +static void sp_flowregionexclude_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) +{ + ((SPFlowregionExclude*)object)->cflowregionexclude->onChildAdded(child, ref); +} + /* fixme: hide (Lauris) */ +void CFlowregionExclude::onRemoveChild(Inkscape::XML::Node * child) { + SPFlowregionExclude* object = this->spflowregionexclude; + + CItem::onRemoveChild(child); + + object->requestModified(SP_OBJECT_MODIFIED_FLAG); +} + static void sp_flowregionexclude_remove_child (SPObject * object, Inkscape::XML::Node * child) { - if (((SPObjectClass *) (flowregionexclude_parent_class))->remove_child) - (* ((SPObjectClass *) (flowregionexclude_parent_class))->remove_child) (object, child); - - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + ((SPFlowregionExclude*)object)->cflowregionexclude->onRemoveChild(child); } +void CFlowregionExclude::onUpdate(SPCtx *ctx, unsigned int flags) { + SPFlowregionExclude* object = this->spflowregionexclude; -static void sp_flowregionexclude_update(SPObject *object, SPCtx *ctx, unsigned int flags) -{ SPFlowregionExclude *group = SP_FLOWREGIONEXCLUDE (object); SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - if (((SPObjectClass *) (flowregionexclude_parent_class))->update) { - ((SPObjectClass *) (flowregionexclude_parent_class))->update (object, ctx, flags); - } + CItem::onUpdate(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -394,6 +442,11 @@ static void sp_flowregionexclude_update(SPObject *object, SPCtx *ctx, unsigned i group->UpdateComputed(); } +static void sp_flowregionexclude_update(SPObject *object, SPCtx *ctx, unsigned int flags) +{ + ((SPFlowregionExclude*)object)->cflowregionexclude->onUpdate(ctx, flags); +} + void SPFlowregionExclude::UpdateComputed(void) { if (computed) { @@ -406,9 +459,8 @@ void SPFlowregionExclude::UpdateComputed(void) } } -static void sp_flowregionexclude_modified(SPObject *object, guint flags) -{ - SP_FLOWREGIONEXCLUDE(object); // Ensure it is the proper type +void CFlowregionExclude::onModified(guint flags) { + SPFlowregionExclude* object = this->spflowregionexclude; if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -431,8 +483,14 @@ static void sp_flowregionexclude_modified(SPObject *object, guint flags) } } -static Inkscape::XML::Node *sp_flowregionexclude_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +static void sp_flowregionexclude_modified(SPObject *object, guint flags) { + ((SPFlowregionExclude*)object)->cflowregionexclude->onModified(flags); +} + +Inkscape::XML::Node *CFlowregionExclude::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPFlowregionExclude* object = this->spflowregionexclude; + if (flags & SP_OBJECT_WRITE_BUILD) { if ( repr == NULL ) { repr = xml_doc->createElement("svg:flowRegionExclude"); @@ -458,16 +516,17 @@ static Inkscape::XML::Node *sp_flowregionexclude_write(SPObject *object, Inkscap } } - if (((SPObjectClass *) (flowregionexclude_parent_class))->write) { - ((SPObjectClass *) (flowregionexclude_parent_class))->write (object, xml_doc, repr, flags); - } + CItem::onWrite(xml_doc, repr, flags); return repr; } - -static gchar *sp_flowregionexclude_description(SPItem */*item*/) +static Inkscape::XML::Node *sp_flowregionexclude_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + return ((SPFlowregionExclude*)object)->cflowregionexclude->onWrite(xml_doc, repr, flags); +} + +gchar* CFlowregionExclude::onDescription() { /* TRANSLATORS: A region "cut out of" a flow region; text is not allowed to flow inside the * flow excluded region. flowRegionExclude in SVG 1.2: see * http://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html#flowRegion-elem and @@ -475,6 +534,11 @@ static gchar *sp_flowregionexclude_description(SPItem */*item*/) return g_strdup_printf(_("Flow excluded region")); } +static gchar *sp_flowregionexclude_description(SPItem *item) +{ + return ((SPFlowregionExclude*)item)->cflowregionexclude->onDescription(); +} + /* * */ -- cgit v1.2.3 From 99cb30e28d4ee193f39e23464abbd7630cac8a2d Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 6 Oct 2012 23:56:27 +0200 Subject: Added virtual pad to SPFlowtext; removed old calls to virtual SPItem methods. (bzr r11608.1.46) --- src/sp-flowregion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 8dc8ebf8a..a72b2bea0 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -98,7 +98,7 @@ sp_flowregion_class_init (SPFlowregionClass *klass) sp_object_class->modified = sp_flowregion_modified; sp_object_class->write = sp_flowregion_write; - item_class->description = sp_flowregion_description; +// item_class->description = sp_flowregion_description; } CFlowregion::CFlowregion(SPFlowregion* flowregion) : CItem(flowregion) { @@ -343,7 +343,7 @@ sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) sp_object_class->modified = sp_flowregionexclude_modified; sp_object_class->write = sp_flowregionexclude_write; - item_class->description = sp_flowregionexclude_description; +// item_class->description = sp_flowregionexclude_description; } CFlowregionExclude::CFlowregionExclude(SPFlowregionExclude* flowregionexclude) : CItem(flowregionexclude) { -- cgit v1.2.3 From 957c3e4b7909d42c5a13f1b1dd583f877fc32259 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 30 Mar 2013 00:46:57 +0100 Subject: Removed function pointers from SPObject and subclasses. Added some missing virtual pads for classes that were hidden by preprocessor macros. (bzr r11608.1.55) --- src/sp-flowregion.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index a72b2bea0..b81e18d32 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -92,11 +92,11 @@ sp_flowregion_class_init (SPFlowregionClass *klass) object_class->dispose = sp_flowregion_dispose; - sp_object_class->child_added = sp_flowregion_child_added; - sp_object_class->remove_child = sp_flowregion_remove_child; - sp_object_class->update = sp_flowregion_update; - sp_object_class->modified = sp_flowregion_modified; - sp_object_class->write = sp_flowregion_write; +// sp_object_class->child_added = sp_flowregion_child_added; +// sp_object_class->remove_child = sp_flowregion_remove_child; +// sp_object_class->update = sp_flowregion_update; +// sp_object_class->modified = sp_flowregion_modified; +// sp_object_class->write = sp_flowregion_write; // item_class->description = sp_flowregion_description; } @@ -337,11 +337,11 @@ sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) object_class->dispose = sp_flowregionexclude_dispose; - sp_object_class->child_added = sp_flowregionexclude_child_added; - sp_object_class->remove_child = sp_flowregionexclude_remove_child; - sp_object_class->update = sp_flowregionexclude_update; - sp_object_class->modified = sp_flowregionexclude_modified; - sp_object_class->write = sp_flowregionexclude_write; +// sp_object_class->child_added = sp_flowregionexclude_child_added; +// sp_object_class->remove_child = sp_flowregionexclude_remove_child; +// sp_object_class->update = sp_flowregionexclude_update; +// sp_object_class->modified = sp_flowregionexclude_modified; +// sp_object_class->write = sp_flowregionexclude_write; // item_class->description = sp_flowregionexclude_description; } -- cgit v1.2.3 From 7df6616da5ea2debb86838366ddf746841549cdb Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sat, 30 Mar 2013 00:56:13 +0100 Subject: Renamed virtual function names. (bzr r11608.1.57) --- src/sp-flowregion.cpp | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 4208a0ed0..da30db7d3 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -71,26 +71,26 @@ sp_flowregion_dispose(GObject *object) group->computed.~vector(); } -void CFlowregion::onChildAdded(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { +void CFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { SPFlowregion* object = this->spflowregion; - CItem::onChildAdded(child, ref); + CItem::child_added(child, ref); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } /* fixme: hide (Lauris) */ -void CFlowregion::onRemoveChild(Inkscape::XML::Node * child) { +void CFlowregion::remove_child(Inkscape::XML::Node * child) { SPFlowregion* object = this->spflowregion; - CItem::onRemoveChild(child); + CItem::remove_child(child); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void CFlowregion::onUpdate(SPCtx *ctx, unsigned int flags) { +void CFlowregion::update(SPCtx *ctx, unsigned int flags) { SPFlowregion* object = this->spflowregion; SPFlowregion *group = SP_FLOWREGION(object); @@ -98,7 +98,7 @@ void CFlowregion::onUpdate(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - CItem::onUpdate(ctx, flags); + CItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -144,7 +144,7 @@ void SPFlowregion::UpdateComputed(void) } } -void CFlowregion::onModified(guint flags) { +void CFlowregion::modified(guint flags) { SPFlowregion* object = this->spflowregion; if (flags & SP_OBJECT_MODIFIED_FLAG) { @@ -168,7 +168,7 @@ void CFlowregion::onModified(guint flags) { } } -Inkscape::XML::Node *CFlowregion::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { +Inkscape::XML::Node *CFlowregion::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPFlowregion* object = this->spflowregion; if (flags & SP_OBJECT_WRITE_BUILD) { @@ -200,12 +200,12 @@ Inkscape::XML::Node *CFlowregion::onWrite(Inkscape::XML::Document *xml_doc, Inks } } - CItem::onWrite(xml_doc, repr, flags); + CItem::write(xml_doc, repr, flags); return repr; } -gchar* CFlowregion::onDescription() { +gchar* CFlowregion::description() { // TRANSLATORS: "Flow region" is an area where text is allowed to flow return g_strdup_printf(_("Flow region")); } @@ -253,26 +253,26 @@ sp_flowregionexclude_dispose(GObject *object) } } -void CFlowregionExclude::onChildAdded(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { +void CFlowregionExclude::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { SPFlowregionExclude* object = this->spflowregionexclude; - CItem::onChildAdded(child, ref); + CItem::child_added(child, ref); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } /* fixme: hide (Lauris) */ -void CFlowregionExclude::onRemoveChild(Inkscape::XML::Node * child) { +void CFlowregionExclude::remove_child(Inkscape::XML::Node * child) { SPFlowregionExclude* object = this->spflowregionexclude; - CItem::onRemoveChild(child); + CItem::remove_child(child); object->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void CFlowregionExclude::onUpdate(SPCtx *ctx, unsigned int flags) { +void CFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { SPFlowregionExclude* object = this->spflowregionexclude; SPFlowregionExclude *group = SP_FLOWREGIONEXCLUDE (object); @@ -280,7 +280,7 @@ void CFlowregionExclude::onUpdate(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - CItem::onUpdate(ctx, flags); + CItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -325,7 +325,7 @@ void SPFlowregionExclude::UpdateComputed(void) } } -void CFlowregionExclude::onModified(guint flags) { +void CFlowregionExclude::modified(guint flags) { SPFlowregionExclude* object = this->spflowregionexclude; if (flags & SP_OBJECT_MODIFIED_FLAG) { @@ -349,7 +349,7 @@ void CFlowregionExclude::onModified(guint flags) { } } -Inkscape::XML::Node *CFlowregionExclude::onWrite(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { +Inkscape::XML::Node *CFlowregionExclude::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPFlowregionExclude* object = this->spflowregionexclude; if (flags & SP_OBJECT_WRITE_BUILD) { @@ -377,12 +377,12 @@ Inkscape::XML::Node *CFlowregionExclude::onWrite(Inkscape::XML::Document *xml_do } } - CItem::onWrite(xml_doc, repr, flags); + CItem::write(xml_doc, repr, flags); return repr; } -gchar* CFlowregionExclude::onDescription() { +gchar* CFlowregionExclude::description() { /* TRANSLATORS: A region "cut out of" a flow region; text is not allowed to flow inside the * flow excluded region. flowRegionExclude in SVG 1.2: see * http://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html#flowRegion-elem and -- cgit v1.2.3 From a5d6e692d661f0bf7648e64e8fcb04588bb8f3ab Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Mon, 1 Apr 2013 00:07:00 +0200 Subject: Prepared exchange of casting macros. (bzr r11608.1.63) --- src/sp-flowregion.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index da30db7d3..3c4bc84a1 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -54,6 +54,7 @@ static void sp_flowregion_init (SPFlowregion *group) { group->cflowregion = new CFlowregion(group); + group->typeHierarchy.insert(typeid(SPFlowregion)); delete group->citem; group->citem = group->cflowregion; @@ -235,6 +236,7 @@ static void sp_flowregionexclude_init (SPFlowregionExclude *group) { group->cflowregionexclude = new CFlowregionExclude(group); + group->typeHierarchy.insert(typeid(SPFlowregionExclude)); delete group->citem; group->citem = group->cflowregionexclude; -- cgit v1.2.3 From 7eb077e4097aed62c11e5b4e97ff4b16039e73fa Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Mon, 1 Apr 2013 23:04:54 +0200 Subject: Replaced calls to g_object_(un)ref with sp_object_(un)ref. (bzr r11608.1.65) --- src/sp-flowregion.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 3c4bc84a1..0c99d6f9a 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -108,7 +108,7 @@ void CFlowregion::update(SPCtx *ctx, unsigned int flags) { GSList *l = NULL; for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { - g_object_ref( G_OBJECT(child) ); + sp_object_ref(child); l = g_slist_prepend(l, child); } l = g_slist_reverse(l); @@ -125,7 +125,7 @@ void CFlowregion::update(SPCtx *ctx, unsigned int flags) { child->updateDisplay(ctx, flags); } } - g_object_unref (G_OBJECT(child)); + sp_object_unref(child); } group->UpdateComputed(); @@ -155,7 +155,7 @@ void CFlowregion::modified(guint flags) { GSList *l = NULL; for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { - g_object_ref( G_OBJECT(child) ); + sp_object_ref(child); l = g_slist_prepend(l, child); } l = g_slist_reverse(l); @@ -165,7 +165,7 @@ void CFlowregion::modified(guint flags) { if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { child->emitModified(flags); } - g_object_unref( G_OBJECT(child) ); + sp_object_unref(child); } } @@ -291,7 +291,7 @@ void CFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { GSList *l = NULL; for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { - g_object_ref( G_OBJECT(child) ); + sp_object_ref(child); l = g_slist_prepend(l, child); } l = g_slist_reverse (l); @@ -308,7 +308,7 @@ void CFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { child->updateDisplay(ctx, flags); } } - g_object_unref( G_OBJECT(child) ); + sp_object_unref(child); } group->UpdateComputed(); @@ -337,7 +337,7 @@ void CFlowregionExclude::modified(guint flags) { GSList *l = NULL; for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { - g_object_ref( G_OBJECT(child) ); + sp_object_ref(child); l = g_slist_prepend(l, child); } l = g_slist_reverse (l); @@ -347,7 +347,7 @@ void CFlowregionExclude::modified(guint flags) { if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { child->emitModified(flags); } - g_object_unref( G_OBJECT(child) ); + sp_object_unref(child); } } -- cgit v1.2.3 From 69f3b6f1abb2bb422935d43262e1e99aab359954 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 2 Apr 2013 01:41:30 +0200 Subject: Added constructors to SP classes. (bzr r11608.1.67) --- src/sp-flowregion.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 0c99d6f9a..29ce4e7a9 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -27,7 +27,7 @@ static void sp_flowregion_init (SPFlowregion *group); static void sp_flowregion_dispose (GObject *object); -G_DEFINE_TYPE(SPFlowregion, sp_flowregion, SP_TYPE_ITEM); +G_DEFINE_TYPE(SPFlowregion, sp_flowregion, G_TYPE_OBJECT); static void sp_flowregionexclude_init (SPFlowregionExclude *group); static void sp_flowregionexclude_dispose (GObject *object); @@ -50,9 +50,9 @@ CFlowregion::CFlowregion(SPFlowregion* flowregion) : CItem(flowregion) { CFlowregion::~CFlowregion() { } -static void -sp_flowregion_init (SPFlowregion *group) -{ +SPFlowregion::SPFlowregion() : SPItem() { + SPFlowregion* group = this; + group->cflowregion = new CFlowregion(group); group->typeHierarchy.insert(typeid(SPFlowregion)); @@ -63,6 +63,12 @@ sp_flowregion_init (SPFlowregion *group) new (&group->computed) std::vector; } +static void +sp_flowregion_init (SPFlowregion *group) +{ + new (group) SPFlowregion(); +} + static void sp_flowregion_dispose(GObject *object) { @@ -215,7 +221,7 @@ gchar* CFlowregion::description() { * */ -G_DEFINE_TYPE(SPFlowregionExclude, sp_flowregionexclude, SP_TYPE_ITEM); +G_DEFINE_TYPE(SPFlowregionExclude, sp_flowregionexclude, G_TYPE_OBJECT); static void sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) @@ -232,9 +238,9 @@ CFlowregionExclude::CFlowregionExclude(SPFlowregionExclude* flowregionexclude) : CFlowregionExclude::~CFlowregionExclude() { } -static void -sp_flowregionexclude_init (SPFlowregionExclude *group) -{ +SPFlowregionExclude::SPFlowregionExclude() : SPItem() { + SPFlowregionExclude* group = this; + group->cflowregionexclude = new CFlowregionExclude(group); group->typeHierarchy.insert(typeid(SPFlowregionExclude)); @@ -245,6 +251,12 @@ sp_flowregionexclude_init (SPFlowregionExclude *group) group->computed = NULL; } +static void +sp_flowregionexclude_init (SPFlowregionExclude *group) +{ + new (group) SPFlowregionExclude(); +} + static void sp_flowregionexclude_dispose(GObject *object) { -- cgit v1.2.3 From d1af3566872dfff2aeec84859c87f1f8d13f79df Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Tue, 2 Apr 2013 19:14:36 +0200 Subject: Registered classes with new factory. Hkern, Vkern and FeFuncX have to be rewritten, as they aren't real classes. (bzr r11608.1.69) --- src/sp-flowregion.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 29ce4e7a9..bc9f6aeda 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -27,6 +27,21 @@ static void sp_flowregion_init (SPFlowregion *group); static void sp_flowregion_dispose (GObject *object); +#include "sp-factory.h" + +namespace { + SPObject* createFlowregion() { + return new SPFlowregion(); + } + + SPObject* createFlowregionExclude() { + return new SPFlowregionExclude(); + } + + bool flowregionRegistered = SPFactory::instance().registerObject("svg:flowRegion", createFlowregion); + bool flowregionExcludeRegistered = SPFactory::instance().registerObject("svg:flowRegionExclude", createFlowregionExclude); +} + G_DEFINE_TYPE(SPFlowregion, sp_flowregion, G_TYPE_OBJECT); static void sp_flowregionexclude_init (SPFlowregionExclude *group); -- cgit v1.2.3 From 61003d31ea058fdf94f4f80c753c3e38426f35e4 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 21:07:38 +0200 Subject: Merged FlowX classes. (bzr r11608.1.79) --- src/sp-flowregion.cpp | 209 +++++++++++++++++--------------------------------- 1 file changed, 72 insertions(+), 137 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index bc9f6aeda..bcdb6705a 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -20,13 +20,9 @@ #include "display/canvas-bpath.h" - #include "livarot/Path.h" #include "livarot/Shape.h" -static void sp_flowregion_init (SPFlowregion *group); -static void sp_flowregion_dispose (GObject *object); - #include "sp-factory.h" namespace { @@ -42,81 +38,41 @@ namespace { bool flowregionExcludeRegistered = SPFactory::instance().registerObject("svg:flowRegionExclude", createFlowregionExclude); } -G_DEFINE_TYPE(SPFlowregion, sp_flowregion, G_TYPE_OBJECT); - -static void sp_flowregionexclude_init (SPFlowregionExclude *group); -static void sp_flowregionexclude_dispose (GObject *object); - - static void GetDest(SPObject* child,Shape **computed); -static void -sp_flowregion_class_init (SPFlowregionClass *klass) -{ - GObjectClass * object_class; - object_class = (GObjectClass *) klass; - object_class->dispose = sp_flowregion_dispose; -} -CFlowregion::CFlowregion(SPFlowregion* flowregion) : CItem(flowregion) { - this->spflowregion = flowregion; -} +SPFlowregion::SPFlowregion() : SPItem(), CItem(this) { + delete this->citem; + this->citem = this; + this->cobject = this; -CFlowregion::~CFlowregion() { + new (&this->computed) std::vector; } -SPFlowregion::SPFlowregion() : SPItem() { - SPFlowregion* group = this; - - group->cflowregion = new CFlowregion(group); - group->typeHierarchy.insert(typeid(SPFlowregion)); - - delete group->citem; - group->citem = group->cflowregion; - group->cobject = group->cflowregion; - - new (&group->computed) std::vector; -} - -static void -sp_flowregion_init (SPFlowregion *group) -{ - new (group) SPFlowregion(); -} - -static void -sp_flowregion_dispose(GObject *object) -{ - SPFlowregion *group=(SPFlowregion *)object; - for (std::vector::iterator it = group->computed.begin() ; it != group->computed.end() ; ++it) +SPFlowregion::~SPFlowregion() { + for (std::vector::iterator it = this->computed.begin() ; it != this->computed.end() ; ++it) { delete *it; - group->computed.~vector(); -} + } -void CFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { - SPFlowregion* object = this->spflowregion; + this->computed.~vector(); +} +void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { CItem::child_added(child, ref); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + this->requestModified(SP_OBJECT_MODIFIED_FLAG); } /* fixme: hide (Lauris) */ -void CFlowregion::remove_child(Inkscape::XML::Node * child) { - SPFlowregion* object = this->spflowregion; - +void SPFlowregion::remove_child(Inkscape::XML::Node * child) { CItem::remove_child(child); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + this->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void CFlowregion::update(SPCtx *ctx, unsigned int flags) { - SPFlowregion* object = this->spflowregion; - - SPFlowregion *group = SP_FLOWREGION(object); - +void SPFlowregion::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; @@ -125,17 +81,22 @@ void CFlowregion::update(SPCtx *ctx, 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 = object->firstChild() ; child ; child = child->getNext() ) { + + 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->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { if (SP_IS_ITEM (child)) { SPItem const &chi = *SP_ITEM(child); @@ -146,10 +107,11 @@ void CFlowregion::update(SPCtx *ctx, unsigned int flags) { child->updateDisplay(ctx, flags); } } + sp_object_unref(child); } - group->UpdateComputed(); + this->UpdateComputed(); } void SPFlowregion::UpdateComputed(void) @@ -166,42 +128,45 @@ void SPFlowregion::UpdateComputed(void) } } -void CFlowregion::modified(guint flags) { - SPFlowregion* object = this->spflowregion; - +void SPFlowregion::modified(guint flags) { if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } + flags &= SP_OBJECT_MODIFIED_CASCADE; GSList *l = NULL; - for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { + + 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); } } -Inkscape::XML::Node *CFlowregion::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPFlowregion* object = this->spflowregion; - +Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { if (flags & SP_OBJECT_WRITE_BUILD) { if ( repr == NULL ) { repr = xml_doc->createElement("svg:flowRegion"); } GSList *l = NULL; - for ( SPObject *child = object->firstChild() ; child; child = child->getNext() ) { + for ( SPObject *child = this->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); } @@ -215,7 +180,7 @@ Inkscape::XML::Node *CFlowregion::write(Inkscape::XML::Document *xml_doc, Inksca } } else { - for ( SPObject *child = object->firstChild() ; child; child = child->getNext() ) { + for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { if ( !SP_IS_TITLE(child) && !SP_IS_DESC(child) ) { child->updateRepr(flags); } @@ -227,7 +192,7 @@ Inkscape::XML::Node *CFlowregion::write(Inkscape::XML::Document *xml_doc, Inksca return repr; } -gchar* CFlowregion::description() { +gchar* SPFlowregion::description() { // TRANSLATORS: "Flow region" is an area where text is allowed to flow return g_strdup_printf(_("Flow region")); } @@ -235,77 +200,37 @@ gchar* CFlowregion::description() { /* * */ +SPFlowregionExclude::SPFlowregionExclude() : SPItem(), CItem(this) { + delete this->citem; + this->citem = this; + this->cobject = this; -G_DEFINE_TYPE(SPFlowregionExclude, sp_flowregionexclude, G_TYPE_OBJECT); - -static void -sp_flowregionexclude_class_init (SPFlowregionExcludeClass *klass) -{ - GObjectClass * object_class; - object_class = (GObjectClass *) klass; - object_class->dispose = sp_flowregionexclude_dispose; -} - -CFlowregionExclude::CFlowregionExclude(SPFlowregionExclude* flowregionexclude) : CItem(flowregionexclude) { - this->spflowregionexclude = flowregionexclude; -} - -CFlowregionExclude::~CFlowregionExclude() { -} - -SPFlowregionExclude::SPFlowregionExclude() : SPItem() { - SPFlowregionExclude* group = this; - - group->cflowregionexclude = new CFlowregionExclude(group); - group->typeHierarchy.insert(typeid(SPFlowregionExclude)); - - delete group->citem; - group->citem = group->cflowregionexclude; - group->cobject = group->cflowregionexclude; - - group->computed = NULL; + this->computed = NULL; } -static void -sp_flowregionexclude_init (SPFlowregionExclude *group) -{ - new (group) SPFlowregionExclude(); -} - -static void -sp_flowregionexclude_dispose(GObject *object) -{ - SPFlowregionExclude *group=(SPFlowregionExclude *)object; - if (group->computed) { - delete group->computed; - group->computed = NULL; +SPFlowregionExclude::~SPFlowregionExclude() { + if (this->computed) { + delete this->computed; + this->computed = NULL; } } -void CFlowregionExclude::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { - SPFlowregionExclude* object = this->spflowregionexclude; - +void SPFlowregionExclude::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { CItem::child_added(child, ref); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + this->requestModified(SP_OBJECT_MODIFIED_FLAG); } /* fixme: hide (Lauris) */ -void CFlowregionExclude::remove_child(Inkscape::XML::Node * child) { - SPFlowregionExclude* object = this->spflowregionexclude; - +void SPFlowregionExclude::remove_child(Inkscape::XML::Node * child) { CItem::remove_child(child); - object->requestModified(SP_OBJECT_MODIFIED_FLAG); + this->requestModified(SP_OBJECT_MODIFIED_FLAG); } -void CFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { - SPFlowregionExclude* object = this->spflowregionexclude; - - SPFlowregionExclude *group = SP_FLOWREGIONEXCLUDE (object); - +void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; @@ -314,17 +239,22 @@ void CFlowregionExclude::update(SPCtx *ctx, 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 = object->firstChild() ; child ; child = child->getNext() ) { + + 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->uflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) { if (SP_IS_ITEM (child)) { SPItem const &chi = *SP_ITEM(child); @@ -335,10 +265,11 @@ void CFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { child->updateDisplay(ctx, flags); } } + sp_object_unref(child); } - group->UpdateComputed(); + this->UpdateComputed(); } @@ -354,41 +285,45 @@ void SPFlowregionExclude::UpdateComputed(void) } } -void CFlowregionExclude::modified(guint flags) { - SPFlowregionExclude* object = this->spflowregionexclude; - +void SPFlowregionExclude::modified(guint flags) { if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; } + flags &= SP_OBJECT_MODIFIED_CASCADE; GSList *l = NULL; - for ( SPObject *child = object->firstChild() ; child ; child = child->getNext() ) { + + 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); } } -Inkscape::XML::Node *CFlowregionExclude::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPFlowregionExclude* object = this->spflowregionexclude; - +Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { if (flags & SP_OBJECT_WRITE_BUILD) { if ( repr == NULL ) { repr = xml_doc->createElement("svg:flowRegionExclude"); } GSList *l = NULL; - for ( SPObject *child = object->firstChild() ; child; child = child->getNext() ) { + + 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); } @@ -401,7 +336,7 @@ Inkscape::XML::Node *CFlowregionExclude::write(Inkscape::XML::Document *xml_doc, } } else { - for ( SPObject *child = object->firstChild() ; child; child = child->getNext() ) { + for ( SPObject *child = this->firstChild() ; child; child = child->getNext() ) { child->updateRepr(flags); } } @@ -411,7 +346,7 @@ Inkscape::XML::Node *CFlowregionExclude::write(Inkscape::XML::Document *xml_doc, return repr; } -gchar* CFlowregionExclude::description() { +gchar* SPFlowregionExclude::description() { /* TRANSLATORS: A region "cut out of" a flow region; text is not allowed to flow inside the * flow excluded region. flowRegionExclude in SVG 1.2: see * http://www.w3.org/TR/2004/WD-SVG12-20041027/flow.html#flowRegion-elem and -- cgit v1.2.3 From 8073924aacdda310fb7492750f78d5389b3186af Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Fri, 5 Apr 2013 22:45:01 +0200 Subject: Merged Item. (bzr r11608.1.81) --- src/sp-flowregion.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index bcdb6705a..360bf49f3 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -41,9 +41,7 @@ namespace { static void GetDest(SPObject* child,Shape **computed); -SPFlowregion::SPFlowregion() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowregion::SPFlowregion() : SPItem() { this->cobject = this; new (&this->computed) std::vector; @@ -58,7 +56,7 @@ SPFlowregion::~SPFlowregion() { } void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { - CItem::child_added(child, ref); + SPItem::child_added(child, ref); this->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -66,7 +64,7 @@ void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node * /* fixme: hide (Lauris) */ void SPFlowregion::remove_child(Inkscape::XML::Node * child) { - CItem::remove_child(child); + SPItem::remove_child(child); this->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -76,7 +74,7 @@ void SPFlowregion::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -187,7 +185,7 @@ Inkscape::XML::Node *SPFlowregion::write(Inkscape::XML::Document *xml_doc, Inksc } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -200,9 +198,7 @@ gchar* SPFlowregion::description() { /* * */ -SPFlowregionExclude::SPFlowregionExclude() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowregionExclude::SPFlowregionExclude() : SPItem() { this->cobject = this; this->computed = NULL; @@ -216,7 +212,7 @@ SPFlowregionExclude::~SPFlowregionExclude() { } void SPFlowregionExclude::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { - CItem::child_added(child, ref); + SPItem::child_added(child, ref); this->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -224,7 +220,7 @@ void SPFlowregionExclude::child_added(Inkscape::XML::Node *child, Inkscape::XML: /* fixme: hide (Lauris) */ void SPFlowregionExclude::remove_child(Inkscape::XML::Node * child) { - CItem::remove_child(child); + SPItem::remove_child(child); this->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -234,7 +230,7 @@ void SPFlowregionExclude::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast(ctx); SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -341,7 +337,7 @@ Inkscape::XML::Node *SPFlowregionExclude::write(Inkscape::XML::Document *xml_doc } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } -- cgit v1.2.3 From 27e2102f96a5554bcd5310ec11435d155773b279 Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Sun, 7 Apr 2013 18:28:22 +0200 Subject: Merge Object and subclasses. Merging of SP- and C-classes complete. (bzr r11608.1.86) --- src/sp-flowregion.cpp | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index 360bf49f3..fab4c1f23 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -42,8 +42,6 @@ static void GetDest(SPObject* child,Shape **computed); SPFlowregion::SPFlowregion() : SPItem() { - this->cobject = this; - new (&this->computed) std::vector; } @@ -199,8 +197,6 @@ gchar* SPFlowregion::description() { * */ SPFlowregionExclude::SPFlowregionExclude() : SPItem() { - this->cobject = this; - this->computed = NULL; } -- cgit v1.2.3 From 127543bae3c0a76770e197c7058a783dea18fe3e Mon Sep 17 00:00:00 2001 From: Markus Engel Date: Wed, 31 Jul 2013 23:23:10 +0200 Subject: Removed placement news / explicit destructor calls. (bzr r11608.1.113) --- src/sp-flowregion.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/sp-flowregion.cpp') diff --git a/src/sp-flowregion.cpp b/src/sp-flowregion.cpp index fab4c1f23..3a0aef6be 100644 --- a/src/sp-flowregion.cpp +++ b/src/sp-flowregion.cpp @@ -42,7 +42,7 @@ static void GetDest(SPObject* child,Shape **computed); SPFlowregion::SPFlowregion() : SPItem() { - new (&this->computed) std::vector; + //new (&this->computed) std::vector; } SPFlowregion::~SPFlowregion() { @@ -50,7 +50,7 @@ SPFlowregion::~SPFlowregion() { delete *it; } - this->computed.~vector(); + //this->computed.~vector(); } void SPFlowregion::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { -- cgit v1.2.3