From 4dd33aa4d5c57706c7f64f63391174954160a308 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 6 Aug 2011 14:18:32 +0200 Subject: Rewrite NRArenaItem hierarchy into C++ (bzr r10347.1.21) --- src/sp-root.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index 918bd3295..bbb12f5d3 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -22,7 +22,7 @@ #include <2geom/transforms.h> #include "svg/svg.h" -#include "display/nr-arena-group.h" +#include "display/drawing-group.h" #include "attributes.h" #include "print.h" #include "document.h" @@ -46,7 +46,7 @@ static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags); static void sp_root_modified(SPObject *object, guint flags); static Inkscape::XML::Node *sp_root_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); -static NRArenaItem *sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags); +static Inkscape::DrawingItem *sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags); static void sp_root_print(SPItem *item, SPPrintContext *ctx); static SPGroupClass *parent_class; @@ -540,7 +540,8 @@ static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags) /* As last step set additional transform of arena group */ for (SPItemView *v = root->display; v != NULL; v = v->next) { - nr_arena_group_set_child_transform(NR_ARENA_GROUP(v->arenaitem), root->c2p); + Inkscape::DrawingGroup *g = dynamic_cast(v->arenaitem); + g->setChildTransform(root->c2p); } } @@ -609,16 +610,17 @@ sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML: /** * Displays the SPRoot item on the NRArena. */ -static NRArenaItem * +static Inkscape::DrawingItem * sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags) { SPRoot *root = SP_ROOT(item); - NRArenaItem *ai; + Inkscape::DrawingItem *ai; if (((SPItemClass *) (parent_class))->show) { ai = ((SPItemClass *) (parent_class))->show(item, arena, key, flags); if (ai) { - nr_arena_group_set_child_transform(NR_ARENA_GROUP(ai), root->c2p); + Inkscape::DrawingGroup *g = dynamic_cast(ai); + g->setChildTransform(root->c2p); } } else { ai = NULL; -- cgit v1.2.3 From 75976ea07dba9b97186667524d0a76603de416af Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sun, 7 Aug 2011 12:53:12 +0200 Subject: Rewrite NRArena -> Inkscape::Drawing. Call render and update methods on the Drawing rather than on the root DrawingItem. (bzr r10347.1.25) --- src/sp-root.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/sp-root.cpp') diff --git a/src/sp-root.cpp b/src/sp-root.cpp index bbb12f5d3..a6df580d3 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -46,7 +46,7 @@ static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags); static void sp_root_modified(SPObject *object, guint flags); static Inkscape::XML::Node *sp_root_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); -static Inkscape::DrawingItem *sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags); +static Inkscape::DrawingItem *sp_root_show(SPItem *item, Inkscape::Drawing &drawing, unsigned int key, unsigned int flags); static void sp_root_print(SPItem *item, SPPrintContext *ctx); static SPGroupClass *parent_class; @@ -538,7 +538,7 @@ static void sp_root_update(SPObject *object, SPCtx *ctx, guint flags) if (((SPObjectClass *) (parent_class))->update) ((SPObjectClass *) (parent_class))->update(object, (SPCtx *) &rctx, flags); - /* As last step set additional transform of arena group */ + /* As last step set additional transform of drawing group */ for (SPItemView *v = root->display; v != NULL; v = v->next) { Inkscape::DrawingGroup *g = dynamic_cast(v->arenaitem); g->setChildTransform(root->c2p); @@ -608,16 +608,16 @@ sp_root_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML: } /** - * Displays the SPRoot item on the NRArena. + * Displays the SPRoot item on the drawing. */ static Inkscape::DrawingItem * -sp_root_show(SPItem *item, NRArena *arena, unsigned int key, unsigned int flags) +sp_root_show(SPItem *item, Inkscape::Drawing &drawing, unsigned int key, unsigned int flags) { SPRoot *root = SP_ROOT(item); Inkscape::DrawingItem *ai; if (((SPItemClass *) (parent_class))->show) { - ai = ((SPItemClass *) (parent_class))->show(item, arena, key, flags); + ai = ((SPItemClass *) (parent_class))->show(item, drawing, key, flags); if (ai) { Inkscape::DrawingGroup *g = dynamic_cast(ai); g->setChildTransform(root->c2p); -- cgit v1.2.3