From: Abhishek Sharma public Date: Tue, 20 Jul 2010 10:44:23 +0000 (+0530) Subject: More on c++ification and some XML privatisation X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ef610fdbfb424e7ad204ac9de142c05bb986e1dc;p=inkscape.git More on c++ification and some XML privatisation --- diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index d6f1f6b42..6838008bb 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -346,8 +346,10 @@ box3d_side_convert_to_path(Box3DSide *side) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); - repr->setAttribute("d", SP_OBJECT_REPR(side)->attribute("d")); - repr->setAttribute("style", SP_OBJECT_REPR(side)->attribute("style")); + //repr->setAttribute("d", SP_OBJECT_REPR(side)->attribute("d")); + repr->setAttribute("d", side->getAttribute("d")); + //repr->setAttribute("style", SP_OBJECT_REPR(side)->attribute("style")); + repr->setAttribute("style", side->getAttribute("style")); return repr; } diff --git a/src/conditions.cpp b/src/conditions.cpp index 4a18a6913..7087abac2 100644 --- a/src/conditions.cpp +++ b/src/conditions.cpp @@ -41,10 +41,11 @@ static Condition _condition_handlers[] = { /* function which evaluates if item should be displayed */ bool sp_item_evaluate(SPItem const *item) { - Inkscape::XML::Node *grepr = SP_OBJECT_REPR (item); + //Inkscape::XML::Node *grepr = SP_OBJECT_REPR (item); for ( unsigned int i = 0 ; i < sizeof(_condition_handlers)/sizeof(_condition_handlers[0]) ; i++ ) { - gchar const *value = grepr->attribute(_condition_handlers[i].attribute); + //gchar const *value = grepr->attribute(_condition_handlers[i].attribute); + gchar const *value = item->getAttribute(_condition_handlers[i].attribute); if ( NULL == value ) continue; diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index fd37fceed..3e8359c57 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -314,7 +314,8 @@ void SPAvoidRef::handleSettingChange(void) _transformed_connection = item->connectTransformed( sigc::ptr_fun(&avoid_item_move)); - const char *id = SP_OBJECT_REPR(item)->attribute("id"); + //const char *id = SP_OBJECT_REPR(item)->attribute("id"); + const char *id = item->getAttribute("id"); g_assert(id != NULL); // Get a unique ID for the item. diff --git a/src/desktop.h b/src/desktop.h index 59ba3f957..160a33558 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -84,8 +84,9 @@ namespace Inkscape { * * @see \ref desktop-handles.h for desktop macros. */ -struct SPDesktop : public Inkscape::UI::View::View +class SPDesktop : public Inkscape::UI::View::View { + public: Inkscape::UI::Dialog::DialogManager *_dlg_mgr; SPNamedView *namedview; SPCanvas *canvas; diff --git a/src/forward.h b/src/forward.h index 41365611a..e090b68b7 100644 --- a/src/forward.h +++ b/src/forward.h @@ -46,11 +46,11 @@ GType sp_event_context_get_type (); class SPDocument; class SPDocumentClass; -#define SP_TYPE_DOCUMENT (sp_document_get_type ()) -#define SP_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_DOCUMENT, SPDocument)) -#define SP_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_DOCUMENT)) +//#define SP_TYPE_DOCUMENT (sp_document_get_type ()) +//#define SP_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_DOCUMENT, SPDocument)) +//#define SP_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_DOCUMENT)) -GType sp_document_get_type (); +//GType sp_document_get_type (); /* Objects */ diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 8b4db3e25..7c93c5f07 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -2970,7 +2970,7 @@ sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_to_la gchar const *mask_id = NULL; if (apply_clip_path) { - mask_id = sp_clippath_create(mask_items_dup, doc, &maskTransform); + mask_id = SPClipPath::create(mask_items_dup, doc, &maskTransform); } else { mask_id = sp_mask_create(mask_items_dup, doc, &maskTransform); } diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 63e617551..d074ef197 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -37,7 +37,7 @@ struct SPClipPathView { NRRect bbox; }; -static void sp_clippath_class_init(SPClipPathClass *klass); +/*static void sp_clippath_class_init(SPClipPathClass *klass); static void sp_clippath_init(SPClipPath *clippath); static void sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); @@ -46,22 +46,23 @@ static void sp_clippath_set(SPObject *object, unsigned int key, gchar const *val static void sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); static void sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags); static void sp_clippath_modified(SPObject *object, guint flags); -static Inkscape::XML::Node *sp_clippath_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); +static Inkscape::XML::Node *sp_clippath_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags);*/ SPClipPathView *sp_clippath_view_new_prepend(SPClipPathView *list, unsigned int key, NRArenaItem *arenaitem); SPClipPathView *sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view); -static SPObjectGroupClass *parent_class; +//static SPObjectGroupClass *parent_class; +SPObjectGroupClass * SPClipPathClass::static_parent_class = 0; GType -sp_clippath_get_type(void) +SPClipPath::sp_clippath_get_type(void) { static GType type = 0; if (!type) { GTypeInfo info = { sizeof(SPClipPathClass), NULL, NULL, - (GClassInitFunc) sp_clippath_class_init, + (GClassInitFunc) SPClipPathClass::sp_clippath_class_init, NULL, NULL, sizeof(SPClipPath), 16, @@ -73,24 +74,24 @@ sp_clippath_get_type(void) return type; } -static void -sp_clippath_class_init(SPClipPathClass *klass) +void +SPClipPathClass::sp_clippath_class_init(SPClipPathClass *klass) { SPObjectClass *sp_object_class = (SPObjectClass *) klass; - parent_class = (SPObjectGroupClass*)g_type_class_ref(SP_TYPE_OBJECTGROUP); + static_parent_class = (SPObjectGroupClass*)g_type_class_ref(SP_TYPE_OBJECTGROUP); - sp_object_class->build = sp_clippath_build; - sp_object_class->release = sp_clippath_release; - sp_object_class->set = sp_clippath_set; - sp_object_class->child_added = sp_clippath_child_added; - sp_object_class->update = sp_clippath_update; - sp_object_class->modified = sp_clippath_modified; - sp_object_class->write = sp_clippath_write; + sp_object_class->build = SPClipPath::sp_clippath_build; + sp_object_class->release = SPClipPath::sp_clippath_release; + sp_object_class->set = SPClipPath::sp_clippath_set; + sp_object_class->child_added = SPClipPath::sp_clippath_child_added; + sp_object_class->update = SPClipPath::sp_clippath_update; + sp_object_class->modified = SPClipPath::sp_clippath_modified; + sp_object_class->write = SPClipPath::sp_clippath_write; } -static void -sp_clippath_init(SPClipPath *cp) +void +SPClipPath::sp_clippath_init(SPClipPath *cp) { cp->clipPathUnits_set = FALSE; cp->clipPathUnits = SP_CONTENT_UNITS_USERSPACEONUSE; @@ -98,11 +99,11 @@ sp_clippath_init(SPClipPath *cp) cp->display = NULL; } -static void -sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) +void +SPClipPath::sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { - if (((SPObjectClass *) parent_class)->build) - ((SPObjectClass *) parent_class)->build(object, document, repr); + if (((SPObjectClass *) SPClipPathClass::static_parent_class)->build) + ((SPObjectClass *) SPClipPathClass::static_parent_class)->build(object, document, repr); object->readAttr( "clipPathUnits"); @@ -110,8 +111,8 @@ sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *r document->add_resource("clipPath", object); } -static void -sp_clippath_release(SPObject * object) +void +SPClipPath::sp_clippath_release(SPObject * object) { if (SP_OBJECT_DOCUMENT(object)) { /* Unregister ourselves */ @@ -124,13 +125,13 @@ sp_clippath_release(SPObject * object) cp->display = sp_clippath_view_list_remove(cp->display, cp->display); } - if (((SPObjectClass *) (parent_class))->release) { - ((SPObjectClass *) parent_class)->release(object); + if (((SPObjectClass *) (SPClipPathClass::static_parent_class))->release) { + ((SPObjectClass *) SPClipPathClass::static_parent_class)->release(object); } } -static void -sp_clippath_set(SPObject *object, unsigned int key, gchar const *value) +void +SPClipPath::sp_clippath_set(SPObject *object, unsigned int key, gchar const *value) { SPClipPath *cp = SP_CLIPPATH(object); @@ -149,17 +150,17 @@ sp_clippath_set(SPObject *object, unsigned int key, gchar const *value) object->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); break; default: - if (((SPObjectClass *) parent_class)->set) - ((SPObjectClass *) parent_class)->set(object, key, value); + if (((SPObjectClass *) SPClipPathClass::static_parent_class)->set) + ((SPObjectClass *) SPClipPathClass::static_parent_class)->set(object, key, value); break; } } -static void -sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) +void +SPClipPath::sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref) { /* Invoke SPObjectGroup implementation */ - ((SPObjectClass *) (parent_class))->child_added(object, child, ref); + ((SPObjectClass *) (SPClipPathClass::static_parent_class))->child_added(object, child, ref); /* Show new object */ SPObject *ochild = SP_OBJECT_DOCUMENT(object)->getObjectByRepr(child); @@ -176,8 +177,8 @@ sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape:: } } -static void -sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags) +void +SPClipPath::sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags) { if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -214,8 +215,8 @@ sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags) } } -static void -sp_clippath_modified(SPObject *object, guint flags) +void +SPClipPath::sp_clippath_modified(SPObject *object, guint flags) { if (flags & SP_OBJECT_MODIFIED_FLAG) { flags |= SP_OBJECT_PARENT_MODIFIED_FLAG; @@ -240,31 +241,31 @@ sp_clippath_modified(SPObject *object, guint flags) } } -static Inkscape::XML::Node * -sp_clippath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) +Inkscape::XML::Node * +SPClipPath::sp_clippath_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { if ((flags & SP_OBJECT_WRITE_BUILD) && !repr) { repr = xml_doc->createElement("svg:clipPath"); } - if (((SPObjectClass *) (parent_class))->write) - ((SPObjectClass *) (parent_class))->write(object, xml_doc, repr, flags); + if (((SPObjectClass *) (SPClipPathClass::static_parent_class))->write) + ((SPObjectClass *) (SPClipPathClass::static_parent_class))->write(object, xml_doc, repr, flags); return repr; } NRArenaItem * -sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key) +SPClipPath::sp_clippath_show(NRArena *arena, unsigned int key) { - g_return_val_if_fail(cp != NULL, NULL); - g_return_val_if_fail(SP_IS_CLIPPATH(cp), NULL); + //g_return_val_if_fail(cp != NULL, NULL); + //g_return_val_if_fail(SP_IS_CLIPPATH(cp), NULL); g_return_val_if_fail(arena != NULL, NULL); g_return_val_if_fail(NR_IS_ARENA(arena), NULL); NRArenaItem *ai = NRArenaGroup::create(arena); - cp->display = sp_clippath_view_new_prepend(cp->display, key, ai); + this->display = sp_clippath_view_new_prepend(this->display, key, ai); - for (SPObject *child = SP_OBJECT(cp)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) { + for (SPObject *child = this->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) { if (SP_IS_ITEM(child)) { NRArenaItem *ac = SP_ITEM(child)->invoke_show(arena, key, SP_ITEM_REFERENCE_FLAGS); if (ac) { @@ -274,10 +275,10 @@ sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key) } } - if (cp->clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) { - Geom::Matrix t(Geom::Scale(cp->display->bbox.x1 - cp->display->bbox.x0, cp->display->bbox.y1 - cp->display->bbox.y0)); - t[4] = cp->display->bbox.x0; - t[5] = cp->display->bbox.y0; + if (this->clipPathUnits == SP_CONTENT_UNITS_OBJECTBOUNDINGBOX) { + Geom::Matrix t(Geom::Scale(this->display->bbox.x1 - this->display->bbox.x0, this->display->bbox.y1 - this->display->bbox.y0)); + t[4] = this->display->bbox.x0; + t[5] = this->display->bbox.y0; nr_arena_group_set_child_transform(NR_ARENA_GROUP(ai), &t); } @@ -285,21 +286,21 @@ sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key) } void -sp_clippath_hide(SPClipPath *cp, unsigned int key) +SPClipPath::sp_clippath_hide(unsigned int key) { - g_return_if_fail(cp != NULL); - g_return_if_fail(SP_IS_CLIPPATH(cp)); + //g_return_if_fail(cp != NULL); + //g_return_if_fail(SP_IS_CLIPPATH(cp)); - for (SPObject *child = SP_OBJECT(cp)->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) { + for (SPObject *child = this->first_child() ; child != NULL; child = SP_OBJECT_NEXT(child)) { if (SP_IS_ITEM(child)) { SP_ITEM(child)->invoke_hide(key); } } - for (SPClipPathView *v = cp->display; v != NULL; v = v->next) { + for (SPClipPathView *v = this->display; v != NULL; v = v->next) { if (v->key == key) { /* We simply unref and let item to manage this in handler */ - cp->display = sp_clippath_view_list_remove(cp->display, v); + this->display = sp_clippath_view_list_remove(this->display, v); return; } } @@ -308,9 +309,9 @@ sp_clippath_hide(SPClipPath *cp, unsigned int key) } void -sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox) +SPClipPath::sp_clippath_set_bbox(unsigned int key, NRRect *bbox) { - for (SPClipPathView *v = cp->display; v != NULL; v = v->next) { + for (SPClipPathView *v = this->display; v != NULL; v = v->next) { if (v->key == key) { if (!NR_DF_TEST_CLOSE(v->bbox.x0, bbox->x0, NR_EPSILON) || !NR_DF_TEST_CLOSE(v->bbox.y0, bbox->y0, NR_EPSILON) || @@ -324,10 +325,10 @@ sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox) } void -sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, Geom::Matrix const &transform, unsigned const /*flags*/) +SPClipPath::sp_clippath_get_bbox(NRRect *bbox, Geom::Matrix const &transform, unsigned const /*flags*/) { SPObject *i; - for (i = SP_OBJECT(cp)->first_child(); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i)){}; + for (i = this->first_child(); i && !SP_IS_ITEM(i); i = SP_OBJECT_NEXT(i)){}; if (!i) return; SP_ITEM(i)->invoke_bbox_full( bbox, Geom::Matrix(SP_ITEM(i)->transform) * transform, SPItem::GEOMETRIC_BBOX, FALSE); @@ -380,7 +381,7 @@ sp_clippath_view_list_remove(SPClipPathView *list, SPClipPathView *view) // Create a mask element (using passed elements), add it to const gchar * -sp_clippath_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform) +SPClipPath::create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform) { Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document)); diff --git a/src/sp-clippath.h b/src/sp-clippath.h index 308c3c893..239dca049 100644 --- a/src/sp-clippath.h +++ b/src/sp-clippath.h @@ -13,7 +13,7 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -#define SP_TYPE_CLIPPATH (sp_clippath_get_type ()) +#define SP_TYPE_CLIPPATH (SPClipPath::sp_clippath_get_type ()) #define SP_CLIPPATH(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SP_TYPE_CLIPPATH, SPClipPath)) #define SP_CLIPPATH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SP_TYPE_CLIPPATH, SPClipPathClass)) #define SP_IS_CLIPPATH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SP_TYPE_CLIPPATH)) @@ -27,20 +27,47 @@ class SPClipPathView; #include "uri-references.h" #include "xml/node.h" -struct SPClipPath : public SPObjectGroup { +class SPClipPath : public SPObjectGroup { + public: class Reference; unsigned int clipPathUnits_set : 1; unsigned int clipPathUnits : 1; SPClipPathView *display; + static const gchar *create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform); + static GType sp_clippath_get_type (void); + + NRArenaItem *sp_clippath_show(NRArena *arena, unsigned int key); + void sp_clippath_hide(unsigned int key); + + void sp_clippath_set_bbox(unsigned int key, NRRect *bbox); + void sp_clippath_get_bbox(NRRect *bbox, Geom::Matrix const &transform, unsigned const flags); + private: + static void sp_clippath_init(SPClipPath *clippath); + + static void sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); + static void sp_clippath_release(SPObject * object); + static void sp_clippath_set(SPObject *object, unsigned int key, gchar const *value); + static void sp_clippath_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); + static void sp_clippath_update(SPObject *object, SPCtx *ctx, guint flags); + static void sp_clippath_modified(SPObject *object, guint flags); + static Inkscape::XML::Node *sp_clippath_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); + + friend class SPClipPathClass; }; -struct SPClipPathClass { +class SPClipPathClass { + public: SPObjectGroupClass parent_class; + private: + static void sp_clippath_class_init(SPClipPathClass *klass); + static SPObjectGroupClass *static_parent_class; + + friend class SPClipPath; }; -GType sp_clippath_get_type (void); +//GType sp_clippath_get_type (void); class SPClipPathReference : public Inkscape::URIReference { public: @@ -87,12 +114,12 @@ protected: } }; -NRArenaItem *sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key); +/*NRArenaItem *sp_clippath_show(SPClipPath *cp, NRArena *arena, unsigned int key); void sp_clippath_hide(SPClipPath *cp, unsigned int key); void sp_clippath_set_bbox(SPClipPath *cp, unsigned int key, NRRect *bbox); -void sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags); +void sp_clippath_get_bbox(SPClipPath *cp, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags);*/ -const gchar *sp_clippath_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform); +//const gchar *sp_clippath_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform); #endif diff --git a/src/sp-item.cpp b/src/sp-item.cpp index ae77f9d84..fc605516d 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -563,7 +563,7 @@ SPItem::clip_ref_changed(SPObject *old_clip, SPObject *clip, SPItem *item) SPItemView *v; /* Hide clippath */ for (v = item->display; v != NULL; v = v->next) { - sp_clippath_hide(SP_CLIPPATH(old_clip), NR_ARENA_ITEM_GET_KEY(v->arenaitem)); + SP_CLIPPATH(old_clip)->sp_clippath_hide(NR_ARENA_ITEM_GET_KEY(v->arenaitem)); nr_arena_item_set_clip(v->arenaitem, NULL); } } @@ -574,12 +574,12 @@ SPItem::clip_ref_changed(SPObject *old_clip, SPObject *clip, SPItem *item) if (!v->arenaitem->key) { NR_ARENA_ITEM_SET_KEY(v->arenaitem, SPItem::display_key_new(3)); } - NRArenaItem *ai = sp_clippath_show(SP_CLIPPATH(clip), + NRArenaItem *ai = SP_CLIPPATH(clip)->sp_clippath_show( NR_ARENA_ITEM_ARENA(v->arenaitem), NR_ARENA_ITEM_GET_KEY(v->arenaitem)); nr_arena_item_set_clip(v->arenaitem, ai); nr_arena_item_unref(ai); - sp_clippath_set_bbox(SP_CLIPPATH(clip), NR_ARENA_ITEM_GET_KEY(v->arenaitem), &bbox); + SP_CLIPPATH(clip)->sp_clippath_set_bbox(NR_ARENA_ITEM_GET_KEY(v->arenaitem), &bbox); SP_OBJECT(clip)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } } @@ -636,7 +636,7 @@ SPItem::sp_item_update(SPObject *object, SPCtx *ctx, guint flags) item->invoke_bbox( &bbox, Geom::identity(), TRUE); if (clip_path) { for (SPItemView *v = item->display; v != NULL; v = v->next) { - sp_clippath_set_bbox(clip_path, NR_ARENA_ITEM_GET_KEY(v->arenaitem), &bbox); + clip_path->sp_clippath_set_bbox(NR_ARENA_ITEM_GET_KEY(v->arenaitem), &bbox); } } if (mask) { @@ -846,7 +846,7 @@ SPItem::invoke_bbox_full( Geom::OptRect &bbox, Geom::Matrix const &transform, un } if (this->clip_ref->getObject()) { NRRect b; - sp_clippath_get_bbox(SP_CLIPPATH(this->clip_ref->getObject()), &b, transform, flags); + SP_CLIPPATH(this->clip_ref->getObject())->sp_clippath_get_bbox(&b, transform, flags); nr_rect_d_intersect (&temp_bbox, &temp_bbox, &b); } } @@ -899,7 +899,7 @@ SPItem::invoke_bbox_full( NRRect *bbox, Geom::Matrix const &transform, unsigned // unless this is geometric bbox, crop the bbox by clip path, if any if ((SPItem::BBoxType) flags != SPItem::GEOMETRIC_BBOX && this->clip_ref->getObject()) { NRRect b; - sp_clippath_get_bbox(SP_CLIPPATH(this->clip_ref->getObject()), &b, transform, flags); + SP_CLIPPATH(this->clip_ref->getObject())->sp_clippath_get_bbox(&b, transform, flags); nr_rect_d_intersect (&this_bbox, &this_bbox, &b); } @@ -1125,14 +1125,14 @@ SPItem::invoke_show(NRArena *arena, unsigned key, unsigned flags) int clip_key = NR_ARENA_ITEM_GET_KEY(display->arenaitem); // Show and set clip - NRArenaItem *ac = sp_clippath_show(cp, arena, clip_key); + NRArenaItem *ac = cp->sp_clippath_show(arena, clip_key); nr_arena_item_set_clip(ai, ac); nr_arena_item_unref(ac); // Update bbox, in case the clip uses bbox units NRRect bbox; invoke_bbox( &bbox, Geom::identity(), TRUE); - sp_clippath_set_bbox(SP_CLIPPATH(cp), clip_key, &bbox); + SP_CLIPPATH(cp)->sp_clippath_set_bbox(clip_key, &bbox); SP_OBJECT(cp)->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG); } if (mask_ref->getObject()) { @@ -1179,7 +1179,7 @@ SPItem::invoke_hide(unsigned key) SPItemView *next = v->next; if (v->key == key) { if (clip_ref->getObject()) { - sp_clippath_hide(clip_ref->getObject(), NR_ARENA_ITEM_GET_KEY(v->arenaitem)); + (clip_ref->getObject())->sp_clippath_hide(NR_ARENA_ITEM_GET_KEY(v->arenaitem)); nr_arena_item_set_clip(v->arenaitem, NULL); } if (mask_ref->getObject()) {