diff options
Diffstat (limited to 'src')
43 files changed, 182 insertions, 277 deletions
diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index 2761bde61..fc261ae85 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -37,7 +37,6 @@ namespace { } Box3DSide::Box3DSide() : SPPolygon() { - this->citem = this; this->cobject = this; this->dir1 = Box3D::NONE; diff --git a/src/box3d.cpp b/src/box3d.cpp index a2c92d880..e7abf4793 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -54,7 +54,6 @@ namespace { } SPBox3D::SPBox3D() : SPGroup() { - this->citem = this; this->cobject = this; this->my_counter = 0; diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 65b26937b..a1bc97888 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1415,7 +1415,7 @@ void GrDragger::updateTip() if (g_slist_length (this->draggables) == 1) { GrDraggable *draggable = (GrDraggable *) this->draggables->data; - char *item_desc = draggable->item->description(); + char *item_desc = draggable->item->getDetailedDescription(); switch (draggable->point_type) { case POINT_LG_MID: case POINT_RG_MID1: diff --git a/src/marker.cpp b/src/marker.cpp index ba7366ec3..bcb246d2b 100644 --- a/src/marker.cpp +++ b/src/marker.cpp @@ -53,7 +53,6 @@ namespace { } SPMarker::SPMarker() : SPGroup() { - this->citem = this; this->cobject = this; this->aspect_clip = 0; diff --git a/src/persp3d.h b/src/persp3d.h index 9db9ba4b1..5b472a80f 100644 --- a/src/persp3d.h +++ b/src/persp3d.h @@ -55,7 +55,7 @@ public: }; struct Persp3DClass { - SPItemClass parent_class; +// SPItemClass parent_class; }; class CPersp3D : public CObject { diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 2506c1477..1827ea7ff 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2854,7 +2854,7 @@ static void sp_selection_to_guides_recursive(SPItem *item, bool deleteitem, bool sp_selection_to_guides_recursive(SP_ITEM(i->data), deleteitem, wholegroups); } } else { - item->citem->convert_to_guides(); + item->convert_to_guides(); if (deleteitem) { item->deleteObject(true); diff --git a/src/selection-describer.cpp b/src/selection-describer.cpp index 1639a2b95..b9e1ed510 100644 --- a/src/selection-describer.cpp +++ b/src/selection-describer.cpp @@ -236,7 +236,7 @@ void SelectionDescriber::_updateMessageFromSelection(Inkscape::Selection *select g_free (parent_name); if (!items->next) { // one item - char *item_desc = item->description(); + char *item_desc = item->getDetailedDescription(); if (SP_IS_USE(item) && SP_IS_SYMBOL(item->firstChild())) { _context.setF(Inkscape::NORMAL_MESSAGE, "%s%s. %s. %s.", item_desc, in_phrase, diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp index 5679aa13b..2682d1906 100644 --- a/src/sp-anchor.cpp +++ b/src/sp-anchor.cpp @@ -36,7 +36,6 @@ namespace { } SPAnchor::SPAnchor() : SPGroup() { - this->citem = this; this->cobject = this; this->href = NULL; diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index d71ae04a9..5efd9ade2 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -89,7 +89,6 @@ static double sp_round(double x, double y) static gboolean sp_arc_set_elliptical_path_attribute(SPArc *arc, Inkscape::XML::Node *repr); SPGenericEllipse::SPGenericEllipse() : SPShape() { - this->citem = this; this->cobject = this; this->cx.unset(); @@ -365,7 +364,6 @@ Inkscape::XML::Node* SPGenericEllipse::write(Inkscape::XML::Document *xml_doc, I /* SVG <ellipse> element */ SPEllipse::SPEllipse() : SPGenericEllipse() { - this->citem = this; this->cobject = this; } @@ -457,7 +455,6 @@ sp_ellipse_position_set(SPEllipse *ellipse, gdouble x, gdouble y, gdouble rx, gd /* SVG <circle> element */ SPCircle::SPCircle() : SPGenericEllipse() { - this->citem = this; this->cobject = this; } @@ -520,7 +517,6 @@ gchar* SPCircle::description() { /* <path sodipodi:type="arc"> element */ SPArc::SPArc() : SPGenericEllipse() { - this->citem = this; this->cobject = this; } diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp index d99657bed..1052b4a64 100644 --- a/src/sp-flowdiv.cpp +++ b/src/sp-flowdiv.cpp @@ -44,9 +44,7 @@ namespace { bool flowregionbreakRegistered = SPFactory::instance().registerObject("svg:flowRegionBreak", createFlowregionbreak); } -SPFlowdiv::SPFlowdiv() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowdiv::SPFlowdiv() : SPItem() { this->cobject = this; } @@ -54,7 +52,7 @@ SPFlowdiv::~SPFlowdiv() { } void SPFlowdiv::release() { - CItem::release(); + SPItem::release(); } void SPFlowdiv::update(SPCtx *ctx, unsigned int flags) { @@ -62,7 +60,7 @@ void SPFlowdiv::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast<SPItemCtx *>(ctx); SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -95,7 +93,7 @@ void SPFlowdiv::update(SPCtx *ctx, unsigned int flags) { void SPFlowdiv::modified(unsigned int flags) { SPFlowdiv* object = this; - CItem::modified(flags); + SPItem::modified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -124,11 +122,11 @@ void SPFlowdiv::build(SPDocument *doc, Inkscape::XML::Node *repr) { object->_requireSVGVersion(Inkscape::Version(1, 2)); - CItem::build(doc, repr); + SPItem::build(doc, repr); } void SPFlowdiv::set(unsigned int key, const gchar* value) { - CItem::set(key, value); + SPItem::set(key, value); } @@ -170,7 +168,7 @@ Inkscape::XML::Node* SPFlowdiv::write(Inkscape::XML::Document *xml_doc, Inkscape } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -180,9 +178,7 @@ Inkscape::XML::Node* SPFlowdiv::write(Inkscape::XML::Document *xml_doc, Inkscape * */ -SPFlowtspan::SPFlowtspan() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowtspan::SPFlowtspan() : SPItem() { this->cobject = this; } @@ -190,7 +186,7 @@ SPFlowtspan::~SPFlowtspan() { } void SPFlowtspan::release() { - CItem::release(); + SPItem::release(); } void SPFlowtspan::update(SPCtx *ctx, unsigned int flags) { @@ -199,7 +195,7 @@ void SPFlowtspan::update(SPCtx *ctx, unsigned int flags) { SPItemCtx *ictx = reinterpret_cast<SPItemCtx *>(ctx); SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -232,7 +228,7 @@ void SPFlowtspan::update(SPCtx *ctx, unsigned int flags) { void SPFlowtspan::modified(unsigned int flags) { SPFlowtspan* object = this; - CItem::modified(flags); + SPItem::modified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -258,11 +254,11 @@ void SPFlowtspan::modified(unsigned int flags) { void SPFlowtspan::build(SPDocument *doc, Inkscape::XML::Node *repr) { - CItem::build(doc, repr); + SPItem::build(doc, repr); } void SPFlowtspan::set(unsigned int key, const gchar* value) { - CItem::set(key, value); + SPItem::set(key, value); } Inkscape::XML::Node *SPFlowtspan::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) @@ -304,7 +300,7 @@ Inkscape::XML::Node *SPFlowtspan::write(Inkscape::XML::Document *xml_doc, Inksca } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -315,9 +311,7 @@ Inkscape::XML::Node *SPFlowtspan::write(Inkscape::XML::Document *xml_doc, Inksca /* * */ -SPFlowpara::SPFlowpara() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowpara::SPFlowpara() : SPItem() { this->cobject = this; } @@ -325,7 +319,7 @@ SPFlowpara::~SPFlowpara() { } void SPFlowpara::release() { - CItem::release(); + SPItem::release(); } void SPFlowpara::update(SPCtx *ctx, unsigned int flags) @@ -335,7 +329,7 @@ void SPFlowpara::update(SPCtx *ctx, unsigned int flags) SPItemCtx *ictx = reinterpret_cast<SPItemCtx *>(ctx); SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -368,7 +362,7 @@ void SPFlowpara::update(SPCtx *ctx, unsigned int flags) void SPFlowpara::modified(unsigned int flags) { SPFlowpara* object = this; - CItem::modified(flags); + SPItem::modified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -394,11 +388,11 @@ void SPFlowpara::modified(unsigned int flags) { void SPFlowpara::build(SPDocument *doc, Inkscape::XML::Node *repr) { - CItem::build(doc, repr); + SPItem::build(doc, repr); } void SPFlowpara::set(unsigned int key, const gchar* value) { - CItem::set(key, value); + SPItem::set(key, value); } Inkscape::XML::Node *SPFlowpara::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) @@ -438,7 +432,7 @@ Inkscape::XML::Node *SPFlowpara::write(Inkscape::XML::Document *xml_doc, Inkscap } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } diff --git a/src/sp-flowdiv.h b/src/sp-flowdiv.h index a4973cb9d..91f62522d 100644 --- a/src/sp-flowdiv.h +++ b/src/sp-flowdiv.h @@ -23,7 +23,7 @@ #define SP_IS_FLOWREGIONBREAK(obj) (dynamic_cast<const SPFlowregionbreak*>((SPObject*)obj)) // these 3 are derivatives of SPItem to get the automatic style handling -class SPFlowdiv : public SPItem, public CItem { +class SPFlowdiv : public SPItem { public: SPFlowdiv(); virtual ~SPFlowdiv(); @@ -37,7 +37,7 @@ public: virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); }; -class SPFlowtspan : public SPItem, public CItem { +class SPFlowtspan : public SPItem { public: SPFlowtspan(); virtual ~SPFlowtspan(); @@ -51,7 +51,7 @@ public: virtual Inkscape::XML::Node* write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags); }; -class SPFlowpara : public SPItem, public CItem { +class SPFlowpara : public SPItem { public: SPFlowpara(); virtual ~SPFlowpara(); 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<Shape*>; @@ -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<SPItemCtx *>(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<SPItemCtx *>(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; } diff --git a/src/sp-flowregion.h b/src/sp-flowregion.h index 8eb6218c9..48d702494 100644 --- a/src/sp-flowregion.h +++ b/src/sp-flowregion.h @@ -17,7 +17,7 @@ class Shape; class flow_dest; class FloatLigne; -class SPFlowregion : public SPItem, public CItem { +class SPFlowregion : public SPItem { public: SPFlowregion(); virtual ~SPFlowregion(); @@ -34,7 +34,7 @@ public: virtual gchar *description(); }; -class SPFlowregionExclude : public SPItem, public CItem { +class SPFlowregionExclude : public SPItem { public: SPFlowregionExclude(); virtual ~SPFlowregionExclude(); diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index 8cdf52000..3b3d3cee7 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -43,9 +43,7 @@ namespace { bool flowtextRegistered = SPFactory::instance().registerObject("svg:flowRoot", createFlowtext); } -SPFlowtext::SPFlowtext() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPFlowtext::SPFlowtext() : SPItem() { this->cobject = this; this->par_indent = 0; @@ -57,7 +55,7 @@ SPFlowtext::~SPFlowtext() { } void SPFlowtext::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 SPFlowtext::child_added(Inkscape::XML::Node* child, Inkscape::XML::Node* re /* fixme: hide (Lauris) */ void SPFlowtext::remove_child(Inkscape::XML::Node* child) { - CItem::remove_child(child); + SPItem::remove_child(child); this->requestModified(SP_OBJECT_MODIFIED_FLAG); } @@ -75,7 +73,7 @@ void SPFlowtext::update(SPCtx* ctx, unsigned int flags) { SPItemCtx *ictx = (SPItemCtx *) ctx; SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; flags &= SP_OBJECT_MODIFIED_CASCADE; @@ -159,7 +157,7 @@ void SPFlowtext::modified(unsigned int flags) { void SPFlowtext::build(SPDocument* doc, Inkscape::XML::Node* repr) { this->_requireSVGVersion(Inkscape::Version(1, 2)); - CItem::build(doc, repr); + SPItem::build(doc, repr); this->readAttr( "inkscape:layoutOptions" ); // must happen after css has been read } @@ -217,7 +215,7 @@ void SPFlowtext::set(unsigned int key, const gchar* value) { } default: - CItem::set(key, value); + SPItem::set(key, value); break; } } @@ -255,7 +253,7 @@ Inkscape::XML::Node* SPFlowtext::write(Inkscape::XML::Document* doc, Inkscape::X } } - CItem::write(doc, repr, flags); + SPItem::write(doc, repr, flags); return repr; } @@ -326,7 +324,7 @@ Inkscape::DrawingItem* SPFlowtext::show(Inkscape::Drawing &drawing, unsigned int } void SPFlowtext::hide(unsigned int key) { - CItem::hide(key); + SPItem::hide(key); } diff --git a/src/sp-flowtext.h b/src/sp-flowtext.h index c42639fb9..388d5a4b2 100644 --- a/src/sp-flowtext.h +++ b/src/sp-flowtext.h @@ -19,7 +19,7 @@ class DrawingGroup; } // namespace Inkscape -class SPFlowtext : public SPItem, public CItem { +class SPFlowtext : public SPItem { public: SPFlowtext(); virtual ~SPFlowtext(); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 442d0e539..632340ee4 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -514,9 +514,7 @@ namespace { bool imageRegistered = SPFactory::instance().registerObject("svg:image", createImage); } -SPImage::SPImage() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPImage::SPImage() : SPItem() { this->cobject = this; this->aspect_clip = 0; @@ -545,7 +543,7 @@ SPImage::~SPImage() { } void SPImage::build(SPDocument *document, Inkscape::XML::Node *repr) { - CItem::build(document, repr); + SPItem::build(document, repr); this->readAttr( "xlink:href" ); this->readAttr( "x" ); @@ -591,7 +589,7 @@ void SPImage::release() { this->curve = this->curve->unref(); } - CItem::release(); + SPItem::release(); } void SPImage::set(unsigned int key, const gchar* value) { @@ -722,7 +720,7 @@ void SPImage::set(unsigned int key, const gchar* value) { #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) default: - CItem::set(key, value); + SPItem::set(key, value); break; } @@ -732,7 +730,7 @@ void SPImage::set(unsigned int key, const gchar* value) { void SPImage::update(SPCtx *ctx, unsigned int flags) { SPDocument *doc = this->document; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_IMAGE_HREF_MODIFIED_FLAG) { if (this->pixbuf) { @@ -938,7 +936,7 @@ void SPImage::update(SPCtx *ctx, unsigned int flags) { } void SPImage::modified(unsigned int flags) { -// CItem::onModified(flags); +// SPItem::onModified(flags); if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) { for (SPItemView *v = this->display; v != NULL; v = v->next) { @@ -981,7 +979,7 @@ Inkscape::XML::Node *SPImage::write(Inkscape::XML::Document *xml_doc, Inkscape:: } #endif // defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2) - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } diff --git a/src/sp-image.h b/src/sp-image.h index 54bbf19b4..63136ff39 100644 --- a/src/sp-image.h +++ b/src/sp-image.h @@ -26,7 +26,7 @@ #define SP_IMAGE_HREF_MODIFIED_FLAG SP_OBJECT_USER_MODIFIED_FLAG_A -class SPImage : public SPItem, public CItem { +class SPImage : public SPItem { public: SPImage(); virtual ~SPImage(); diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index 77bf647dc..45617e282 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -66,7 +66,6 @@ namespace { } SPGroup::SPGroup() : SPLPEItem() { - this->citem = this; this->cobject = this; this->_layer_mode = SPGroup::GROUP; diff --git a/src/sp-item.cpp b/src/sp-item.cpp index b6298e3a6..57c00d12d 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -78,59 +78,25 @@ static SPItemView* sp_item_view_list_remove(SPItemView *list, SPItemView *view); -G_DEFINE_TYPE(SPItem, sp_item, G_TYPE_OBJECT); -/** - * SPItem vtable initialization. - */ -static void -sp_item_class_init(SPItemClass *klass) -{ -} - -// CPPIFY: remove -CItem::CItem(SPItem* item) : CObject(item) { - this->spitem = item; -} -CItem::~CItem() { -} - -SPItem::SPItem() : SPObject() { - SPItem* item = this; - - item->citem = new CItem(item); - item->typeHierarchy.insert(typeid(SPItem)); - - delete item->cobject; - item->cobject = item->citem; - - item->sensitive = 0; - item->clip_ref = NULL; - item->avoidRef = NULL; - item->_is_evaluated = false; - item->stop_paint = 0; - item->_evaluated_status = StatusUnknown; - item->bbox_valid = 0; - item->freeze_stroke_width = false; - item->transform_center_x = 0; - item->transform_center_y = 0; - item->display = NULL; - item->mask_ref = NULL; - - item->init(); -} +SPItem::SPItem() : SPObject(), CObject(this) { + delete this->cobject; + this->cobject = this; -/** - * Callback for SPItem object initialization. - */ -static void -sp_item_init(SPItem *item) -{ - new (item) SPItem(); -} + this->sensitive = 0; + this->clip_ref = NULL; + this->avoidRef = NULL; + this->_is_evaluated = false; + this->stop_paint = 0; + this->_evaluated_status = StatusUnknown; + this->bbox_valid = 0; + this->freeze_stroke_width = false; + this->transform_center_x = 0; + this->transform_center_y = 0; + this->display = NULL; + this->mask_ref = NULL; -void SPItem::init() { sensitive = TRUE; bbox_valid = FALSE; @@ -159,6 +125,9 @@ void SPItem::init() { new (&_transformed_signal) sigc::signal<void, Geom::Affine const *, SPItem *>(); } +SPItem::~SPItem() { +} + bool SPItem::isVisibleAndUnlocked() const { return (!isHidden() && !isLocked()); } @@ -415,8 +384,8 @@ void SPItem::moveTo(SPItem *target, gboolean intoafter) { } } -void CItem::build(SPDocument *document, Inkscape::XML::Node *repr) { - SPItem* object = this->spitem; +void SPItem::build(SPDocument *document, Inkscape::XML::Node *repr) { + SPItem* object = this; object->readAttr( "style" ); object->readAttr( "transform" ); @@ -432,8 +401,8 @@ void CItem::build(SPDocument *document, Inkscape::XML::Node *repr) { CObject::build(document, repr); } -void CItem::release() { - SPItem* item = this->spitem; +void SPItem::release() { + SPItem* item = this; // Note: do this here before the clip_ref is deleted, since calling // ensureUpToDate() for triggered routing may reference @@ -455,8 +424,8 @@ void CItem::release() { item->_transformed_signal.~signal(); } -void CItem::set(unsigned int key, gchar const* value) { - SPItem *item = this->spitem; +void SPItem::set(unsigned int key, gchar const* value) { + SPItem *item = this; SPItem* object = item; switch (key) { @@ -594,8 +563,8 @@ void SPItem::mask_ref_changed(SPObject *old_mask, SPObject *mask, SPItem *item) } } -void CItem::update(SPCtx *ctx, guint flags) { - SPItem *item = this->spitem; +void SPItem::update(SPCtx *ctx, guint flags) { + SPItem *item = this; SPItem* object = item; // CObject::onUpdate(ctx, flags); @@ -652,8 +621,8 @@ void CItem::update(SPCtx *ctx, guint flags) { item->avoidRef->handleSettingChange(); } -Inkscape::XML::Node* CItem::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { - SPItem *item = this->spitem; +Inkscape::XML::Node* SPItem::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { + SPItem *item = this; SPItem* object = item; // in the case of SP_OBJECT_WRITE_BUILD, the item should always be newly created, @@ -718,7 +687,7 @@ Inkscape::XML::Node* CItem::write(Inkscape::XML::Document *xml_doc, Inkscape::XM } // CPPIFY: make pure virtual -Geom::OptRect CItem::bbox(Geom::Affine const &transform, SPItem::BBoxType type) { +Geom::OptRect SPItem::bbox(Geom::Affine const &transform, SPItem::BBoxType type) { //throw; return Geom::OptRect(); } @@ -732,7 +701,9 @@ Geom::OptRect SPItem::geometricBounds(Geom::Affine const &transform) const Geom::OptRect bbox; // call the subclass method - bbox = this->citem->bbox(transform, SPItem::GEOMETRIC_BBOX); + // CPPIFY + //bbox = this->bbox(transform, SPItem::GEOMETRIC_BBOX); + bbox = const_cast<SPItem*>(this)->bbox(transform, SPItem::GEOMETRIC_BBOX); return bbox; } @@ -751,7 +722,9 @@ Geom::OptRect SPItem::visualBounds(Geom::Affine const &transform) const if ( style && style->filter.href && style->getFilter() && SP_IS_FILTER(style->getFilter())) { // call the subclass method - bbox = this->citem->bbox(Geom::identity(), SPItem::VISUAL_BBOX); + // CPPIFY + //bbox = this->bbox(Geom::identity(), SPItem::VISUAL_BBOX); + bbox = const_cast<SPItem*>(this)->bbox(Geom::identity(), SPItem::VISUAL_BBOX); SPFilter *filter = SP_FILTER(style->getFilter()); // default filer area per the SVG spec: @@ -795,7 +768,9 @@ Geom::OptRect SPItem::visualBounds(Geom::Affine const &transform) const *bbox *= transform; } else { // call the subclass method - bbox = this->citem->bbox(transform, SPItem::VISUAL_BBOX); + // CPPIFY + //bbox = this->bbox(transform, SPItem::VISUAL_BBOX); + bbox = const_cast<SPItem*>(this)->bbox(transform, SPItem::VISUAL_BBOX); } if (clip_ref->getObject()) { bbox.intersectWith(SP_CLIPPATH(clip_ref->getObject())->geometricBounds(transform)); @@ -894,7 +869,7 @@ unsigned SPItem::pos_in_parent() } // CPPIFY: make pure virtual, see below! -void CItem::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) { +void SPItem::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) { //throw; } /* This will only be called if the derived class doesn't override this. @@ -906,7 +881,9 @@ void CItem::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::S void SPItem::getSnappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::SnapPreferences const *snapprefs) const { // Get the snappoints of the item - this->citem->snappoints(p, snapprefs); + // CPPIFY + //this->snappoints(p, snapprefs); + const_cast<SPItem*>(this)->snappoints(p, snapprefs); // Get the snappoints at the item's center if (snapprefs != NULL && snapprefs->isTargetSnappable(Inkscape::SNAPTARGET_ROTATION_CENTER)) { @@ -942,7 +919,7 @@ void SPItem::getSnappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscap } // CPPIFY: make pure virtual -void CItem::print(SPPrintContext* ctx) { +void SPItem::print(SPPrintContext* ctx) { //throw; } @@ -951,16 +928,16 @@ void SPItem::invoke_print(SPPrintContext *ctx) if ( !isHidden() ) { if (!transform.isIdentity() || style->opacity.value != SP_SCALE24_MAX) { sp_print_bind(ctx, transform, SP_SCALE24_TO_FLOAT(style->opacity.value)); - this->citem->print(ctx); + this->print(ctx); sp_print_release(ctx); } else { - this->citem->print(ctx); + this->print(ctx); } } } // CPPIFY: is it possible to combine this method with "SPItem::description()"? -gchar* CItem::description() { +gchar* SPItem::description() { return g_strdup(_("Object")); } @@ -969,30 +946,36 @@ gchar* CItem::description() { * * Must be freed by caller. */ -gchar *SPItem::description() +gchar *SPItem::getDetailedDescription() { - gchar* s = this->citem->description(); + gchar* s = this->description(); + if (s && clip_ref->getObject()) { gchar *snew = g_strdup_printf (_("%s; <i>clipped</i>"), s); g_free (s); s = snew; } + if (s && mask_ref->getObject()) { gchar *snew = g_strdup_printf (_("%s; <i>masked</i>"), s); g_free (s); s = snew; } + if ( style && style->filter.href && style->filter.href->getObject() ) { const gchar *label = style->filter.href->getObject()->label(); gchar *snew = 0; + if (label) { snew = g_strdup_printf (_("%s; <i>filtered (%s)</i>"), s, _(label)); } else { snew = g_strdup_printf (_("%s; <i>filtered</i>"), s); } + g_free (s); s = snew; } + return s; } @@ -1026,7 +1009,7 @@ unsigned SPItem::display_key_new(unsigned numkeys) } // CPPIFY: make pure virtual -Inkscape::DrawingItem* CItem::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) { +Inkscape::DrawingItem* SPItem::show(Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) { //throw; return 0; } @@ -1035,7 +1018,7 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned { Inkscape::DrawingItem *ai = NULL; - ai = this->citem->show(drawing, key, flags); + ai = this->show(drawing, key, flags); if (ai != NULL) { Geom::OptRect item_bbox = geometricBounds(); @@ -1085,13 +1068,13 @@ Inkscape::DrawingItem *SPItem::invoke_show(Inkscape::Drawing &drawing, unsigned } // CPPIFY: make pure virtual -void CItem::hide(unsigned int key) { +void SPItem::hide(unsigned int key) { //throw; } void SPItem::invoke_hide(unsigned key) { - this->citem->hide(key); + this->hide(key); SPItemView *ref = NULL; SPItemView *v = display; @@ -1318,7 +1301,7 @@ void SPItem::adjust_livepatheffect (Geom::Affine const &postmul, bool set) // CPPIFY:: make pure virtual? // Not all SPItems must necessarily have a set transform method! -Geom::Affine CItem::set_transform(Geom::Affine const &transform) { +Geom::Affine SPItem::set_transform(Geom::Affine const &transform) { // throw; return transform; } @@ -1398,7 +1381,7 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra !mask_ref->getObject() && // the object does not have a mask !(!transform.isTranslation() && style && style->getFilter()) // the object does not have a filter, or the transform is translation (which is supposed to not affect filters) ) { - transform_attr = this->citem->set_transform(transform); + transform_attr = this->set_transform(transform); if (freeze_stroke_width) { freeze_stroke_width_recursive(false); @@ -1431,13 +1414,13 @@ void SPItem::doWriteTransform(Inkscape::XML::Node *repr, Geom::Affine const &tra } // CPPIFY: see below, do not make pure? -gint CItem::event(SPEvent* event) { +gint SPItem::event(SPEvent* event) { return FALSE; } gint SPItem::emitEvent(SPEvent &event) { - return this->citem->event(&event); + return this->event(&event); } /** @@ -1455,10 +1438,10 @@ void SPItem::set_item_transform(Geom::Affine const &transform_matrix) } } -void CItem::convert_to_guides() { - // CPPIFY: If not overridden, call SPItem::convert_to_guides(), see below! - this->spitem->convert_to_guides(); -} +//void SPItem::convert_to_guides() { +// // CPPIFY: If not overridden, call SPItem::convert_to_guides(), see below! +// this->convert_to_guides(); +//} /** diff --git a/src/sp-item.h b/src/sp-item.h index 02bd10a8b..1f581e6c2 100644 --- a/src/sp-item.h +++ b/src/sp-item.h @@ -99,19 +99,11 @@ public: Geom::Affine i2vp; }; -class SPItem; -class SPItemClass; -class CItem; - -#define SP_TYPE_ITEM (sp_item_get_type ()) #define SP_ITEM(obj) ((SPItem*)obj) -//#define SP_IS_ITEM(obj) (obj != NULL && static_cast<const SPObject*>(obj)->typeHierarchy.count(typeid(SPItem))) #define SP_IS_ITEM(obj) (dynamic_cast<const SPItem*>((SPObject*)obj)) -GType sp_item_get_type() G_GNUC_CONST; - /** Abstract base class for all visible shapes. */ -class SPItem : public SPObject { +class SPItem : public SPObject, public CObject { public: enum BBoxType { // legacy behavior: includes crude stroke, markers; excludes long miters, blur margin; is known to be wrong for caps @@ -123,7 +115,7 @@ public: }; SPItem(); - CItem* citem; + virtual ~SPItem(); unsigned int sensitive : 1; unsigned int stop_paint: 1; @@ -147,7 +139,6 @@ public: sigc::signal<void, Geom::Affine const *, SPItem *> _transformed_signal; - void init(); bool isLocked() const; void setLocked(bool lock); @@ -197,7 +188,7 @@ public: Geom::OptRect desktopBounds(BBoxType type) const; unsigned pos_in_parent(); - gchar *description(); + gchar *getDetailedDescription(); int ifilt(); void invoke_print(SPPrintContext *ctx); static unsigned int display_key_new(unsigned int numkeys); @@ -221,7 +212,7 @@ public: Geom::Affine i2dt_affine() const; void set_i2d_affine(Geom::Affine const &transform); Geom::Affine dt2i_affine() const; - void convert_to_guides(); + //void convert_to_guides(); private: enum EvaluatedStatus @@ -236,26 +227,7 @@ private: static void clip_ref_changed(SPObject *old_clip, SPObject *clip, SPItem *item); static void mask_ref_changed(SPObject *old_clip, SPObject *clip, SPItem *item); - friend class SPItemClass; - friend class CItem; -}; - -/// The SPItem vtable. -class SPItemClass { public: - SPObjectClass parent_class; - - private: - friend class SPItem; - friend class CItem; -}; - - -class CItem : public CObject { -public: - CItem(SPItem* item); - virtual ~CItem(); - virtual void build(SPDocument *document, Inkscape::XML::Node *repr); virtual void release(); virtual void set(unsigned int key, gchar const* value); @@ -271,9 +243,6 @@ public: virtual Geom::Affine set_transform(Geom::Affine const &transform); virtual void convert_to_guides(); virtual gint event(SPEvent *event); - -protected: - SPItem* spitem; }; diff --git a/src/sp-line.cpp b/src/sp-line.cpp index 4c1fef70a..eee59930b 100644 --- a/src/sp-line.cpp +++ b/src/sp-line.cpp @@ -35,7 +35,6 @@ namespace { } SPLine::SPLine() : SPShape() { - this->citem = this; this->cobject = this; this->x1.unset(); diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index e3bc32f37..dc8e166e4 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -49,9 +49,7 @@ typedef std::list<std::string> HRefList; static std::string patheffectlist_write_svg(PathEffectList const & list); static std::string hreflist_write_svg(HRefList const & list); -SPLPEItem::SPLPEItem() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPLPEItem::SPLPEItem() : SPItem() { this->cobject = this; this->path_effects_enabled = 1; @@ -68,7 +66,7 @@ SPLPEItem::~SPLPEItem() { void SPLPEItem::build(SPDocument *document, Inkscape::XML::Node *repr) { this->readAttr( "inkscape:path-effect" ); - CItem::build(document, repr); + SPItem::build(document, repr); } void SPLPEItem::release() { @@ -95,7 +93,7 @@ void SPLPEItem::release() { delete this->path_effect_list; this->path_effect_list = NULL; - CItem::release(); + SPItem::release(); } void SPLPEItem::set(unsigned int key, gchar const* value) { @@ -163,13 +161,13 @@ void SPLPEItem::set(unsigned int key, gchar const* value) { break; default: - CItem::set(key, value); + SPItem::set(key, value); break; } } void SPLPEItem::update(SPCtx* ctx, unsigned int flags) { - CItem::update(ctx, flags); + SPItem::update(ctx, flags); // update the helperpaths of all LPEs applied to the item // TODO: re-add for the new node tool @@ -180,7 +178,7 @@ void SPLPEItem::modified(unsigned int flags) { sp_lpe_item_update_patheffect(this, true, true); } -// CItem::onModified(flags); +// SPItem::onModified(flags); } Inkscape::XML::Node* SPLPEItem::write(Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { @@ -193,7 +191,7 @@ Inkscape::XML::Node* SPLPEItem::write(Inkscape::XML::Document *xml_doc, Inkscape } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -579,7 +577,7 @@ void sp_lpe_item_edit_next_param_oncanvas(SPLPEItem *lpeitem, SPDesktop *dt) } void SPLPEItem::child_added(Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { - CItem::child_added(child, ref); + SPItem::child_added(child, ref); if (sp_lpe_item_has_path_effect_recursive(this)) { SPObject *ochild = this->get_child_by_repr(child); @@ -598,7 +596,7 @@ void SPLPEItem::remove_child(Inkscape::XML::Node * child) { } } - CItem::remove_child(child); + SPItem::remove_child(child); } static std::string patheffectlist_write_svg(PathEffectList const & list) diff --git a/src/sp-lpe-item.h b/src/sp-lpe-item.h index 9a59a897f..3b0a7bb77 100644 --- a/src/sp-lpe-item.h +++ b/src/sp-lpe-item.h @@ -38,7 +38,7 @@ namespace LivePathEffect{ typedef std::list<Inkscape::LivePathEffect::LPEObjectReference *> PathEffectList; -class SPLPEItem : public SPItem, public CItem { +class SPLPEItem : public SPItem { public: SPLPEItem(); virtual ~SPLPEItem(); diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index 3743ad88d..89f6e20d4 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -96,7 +96,6 @@ static void sp_offset_source_modified (SPObject *iSource, guint flags, SPItem *i static bool use_slow_but_correct_offset_method=false; SPOffset::SPOffset() : SPShape() { - this->citem = this; this->cobject = this; this->rad = 1.0; diff --git a/src/sp-path.cpp b/src/sp-path.cpp index 5b50eeee6..d8c43aa68 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -120,7 +120,6 @@ void SPPath::convert_to_guides() { } SPPath::SPPath() : SPShape(), connEndPair(this) { - this->citem = this; this->cobject = this; } diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp index e5b2e0cd8..0efd06b27 100644 --- a/src/sp-polygon.cpp +++ b/src/sp-polygon.cpp @@ -36,7 +36,6 @@ namespace { } SPPolygon::SPPolygon() : SPShape() { - this->citem = this; this->cobject = this; } diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp index 448c5a27b..4638952a6 100644 --- a/src/sp-polyline.cpp +++ b/src/sp-polyline.cpp @@ -31,7 +31,6 @@ namespace { } SPPolyLine::SPPolyLine() : SPShape() { - this->citem = this; this->cobject = this; } diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index ff158974c..94a92079a 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -39,7 +39,6 @@ namespace { SPRect::SPRect() : SPShape() { - this->citem = this; this->cobject = this; } diff --git a/src/sp-root.cpp b/src/sp-root.cpp index c0e71ed2c..b1484759d 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -42,7 +42,6 @@ namespace { } SPRoot::SPRoot() : SPGroup() { - this->citem = this; this->cobject = this; this->aspect_set = 0; diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index eda4fce49..b5c920bee 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -56,7 +56,6 @@ static void sp_shape_update_marker_view (SPShape *shape, Inkscape::DrawingItem *ai); SPShape::SPShape() : SPLPEItem() { - this->citem = this; this->cobject = this; for ( int i = 0 ; i < SP_MARKER_LOC_QTY ; i++ ) { diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index 905a05a5f..e1e175e9d 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -40,7 +40,6 @@ namespace { } SPSpiral::SPSpiral() : SPShape() { - this->citem = this; this->cobject = this; this->cx = 0.0; diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 8c7ebaf52..489c896b9 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -43,7 +43,6 @@ namespace { } SPStar::SPStar() : SPPolygon() { - this->citem = this; this->cobject = this; this->sides = 5; diff --git a/src/sp-switch.cpp b/src/sp-switch.cpp index 6aa179d14..c2515ef66 100644 --- a/src/sp-switch.cpp +++ b/src/sp-switch.cpp @@ -36,7 +36,6 @@ namespace { } SPSwitch::SPSwitch() : SPGroup() { - this->citem = this; this->cobject = this; this->_cached_item = 0; diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp index a9a8ed639..989b6ea15 100644 --- a/src/sp-symbol.cpp +++ b/src/sp-symbol.cpp @@ -37,7 +37,6 @@ namespace { } SPSymbol::SPSymbol() : SPGroup() { - this->citem = this; this->cobject = this; this->aspect_align = 0; diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 386b49d26..c59093ae9 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -71,9 +71,7 @@ namespace { /*##################################################### # SPTEXT #####################################################*/ -SPText::SPText() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPText::SPText() : SPItem() { this->cobject = this; new (&this->layout) Inkscape::Text::Layout; @@ -90,7 +88,7 @@ void SPText::build(SPDocument *doc, Inkscape::XML::Node *repr) { this->readAttr( "dy" ); this->readAttr( "rotate" ); - CItem::build(doc, repr); + SPItem::build(doc, repr); this->readAttr( "sodipodi:linespacing" ); // has to happen after the styles are read } @@ -99,7 +97,7 @@ void SPText::release() { this->attributes.~TextTagAttributes(); this->layout.~Layout(); - CItem::release(); + SPItem::release(); } void SPText::set(unsigned int key, const gchar* value) { @@ -121,27 +119,27 @@ void SPText::set(unsigned int key, const gchar* value) { break; default: - CItem::set(key, value); + SPItem::set(key, value); break; } } } void SPText::child_added(Inkscape::XML::Node *rch, Inkscape::XML::Node *ref) { - CItem::child_added(rch, ref); + SPItem::child_added(rch, ref); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_CONTENT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); } void SPText::remove_child(Inkscape::XML::Node *rch) { - CItem::remove_child(rch); + SPItem::remove_child(rch); this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_TEXT_CONTENT_MODIFIED_FLAG | SP_TEXT_LAYOUT_MODIFIED_FLAG); } void SPText::update(SPCtx *ctx, guint flags) { - CItem::update(ctx, flags); + SPItem::update(ctx, flags); guint cflags = (flags & SP_OBJECT_MODIFIED_CASCADE); @@ -193,7 +191,7 @@ void SPText::update(SPCtx *ctx, guint flags) { } void SPText::modified(guint flags) { -// CItem::onModified(flags); +// SPItem::onModified(flags); guint cflags = (flags & SP_OBJECT_MODIFIED_CASCADE); @@ -294,7 +292,7 @@ Inkscape::XML::Node *SPText::write(Inkscape::XML::Document *xml_doc, Inkscape::X this->getRepr()->setAttribute("sodipodi:linespacing", NULL); } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -324,7 +322,7 @@ Inkscape::DrawingItem* SPText::show(Inkscape::Drawing &drawing, unsigned key, un void SPText::hide(unsigned int key) { -// CItem::onHide(key); +// SPItem::onHide(key); } diff --git a/src/sp-text.h b/src/sp-text.h index f3113e59f..7722a4c7a 100644 --- a/src/sp-text.h +++ b/src/sp-text.h @@ -30,7 +30,7 @@ /* SPText */ -class SPText : public SPItem, public CItem { +class SPText : public SPItem { public: SPText(); virtual ~SPText(); diff --git a/src/sp-textpath.h b/src/sp-textpath.h index f4f0aa5bf..94672b36d 100644 --- a/src/sp-textpath.h +++ b/src/sp-textpath.h @@ -12,7 +12,7 @@ class Path; #define SP_TEXTPATH(obj) ((SPTextPath*)obj) #define SP_IS_TEXTPATH(obj) (dynamic_cast<const SPTextPath*>((SPObject*)obj)) -class SPTextPath : public SPItem, public CItem { +class SPTextPath : public SPItem { public: SPTextPath(); virtual ~SPTextPath(); diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 1929b6820..6c6490ad5 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -63,9 +63,7 @@ static void build_string_from_root(Inkscape::XML::Node *root, Glib::ustring *ret static void sp_tref_href_changed(SPObject *old_ref, SPObject *ref, SPTRef *tref); static void sp_tref_delete_self(SPObject *deleted, SPTRef *self); -SPTRef::SPTRef() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPTRef::SPTRef() : SPItem() { this->cobject = this; this->stringChild = NULL; @@ -89,7 +87,7 @@ SPTRef::~SPTRef() { } void SPTRef::build(SPDocument *document, Inkscape::XML::Node *repr) { - CItem::build(document, repr); + SPItem::build(document, repr); this->readAttr( "xlink:href" ); this->readAttr( "x" ); @@ -110,7 +108,7 @@ void SPTRef::release() { this->uriOriginalRef->detach(); - CItem::release(); + SPItem::release(); } void SPTRef::set(unsigned int key, const gchar* value) { @@ -147,14 +145,14 @@ void SPTRef::set(unsigned int key, const gchar* value) { this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } } else { // default - CItem::set(key, value); + SPItem::set(key, value); } } void SPTRef::update(SPCtx *ctx, guint flags) { debug("0x%p",this); - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -207,7 +205,7 @@ Inkscape::XML::Node* SPTRef::write(Inkscape::XML::Document *xml_doc, Inkscape::X g_free(uri_string); } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -246,7 +244,7 @@ gchar* SPTRef::description() { char *child_desc; if (SP_IS_ITEM(referred)) { - child_desc = SP_ITEM(referred)->description(); + child_desc = SP_ITEM(referred)->getDetailedDescription(); } else { child_desc = g_strdup(""); } diff --git a/src/sp-tref.h b/src/sp-tref.h index 29183047b..8be5afc18 100644 --- a/src/sp-tref.h +++ b/src/sp-tref.h @@ -25,7 +25,7 @@ #define SP_TREF(obj) ((SPTRef*)obj) #define SP_IS_TREF(obj) (dynamic_cast<const SPTRef*>((SPObject*)obj)) -class SPTRef : public SPItem, public CItem { +class SPTRef : public SPItem { public: SPTRef(); virtual ~SPTRef(); diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index f72fe4c41..f76fa1b27 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -61,9 +61,7 @@ namespace { /*##################################################### # SPTSPAN #####################################################*/ -SPTSpan::SPTSpan() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPTSpan::SPTSpan() : SPItem() { this->cobject = this; this->role = SP_TSPAN_ROLE_UNSPECIFIED; @@ -81,13 +79,13 @@ void SPTSpan::build(SPDocument *doc, Inkscape::XML::Node *repr) { this->readAttr( "rotate" ); this->readAttr( "sodipodi:role" ); - CItem::build(doc, repr); + SPItem::build(doc, repr); } void SPTSpan::release() { this->attributes.~TextTagAttributes(); - CItem::release(); + SPItem::release(); } void SPTSpan::set(unsigned int key, const gchar* value) { @@ -104,14 +102,14 @@ void SPTSpan::set(unsigned int key, const gchar* value) { break; default: - CItem::set(key, value); + SPItem::set(key, value); break; } } } void SPTSpan::update(SPCtx *ctx, guint flags) { - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -127,7 +125,7 @@ void SPTSpan::update(SPCtx *ctx, guint flags) { } void SPTSpan::modified(unsigned int flags) { -// CItem::onModified(flags); +// SPItem::onModified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -215,7 +213,7 @@ Inkscape::XML::Node* SPTSpan::write(Inkscape::XML::Document *xml_doc, Inkscape:: } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } @@ -230,9 +228,7 @@ gchar* SPTSpan::description() { #####################################################*/ void refresh_textpath_source(SPTextPath* offset); -SPTextPath::SPTextPath() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPTextPath::SPTextPath() : SPItem() { this->cobject = this; new (&this->attributes) TextTagAttributes; @@ -275,7 +271,7 @@ void SPTextPath::build(SPDocument *doc, Inkscape::XML::Node *repr) { repr->addChild(rch, NULL); } - CItem::build(doc, repr); + SPItem::build(doc, repr); } void SPTextPath::release() { @@ -287,7 +283,7 @@ void SPTextPath::release() { this->originalPath = NULL; - CItem::release(); + SPItem::release(); } void SPTextPath::set(unsigned int key, const gchar* value) { @@ -303,7 +299,7 @@ void SPTextPath::set(unsigned int key, const gchar* value) { this->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; default: - CItem::set(key, value); + SPItem::set(key, value); break; } } @@ -318,7 +314,7 @@ void SPTextPath::update(SPCtx *ctx, guint flags) { this->isUpdating = false; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -358,7 +354,7 @@ void refresh_textpath_source(SPTextPath* tp) } void SPTextPath::modified(unsigned int flags) { -// CItem::onModified(flags); +// SPItem::onModified(flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -431,7 +427,7 @@ Inkscape::XML::Node* SPTextPath::write(Inkscape::XML::Document *xml_doc, Inkscap } } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); return repr; } diff --git a/src/sp-tspan.h b/src/sp-tspan.h index 1f399f6cf..75ef190c6 100644 --- a/src/sp-tspan.h +++ b/src/sp-tspan.h @@ -18,7 +18,7 @@ enum { SP_TSPAN_ROLE_LINE }; -class SPTSpan : public SPItem, public CItem { +class SPTSpan : public SPItem { public: SPTSpan(); virtual ~SPTSpan(); diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 8b73844e5..8fadc0fac 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -52,9 +52,7 @@ namespace { bool useRegistered = SPFactory::instance().registerObject("svg:use", createUse); } -SPUse::SPUse() : SPItem(), CItem(this) { - delete this->citem; - this->citem = this; +SPUse::SPUse() : SPItem() { this->cobject = this; this->child = NULL; @@ -92,7 +90,7 @@ SPUse::~SPUse() { } void SPUse::build(SPDocument *document, Inkscape::XML::Node *repr) { - CItem::build(document, repr); + SPItem::build(document, repr); this->readAttr( "x" ); this->readAttr( "y" ); @@ -120,7 +118,7 @@ void SPUse::release() { this->ref->detach(); - CItem::release(); + SPItem::release(); } void SPUse::set(unsigned int key, const gchar* value) { @@ -171,7 +169,7 @@ void SPUse::set(unsigned int key, const gchar* value) { } default: - CItem::set(key, value); + SPItem::set(key, value); break; } } @@ -181,7 +179,7 @@ Inkscape::XML::Node* SPUse::write(Inkscape::XML::Document *xml_doc, Inkscape::XM repr = xml_doc->createElement("svg:use"); } - CItem::write(xml_doc, repr, flags); + SPItem::write(xml_doc, repr, flags); sp_repr_set_svg_double(repr, "x", this->x.computed); sp_repr_set_svg_double(repr, "y", this->y.computed); @@ -253,7 +251,7 @@ gchar* SPUse::description() { } ++recursion_depth; - char *child_desc = SP_ITEM(this->child)->description(); + char *child_desc = SP_ITEM(this->child)->getDetailedDescription(); --recursion_depth; ret = g_strdup_printf(_("<b>Clone</b> of: %s"), child_desc); @@ -288,7 +286,7 @@ void SPUse::hide(unsigned int key) { SP_ITEM(this->child)->invoke_hide(key); } -// CItem::onHide(key); +// SPItem::onHide(key); } @@ -508,7 +506,7 @@ void SPUse::update(SPCtx *ctx, unsigned flags) { SPItemCtx *ictx = (SPItemCtx *) ctx; SPItemCtx cctx = *ictx; - CItem::update(ctx, flags); + SPItem::update(ctx, flags); if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -702,7 +700,7 @@ void SPUse::snappoints(std::vector<Inkscape::SnapCandidatePoint> &p, Inkscape::S return; } - root->citem->snappoints(p, snapprefs); + root->snappoints(p, snapprefs); } diff --git a/src/sp-use.h b/src/sp-use.h index 83059b672..a1817fc32 100644 --- a/src/sp-use.h +++ b/src/sp-use.h @@ -23,7 +23,7 @@ class SPUseReference; -class SPUse : public SPItem, public CItem { +class SPUse : public SPItem { public: SPUse(); virtual ~SPUse(); |
