From 09ba3247163582bf2e30e17c4c154aa259ce038a Mon Sep 17 00:00:00 2001 From: cilix42 Date: Thu, 6 Aug 2009 14:17:17 +0000 Subject: [PATCH] Revert recent refactoring changes by johnce because they break the build, which cannot be fixed easily. --- src/Makefile_insert | 3 - src/application/editor.cpp | 16 +- src/application/editor.h | 14 +- src/arc-context.cpp | 3 +- src/bind/javabind.cpp | 6 +- src/box3d-context.cpp | 4 +- src/box3d-side.cpp | 6 +- src/box3d.cpp | 16 +- src/color-profile-fns.h | 4 +- src/color-profile-test.h | 2 +- src/color-profile.cpp | 10 +- src/color-profile.h | 2 +- src/composite-undo-stack-observer.cpp | 2 +- src/composite-undo-stack-observer.h | 4 +- src/conditions.cpp | 2 +- src/conn-avoid-ref.cpp | 2 +- src/connector-context.cpp | 10 +- src/desktop-events.cpp | 2 +- src/desktop-handles.cpp | 2 +- src/desktop-handles.h | 2 +- src/desktop.cpp | 6 +- src/desktop.h | 8 +- src/dialogs/clonetiler.cpp | 4 +- src/dialogs/export.cpp | 16 +- src/dialogs/xml-tree.cpp | 14 +- src/display/canvas-axonomgrid.cpp | 2 +- src/display/canvas-axonomgrid.h | 2 +- src/display/canvas-grid.cpp | 8 +- src/display/canvas-grid.h | 12 +- src/display/nr-filter-image.cpp | 2 +- src/display/nr-filter-image.h | 4 +- src/document-private.h | 18 +- src/document-subset.h | 2 +- src/document-undo.cpp | 30 +-- src/document.cpp | 154 +++++++-------- src/document.h | 103 +++++----- src/doxygen-main.cpp | 2 +- src/draw-context.cpp | 4 +- src/event-log.cpp | 2 +- src/event-log.h | 4 +- src/extension/effect.cpp | 2 +- src/extension/effect.h | 2 +- src/extension/execution-env.cpp | 2 +- src/extension/extension.cpp | 24 +-- src/extension/extension.h | 26 +-- .../implementation/implementation.cpp | 8 +- src/extension/implementation/implementation.h | 6 +- src/extension/implementation/script.cpp | 8 +- src/extension/implementation/script.h | 4 +- src/extension/implementation/xslt.cpp | 6 +- src/extension/implementation/xslt.h | 4 +- src/extension/input.cpp | 4 +- src/extension/input.h | 2 +- src/extension/internal/bitmap/imagemagick.cpp | 2 +- src/extension/internal/cairo-png-out.cpp | 4 +- src/extension/internal/cairo-png-out.h | 2 +- src/extension/internal/cairo-ps-out.cpp | 6 +- src/extension/internal/cairo-ps-out.h | 4 +- .../internal/cairo-render-context.cpp | 2 +- .../internal/cairo-renderer-pdf-out.cpp | 4 +- .../internal/cairo-renderer-pdf-out.h | 2 +- src/extension/internal/cairo-renderer.cpp | 4 +- src/extension/internal/cairo-renderer.h | 4 +- src/extension/internal/emf-win32-inout.cpp | 8 +- src/extension/internal/emf-win32-inout.h | 4 +- src/extension/internal/emf-win32-print.cpp | 2 +- src/extension/internal/emf-win32-print.h | 2 +- src/extension/internal/gdkpixbuf-input.cpp | 4 +- src/extension/internal/gdkpixbuf-input.h | 2 +- src/extension/internal/gimpgrad.cpp | 4 +- src/extension/internal/gimpgrad.h | 2 +- src/extension/internal/grid.cpp | 4 +- src/extension/internal/javafx-out.cpp | 10 +- src/extension/internal/javafx-out.h | 10 +- src/extension/internal/latex-pstricks-out.cpp | 2 +- src/extension/internal/latex-pstricks-out.h | 2 +- src/extension/internal/latex-pstricks.cpp | 2 +- src/extension/internal/latex-pstricks.h | 2 +- src/extension/internal/odf.cpp | 2 +- src/extension/internal/odf.h | 2 +- src/extension/internal/pdf-input-cairo.cpp | 4 +- src/extension/internal/pdf-input-cairo.h | 2 +- src/extension/internal/pdfinput/pdf-input.cpp | 4 +- src/extension/internal/pdfinput/pdf-input.h | 2 +- .../internal/pdfinput/svg-builder.cpp | 2 +- src/extension/internal/pdfinput/svg-builder.h | 6 +- src/extension/internal/pov-out.cpp | 8 +- src/extension/internal/pov-out.h | 8 +- src/extension/internal/svg.cpp | 8 +- src/extension/internal/svg.h | 4 +- src/extension/internal/win32.cpp | 2 +- src/extension/internal/win32.h | 2 +- src/extension/internal/wpg-input.cpp | 4 +- src/extension/internal/wpg-input.h | 2 +- src/extension/output.cpp | 2 +- src/extension/output.h | 4 +- src/extension/param/bool.cpp | 10 +- src/extension/param/bool.h | 6 +- src/extension/param/color.cpp | 4 +- src/extension/param/color.h | 6 +- src/extension/param/description.cpp | 2 +- src/extension/param/description.h | 2 +- src/extension/param/enum.cpp | 8 +- src/extension/param/enum.h | 6 +- src/extension/param/float.cpp | 8 +- src/extension/param/float.h | 6 +- src/extension/param/int.cpp | 8 +- src/extension/param/int.h | 6 +- src/extension/param/notebook.cpp | 12 +- src/extension/param/notebook.h | 6 +- src/extension/param/parameter.cpp | 26 +-- src/extension/param/parameter.h | 26 +-- src/extension/param/radiobutton.cpp | 14 +- src/extension/param/radiobutton.h | 6 +- src/extension/param/string.cpp | 8 +- src/extension/param/string.h | 6 +- src/extension/patheffect.cpp | 4 +- src/extension/patheffect.h | 4 +- src/extension/print.cpp | 2 +- src/extension/print.h | 2 +- src/extension/system.cpp | 6 +- src/extension/system.h | 4 +- src/file.cpp | 179 ++---------------- src/file.h | 37 +--- src/filter-chemistry.cpp | 10 +- src/filter-chemistry.h | 8 +- src/filters/blend.cpp | 4 +- src/filters/colormatrix.cpp | 4 +- src/filters/componenttransfer-funcnode.cpp | 4 +- src/filters/componenttransfer.cpp | 4 +- src/filters/composite.cpp | 4 +- src/filters/convolvematrix.cpp | 4 +- src/filters/diffuselighting.cpp | 4 +- src/filters/displacementmap.cpp | 4 +- src/filters/distantlight.cpp | 4 +- src/filters/flood.cpp | 4 +- src/filters/image.cpp | 4 +- src/filters/image.h | 2 +- src/filters/merge.cpp | 4 +- src/filters/mergenode.cpp | 4 +- src/filters/morphology.cpp | 4 +- src/filters/offset.cpp | 4 +- src/filters/pointlight.cpp | 4 +- src/filters/specularlighting.cpp | 4 +- src/filters/spotlight.cpp | 4 +- src/filters/tile.cpp | 4 +- src/filters/turbulence.cpp | 4 +- src/flood-context.cpp | 4 +- src/forward.h | 7 +- src/gradient-chemistry.cpp | 10 +- src/gradient-chemistry.h | 4 +- src/gradient-context.cpp | 6 +- src/gradient-drag.cpp | 2 +- src/helper/action.cpp | 2 +- src/helper/pixbuf-ops.cpp | 4 +- src/helper/pixbuf-ops.h | 6 +- src/helper/png-write.cpp | 6 +- src/helper/png-write.h | 6 +- src/helper/stock-items.cpp | 22 +-- src/id-clash.cpp | 4 +- src/id-clash.h | 2 +- src/inkscape-private.h | 4 +- src/inkscape.cpp | 28 +-- src/inkscape.h | 4 +- src/inkview.cpp | 16 +- src/interface.cpp | 10 +- src/jabber_whiteboard/node-tracker.h | 2 +- src/jabber_whiteboard/session-manager.cpp | 10 +- src/jabber_whiteboard/session-manager.h | 6 +- src/layer-fns.cpp | 2 +- src/layer-manager.cpp | 8 +- src/layer-manager.h | 6 +- src/livarot/LivarotDefs.h | 4 +- src/live_effects/effect.cpp | 6 +- src/live_effects/effect.h | 8 +- src/live_effects/lpeobject.cpp | 4 +- src/live_effects/lpeobject.h | 2 +- src/lpe-tool-context.cpp | 4 +- src/lpe-tool-context.h | 2 +- src/main-cmdlineact.cpp | 2 +- src/main.cpp | 22 +-- src/marker.cpp | 6 +- src/marker.h | 2 +- src/nodepath.cpp | 4 +- src/path-chemistry.cpp | 4 +- src/persp3d.cpp | 10 +- src/persp3d.h | 8 +- src/print.cpp | 6 +- src/print.h | 6 +- src/profile-manager.cpp | 2 +- src/profile-manager.h | 6 +- src/rdf.cpp | 18 +- src/rdf.h | 10 +- src/selection-chemistry.cpp | 40 ++-- src/selection-chemistry.h | 8 +- src/snap.cpp | 2 +- src/snap.h | 2 +- src/sp-anchor.cpp | 4 +- src/sp-animation.cpp | 12 +- src/sp-clippath.cpp | 6 +- src/sp-clippath.h | 2 +- src/sp-ellipse.cpp | 12 +- src/sp-filter-primitive.cpp | 4 +- src/sp-filter-reference.h | 2 +- src/sp-filter.cpp | 4 +- src/sp-flowdiv.cpp | 12 +- src/sp-flowtext.cpp | 6 +- src/sp-font-face.cpp | 4 +- src/sp-font.cpp | 4 +- src/sp-gaussian-blur.cpp | 4 +- src/sp-glyph-kerning.cpp | 4 +- src/sp-glyph.cpp | 4 +- src/sp-gradient-test.h | 2 +- src/sp-gradient.cpp | 16 +- src/sp-guide.cpp | 8 +- src/sp-image.cpp | 6 +- src/sp-item-group.cpp | 6 +- src/sp-item.cpp | 4 +- src/sp-line.cpp | 4 +- src/sp-lpe-item.cpp | 4 +- src/sp-mask.cpp | 6 +- src/sp-mask.h | 2 +- src/sp-metadata.cpp | 6 +- src/sp-metadata.h | 2 +- src/sp-missing-glyph.cpp | 4 +- src/sp-namedview.cpp | 14 +- src/sp-namedview.h | 4 +- src/sp-object-repr.cpp | 2 +- src/sp-object-repr.h | 2 +- src/sp-object.cpp | 12 +- src/sp-object.h | 10 +- src/sp-offset.cpp | 6 +- src/sp-paint-server.h | 2 +- src/sp-path.cpp | 4 +- src/sp-pattern.cpp | 8 +- src/sp-pattern.h | 2 +- src/sp-polygon.cpp | 4 +- src/sp-polyline.cpp | 4 +- src/sp-rect.cpp | 4 +- src/sp-root.cpp | 4 +- src/sp-script.cpp | 4 +- src/sp-shape.cpp | 4 +- src/sp-skeleton.cpp | 4 +- src/sp-spiral.cpp | 4 +- src/sp-star.cpp | 4 +- src/sp-string.cpp | 4 +- src/sp-style-elem-test.h | 2 +- src/sp-style-elem.cpp | 4 +- src/sp-symbol.cpp | 4 +- src/sp-text.cpp | 4 +- src/sp-tref.cpp | 6 +- src/sp-tspan.cpp | 8 +- src/sp-use.cpp | 6 +- src/splivarot.cpp | 4 +- src/style-test.h | 2 +- src/style.cpp | 26 +-- src/style.h | 4 +- src/svg-view-widget.cpp | 2 +- src/svg-view-widget.h | 4 +- src/svg-view.cpp | 2 +- src/svg-view.h | 2 +- src/test-helpers.h | 2 +- src/text-chemistry.cpp | 4 +- src/trace/trace.cpp | 2 +- src/tweak-context.cpp | 4 +- src/ui/clipboard.cpp | 38 ++-- src/ui/clipboard.h | 2 +- src/ui/dialog/aboutbox.cpp | 2 +- src/ui/dialog/document-metadata.cpp | 2 +- src/ui/dialog/document-metadata.h | 2 +- src/ui/dialog/document-properties.cpp | 4 +- src/ui/dialog/document-properties.h | 2 +- src/ui/dialog/filedialogimpl-gtkmm.cpp | 6 +- src/ui/dialog/filedialogimpl-gtkmm.h | 4 +- src/ui/dialog/filedialogimpl-win32.cpp | 2 +- src/ui/dialog/filter-effects-dialog.cpp | 8 +- src/ui/dialog/filter-effects-dialog.h | 2 +- src/ui/dialog/guides.cpp | 2 +- src/ui/dialog/icon-preview.cpp | 4 +- src/ui/dialog/layers.cpp | 4 +- src/ui/dialog/layers.h | 2 +- src/ui/dialog/livepatheffect-editor.cpp | 2 +- src/ui/dialog/panel-dialog.h | 4 +- src/ui/dialog/print.cpp | 2 +- src/ui/dialog/print.h | 6 +- src/ui/dialog/svg-fonts-dialog.cpp | 30 +-- src/ui/dialog/swatches.cpp | 16 +- src/ui/dialog/swatches.h | 4 +- src/ui/dialog/undo-history.h | 2 +- src/ui/view/edit-widget.cpp | 8 +- src/ui/view/edit-widget.h | 6 +- src/ui/view/view.cpp | 2 +- src/ui/view/view.h | 8 +- src/ui/widget/entity-entry.cpp | 8 +- src/ui/widget/entity-entry.h | 8 +- src/ui/widget/imageicon.cpp | 8 +- src/ui/widget/imageicon.h | 6 +- src/ui/widget/layer-selector.h | 2 +- src/ui/widget/licensor.cpp | 2 +- src/ui/widget/licensor.h | 4 +- src/ui/widget/object-composite-settings.cpp | 2 +- src/ui/widget/page-sizer.cpp | 2 +- src/ui/widget/panel.cpp | 2 +- src/ui/widget/panel.h | 4 +- src/ui/widget/registered-enums.h | 2 +- src/ui/widget/registered-widget.cpp | 24 +-- src/ui/widget/registered-widget.h | 30 +-- src/ui/widget/tolerance-slider.cpp | 2 +- src/uri-references.cpp | 8 +- src/uri-references.h | 10 +- src/vanishing-point.cpp | 2 +- src/vanishing-point.h | 4 +- src/verbs.cpp | 16 +- src/verbs.h | 4 +- src/widgets/desktop-widget.cpp | 4 +- src/widgets/fill-style.cpp | 2 +- src/widgets/gradient-selector.cpp | 4 +- src/widgets/gradient-selector.h | 2 +- src/widgets/gradient-toolbar.cpp | 4 +- src/widgets/gradient-vector.cpp | 8 +- src/widgets/gradient-vector.h | 8 +- src/widgets/icon.cpp | 6 +- src/widgets/paint-selector.cpp | 12 +- src/widgets/select-toolbar.cpp | 2 +- src/widgets/stroke-style.cpp | 34 ++-- src/widgets/toolbox.cpp | 8 +- src/xml/document.h | 6 +- src/xml/node.h | 2 - src/xml/rebase-hrefs.cpp | 8 +- src/xml/rebase-hrefs.h | 5 +- src/xml/repr-css.cpp | 10 +- src/xml/repr.h | 2 +- src/xml/xml-forward.h | 2 +- 333 files changed, 1139 insertions(+), 1320 deletions(-) diff --git a/src/Makefile_insert b/src/Makefile_insert index 5967c7cfc..de986ca16 100644 --- a/src/Makefile_insert +++ b/src/Makefile_insert @@ -225,9 +225,6 @@ ink_common_sources += \ star-context.cpp star-context.h \ streq.h \ strneq.h \ - streams-handles.h streams-handles.cpp \ - streams-ftp.h streams-ftp.cpp \ - streams-http.h streams-http.cpp \ style.cpp style.h \ svg-profile.h \ svg-view.cpp svg-view.h \ diff --git a/src/application/editor.cpp b/src/application/editor.cpp index 730188bdd..49010efdc 100644 --- a/src/application/editor.cpp +++ b/src/application/editor.cpp @@ -18,7 +18,7 @@ #endif /* - TODO: Replace Document with the new Inkscape::Document + TODO: Replace SPDocument with the new Inkscape::Document TODO: Change 'desktop's to 'view*'s TODO: Add derivation from Inkscape::Application::RunMode */ @@ -76,7 +76,7 @@ Editor::init() // gchar const *tmpl = g_build_filename ((INKSCAPE_TEMPLATESDIR), "default.svg", NULL); bool have_default = Inkscape::IO::file_test (tmpl, G_FILE_TEST_IS_REGULAR); - Document *doc = sp_document_new (have_default? tmpl:0, true, true); + SPDocument *doc = sp_document_new (have_default? tmpl:0, true, true); g_return_val_if_fail (doc != 0, false); Inkscape::UI::View::EditWidget *ew = new Inkscape::UI::View::EditWidget (doc); sp_document_unref (doc); @@ -96,7 +96,7 @@ Editor::getWindow() } /// Returns the active document -Document* +SPDocument* Editor::getActiveDocument() { if (getActiveDesktop()) { @@ -107,7 +107,7 @@ Editor::getActiveDocument() } void -Editor::addDocument (Document *doc) +Editor::addDocument (SPDocument *doc) { if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) { _instance->_documents = g_slist_append (_instance->_documents, doc); @@ -116,7 +116,7 @@ Editor::addDocument (Document *doc) } void -Editor::removeDocument (Document *doc) +Editor::removeDocument (SPDocument *doc) { _instance->_document_set.erase(doc); if ( _instance->_document_set.find(doc) == _instance->_document_set.end() ) { @@ -125,7 +125,7 @@ Editor::removeDocument (Document *doc) } SPDesktop* -Editor::createDesktop (Document* doc) +Editor::createDesktop (SPDocument* doc) { g_assert (doc != 0); (new Inkscape::UI::View::EditWidget (doc))->present(); @@ -227,13 +227,13 @@ Editor::reactivateDesktop (SPDesktop* dt) bool Editor::isDuplicatedView (SPDesktop* dt) { - Document const* document = dt->doc(); + SPDocument const* document = dt->doc(); if (!document) { return false; } for ( GSList *iter = _instance->_desktops ; iter ; iter = iter->next ) { SPDesktop *other_desktop=(SPDesktop *)iter->data; - Document *other_document=other_desktop->doc(); + SPDocument *other_document=other_desktop->doc(); if ( other_document == document && other_desktop != dt ) { return true; } diff --git a/src/application/editor.h b/src/application/editor.h index 0886555e9..4545022b8 100644 --- a/src/application/editor.h +++ b/src/application/editor.h @@ -22,7 +22,7 @@ #include "app-prototype.h" class SPDesktop; -class Document; +class SPDocument; class SPEventContext; namespace Inkscape { @@ -52,7 +52,7 @@ public: void refreshDisplay(); void exit(); - bool lastViewOfDocument(Document* doc, SPDesktop* view) const; + bool lastViewOfDocument(SPDocument* doc, SPDesktop* view) const; bool addView(SPDesktop* view); bool deleteView(SPDesktop* view); @@ -60,16 +60,16 @@ public: static Inkscape::XML::Document *getPreferences(); static SPDesktop* getActiveDesktop(); static bool isDesktopActive (SPDesktop* dt) { return getActiveDesktop()==dt; } - static SPDesktop* createDesktop (Document* doc); + static SPDesktop* createDesktop (SPDocument* doc); static void addDesktop (SPDesktop* dt); static void removeDesktop (SPDesktop* dt); static void activateDesktop (SPDesktop* dt); static void reactivateDesktop (SPDesktop* dt); static bool isDuplicatedView (SPDesktop* dt); - static Document* getActiveDocument(); - static void addDocument (Document* doc); - static void removeDocument (Document* doc); + static SPDocument* getActiveDocument(); + static void addDocument (SPDocument* doc); + static void removeDocument (SPDocument* doc); static void selectionModified (Inkscape::Selection*, guint); static void selectionChanged (Inkscape::Selection*); @@ -96,7 +96,7 @@ protected: Editor(Editor const &); Editor& operator=(Editor const &); - std::multiset _document_set; + std::multiset _document_set; GSList *_documents; GSList *_desktops; gchar *_argv0; diff --git a/src/arc-context.cpp b/src/arc-context.cpp index 835e43a26..e689c93db 100644 --- a/src/arc-context.cpp +++ b/src/arc-context.cpp @@ -25,7 +25,6 @@ #include "display/sp-canvas.h" #include "sp-ellipse.h" #include "document.h" -#include "xml/document.h" #include "sp-namedview.h" #include "selection.h" #include "desktop-handles.h" @@ -404,7 +403,7 @@ static void sp_arc_drag(SPArcContext *ac, Geom::Point pt, guint state) } /* Create object */ - Inkscape::XML::DocumentTree *xml_doc = sp_document_repr_doc(desktop->doc()); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(desktop->doc()); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); repr->setAttribute("sodipodi:type", "arc"); diff --git a/src/bind/javabind.cpp b/src/bind/javabind.cpp index 026486948..f7022584f 100644 --- a/src/bind/javabind.cpp +++ b/src/bind/javabind.cpp @@ -44,9 +44,9 @@ #include #endif -//--tullarisc #if HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H #include -//#endif +#endif #include "javabind.h" #include "javabind-private.h" @@ -742,7 +742,7 @@ jboolean JNICALL documentSet(JNIEnv */*env*/, jobject /*obj*/, jlong /*ptr*/, js /* JavaBinderyImpl *bind = (JavaBinderyImpl *)ptr; String s = getString(env, jstr); - Document *doc = sp_document_new_from_mem(s.c_str(), s.size(), true); + SPDocument *doc = sp_document_new_from_mem(s.c_str(), s.size(), true); */ return JNI_TRUE; } diff --git a/src/box3d-context.cpp b/src/box3d-context.cpp index 4146ec30d..128b5f2ff 100644 --- a/src/box3d-context.cpp +++ b/src/box3d-context.cpp @@ -185,7 +185,7 @@ static void sp_box3d_context_selection_changed(Inkscape::Selection *selection, g /* create a default perspective in document defs if none is present (can happen after 'vacuum defs' or when a pre-0.46 file is opened) */ -static void sp_box3d_context_check_for_persp_in_defs(Document *document) { +static void sp_box3d_context_check_for_persp_in_defs(SPDocument *document) { SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); bool has_persp = false; @@ -561,7 +561,7 @@ static void sp_box3d_drag(Box3DContext &bc, guint /*state*/) } /* Create object */ - Inkscape::XML::DocumentTree *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc)); + Inkscape::XML::Document *xml_doc = sp_document_repr_doc(SP_EVENT_CONTEXT_DOCUMENT(&bc)); Inkscape::XML::Node *repr = xml_doc->createElement("svg:g"); repr->setAttribute("sodipodi:type", "inkscape:box3d"); diff --git a/src/box3d-side.cpp b/src/box3d-side.cpp index f09a2f9f6..241279100 100644 --- a/src/box3d-side.cpp +++ b/src/box3d-side.cpp @@ -28,7 +28,7 @@ static void box3d_side_class_init (Box3DSideClass *klass); static void box3d_side_init (Box3DSide *side); -static void box3d_side_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void box3d_side_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *box3d_side_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void box3d_side_set (SPObject *object, unsigned int key, const gchar *value); static void box3d_side_update (SPObject *object, SPCtx *ctx, guint flags); @@ -94,7 +94,7 @@ box3d_side_init (Box3DSide * side) } static void -box3d_side_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +box3d_side_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); @@ -307,7 +307,7 @@ box3d_side_perspective(Box3DSide *side) { Inkscape::XML::Node * box3d_side_convert_to_path(Box3DSide *side) { // TODO: Copy over all important attributes (see sp_selected_item_to_curved_repr() for an example) - Document *doc = SP_OBJECT_DOCUMENT(side); + SPDocument *doc = SP_OBJECT_DOCUMENT(side); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); diff --git a/src/box3d.cpp b/src/box3d.cpp index 0caf7b1ef..5cffa66d9 100644 --- a/src/box3d.cpp +++ b/src/box3d.cpp @@ -43,11 +43,11 @@ static void box3d_class_init(SPBox3DClass *klass); static void box3d_init(SPBox3D *box3d); -static void box3d_build(SPObject *object, Inkscape::XML::Document *document, Inkscape::XML::Node *repr); +static void box3d_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void box3d_release(SPObject *object); static void box3d_set(SPObject *object, unsigned int key, const gchar *value); static void box3d_update(SPObject *object, SPCtx *ctx, guint flags); -static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::DocumentTree *doc, Inkscape::XML::Node *repr, guint flags); +static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static gchar *box3d_description(SPItem *item); static Geom::Matrix box3d_set_transform(SPItem *item, Geom::Matrix const &xform); @@ -110,7 +110,7 @@ box3d_init(SPBox3D *box) } static void -box3d_build(SPObject *object, Inkscape::XML::Document *document, Inkscape::XML::Node *repr) +box3d_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); @@ -126,7 +126,7 @@ box3d_build(SPObject *object, Inkscape::XML::Document *document, Inkscape::XML:: // TODO: Create/link to the correct perspective - Inkscape::XML::Document *doc = SP_OBJECT_DOCUMENT(box); + SPDocument *doc = SP_OBJECT_DOCUMENT(box); if (!doc) { g_print ("No document for the box!!!!\n"); return; @@ -256,7 +256,7 @@ box3d_update(SPObject *object, SPCtx *ctx, guint flags) } -static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::DocumentTree *xml_doc, Inkscape::XML::Node *repr, guint flags) +static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML::Node *repr, guint flags) { SPBox3D *box = SP_BOX3D(object); @@ -272,13 +272,13 @@ static Inkscape::XML::Node *box3d_write(SPObject *object, Inkscape::XML::Documen repr->setAttribute("inkscape:perspectiveID", box->persp_href); } else { /* box is not yet linked to a perspective; use the document's current perspective */ - Inkscape::XML::Document *doc = SP_OBJECT_DOCUMENT(object); + SPDocument *doc = SP_OBJECT_DOCUMENT(object); if (box->persp_ref->getURI()) { gchar *uri_string = box->persp_ref->getURI()->toString(); repr->setAttribute("inkscape:perspectiveID", uri_string); g_free(uri_string); } else { - Inkscape::XML::Node *persp_repr = SP_OBJECT_REPR(doc->current_persp3d);//NOTE1 + Inkscape::XML::Node *persp_repr = SP_OBJECT_REPR(doc->current_persp3d); const gchar *persp_id = persp_repr->attribute("id"); gchar *href = g_strdup_printf("#%s", persp_id); repr->setAttribute("inkscape:perspectiveID", href); @@ -1378,7 +1378,7 @@ box3d_switch_perspectives(SPBox3D *box, Persp3D *old_persp, Persp3D *new_persp, the original box and deletes the latter */ SPGroup * box3d_convert_to_group(SPBox3D *box) { - Inkscape::XML::Document *doc = SP_OBJECT_DOCUMENT(box); + SPDocument *doc = SP_OBJECT_DOCUMENT(box); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); // remember position of the box diff --git a/src/color-profile-fns.h b/src/color-profile-fns.h index 62e4c865f..c8c51b551 100644 --- a/src/color-profile-fns.h +++ b/src/color-profile-fns.h @@ -13,7 +13,7 @@ #include #endif // ENABLE_LCMS -class Document; +class SPDocument; namespace Inkscape { @@ -27,7 +27,7 @@ GType colorprofile_get_type(); #if ENABLE_LCMS -cmsHPROFILE colorprofile_get_handle( Document* document, guint* intent, gchar const* name ); +cmsHPROFILE colorprofile_get_handle( SPDocument* document, guint* intent, gchar const* name ); cmsHTRANSFORM colorprofile_get_display_transform(); Glib::ustring colorprofile_get_display_id( int screen, int monitor ); diff --git a/src/color-profile-test.h b/src/color-profile-test.h index d7b361c50..cdbf76b44 100644 --- a/src/color-profile-test.h +++ b/src/color-profile-test.h @@ -14,7 +14,7 @@ class ColorProfileTest : public CxxTest::TestSuite { public: - Document* _doc; + SPDocument* _doc; ColorProfileTest() : _doc(0) diff --git a/src/color-profile.cpp b/src/color-profile.cpp index b2487a6a9..5868a9582 100644 --- a/src/color-profile.cpp +++ b/src/color-profile.cpp @@ -151,7 +151,7 @@ void ColorProfile::init( ColorProfile *cprof ) void ColorProfile::release( SPObject *object ) { // Unregister ourselves - Document* document = SP_OBJECT_DOCUMENT(object); + SPDocument* document = SP_OBJECT_DOCUMENT(object); if ( document ) { sp_document_remove_resource (SP_OBJECT_DOCUMENT (object), "iccprofile", SP_OBJECT (object)); } @@ -205,7 +205,7 @@ void ColorProfile::_clearProfile() /** * Callback: set attributes from associated repr. */ -void ColorProfile::build( SPObject *object, Document *document, Inkscape::XML::Node *repr ) +void ColorProfile::build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr ) { ColorProfile *cprof = COLORPROFILE(object); g_assert(cprof->href == 0); @@ -251,7 +251,7 @@ void ColorProfile::set( SPObject *object, unsigned key, gchar const *value ) //LCMSAPI cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize); // Try to open relative - Document *doc = SP_OBJECT_DOCUMENT(object); + SPDocument *doc = SP_OBJECT_DOCUMENT(object); if (!doc) { doc = SP_ACTIVE_DOCUMENT; g_warning("object has no document. using active"); @@ -436,7 +436,7 @@ static int getLcmsIntent( guint svgIntent ) return intent; } -static SPObject* bruteFind( Document* document, gchar const* name ) +static SPObject* bruteFind( SPDocument* document, gchar const* name ) { SPObject* result = 0; const GSList * current = sp_document_get_resource_list(document, "iccprofile"); @@ -456,7 +456,7 @@ static SPObject* bruteFind( Document* document, gchar const* name ) return result; } -cmsHPROFILE Inkscape::colorprofile_get_handle( Document* document, guint* intent, gchar const* name ) +cmsHPROFILE Inkscape::colorprofile_get_handle( SPDocument* document, guint* intent, gchar const* name ) { cmsHPROFILE prof = 0; diff --git a/src/color-profile.h b/src/color-profile.h index 2d8ac5b6d..2e57e7ef0 100644 --- a/src/color-profile.h +++ b/src/color-profile.h @@ -56,7 +56,7 @@ private: static void init( ColorProfile *cprof ); static void release( SPObject *object ); - static void build( SPObject *object, Document *document, Inkscape::XML::Node *repr ); + static void build( SPObject *object, SPDocument *document, Inkscape::XML::Node *repr ); static void set( SPObject *object, unsigned key, gchar const *value ); static Inkscape::XML::Node *write( SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags ); #if ENABLE_LCMS diff --git a/src/composite-undo-stack-observer.cpp b/src/composite-undo-stack-observer.cpp index 89ffdc65e..03e4796bd 100644 --- a/src/composite-undo-stack-observer.cpp +++ b/src/composite-undo-stack-observer.cpp @@ -1,5 +1,5 @@ /** - * Aggregates undo stack observers for convenient management and triggering in Document + * Aggregates undo stack observers for convenient management and triggering in SPDocument * * Heavily inspired by Inkscape::XML::CompositeNodeObserver. * diff --git a/src/composite-undo-stack-observer.h b/src/composite-undo-stack-observer.h index 01c64f4fd..cd00d4211 100644 --- a/src/composite-undo-stack-observer.h +++ b/src/composite-undo-stack-observer.h @@ -1,5 +1,5 @@ /** - * Aggregates undo stack observers for management and triggering in Document + * Aggregates undo stack observers for management and triggering in SPDocument * * Heavily inspired by Inkscape::XML::CompositeNodeObserver. * @@ -25,7 +25,7 @@ namespace Inkscape { class Event; /** - * Aggregates UndoStackObservers for management and triggering in an Document's undo/redo + * Aggregates UndoStackObservers for management and triggering in an SPDocument's undo/redo * system. */ class CompositeUndoStackObserver : public UndoStackObserver { diff --git a/src/conditions.cpp b/src/conditions.cpp index c431600f3..4a18a6913 100644 --- a/src/conditions.cpp +++ b/src/conditions.cpp @@ -108,7 +108,7 @@ static bool evaluateSystemLanguage(SPItem const *item, gchar const *value) { if (language_codes.empty()) return false; - Document *document = SP_OBJECT_DOCUMENT(item); + SPDocument *document = SP_OBJECT_DOCUMENT(item); Glib::ustring document_language = document->getLanguage(); if (document_language.size() == 0) diff --git a/src/conn-avoid-ref.cpp b/src/conn-avoid-ref.cpp index 0bc961e5d..43c9c0b66 100644 --- a/src/conn-avoid-ref.cpp +++ b/src/conn-avoid-ref.cpp @@ -254,7 +254,7 @@ void init_avoided_shape_geometry(SPDesktop *desktop) { // Don't count this as changes to the document, // it is basically just late initialisation. - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); bool saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive(document, false); diff --git a/src/connector-context.cpp b/src/connector-context.cpp index 17e5f6f32..2131bdced 100644 --- a/src/connector-context.cpp +++ b/src/connector-context.cpp @@ -686,7 +686,7 @@ connector_handle_button_release(SPConnectorContext *const cc, GdkEventButton con if ( revent.button == 1 && !event_context->space_panning ) { SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); SnapManager &m = desktop->namedview->snap_manager; m.setup(desktop); @@ -763,7 +763,7 @@ connector_handle_key_press(SPConnectorContext *const cc, guint const keyval) if (cc->state == SP_CONNECTOR_CONTEXT_REROUTING) { SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); cc_connector_rerouting_finish(cc, NULL); @@ -794,7 +794,7 @@ static void cc_connector_rerouting_finish(SPConnectorContext *const cc, Geom::Point *const p) { SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); // Clear the temporary path: cc->red_curve->reset(); @@ -936,7 +936,7 @@ spcc_flush_white(SPConnectorContext *cc, SPCurve *gc) c->transform(SP_EVENT_CONTEXT_DESKTOP(cc)->dt2doc()); SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(cc); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); if ( c && !c->is_empty() ) { @@ -1311,7 +1311,7 @@ void cc_selection_set_avoid(bool const set_avoid) return; } - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); Inkscape::Selection *selection = sp_desktop_selection(desktop); diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 41b7ab4da..cea478f85 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -440,7 +440,7 @@ gint sp_dt_guide_event(SPCanvasItem *item, GdkEvent *event, gpointer data) case GDK_KP_Delete: case GDK_BackSpace: { - Document *doc = SP_OBJECT_DOCUMENT(guide); + SPDocument *doc = SP_OBJECT_DOCUMENT(guide); sp_guide_remove(guide); sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); ret = TRUE; diff --git a/src/desktop-handles.cpp b/src/desktop-handles.cpp index b0ca4b84a..481bf35ea 100644 --- a/src/desktop-handles.cpp +++ b/src/desktop-handles.cpp @@ -31,7 +31,7 @@ sp_desktop_selection (SPDesktop const * desktop) return desktop->selection; } -Document * +SPDocument * sp_desktop_document (SPDesktop const * desktop) { g_return_val_if_fail (desktop != NULL, NULL); diff --git a/src/desktop-handles.h b/src/desktop-handles.h index 8c48d0bbd..a8d0a3d1e 100644 --- a/src/desktop-handles.h +++ b/src/desktop-handles.h @@ -30,7 +30,7 @@ namespace Inkscape { SPEventContext * sp_desktop_event_context (SPDesktop const * desktop); Inkscape::Selection * sp_desktop_selection (SPDesktop const * desktop); -Document * sp_desktop_document (SPDesktop const * desktop); +SPDocument * sp_desktop_document (SPDesktop const * desktop); SPCanvas * sp_desktop_canvas (SPDesktop const * desktop); SPCanvasItem * sp_desktop_acetate (SPDesktop const * desktop); SPCanvasGroup * sp_desktop_main (SPDesktop const * desktop); diff --git a/src/desktop.cpp b/src/desktop.cpp index 4f832682d..6b7c20094 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -178,7 +178,7 @@ SPDesktop::init (SPNamedView *nv, SPCanvas *aCanvas) namedview = nv; canvas = aCanvas; - Document *document = SP_OBJECT_DOCUMENT (namedview); + SPDocument *document = SP_OBJECT_DOCUMENT (namedview); /* Kill flicker */ sp_document_ensure_up_to_date (document); @@ -577,7 +577,7 @@ SPDesktop::activate_guides(bool activate) * Make desktop switch documents. */ void -SPDesktop::change_document (Document *theDocument) +SPDesktop::change_document (SPDocument *theDocument) { g_return_if_fail (theDocument != NULL); @@ -1492,7 +1492,7 @@ SPDesktop::updateCanvasNow() * Associate document with desktop. */ void -SPDesktop::setDocument (Document *doc) +SPDesktop::setDocument (SPDocument *doc) { if (this->doc() && doc) { namedview->hide(this); diff --git a/src/desktop.h b/src/desktop.h index f9e7f6a17..73b9262dd 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -143,7 +143,7 @@ struct SPDesktop : public Inkscape::UI::View::View sigc::signal _layer_changed_signal; sigc::signal::accumulated _set_style_signal; sigc::signal::accumulated _query_style_signal; - sigc::connection connectDocumentReplaced (const sigc::slot & slot) + sigc::connection connectDocumentReplaced (const sigc::slot & slot) { return _document_replaced_signal.connect (slot); } @@ -219,7 +219,7 @@ struct SPDesktop : public Inkscape::UI::View::View bool itemIsHidden(SPItem const *item) const; void activate_guides (bool activate); - void change_document (Document *document); + void change_document (SPDocument *document); void set_event_context (GtkType type, const gchar *config); void push_event_context (GtkType type, const gchar *config, unsigned int key); @@ -315,7 +315,7 @@ struct SPDesktop : public Inkscape::UI::View::View Geom::Point doc2dt(Geom::Point const &p) const; Geom::Point dt2doc(Geom::Point const &p) const; - virtual void setDocument (Document* doc); + virtual void setDocument (SPDocument* doc); virtual bool shutdown(); virtual void mouseover() {} virtual void mouseout() {} @@ -337,7 +337,7 @@ private: void push_current_zoom (GList**); - sigc::signal _document_replaced_signal; + sigc::signal _document_replaced_signal; sigc::signal _activate_signal; sigc::signal _deactivate_signal; sigc::signal _event_context_changed_signal; diff --git a/src/dialogs/clonetiler.cpp b/src/dialogs/clonetiler.cpp index cd690a0d4..55884fe4a 100644 --- a/src/dialogs/clonetiler.cpp +++ b/src/dialogs/clonetiler.cpp @@ -841,7 +841,7 @@ static NRArena const *trace_arena = NULL; static unsigned trace_visionkey; static NRArenaItem *trace_root; static gdouble trace_zoom; -static Document *trace_doc; +static SPDocument *trace_doc; static void clonetiler_trace_hide_tiled_clones_recursively (SPObject *from) @@ -857,7 +857,7 @@ clonetiler_trace_hide_tiled_clones_recursively (SPObject *from) } static void -clonetiler_trace_setup (Document *doc, gdouble zoom, SPItem *original) +clonetiler_trace_setup (SPDocument *doc, gdouble zoom, SPItem *original) { trace_arena = NRArena::create(); /* Create ArenaItem and set transform */ diff --git a/src/dialogs/export.cpp b/src/dialogs/export.cpp index 56d50596c..0cde76657 100644 --- a/src/dialogs/export.cpp +++ b/src/dialogs/export.cpp @@ -538,7 +538,7 @@ sp_export_dialog (void) if (SP_ACTIVE_DOCUMENT && SP_DOCUMENT_URI (SP_ACTIVE_DOCUMENT)) { gchar *name; - Document * doc = SP_ACTIVE_DOCUMENT; + SPDocument * doc = SP_ACTIVE_DOCUMENT; const gchar *uri = SP_DOCUMENT_URI (doc); Inkscape::XML::Node * repr = sp_document_repr_root(doc); const gchar * text_extension = repr->attribute("inkscape:output_extension"); @@ -779,7 +779,7 @@ sp_export_selection_modified ( Inkscape::Application */*inkscape*/, switch (current_key) { case SELECTION_DRAWING: if ( SP_ACTIVE_DESKTOP ) { - Document *doc; + SPDocument *doc; doc = sp_desktop_document (SP_ACTIVE_DESKTOP); Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc))); if (bbox) { @@ -839,7 +839,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) if ( SP_ACTIVE_DESKTOP ) { - Document *doc; + SPDocument *doc; Geom::OptRect bbox; doc = sp_desktop_document (SP_ACTIVE_DESKTOP); @@ -906,7 +906,7 @@ sp_export_area_toggled (GtkToggleButton *tb, GtkObject *base) switch (key) { case SELECTION_PAGE: case SELECTION_DRAWING: { - Document * doc = SP_ACTIVE_DOCUMENT; + SPDocument * doc = SP_ACTIVE_DOCUMENT; sp_document_get_export_hints (doc, &filename, &xdpi, &ydpi); if (filename == NULL) { @@ -1213,7 +1213,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base) switch ((selection_type)(GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(base), "selection-type")))) { case SELECTION_PAGE: case SELECTION_DRAWING: { - Document * doc = SP_ACTIVE_DOCUMENT; + SPDocument * doc = SP_ACTIVE_DOCUMENT; Inkscape::XML::Node * repr = sp_document_repr_root(doc); bool modified = false; const gchar * temp_string; @@ -1245,7 +1245,7 @@ sp_export_export_clicked (GtkButton */*button*/, GtkObject *base) } case SELECTION_SELECTION: { const GSList * reprlst; - Document * doc = SP_ACTIVE_DOCUMENT; + SPDocument * doc = SP_ACTIVE_DOCUMENT; bool modified = false; bool saved = sp_document_get_undo_sensitive(doc); @@ -1466,7 +1466,7 @@ sp_export_detect_size(GtkObject * base) { } break; case SELECTION_DRAWING: { - Document *doc = sp_desktop_document (SP_ACTIVE_DESKTOP); + SPDocument *doc = sp_desktop_document (SP_ACTIVE_DESKTOP); Geom::OptRect bbox = sp_item_bbox_desktop (SP_ITEM (SP_DOCUMENT_ROOT (doc))); @@ -1478,7 +1478,7 @@ sp_export_detect_size(GtkObject * base) { } case SELECTION_PAGE: { - Document *doc; + SPDocument *doc; doc = sp_desktop_document (SP_ACTIVE_DESKTOP); diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index 32dee453a..c8644fef9 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -69,7 +69,7 @@ static SPXMLViewContent *content = NULL; static gint blocked = 0; static SPDesktop *current_desktop = NULL; -static Document *current_document = NULL; +static SPDocument *current_document = NULL; static gint selected_attr = 0; static Inkscape::XML::Node *selected_repr = NULL; @@ -77,7 +77,7 @@ static void sp_xmltree_desktop_activate( Inkscape::Application *inkscape, SPDes static void sp_xmltree_desktop_deactivate( Inkscape::Application *inkscape, SPDesktop *desktop, GtkWidget *dialog ); static void set_tree_desktop(SPDesktop *desktop); -static void set_tree_document(Document *document); +static void set_tree_document(SPDocument *document); static void set_tree_repr(Inkscape::XML::Node *repr); static void set_tree_select(Inkscape::XML::Node *repr); @@ -119,8 +119,8 @@ static void on_attr_unselect_row_clear_text(GtkCList *list, gint row, gint colum static void on_editable_changed_enable_if_valid_xml_name(GtkEditable *editable, gpointer data); static void on_desktop_selection_changed(Inkscape::Selection *selection); -static void on_document_replaced(SPDesktop *dt, Document *document); -static void on_document_uri_set(gchar const *uri, Document *document); +static void on_document_replaced(SPDesktop *dt, SPDocument *document); +static void on_document_uri_set(gchar const *uri, SPDocument *document); static void on_clicked_get_editable_text(GtkWidget *widget, gpointer data); @@ -666,7 +666,7 @@ void set_tree_desktop(SPDesktop *desktop) -void set_tree_document(Document *document) +void set_tree_document(SPDocument *document) { if (document == current_document) { return; @@ -1262,7 +1262,7 @@ void on_desktop_selection_changed(Inkscape::Selection */*selection*/) blocked--; } -static void on_document_replaced(SPDesktop *dt, Document *doc) +static void on_document_replaced(SPDesktop *dt, SPDocument *doc) { if (current_desktop) sel_changed_connection.disconnect(); @@ -1271,7 +1271,7 @@ static void on_document_replaced(SPDesktop *dt, Document *doc) set_tree_document(doc); } -void on_document_uri_set(gchar const */*uri*/, Document *document) +void on_document_uri_set(gchar const */*uri*/, SPDocument *document) { gchar title[500]; sp_ui_dialog_title_string(Inkscape::Verb::get(SP_VERB_DIALOG_XML_EDITOR), title); diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 90bac6053..a92e7cf5b 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -190,7 +190,7 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int } } -CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, Document * in_doc) +CanvasAxonomGrid::CanvasAxonomGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc) : CanvasGrid(nv, in_repr, in_doc, GRID_AXONOMETRIC) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/display/canvas-axonomgrid.h b/src/display/canvas-axonomgrid.h index b4a27c873..e36804d7c 100644 --- a/src/display/canvas-axonomgrid.h +++ b/src/display/canvas-axonomgrid.h @@ -31,7 +31,7 @@ namespace Inkscape { class CanvasAxonomGrid : public CanvasGrid { public: - CanvasAxonomGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, Document * in_doc); + CanvasAxonomGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc); virtual ~CanvasAxonomGrid(); void Update (Geom::Matrix const &affine, unsigned int flags); diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 710074a97..5037c0375 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -155,7 +155,7 @@ grid_canvasitem_update (SPCanvasItem *item, Geom::Matrix const &affine, unsigned NULL /* order_changed */ }; -CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, Document *in_doc, GridType type) +CanvasGrid::CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc, GridType type) : visible(true), gridtype(type) { repr = in_repr; @@ -240,7 +240,7 @@ CanvasGrid::getGridTypeFromName(char const *typestr) * writes an child to repr. */ void -CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, Document * doc, GridType gridtype) +CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, GridType gridtype) { if (!repr) return; if (gridtype > GRID_MAXTYPENR) return; @@ -262,7 +262,7 @@ CanvasGrid::writeNewGridToRepr(Inkscape::XML::Node * repr, Document * doc, GridT * Creates a new CanvasGrid object of type gridtype */ CanvasGrid* -CanvasGrid::NewGrid(SPNamedView * nv, Inkscape::XML::Node * repr, Document * doc, GridType gridtype) +CanvasGrid::NewGrid(SPNamedView * nv, Inkscape::XML::Node * repr, SPDocument * doc, GridType gridtype) { if (!repr) return NULL; if (!doc) { @@ -420,7 +420,7 @@ attach_all(Gtk::Table &table, Gtk::Widget const *const arr[], unsigned size, int } } -CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, Document * in_doc) +CanvasXYGrid::CanvasXYGrid (SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc) : CanvasGrid(nv, in_repr, in_doc, GRID_RECTANGULAR) { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/display/canvas-grid.h b/src/display/canvas-grid.h index 058f88ef8..58cfbf735 100644 --- a/src/display/canvas-grid.h +++ b/src/display/canvas-grid.h @@ -26,7 +26,7 @@ struct SPDesktop; struct SPNamedView; -class Document; +class SPDocument; namespace Inkscape { @@ -73,8 +73,8 @@ public: static GridType getGridTypeFromSVGName(const char * typestr); static GridType getGridTypeFromName(const char * typestr); - static CanvasGrid* NewGrid(SPNamedView * nv, Inkscape::XML::Node * repr, Document *doc, GridType gridtype); - static void writeNewGridToRepr(Inkscape::XML::Node * repr, Document * doc, GridType gridtype); + static CanvasGrid* NewGrid(SPNamedView * nv, Inkscape::XML::Node * repr, SPDocument *doc, GridType gridtype); + static void writeNewGridToRepr(Inkscape::XML::Node * repr, SPDocument * doc, GridType gridtype); GridCanvasItem * createCanvasItem(SPDesktop * desktop); @@ -94,7 +94,7 @@ public: SPUnit const* gridunit; Inkscape::XML::Node * repr; - Document *doc; + SPDocument *doc; Inkscape::Snapper* snapper; @@ -104,7 +104,7 @@ public: bool isEnabled(); protected: - CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, Document *in_doc, GridType type); + CanvasGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument *in_doc, GridType type); virtual Gtk::Widget * newSpecificWidget() = 0; @@ -125,7 +125,7 @@ private: class CanvasXYGrid : public CanvasGrid { public: - CanvasXYGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, Document * in_doc); + CanvasXYGrid(SPNamedView * nv, Inkscape::XML::Node * in_repr, SPDocument * in_doc); virtual ~CanvasXYGrid(); void Update (Geom::Matrix const &affine, unsigned int flags); diff --git a/src/display/nr-filter-image.cpp b/src/display/nr-filter-image.cpp index 4430907da..2b799f8d2 100644 --- a/src/display/nr-filter-image.cpp +++ b/src/display/nr-filter-image.cpp @@ -225,7 +225,7 @@ void FilterImage::set_href(const gchar *href){ feImageHref = (href) ? g_strdup (href) : NULL; } -void FilterImage::set_document(Document *doc){ +void FilterImage::set_document(SPDocument *doc){ document = doc; } diff --git a/src/display/nr-filter-image.h b/src/display/nr-filter-image.h index 6fbc5d7eb..f3565ef9f 100644 --- a/src/display/nr-filter-image.h +++ b/src/display/nr-filter-image.h @@ -29,14 +29,14 @@ public: virtual int render(FilterSlot &slot, FilterUnits const &units); virtual FilterTraits get_input_traits(); - void set_document( Document *document ); + void set_document( SPDocument *document ); void set_href(const gchar *href); void set_region(SVGLength x, SVGLength y, SVGLength width, SVGLength height); bool from_element; SPItem* SVGElem; private: - Document *document; + SPDocument *document; gchar *feImageHref; guint8* image_pixbuf; Glib::RefPtr image; diff --git a/src/document-private.h b/src/document-private.h index 221cfa17c..fa4754248 100644 --- a/src/document-private.h +++ b/src/document-private.h @@ -36,9 +36,9 @@ class Event; } -struct DocumentPrivate { - typedef std::map IDChangedSignalMap; - typedef std::map ResourcesChangedSignalMap; +struct SPDocumentPrivate { + typedef std::map IDChangedSignalMap; + typedef std::map ResourcesChangedSignalMap; GHashTable *iddef; /**< Dictionary of id -> SPObject mappings */ GHashTable *reprdef; /**< Dictionary of Inkscape::XML::Node -> SPObject mappings */ @@ -53,12 +53,12 @@ struct DocumentPrivate { GHashTable *resources; ResourcesChangedSignalMap resources_changed_signals; - Document::ModifiedSignal modified_signal; - Document::URISetSignal uri_set_signal; - Document::ResizedSignal resized_signal; - Document::ReconstructionStart _reconstruction_start_signal; - Document::ReconstructionFinish _reconstruction_finish_signal; - Document::CommitSignal commit_signal; + SPDocument::ModifiedSignal modified_signal; + SPDocument::URISetSignal uri_set_signal; + SPDocument::ResizedSignal resized_signal; + SPDocument::ReconstructionStart _reconstruction_start_signal; + SPDocument::ReconstructionFinish _reconstruction_finish_signal; + SPDocument::CommitSignal commit_signal; /* Undo/Redo state */ bool sensitive: true; /* If we save actions to undo stack */ diff --git a/src/document-subset.h b/src/document-subset.h index b7b724162..e424a289c 100644 --- a/src/document-subset.h +++ b/src/document-subset.h @@ -17,7 +17,7 @@ #include "gc-anchored.h" class SPObject; -class Document; +class SPDocument; namespace Inkscape { diff --git a/src/document-undo.cpp b/src/document-undo.cpp index 9dbf5db25..ae1c82e71 100644 --- a/src/document-undo.cpp +++ b/src/document-undo.cpp @@ -23,8 +23,8 @@ * stack. Two methods exist to indicate that the given action is completed: * * \verbatim - void sp_document_done (Document *document); - void sp_document_maybe_done (Document *document, const unsigned char *key) \endverbatim + void sp_document_done (SPDocument *document); + void sp_document_maybe_done (SPDocument *document, const unsigned char *key) \endverbatim * * Both move the recent action list into the undo stack and clear the * list afterwards. While the first method does an unconditional push, @@ -85,7 +85,7 @@ sp_document_set_undo_sensitive(document, saved); \endverbatim */ void -sp_document_set_undo_sensitive (Document *doc, bool sensitive) +sp_document_set_undo_sensitive (SPDocument *doc, bool sensitive) { g_assert (doc != NULL); g_assert (doc->priv != NULL); @@ -112,7 +112,7 @@ sp_document_set_undo_sensitive (Document *doc, bool sensitive) * the saved bools in a stack. Perhaps this is why the above solution is better. */ -bool sp_document_get_undo_sensitive(Document const *document) { +bool sp_document_get_undo_sensitive(SPDocument const *document) { g_assert(document != NULL); g_assert(document->priv != NULL); @@ -120,7 +120,7 @@ bool sp_document_get_undo_sensitive(Document const *document) { } void -sp_document_done (Document *doc, const unsigned int event_type, Glib::ustring event_description) +sp_document_done (SPDocument *doc, const unsigned int event_type, Glib::ustring event_description) { sp_document_maybe_done (doc, NULL, event_type, event_description); } @@ -128,7 +128,7 @@ sp_document_done (Document *doc, const unsigned int event_type, Glib::ustring ev void sp_document_reset_key (Inkscape::Application */*inkscape*/, SPDesktop */*desktop*/, GtkObject *base) { - Document *doc = (Document *) base; + SPDocument *doc = (SPDocument *) base; doc->actionkey = NULL; } @@ -145,7 +145,7 @@ typedef SimpleEvent InteractionEvent; class CommitEvent : public InteractionEvent { public: - CommitEvent(Document *doc, const gchar *key, const unsigned int type) + CommitEvent(SPDocument *doc, const gchar *key, const unsigned int type) : InteractionEvent(share_static_string("commit")) { _addProperty(share_static_string("timestamp"), timestamp()); @@ -165,7 +165,7 @@ public: } void -sp_document_maybe_done (Document *doc, const gchar *key, const unsigned int event_type, +sp_document_maybe_done (SPDocument *doc, const gchar *key, const unsigned int event_type, Glib::ustring event_description) { g_assert (doc != NULL); @@ -209,7 +209,7 @@ sp_document_maybe_done (Document *doc, const gchar *key, const unsigned int even } void -sp_document_cancel (Document *doc) +sp_document_cancel (SPDocument *doc) { g_assert (doc != NULL); g_assert (doc->priv != NULL); @@ -226,8 +226,8 @@ sp_document_cancel (Document *doc) sp_repr_begin_transaction (doc->rdoc); } -static void finish_incomplete_transaction(Document &doc) { - DocumentPrivate &priv=*doc.priv; +static void finish_incomplete_transaction(SPDocument &doc) { + SPDocumentPrivate &priv=*doc.priv; Inkscape::XML::Event *log=sp_repr_commit_undoable(doc.rdoc); if (log || priv.partial) { g_warning ("Incomplete undo transaction:"); @@ -241,7 +241,7 @@ static void finish_incomplete_transaction(Document &doc) { } gboolean -sp_document_undo (Document *doc) +sp_document_undo (SPDocument *doc) { using Inkscape::Debug::EventTracker; using Inkscape::Debug::SimpleEvent; @@ -287,7 +287,7 @@ sp_document_undo (Document *doc) } gboolean -sp_document_redo (Document *doc) +sp_document_redo (SPDocument *doc) { using Inkscape::Debug::EventTracker; using Inkscape::Debug::SimpleEvent; @@ -333,7 +333,7 @@ sp_document_redo (Document *doc) } void -sp_document_clear_undo (Document *doc) +sp_document_clear_undo (SPDocument *doc) { if (doc->priv->undo) doc->priv->undoStackObservers.notifyClearUndoEvent(); @@ -351,7 +351,7 @@ sp_document_clear_undo (Document *doc) } void -sp_document_clear_redo (Document *doc) +sp_document_clear_redo (SPDocument *doc) { if (doc->priv->redo) doc->priv->undoStackObservers.notifyClearRedoEvent(); diff --git a/src/document.cpp b/src/document.cpp index 4289205c1..288e52c6d 100644 --- a/src/document.cpp +++ b/src/document.cpp @@ -1,7 +1,7 @@ -#define __DOCUMENT_C__ +#define __SP_DOCUMENT_C__ /** \file - * Document manipulation + * SPDocument manipulation * * Authors: * Lauris Kaplinski @@ -15,17 +15,17 @@ * Released under GNU GPL, read the file 'COPYING' for more information */ -/** \class Document - * Document serves as the container of both model trees (agnostic XML +/** \class SPDocument + * SPDocument serves as the container of both model trees (agnostic XML * and typed object tree), and implements all of the document-level * functionality used by the program. Many document level operations, like - * load, save, print, export and so on, use Document as their basic datatype. + * load, save, print, export and so on, use SPDocument as their basic datatype. * - * Document implements undo and redo stacks and an id-based object + * SPDocument implements undo and redo stacks and an id-based object * dictionary. Thanks to unique id attributes, the latter can be used to * map from the XML tree back to the object tree. * - * Document performs the basic operations needed for asynchronous + * SPDocument performs the basic operations needed for asynchronous * update notification (SPObject ::modified virtual method), and implements * the 'modified' signal, as well. */ @@ -74,7 +74,7 @@ static gint doc_count = 0; static unsigned long next_serial = 0; -Document::Document() : +SPDocument::SPDocument() : keepalive(FALSE), virgin(TRUE), modified_since_save(FALSE), @@ -98,7 +98,7 @@ Document::Document() : // Don't use the Consolidate moves optimisation. router->ConsolidateMoves = false; - DocumentPrivate *p = new DocumentPrivate(); + SPDocumentPrivate *p = new SPDocumentPrivate(); p->serial = next_serial++; @@ -123,7 +123,7 @@ Document::Document() : priv->undoStackObservers.add(p->console_output_undo_observer); } -Document::~Document() { +SPDocument::~SPDocument() { collectOrphans(); // kill/unhook this first @@ -204,7 +204,7 @@ Document::~Document() { } -void Document::add_persp3d (Persp3D * const /*persp*/) +void SPDocument::add_persp3d (Persp3D * const /*persp*/) { SPDefs *defs = SP_ROOT(this->root)->defs; for (SPObject *i = sp_object_first_child(SP_OBJECT(defs)); i != NULL; i = SP_OBJECT_NEXT(i) ) { @@ -217,18 +217,18 @@ void Document::add_persp3d (Persp3D * const /*persp*/) persp3d_create_xml_element (this); } -void Document::remove_persp3d (Persp3D * const /*persp*/) +void SPDocument::remove_persp3d (Persp3D * const /*persp*/) { // TODO: Delete the repr, maybe perform a check if any boxes are still linked to the perspective. // Anything else? g_print ("Please implement deletion of perspectives here.\n"); } -unsigned long Document::serial() const { +unsigned long SPDocument::serial() const { return priv->serial; } -void Document::queueForOrphanCollection(SPObject *object) { +void SPDocument::queueForOrphanCollection(SPObject *object) { g_return_if_fail(object != NULL); g_return_if_fail(SP_OBJECT_DOCUMENT(object) == this); @@ -236,7 +236,7 @@ void Document::queueForOrphanCollection(SPObject *object) { _collection_queue = g_slist_prepend(_collection_queue, object); } -void Document::collectOrphans() { +void SPDocument::collectOrphans() { while (_collection_queue) { GSList *objects=_collection_queue; _collection_queue = NULL; @@ -249,25 +249,25 @@ void Document::collectOrphans() { } } -void Document::reset_key (void */*dummy*/) +void SPDocument::reset_key (void */*dummy*/) { actionkey = NULL; } -Document * +SPDocument * sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive) { - Document *document; + SPDocument *document; Inkscape::XML::Node *rroot; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); rroot = rdoc->root(); - document = new Document(); + document = new SPDocument(); document->keepalive = keepalive; @@ -389,8 +389,8 @@ sp_document_create(Inkscape::XML::Document *rdoc, G_CALLBACK(sp_document_reset_key), document); document->oldSignalsConnected = true; } else { - document->_selection_changed_connection = Inkscape::NSApplication::Editor::connectSelectionChanged (sigc::mem_fun (*document, &Document::reset_key)); - document->_desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*document, &Document::reset_key)); + document->_selection_changed_connection = Inkscape::NSApplication::Editor::connectSelectionChanged (sigc::mem_fun (*document, &SPDocument::reset_key)); + document->_desktop_activated_connection = Inkscape::NSApplication::Editor::connectDesktopActivated (sigc::mem_fun (*document, &SPDocument::reset_key)); document->oldSignalsConnected = false; } @@ -401,10 +401,10 @@ sp_document_create(Inkscape::XML::Document *rdoc, * Fetches document from URI, or creates new, if NULL; public document * appears in document list. */ -Document * +SPDocument * sp_document_new(gchar const *uri, unsigned int keepalive, bool make_new) { - Document *doc; + SPDocument *doc; Inkscape::XML::Document *rdoc; gchar *base = NULL; gchar *name = NULL; @@ -452,10 +452,10 @@ sp_document_new(gchar const *uri, unsigned int keepalive, bool make_new) return doc; } -Document * +SPDocument * sp_document_new_from_mem(gchar const *buffer, gint length, unsigned int keepalive) { - Document *doc; + SPDocument *doc; Inkscape::XML::Document *rdoc; Inkscape::XML::Node *rroot; gchar *name; @@ -477,23 +477,23 @@ sp_document_new_from_mem(gchar const *buffer, gint length, unsigned int keepaliv return doc; } -Document * -sp_document_ref(Document *doc) +SPDocument * +sp_document_ref(SPDocument *doc) { g_return_val_if_fail(doc != NULL, NULL); Inkscape::GC::anchor(doc); return doc; } -Document * -sp_document_unref(Document *doc) +SPDocument * +sp_document_unref(SPDocument *doc) { g_return_val_if_fail(doc != NULL, NULL); Inkscape::GC::release(doc); return NULL; } -gdouble sp_document_width(Document *document) +gdouble sp_document_width(SPDocument *document) { g_return_val_if_fail(document != NULL, 0.0); g_return_val_if_fail(document->priv != NULL, 0.0); @@ -507,7 +507,7 @@ gdouble sp_document_width(Document *document) } void -sp_document_set_width (Document *document, gdouble width, const SPUnit *unit) +sp_document_set_width (SPDocument *document, gdouble width, const SPUnit *unit) { SPRoot *root = SP_ROOT(document->root); @@ -533,7 +533,7 @@ sp_document_set_width (Document *document, gdouble width, const SPUnit *unit) SP_OBJECT (root)->updateRepr(); } -void sp_document_set_height (Document * document, gdouble height, const SPUnit *unit) +void sp_document_set_height (SPDocument * document, gdouble height, const SPUnit *unit) { SPRoot *root = SP_ROOT(document->root); @@ -559,7 +559,7 @@ void sp_document_set_height (Document * document, gdouble height, const SPUnit * SP_OBJECT (root)->updateRepr(); } -gdouble sp_document_height(Document *document) +gdouble sp_document_height(SPDocument *document) { g_return_val_if_fail(document != NULL, 0.0); g_return_val_if_fail(document->priv != NULL, 0.0); @@ -572,7 +572,7 @@ gdouble sp_document_height(Document *document) return root->height.computed; } -Geom::Point sp_document_dimensions(Document *doc) +Geom::Point sp_document_dimensions(SPDocument *doc) { return Geom::Point(sp_document_width(doc), sp_document_height(doc)); } @@ -582,7 +582,7 @@ Geom::Point sp_document_dimensions(Document *doc) * this function fits the canvas to that rect by resizing the canvas * and translating the document root into position. */ -void Document::fitToRect(Geom::Rect const &rect) +void SPDocument::fitToRect(Geom::Rect const &rect) { double const w = rect.width(); double const h = rect.height(); @@ -606,7 +606,7 @@ void Document::fitToRect(Geom::Rect const &rect) } static void -do_change_uri(Document *const document, gchar const *const filename, bool const rebase) +do_change_uri(SPDocument *const document, gchar const *const filename, bool const rebase) { g_return_if_fail(document != NULL); @@ -638,7 +638,7 @@ do_change_uri(Document *const document, gchar const *const filename, bool const sp_document_set_undo_sensitive(document, false); if (rebase) { - Inkscape::XML::rebase_hrefs((Inkscape::XML::Document *)document, new_base, true); + Inkscape::XML::rebase_hrefs(document, new_base, true); } repr->setAttribute("sodipodi:docname", document->name); @@ -662,7 +662,7 @@ do_change_uri(Document *const document, gchar const *const filename, bool const * * \see sp_document_change_uri_and_hrefs */ -void sp_document_set_uri(Document *document, gchar const *filename) +void sp_document_set_uri(SPDocument *document, gchar const *filename) { g_return_if_fail(document != NULL); @@ -675,7 +675,7 @@ void sp_document_set_uri(Document *document, gchar const *filename) * * \see sp_document_set_uri */ -void sp_document_change_uri_and_hrefs(Document *document, gchar const *filename) +void sp_document_change_uri_and_hrefs(SPDocument *document, gchar const *filename) { g_return_if_fail(document != NULL); @@ -683,36 +683,36 @@ void sp_document_change_uri_and_hrefs(Document *document, gchar const *filename) } void -sp_document_resized_signal_emit(Document *doc, gdouble width, gdouble height) +sp_document_resized_signal_emit(SPDocument *doc, gdouble width, gdouble height) { g_return_if_fail(doc != NULL); doc->priv->resized_signal.emit(width, height); } -sigc::connection Document::connectModified(Document::ModifiedSignal::slot_type slot) +sigc::connection SPDocument::connectModified(SPDocument::ModifiedSignal::slot_type slot) { return priv->modified_signal.connect(slot); } -sigc::connection Document::connectURISet(Document::URISetSignal::slot_type slot) +sigc::connection SPDocument::connectURISet(SPDocument::URISetSignal::slot_type slot) { return priv->uri_set_signal.connect(slot); } -sigc::connection Document::connectResized(Document::ResizedSignal::slot_type slot) +sigc::connection SPDocument::connectResized(SPDocument::ResizedSignal::slot_type slot) { return priv->resized_signal.connect(slot); } sigc::connection -Document::connectReconstructionStart(Document::ReconstructionStart::slot_type slot) +SPDocument::connectReconstructionStart(SPDocument::ReconstructionStart::slot_type slot) { return priv->_reconstruction_start_signal.connect(slot); } void -Document::emitReconstructionStart(void) +SPDocument::emitReconstructionStart(void) { // printf("Starting Reconstruction\n"); priv->_reconstruction_start_signal.emit(); @@ -720,33 +720,33 @@ Document::emitReconstructionStart(void) } sigc::connection -Document::connectReconstructionFinish(Document::ReconstructionFinish::slot_type slot) +SPDocument::connectReconstructionFinish(SPDocument::ReconstructionFinish::slot_type slot) { return priv->_reconstruction_finish_signal.connect(slot); } void -Document::emitReconstructionFinish(void) +SPDocument::emitReconstructionFinish(void) { // printf("Finishing Reconstruction\n"); priv->_reconstruction_finish_signal.emit(); return; } -sigc::connection Document::connectCommit(Document::CommitSignal::slot_type slot) +sigc::connection SPDocument::connectCommit(SPDocument::CommitSignal::slot_type slot) { return priv->commit_signal.connect(slot); } -void Document::_emitModified() { +void SPDocument::_emitModified() { static guint const flags = SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG | SP_OBJECT_PARENT_MODIFIED_FLAG; root->emitModified(0); priv->modified_signal.emit(flags); } -void Document::bindObjectToId(gchar const *id, SPObject *object) { +void SPDocument::bindObjectToId(gchar const *id, SPObject *object) { GQuark idq = g_quark_from_string(id); if (object) { @@ -757,7 +757,7 @@ void Document::bindObjectToId(gchar const *id, SPObject *object) { g_hash_table_remove(priv->iddef, GINT_TO_POINTER(idq)); } - DocumentPrivate::IDChangedSignalMap::iterator pos; + SPDocumentPrivate::IDChangedSignalMap::iterator pos; pos = priv->id_changed_signals.find(idq); if ( pos != priv->id_changed_signals.end() ) { @@ -770,31 +770,31 @@ void Document::bindObjectToId(gchar const *id, SPObject *object) { } void -Document::addUndoObserver(Inkscape::UndoStackObserver& observer) +SPDocument::addUndoObserver(Inkscape::UndoStackObserver& observer) { this->priv->undoStackObservers.add(observer); } void -Document::removeUndoObserver(Inkscape::UndoStackObserver& observer) +SPDocument::removeUndoObserver(Inkscape::UndoStackObserver& observer) { this->priv->undoStackObservers.remove(observer); } -SPObject *Document::getObjectById(gchar const *id) { +SPObject *SPDocument::getObjectById(gchar const *id) { g_return_val_if_fail(id != NULL, NULL); GQuark idq = g_quark_from_string(id); return (SPObject*)g_hash_table_lookup(priv->iddef, GINT_TO_POINTER(idq)); } -sigc::connection Document::connectIdChanged(gchar const *id, - Document::IDChangedSignal::slot_type slot) +sigc::connection SPDocument::connectIdChanged(gchar const *id, + SPDocument::IDChangedSignal::slot_type slot) { return priv->id_changed_signals[g_quark_from_string(id)].connect(slot); } -void Document::bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object) { +void SPDocument::bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object) { if (object) { g_assert(g_hash_table_lookup(priv->reprdef, repr) == NULL); g_hash_table_insert(priv->reprdef, repr, object); @@ -804,12 +804,12 @@ void Document::bindObjectToRepr(Inkscape::XML::Node *repr, SPObject *object) { } } -SPObject *Document::getObjectByRepr(Inkscape::XML::Node *repr) { +SPObject *SPDocument::getObjectByRepr(Inkscape::XML::Node *repr) { g_return_val_if_fail(repr != NULL, NULL); return (SPObject*)g_hash_table_lookup(priv->reprdef, repr); } -Glib::ustring Document::getLanguage() { +Glib::ustring SPDocument::getLanguage() { gchar const *document_language = rdf_get_work_entity(this, rdf_find_entity("language")); if (document_language) { while (isspace(*document_language)) @@ -841,7 +841,7 @@ Glib::ustring Document::getLanguage() { /* Object modification root handler */ void -sp_document_request_modified(Document *doc) +sp_document_request_modified(SPDocument *doc) { if (!doc->modified_id) { doc->modified_id = gtk_idle_add_priority(SP_DOCUMENT_UPDATE_PRIORITY, sp_document_idle_handler, doc); @@ -849,7 +849,7 @@ sp_document_request_modified(Document *doc) } void -sp_document_setup_viewport (Document *doc, SPItemCtx *ctx) +sp_document_setup_viewport (SPDocument *doc, SPItemCtx *ctx) { ctx->ctx.flags = 0; ctx->i2doc = Geom::identity(); @@ -874,7 +874,7 @@ sp_document_setup_viewport (Document *doc, SPItemCtx *ctx) * been brought fully up to date. */ bool -Document::_updateDocument() +SPDocument::_updateDocument() { /* Process updates */ if (this->root->uflags || this->root->mflags) { @@ -904,7 +904,7 @@ Document::_updateDocument() * since this typically indicates we're stuck in an update loop. */ gint -sp_document_ensure_up_to_date(Document *doc) +sp_document_ensure_up_to_date(SPDocument *doc) { int counter = 32; while (!doc->_updateDocument()) { @@ -930,7 +930,7 @@ sp_document_ensure_up_to_date(Document *doc) static gint sp_document_idle_handler(gpointer data) { - Document *doc = static_cast(data); + SPDocument *doc = static_cast(data); if (doc->_updateDocument()) { doc->modified_id = 0; return false; @@ -1106,7 +1106,7 @@ find_group_at_point(unsigned int dkey, SPGroup *group, Geom::Point const p) * */ -GSList *sp_document_items_in_box(Document *document, unsigned int dkey, Geom::Rect const &box) +GSList *sp_document_items_in_box(SPDocument *document, unsigned int dkey, Geom::Rect const &box) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(document->priv != NULL, NULL); @@ -1121,7 +1121,7 @@ GSList *sp_document_items_in_box(Document *document, unsigned int dkey, Geom::Re * */ -GSList *sp_document_partial_items_in_box(Document *document, unsigned int dkey, Geom::Rect const &box) +GSList *sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey, Geom::Rect const &box) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(document->priv != NULL, NULL); @@ -1130,7 +1130,7 @@ GSList *sp_document_partial_items_in_box(Document *document, unsigned int dkey, } GSList * -sp_document_items_at_points(Document *document, unsigned const key, std::vector points) +sp_document_items_at_points(SPDocument *document, unsigned const key, std::vector points) { GSList *items = NULL; Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -1155,7 +1155,7 @@ sp_document_items_at_points(Document *document, unsigned const key, std::vector< } SPItem * -sp_document_item_at_point(Document *document, unsigned const key, Geom::Point const p, +sp_document_item_at_point(SPDocument *document, unsigned const key, Geom::Point const p, gboolean const into_groups, SPItem *upto) { g_return_val_if_fail(document != NULL, NULL); @@ -1165,7 +1165,7 @@ sp_document_item_at_point(Document *document, unsigned const key, Geom::Point co } SPItem* -sp_document_group_at_point(Document *document, unsigned int key, Geom::Point const p) +sp_document_group_at_point(SPDocument *document, unsigned int key, Geom::Point const p) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(document->priv != NULL, NULL); @@ -1177,7 +1177,7 @@ sp_document_group_at_point(Document *document, unsigned int key, Geom::Point con /* Resource management */ gboolean -sp_document_add_resource(Document *document, gchar const *key, SPObject *object) +sp_document_add_resource(SPDocument *document, gchar const *key, SPObject *object) { GSList *rlist; GQuark q = g_quark_from_string(key); @@ -1202,7 +1202,7 @@ sp_document_add_resource(Document *document, gchar const *key, SPObject *object) } gboolean -sp_document_remove_resource(Document *document, gchar const *key, SPObject *object) +sp_document_remove_resource(SPDocument *document, gchar const *key, SPObject *object) { GSList *rlist; GQuark q = g_quark_from_string(key); @@ -1228,7 +1228,7 @@ sp_document_remove_resource(Document *document, gchar const *key, SPObject *obje } GSList const * -sp_document_get_resource_list(Document *document, gchar const *key) +sp_document_get_resource_list(SPDocument *document, gchar const *key) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(key != NULL, NULL); @@ -1237,9 +1237,9 @@ sp_document_get_resource_list(Document *document, gchar const *key) return (GSList*)g_hash_table_lookup(document->priv->resources, key); } -sigc::connection sp_document_resources_changed_connect(Document *document, +sigc::connection sp_document_resources_changed_connect(SPDocument *document, gchar const *key, - Document::ResourcesChangedSignal::slot_type slot) + SPDocument::ResourcesChangedSignal::slot_type slot) { GQuark q = g_quark_from_string(key); return document->priv->resources_changed_signals[q].connect(slot); @@ -1267,7 +1267,7 @@ count_objects_recursive(SPObject *obj, unsigned int count) } unsigned int -objects_in_document(Document *document) +objects_in_document(SPDocument *document) { return count_objects_recursive(SP_DOCUMENT_ROOT(document), 0); } @@ -1288,7 +1288,7 @@ vacuum_document_recursive(SPObject *obj) } unsigned int -vacuum_document(Document *document) +vacuum_document(SPDocument *document) { unsigned int start = objects_in_document(document); unsigned int end; @@ -1310,7 +1310,7 @@ vacuum_document(Document *document) return start - newend; } -bool Document::isSeeking() const { +bool SPDocument::isSeeking() const { return priv->seeking; } diff --git a/src/document.h b/src/document.h index cb83c4d0d..696e568ad 100644 --- a/src/document.h +++ b/src/document.h @@ -1,8 +1,8 @@ -#ifndef __DOCUMENT_H__ -#define __DOCUMENT_H__ +#ifndef __SP_DOCUMENT_H__ +#define __SP_DOCUMENT_H__ /** \file - * Document: Typed SVG document implementation + * SPDocument: Typed SVG document implementation */ /* Authors: * Lauris Kaplinski @@ -31,8 +31,6 @@ #include #include -#include "xml/document.h" - namespace Avoid { class Router; } @@ -62,14 +60,13 @@ namespace Proj { class TransfMat3x4; } -class DocumentPrivate; +class SPDocumentPrivate; /// Typed SVG document implementation. -class Document : public Inkscape::GC::Managed<>, +struct SPDocument : public Inkscape::GC::Managed<>, public Inkscape::GC::Finalized, public Inkscape::GC::Anchored { -public: typedef sigc::signal IDChangedSignal; typedef sigc::signal ResourcesChangedSignal; typedef sigc::signal ModifiedSignal; @@ -79,14 +76,14 @@ public: typedef sigc::signal ReconstructionFinish; typedef sigc::signal CommitSignal; - Document(); - virtual ~Document(); + SPDocument(); + virtual ~SPDocument(); unsigned int keepalive : 1; unsigned int virgin : 1; ///< Has the document never been touched? unsigned int modified_since_save : 1; - Inkscape::XML::DocumentTree *rdoc; ///< Our Inkscape::XML::Document + Inkscape::XML::Document *rdoc; ///< Our Inkscape::XML::Document Inkscape::XML::Node *rroot; ///< Root element of Inkscape::XML::Document SPObject *root; ///< Our SPRoot CRCascade *style_cascade; @@ -95,7 +92,7 @@ public: gchar *base; ///< To be used for resolving relative hrefs. gchar *name; ///< basename(uri) or other human-readable label for the document. - DocumentPrivate *priv; + SPDocumentPrivate *priv; /// Last action key const gchar *actionkey; @@ -151,8 +148,8 @@ sigc::connection connectCommit(CommitSignal::slot_type slot); } private: - Document(Document const &); // no copy - void operator=(Document const &); // no assign + SPDocument(SPDocument const &); // no copy + void operator=(SPDocument const &); // no assign public: sigc::connection connectReconstructionStart(ReconstructionStart::slot_type slot); @@ -168,14 +165,14 @@ public: void fitToRect(Geom::Rect const &rect); }; -Document *sp_document_new(const gchar *uri, unsigned int keepalive, bool make_new = false); -Document *sp_document_new_from_mem(const gchar *buffer, gint length, unsigned int keepalive); +SPDocument *sp_document_new(const gchar *uri, unsigned int keepalive, bool make_new = false); +SPDocument *sp_document_new_from_mem(const gchar *buffer, gint length, unsigned int keepalive); -Document *sp_document_ref(Document *doc); -Document *sp_document_unref(Document *doc); +SPDocument *sp_document_ref(SPDocument *doc); +SPDocument *sp_document_unref(SPDocument *doc); -Document *sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive); +SPDocument *sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri, gchar const *base, gchar const *name, unsigned int keepalive); /* * Access methods @@ -186,14 +183,14 @@ Document *sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri, gc #define sp_document_root(d) (d->root) #define SP_DOCUMENT_ROOT(d) (d->root) -gdouble sp_document_width(Document *document); -gdouble sp_document_height(Document *document); -Geom::Point sp_document_dimensions(Document *document); +gdouble sp_document_width(SPDocument *document); +gdouble sp_document_height(SPDocument *document); +Geom::Point sp_document_dimensions(SPDocument *document); struct SPUnit; -void sp_document_set_width(Document *document, gdouble width, const SPUnit *unit); -void sp_document_set_height(Document *document, gdouble height, const SPUnit *unit); +void sp_document_set_width(SPDocument *document, gdouble width, const SPUnit *unit); +void sp_document_set_height(SPDocument *document, gdouble height, const SPUnit *unit); #define SP_DOCUMENT_URI(d) (d->uri) #define SP_DOCUMENT_NAME(d) (d->name) @@ -207,39 +204,39 @@ void sp_document_set_height(Document *document, gdouble height, const SPUnit *un * Undo & redo */ -void sp_document_set_undo_sensitive(Document *document, bool sensitive); -bool sp_document_get_undo_sensitive(Document const *document); +void sp_document_set_undo_sensitive(SPDocument *document, bool sensitive); +bool sp_document_get_undo_sensitive(SPDocument const *document); -void sp_document_clear_undo(Document *document); -void sp_document_clear_redo(Document *document); +void sp_document_clear_undo(SPDocument *document); +void sp_document_clear_redo(SPDocument *document); -void sp_document_child_added(Document *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); -void sp_document_child_removed(Document *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); -void sp_document_attr_changed(Document *doc, SPObject *object, const gchar *key, const gchar *oldval, const gchar *newval); -void sp_document_content_changed(Document *doc, SPObject *object, const gchar *oldcontent, const gchar *newcontent); -void sp_document_order_changed(Document *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *oldref, Inkscape::XML::Node *newref); +void sp_document_child_added(SPDocument *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); +void sp_document_child_removed(SPDocument *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); +void sp_document_attr_changed(SPDocument *doc, SPObject *object, const gchar *key, const gchar *oldval, const gchar *newval); +void sp_document_content_changed(SPDocument *doc, SPObject *object, const gchar *oldcontent, const gchar *newcontent); +void sp_document_order_changed(SPDocument *doc, SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *oldref, Inkscape::XML::Node *newref); /* Object modification root handler */ -void sp_document_request_modified(Document *doc); -gint sp_document_ensure_up_to_date(Document *doc); +void sp_document_request_modified(SPDocument *doc); +gint sp_document_ensure_up_to_date(SPDocument *doc); /* Save all previous actions to stack, as one undo step */ -void sp_document_done(Document *document, unsigned int event_type, Glib::ustring event_description); -void sp_document_maybe_done(Document *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description); +void sp_document_done(SPDocument *document, unsigned int event_type, Glib::ustring event_description); +void sp_document_maybe_done(SPDocument *document, const gchar *keyconst, unsigned int event_type, Glib::ustring event_description); void sp_document_reset_key(Inkscape::Application *inkscape, SPDesktop *desktop, GtkObject *base); /* Cancel (and revert) current unsaved actions */ -void sp_document_cancel(Document *document); +void sp_document_cancel(SPDocument *document); /* Undo and redo */ -gboolean sp_document_undo(Document *document); -gboolean sp_document_redo(Document *document); +gboolean sp_document_undo(SPDocument *document); +gboolean sp_document_redo(SPDocument *document); /* Resource management */ -gboolean sp_document_add_resource(Document *document, const gchar *key, SPObject *object); -gboolean sp_document_remove_resource(Document *document, const gchar *key, SPObject *object); -const GSList *sp_document_get_resource_list(Document *document, const gchar *key); -sigc::connection sp_document_resources_changed_connect(Document *document, const gchar *key, Document::ResourcesChangedSignal::slot_type slot); +gboolean sp_document_add_resource(SPDocument *document, const gchar *key, SPObject *object); +gboolean sp_document_remove_resource(SPDocument *document, const gchar *key, SPObject *object); +const GSList *sp_document_get_resource_list(SPDocument *document, const gchar *key); +sigc::connection sp_document_resources_changed_connect(SPDocument *document, const gchar *key, SPDocument::ResourcesChangedSignal::slot_type slot); /* @@ -260,19 +257,19 @@ sigc::connection sp_document_resources_changed_connect(Document *document, const * Misc */ -GSList *sp_document_items_in_box(Document *document, unsigned int dkey, Geom::Rect const &box); -GSList *sp_document_partial_items_in_box(Document *document, unsigned int dkey, Geom::Rect const &box); +GSList *sp_document_items_in_box(SPDocument *document, unsigned int dkey, Geom::Rect const &box); +GSList *sp_document_partial_items_in_box(SPDocument *document, unsigned int dkey, Geom::Rect const &box); SPItem *sp_document_item_from_list_at_point_bottom(unsigned int dkey, SPGroup *group, const GSList *list, Geom::Point const p, bool take_insensitive = false); -SPItem *sp_document_item_at_point (Document *document, unsigned int key, Geom::Point const p, gboolean into_groups, SPItem *upto = NULL); -GSList *sp_document_items_at_points(Document *document, unsigned const key, std::vector points); -SPItem *sp_document_group_at_point (Document *document, unsigned int key, Geom::Point const p); +SPItem *sp_document_item_at_point (SPDocument *document, unsigned int key, Geom::Point const p, gboolean into_groups, SPItem *upto = NULL); +GSList *sp_document_items_at_points(SPDocument *document, unsigned const key, std::vector points); +SPItem *sp_document_group_at_point (SPDocument *document, unsigned int key, Geom::Point const p); -void sp_document_set_uri(Document *document, gchar const *uri); -void sp_document_change_uri_and_hrefs(Document *document, gchar const *uri); +void sp_document_set_uri(SPDocument *document, gchar const *uri); +void sp_document_change_uri_and_hrefs(SPDocument *document, gchar const *uri); -void sp_document_resized_signal_emit(Document *doc, gdouble width, gdouble height); +void sp_document_resized_signal_emit(SPDocument *doc, gdouble width, gdouble height); -unsigned int vacuum_document(Document *document); +unsigned int vacuum_document(SPDocument *document); #endif diff --git a/src/doxygen-main.cpp b/src/doxygen-main.cpp index 47ef14987..fd8f4bb1a 100644 --- a/src/doxygen-main.cpp +++ b/src/doxygen-main.cpp @@ -288,7 +288,7 @@ namespace XML {} * - SPSVGView [\ref svg-view.cpp, \ref svg-view.h] * * SPDesktopWidget [\ref desktop-widget.h] SPSVGSPViewWidget [\ref svg-view.cpp] - * Document [\ref document.cpp, \ref document.h] + * SPDocument [\ref document.cpp, \ref document.h] * * SPDrawAnchor [\ref draw-anchor.cpp, \ref draw-anchor.h] * SPKnot [\ref knot.cpp, \ref knot.h, \ref knot-enums.h] diff --git a/src/draw-context.cpp b/src/draw-context.cpp index 89c2c454e..d2794f0c2 100644 --- a/src/draw-context.cpp +++ b/src/draw-context.cpp @@ -1,4 +1,4 @@ -#define __DRAW_CONTEXT_C__ +#define __SP_DRAW_CONTEXT_C__ /* * Generic drawing context @@ -664,7 +664,7 @@ spdc_flush_white(SPDrawContext *dc, SPCurve *gc) : SP_EVENT_CONTEXT_DESKTOP(dc)->dt2doc() ); SPDesktop *desktop = SP_EVENT_CONTEXT_DESKTOP(dc); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); if ( c && !c->is_empty() ) { diff --git a/src/event-log.cpp b/src/event-log.cpp index d111c43e1..82de44696 100644 --- a/src/event-log.cpp +++ b/src/event-log.cpp @@ -19,7 +19,7 @@ namespace Inkscape { -EventLog::EventLog(Document* document) : +EventLog::EventLog(SPDocument* document) : UndoStackObserver(), _connected (false), _document (document), diff --git a/src/event-log.h b/src/event-log.h index bb17a19a4..9fcd01e1c 100644 --- a/src/event-log.h +++ b/src/event-log.h @@ -44,7 +44,7 @@ public: typedef Gtk::TreeModel::iterator iterator; typedef Gtk::TreeModel::const_iterator const_iterator; - EventLog(Document* document); + EventLog(SPDocument* document); virtual ~EventLog(); /** @@ -115,7 +115,7 @@ public: private: bool _connected; //< connected with dialog - Document *_document; //< document that is logged + SPDocument *_document; //< document that is logged const EventModelColumns _columns; diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index c6b731a84..afc0668a9 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -358,7 +358,7 @@ void Effect::EffectVerb::perform( SPAction *action, void * data, void */*pdata*/ ) { Inkscape::UI::View::View * current_view = sp_action_get_view(action); -// Document * current_document = current_view->doc; +// SPDocument * current_document = current_view->doc; Effect::EffectVerb * ev = reinterpret_cast(data); Effect * effect = ev->_effect; diff --git a/src/extension/effect.h b/src/extension/effect.h index 637d29c5c..c02ce542b 100644 --- a/src/extension/effect.h +++ b/src/extension/effect.h @@ -21,7 +21,7 @@ #include "prefdialog.h" #include "extension.h" -struct Document; +struct SPDocument; namespace Inkscape { namespace UI { diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index a87cc6b64..4a13890d7 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -179,7 +179,7 @@ ExecutionEnv::commit (void) { void ExecutionEnv::reselect (void) { if (_doc == NULL) { return; } - Document * doc = _doc->doc(); + SPDocument * doc = _doc->doc(); if (doc == NULL) { return; } SPDesktop *desktop = (SPDesktop *)_doc; diff --git a/src/extension/extension.cpp b/src/extension/extension.cpp index c8dc30d8b..52d5f5148 100644 --- a/src/extension/extension.cpp +++ b/src/extension/extension.cpp @@ -423,7 +423,7 @@ param_shared (const gchar * name, GSList * list) found parameter. */ const gchar * -Extension::get_param_string (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_string (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -432,7 +432,7 @@ Extension::get_param_string (const gchar * name, const Document * doc, const Ink } const gchar * -Extension::get_param_enum (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_enum (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_enum(doc, node); @@ -450,7 +450,7 @@ Extension::get_param_enum (const gchar * name, const Document * doc, const Inksc found parameter. */ bool -Extension::get_param_bool (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_bool (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -470,7 +470,7 @@ Extension::get_param_bool (const gchar * name, const Document * doc, const Inksc found parameter. */ int -Extension::get_param_int (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_int (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; @@ -490,7 +490,7 @@ Extension::get_param_int (const gchar * name, const Document * doc, const Inksca found parameter. */ float -Extension::get_param_float (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_float (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -509,7 +509,7 @@ Extension::get_param_float (const gchar * name, const Document * doc, const Inks found parameter. */ guint32 -Extension::get_param_color (const gchar * name, const Document * doc, const Inkscape::XML::Node * node) +Extension::get_param_color (const gchar * name, const SPDocument * doc, const Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->get_color(doc, node); @@ -528,7 +528,7 @@ Extension::get_param_color (const gchar * name, const Document * doc, const Inks found parameter. */ bool -Extension::set_param_bool (const gchar * name, bool value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_bool (const gchar * name, bool value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -548,7 +548,7 @@ Extension::set_param_bool (const gchar * name, bool value, Document * doc, Inksc found parameter. */ int -Extension::set_param_int (const gchar * name, int value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_int (const gchar * name, int value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -568,7 +568,7 @@ Extension::set_param_int (const gchar * name, int value, Document * doc, Inkscap found parameter. */ float -Extension::set_param_float (const gchar * name, float value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_float (const gchar * name, float value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -588,7 +588,7 @@ Extension::set_param_float (const gchar * name, float value, Document * doc, Ink found parameter. */ const gchar * -Extension::set_param_string (const gchar * name, const gchar * value, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_string (const gchar * name, const gchar * value, SPDocument * doc, Inkscape::XML::Node * node) { Parameter * param; param = param_shared(name, parameters); @@ -608,7 +608,7 @@ Extension::set_param_string (const gchar * name, const gchar * value, Document * found parameter. */ guint32 -Extension::set_param_color (const gchar * name, guint32 color, Document * doc, Inkscape::XML::Node * node) +Extension::set_param_color (const gchar * name, guint32 color, SPDocument * doc, Inkscape::XML::Node * node) { Parameter* param = param_shared(name, parameters); return param->set_color(color, doc, node); @@ -671,7 +671,7 @@ public: If all parameters are gui_visible = false NULL is returned as well. */ Gtk::Widget * -Extension::autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +Extension::autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (param_visible_count() == 0) return NULL; diff --git a/src/extension/extension.h b/src/extension/extension.h index 8dcd1b393..48ca86cf7 100644 --- a/src/extension/extension.h +++ b/src/extension/extension.h @@ -72,7 +72,7 @@ #define INKSCAPE_EXTENSION_NS_NC "extension" #define INKSCAPE_EXTENSION_NS "extension:" -struct Document; +struct SPDocument; namespace Inkscape { namespace Extension { @@ -173,42 +173,42 @@ private: #endif public: bool get_param_bool (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); int get_param_int (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); float get_param_float (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_string (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); guint32 get_param_color (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); const gchar * get_param_enum (const gchar * name, - const Document * doc = NULL, + const SPDocument * doc = NULL, const Inkscape::XML::Node * node = NULL); bool set_param_bool (const gchar * name, bool value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); int set_param_int (const gchar * name, int value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); float set_param_float (const gchar * name, float value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); const gchar * set_param_string (const gchar * name, const gchar * value, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); guint32 set_param_color (const gchar * name, guint32 color, - Document * doc = NULL, + SPDocument * doc = NULL, Inkscape::XML::Node * node = NULL); /* Error file handling */ @@ -217,7 +217,7 @@ public: static void error_file_close (void); public: - Gtk::Widget * autogui (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); + Gtk::Widget * autogui (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal = NULL); void paramListString (std::list & retlist); /* Extension editor dialog stuff */ diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index e3421b26d..6090b72d0 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -79,7 +79,7 @@ Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const */*f return module->autogui(NULL, NULL); } /* Implementation::prefs_input */ -Document * +SPDocument * Implementation::open(Inkscape::Extension::Input */*module*/, gchar const */*filename*/) { /* throw open_failed(); */ return NULL; @@ -91,7 +91,7 @@ Implementation::prefs_output(Inkscape::Extension::Output *module) { } /* Implementation::prefs_output */ void -Implementation::save(Inkscape::Extension::Output */*module*/, Document */*doc*/, gchar const */*filename*/) { +Implementation::save(Inkscape::Extension::Output */*module*/, SPDocument */*doc*/, gchar const */*filename*/) { /* throw save_fail */ return; } /* Implementation::save */ @@ -100,7 +100,7 @@ Gtk::Widget * Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { if (module->param_visible_count() == 0) return NULL; - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = @@ -134,7 +134,7 @@ Implementation::set_preview(Inkscape::Extension::Print */*module*/) unsigned int -Implementation::begin(Inkscape::Extension::Print */*module*/, Document */*doc*/) +Implementation::begin(Inkscape::Extension::Print */*module*/, SPDocument */*doc*/) { return 0; } diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index 9f1894d95..9de70dce7 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -70,13 +70,13 @@ public: virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module, gchar const *filename); - virtual Document *open(Inkscape::Extension::Input *module, + virtual SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); /* ----- Output functions ----- */ /** Find out information about the file. */ virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module); - virtual void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); + virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); /* ----- Effect functions ----- */ /** Find out information about the file. */ @@ -93,7 +93,7 @@ public: virtual unsigned set_preview(Inkscape::Extension::Print *module); virtual unsigned begin(Inkscape::Extension::Print *module, - Document *doc); + SPDocument *doc); virtual unsigned finish(Inkscape::Extension::Print *module); virtual bool textToPath(Inkscape::Extension::Print *ext); virtual bool fontEmbedded(Inkscape::Extension::Print * ext); diff --git a/src/extension/implementation/script.cpp b/src/extension/implementation/script.cpp index d207c1a19..e6ce40bc0 100644 --- a/src/extension/implementation/script.cpp +++ b/src/extension/implementation/script.cpp @@ -545,7 +545,7 @@ Script::prefs_output(Inkscape::Extension::Output *module) the incoming filename (so that it's not the temporary filename). That document is then returned from this function. */ -Document * +SPDocument * Script::open(Inkscape::Extension::Input *module, const gchar *filenameArg) { @@ -567,7 +567,7 @@ Script::open(Inkscape::Extension::Input *module, int data_read = execute(command, params, lfilename, fileout); fileout.toFile(tempfilename_out); - Document * mydoc = NULL; + SPDocument * mydoc = NULL; if (data_read > 10) { if (helper_extension.size()==0) { mydoc = Inkscape::Extension::open( @@ -623,7 +623,7 @@ Script::open(Inkscape::Extension::Input *module, */ void Script::save(Inkscape::Extension::Output *module, - Document *doc, + SPDocument *doc, const gchar *filenameArg) { std::list params; @@ -757,7 +757,7 @@ Script::effect(Inkscape::Extension::Effect *module, pump_events(); - Document * mydoc = NULL; + SPDocument * mydoc = NULL; if (data_read > 10) { mydoc = Inkscape::Extension::open( Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), diff --git a/src/extension/implementation/script.h b/src/extension/implementation/script.h index 0769c9a18..8e25fb351 100644 --- a/src/extension/implementation/script.h +++ b/src/extension/implementation/script.h @@ -73,7 +73,7 @@ public: /** * */ - virtual Document *open(Inkscape::Extension::Input *module, + virtual SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); /** @@ -85,7 +85,7 @@ public: * */ virtual void save(Inkscape::Extension::Output *module, - Document *doc, + SPDocument *doc, gchar const *filename); /** diff --git a/src/extension/implementation/xslt.cpp b/src/extension/implementation/xslt.cpp index 9eea2dbeb..f34fea64a 100644 --- a/src/extension/implementation/xslt.cpp +++ b/src/extension/implementation/xslt.cpp @@ -136,7 +136,7 @@ XSLT::unload(Inkscape::Extension::Extension *module) return; } -Document * +SPDocument * XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) { xmlDocPtr filein = xmlParseFile(filename); @@ -174,7 +174,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } g_free(s); - Document * doc = sp_document_create(rdoc, filename, base, name, true); + SPDocument * doc = sp_document_create(rdoc, filename, base, name, true); g_free(base); g_free(name); @@ -182,7 +182,7 @@ XSLT::open(Inkscape::Extension::Input */*module*/, gchar const *filename) } void -XSLT::save(Inkscape::Extension::Output */*module*/, Document *doc, gchar const *filename) +XSLT::save(Inkscape::Extension::Output */*module*/, SPDocument *doc, gchar const *filename) { /* TODO: Should we assume filename to be in utf8 or to be a raw filename? * See JavaFXOutput::save for discussion. */ diff --git a/src/extension/implementation/xslt.h b/src/extension/implementation/xslt.h index df9467d9e..45befb529 100644 --- a/src/extension/implementation/xslt.h +++ b/src/extension/implementation/xslt.h @@ -44,9 +44,9 @@ public: bool check(Inkscape::Extension::Extension *module); - Document *open(Inkscape::Extension::Input *module, + SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); - void save(Inkscape::Extension::Output *module, Document *doc, gchar const *filename); + void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); }; } /* Inkscape */ diff --git a/src/extension/input.cpp b/src/extension/input.cpp index ca5fdc29f..689c1286f 100644 --- a/src/extension/input.cpp +++ b/src/extension/input.cpp @@ -145,7 +145,7 @@ Input::check (void) Adobe Illustrator file can be transparent (not recommended, but transparent). This is all done with undo being turned off. */ -Document * +SPDocument * Input::open (const gchar *uri) { if (!loaded()) { @@ -156,7 +156,7 @@ Input::open (const gchar *uri) } timer->touch(); - Document *const doc = imp->open(this, uri); + SPDocument *const doc = imp->open(this, uri); if (doc != NULL) { Inkscape::XML::Node * repr = sp_document_repr_root(doc); bool saved = sp_document_get_undo_sensitive(doc); diff --git a/src/extension/input.h b/src/extension/input.h index d2aac9376..55d807ce2 100644 --- a/src/extension/input.h +++ b/src/extension/input.h @@ -37,7 +37,7 @@ public: Implementation::Implementation * in_imp); virtual ~Input (void); virtual bool check (void); - Document * open (gchar const *uri); + SPDocument * open (gchar const *uri); gchar * get_mimetype (void); gchar * get_extension (void); gchar * get_filetypename (void); diff --git a/src/extension/internal/bitmap/imagemagick.cpp b/src/extension/internal/bitmap/imagemagick.cpp index 75d53927d..e907612fd 100644 --- a/src/extension/internal/bitmap/imagemagick.cpp +++ b/src/extension/internal/bitmap/imagemagick.cpp @@ -221,7 +221,7 @@ ImageMagick::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::Vi Gtk::Widget * ImageMagick::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/cairo-png-out.cpp b/src/extension/internal/cairo-png-out.cpp index d849755b7..c81fdd029 100644 --- a/src/extension/internal/cairo-png-out.cpp +++ b/src/extension/internal/cairo-png-out.cpp @@ -48,7 +48,7 @@ CairoRendererOutput::check (Inkscape::Extension::Extension * module) } static bool -png_render_document_to_file(Document *doc, gchar const *filename) +png_render_document_to_file(SPDocument *doc, gchar const *filename) { CairoRenderer *renderer; CairoRenderContext *ctx; @@ -92,7 +92,7 @@ png_render_document_to_file(Document *doc, gchar const *filename) \param uri Filename to save to (probably will end in .png) */ void -CairoRendererOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoRendererOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { if (!png_render_document_to_file(doc, filename)) throw Inkscape::Extension::Output::save_failed(); diff --git a/src/extension/internal/cairo-png-out.h b/src/extension/internal/cairo-png-out.h index a062ec8df..9b9bd6ffe 100644 --- a/src/extension/internal/cairo-png-out.h +++ b/src/extension/internal/cairo-png-out.h @@ -27,7 +27,7 @@ class CairoRendererOutput : Inkscape::Extension::Implementation::Implementation public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-ps-out.cpp b/src/extension/internal/cairo-ps-out.cpp index d9cac666c..dff89c1ed 100644 --- a/src/extension/internal/cairo-ps-out.cpp +++ b/src/extension/internal/cairo-ps-out.cpp @@ -61,7 +61,7 @@ CairoEpsOutput::check (Inkscape::Extension::Extension * module) } static bool -ps_print_document_to_file(Document *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) +ps_print_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas, bool eps = false) { sp_document_ensure_up_to_date(doc); @@ -124,7 +124,7 @@ ps_print_document_to_file(Document *doc, gchar const *filename, unsigned int lev \param filename Filename to save to (probably will end in .ps) */ void -CairoPsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoPsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; @@ -188,7 +188,7 @@ CairoPsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const \param filename Filename to save to (probably will end in .ps) */ void -CairoEpsOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoEpsOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-ps-out.h b/src/extension/internal/cairo-ps-out.h index 862571f0b..019b6b810 100644 --- a/src/extension/internal/cairo-ps-out.h +++ b/src/extension/internal/cairo-ps-out.h @@ -28,7 +28,7 @@ class CairoPsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); bool textToPath(Inkscape::Extension::Print *ext); @@ -40,7 +40,7 @@ class CairoEpsOutput : Inkscape::Extension::Implementation::Implementation { public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *uri); static void init(); bool textToPath(Inkscape::Extension::Print *ext); diff --git a/src/extension/internal/cairo-render-context.cpp b/src/extension/internal/cairo-render-context.cpp index 28cf406f2..d1462e52e 100644 --- a/src/extension/internal/cairo-render-context.cpp +++ b/src/extension/internal/cairo-render-context.cpp @@ -811,7 +811,7 @@ CairoRenderContext::_finishSurfaceSetup(cairo_surface_t *surface, cairo_matrix_t cairo_scale(_cr, PT_PER_PX, PT_PER_PX); } else if (cairo_surface_get_content(_surface) != CAIRO_CONTENT_ALPHA) { // set background color on non-alpha surfaces - // TODO: bgcolor should be derived from Document + // TODO: bgcolor should be derived from SPDocument cairo_set_source_rgb(_cr, 1.0, 1.0, 1.0); cairo_rectangle(_cr, 0, 0, _width, _height); cairo_fill(_cr); diff --git a/src/extension/internal/cairo-renderer-pdf-out.cpp b/src/extension/internal/cairo-renderer-pdf-out.cpp index 1e5404c50..b44e83449 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.cpp +++ b/src/extension/internal/cairo-renderer-pdf-out.cpp @@ -47,7 +47,7 @@ CairoRendererPdfOutput::check (Inkscape::Extension::Extension * module) } static bool -pdf_render_document_to_file(Document *doc, gchar const *filename, unsigned int level, +pdf_render_document_to_file(SPDocument *doc, gchar const *filename, unsigned int level, bool texttopath, bool filtertobitmap, int resolution, const gchar * const exportId, bool exportDrawing, bool exportCanvas) { @@ -118,7 +118,7 @@ pdf_render_document_to_file(Document *doc, gchar const *filename, unsigned int l tell the printing system to save to file. */ void -CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +CairoRendererPdfOutput::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; unsigned int ret; diff --git a/src/extension/internal/cairo-renderer-pdf-out.h b/src/extension/internal/cairo-renderer-pdf-out.h index f916eed49..d76ffb4d4 100644 --- a/src/extension/internal/cairo-renderer-pdf-out.h +++ b/src/extension/internal/cairo-renderer-pdf-out.h @@ -27,7 +27,7 @@ class CairoRendererPdfOutput : Inkscape::Extension::Implementation::Implementati public: bool check(Inkscape::Extension::Extension *module); void save(Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/cairo-renderer.cpp b/src/extension/internal/cairo-renderer.cpp index 3414993e5..da88a5eae 100644 --- a/src/extension/internal/cairo-renderer.cpp +++ b/src/extension/internal/cairo-renderer.cpp @@ -460,7 +460,7 @@ static void sp_asbitmap_render(SPItem *item, CairoRenderContext *ctx) Geom::Matrix t = t_on_document * t_item.inverse(); // Do the export - Document *document = SP_OBJECT(item)->document; + SPDocument *document = SP_OBJECT(item)->document; GSList *items = NULL; items = g_slist_append(items, item); @@ -567,7 +567,7 @@ CairoRenderer::renderItem(CairoRenderContext *ctx, SPItem *item) } bool -CairoRenderer::setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base) +CairoRenderer::setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base) { g_assert( ctx != NULL ); diff --git a/src/extension/internal/cairo-renderer.h b/src/extension/internal/cairo-renderer.h index 4197c6784..ab5d4cf58 100644 --- a/src/extension/internal/cairo-renderer.h +++ b/src/extension/internal/cairo-renderer.h @@ -50,9 +50,9 @@ public: void applyMask(CairoRenderContext *ctx, SPMask const *mask); /** Initializes the CairoRenderContext according to the specified - Document. A set*Target function can only be called on the context + SPDocument. A set*Target function can only be called on the context before setupDocument. */ - bool setupDocument(CairoRenderContext *ctx, Document *doc, bool pageBoundingBox, SPItem *base); + bool setupDocument(CairoRenderContext *ctx, SPDocument *doc, bool pageBoundingBox, SPItem *base); /** Traverses the object tree and invokes the render methods. */ void renderItem(CairoRenderContext *ctx, SPItem *item); diff --git a/src/extension/internal/emf-win32-inout.cpp b/src/extension/internal/emf-win32-inout.cpp index ffba5af81..f400a3649 100644 --- a/src/extension/internal/emf-win32-inout.cpp +++ b/src/extension/internal/emf-win32-inout.cpp @@ -101,7 +101,7 @@ EmfWin32::check (Inkscape::Extension::Extension * /*module*/) static void -emf_print_document_to_file(Document *doc, gchar const *filename) +emf_print_document_to_file(SPDocument *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; @@ -147,7 +147,7 @@ emf_print_document_to_file(Document *doc, gchar const *filename) void -EmfWin32::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +EmfWin32::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Extension * ext; @@ -2162,7 +2162,7 @@ typedef struct #pragma pack( pop ) -Document * +SPDocument * EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) { EMF_CALLBACK_DATA d; @@ -2365,7 +2365,7 @@ EmfWin32::open( Inkscape::Extension::Input * /*mod*/, const gchar *uri ) // std::cout << "SVG Output: " << std::endl << *(d.outsvg) << std::endl; - Document *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); + SPDocument *doc = sp_document_new_from_mem(d.outsvg->c_str(), d.outsvg->length(), TRUE); delete d.outsvg; delete d.path; diff --git a/src/extension/internal/emf-win32-inout.h b/src/extension/internal/emf-win32-inout.h index 544cd75db..c62d7a4e9 100644 --- a/src/extension/internal/emf-win32-inout.h +++ b/src/extension/internal/emf-win32-inout.h @@ -28,10 +28,10 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - Document *doc, + SPDocument *doc, gchar const *filename); - virtual Document *open( Inkscape::Extension::Input *mod, + virtual SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init(void);//Initialize the class diff --git a/src/extension/internal/emf-win32-print.cpp b/src/extension/internal/emf-win32-print.cpp index 822a0577b..d098f6466 100644 --- a/src/extension/internal/emf-win32-print.cpp +++ b/src/extension/internal/emf-win32-print.cpp @@ -116,7 +116,7 @@ PrintEmfWin32::setup (Inkscape::Extension::Print * /*mod*/) unsigned int -PrintEmfWin32::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintEmfWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { gchar const *utf8_fn = mod->get_param_string("destination"); diff --git a/src/extension/internal/emf-win32-print.h b/src/extension/internal/emf-win32-print.h index bec3f9582..5c1d8439d 100644 --- a/src/extension/internal/emf-win32-print.h +++ b/src/extension/internal/emf-win32-print.h @@ -55,7 +55,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/gdkpixbuf-input.cpp b/src/extension/internal/gdkpixbuf-input.cpp index 2aea1cc64..64a099c8a 100644 --- a/src/extension/internal/gdkpixbuf-input.cpp +++ b/src/extension/internal/gdkpixbuf-input.cpp @@ -16,10 +16,10 @@ GdkPixbuf* pixbuf_new_from_file( char const *utf8name, GError **error ); namespace Extension { namespace Internal { -Document * +SPDocument * GdkpixbufInput::open(Inkscape::Extension::Input */*mod*/, char const *uri) { - Document *doc = NULL; + SPDocument *doc = NULL; GdkPixbuf *pb = Inkscape::IO::pixbuf_new_from_file( uri, NULL ); if (pb) { /* We are readable */ diff --git a/src/extension/internal/gdkpixbuf-input.h b/src/extension/internal/gdkpixbuf-input.h index 373d53da3..9d5e6ccf7 100644 --- a/src/extension/internal/gdkpixbuf-input.h +++ b/src/extension/internal/gdkpixbuf-input.h @@ -9,7 +9,7 @@ namespace Internal { class GdkpixbufInput : Inkscape::Extension::Implementation::Implementation { public: - Document *open(Inkscape::Extension::Input *mod, + SPDocument *open(Inkscape::Extension::Input *mod, gchar const *uri); static void init(); }; diff --git a/src/extension/internal/gimpgrad.cpp b/src/extension/internal/gimpgrad.cpp index 9510b5ebd..5b3e0c16e 100644 --- a/src/extension/internal/gimpgrad.cpp +++ b/src/extension/internal/gimpgrad.cpp @@ -95,7 +95,7 @@ stop_svg(ColorRGBA const in_color, double const location) } /** - \brief Actually open the gradient and turn it into an Document + \brief Actually open the gradient and turn it into an SPDocument \param module The input module being used \param filename The filename of the gradient to be opened \return A Document with the gradient in it. @@ -129,7 +129,7 @@ stop_svg(ColorRGBA const in_color, double const location) document using the \c sp_document_from_mem. That is then returned to Inkscape. */ -Document * +SPDocument * GimpGrad::open (Inkscape::Extension::Input */*module*/, gchar const *filename) { Inkscape::IO::dump_fopen_call(filename, "I"); diff --git a/src/extension/internal/gimpgrad.h b/src/extension/internal/gimpgrad.h index 21ccfa215..45b76dd6d 100644 --- a/src/extension/internal/gimpgrad.h +++ b/src/extension/internal/gimpgrad.h @@ -26,7 +26,7 @@ class GimpGrad : public Inkscape::Extension::Implementation::Implementation { public: bool load(Inkscape::Extension::Extension *module); void unload(Inkscape::Extension::Extension *module); - Document *open(Inkscape::Extension::Input *module, gchar const *filename); + SPDocument *open(Inkscape::Extension::Input *module, gchar const *filename); static void init(); }; diff --git a/src/extension/internal/grid.cpp b/src/extension/internal/grid.cpp index 5a0523ba8..d4b35b261 100644 --- a/src/extension/internal/grid.cpp +++ b/src/extension/internal/grid.cpp @@ -81,7 +81,7 @@ Grid::effect (Inkscape::Extension::Effect *module, Inkscape::UI::View::View *doc Geom::Rect bounding_area = Geom::Rect(Geom::Point(0,0), Geom::Point(100,100)); if (selection->isEmpty()) { /* get page size */ - Document * doc = document->doc(); + SPDocument * doc = document->doc(); bounding_area = Geom::Rect( Geom::Point(0,0), Geom::Point(sp_document_width(doc), sp_document_height(doc)) ); } else { @@ -171,7 +171,7 @@ PrefAdjustment::val_changed (void) Gtk::Widget * Grid::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal, Inkscape::Extension::Implementation::ImplementationDocumentCache * /*docCache*/) { - Document * current_document = view->doc(); + SPDocument * current_document = view->doc(); using Inkscape::Util::GSListConstIterator; GSListConstIterator selected = sp_desktop_selection((SPDesktop *)view)->itemList(); diff --git a/src/extension/internal/javafx-out.cpp b/src/extension/internal/javafx-out.cpp index c1f057071..417755e19 100644 --- a/src/extension/internal/javafx-out.cpp +++ b/src/extension/internal/javafx-out.cpp @@ -701,7 +701,7 @@ bool JavaFXOutput::doCurve(SPItem *item, const String &id) /** * Output the tree data to buffer */ -bool JavaFXOutput::doTreeRecursive(Document *doc, SPObject *obj) +bool JavaFXOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) { /** * Check the type of node and process @@ -749,7 +749,7 @@ bool JavaFXOutput::doTreeRecursive(Document *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool JavaFXOutput::doTree(Document *doc) +bool JavaFXOutput::doTree(SPDocument *doc) { double bignum = 1000000.0; @@ -767,7 +767,7 @@ bool JavaFXOutput::doTree(Document *doc) } -bool JavaFXOutput::doBody(Document *doc, SPObject *obj) +bool JavaFXOutput::doBody(SPDocument *doc, SPObject *obj) { /** * Check the type of node and process @@ -842,7 +842,7 @@ void JavaFXOutput::reset() /** * Saves the of an Inkscape SVG file as JavaFX spline definitions */ -bool JavaFXOutput::saveDocument(Document *doc, gchar const *filename_utf8) +bool JavaFXOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) { reset(); @@ -918,7 +918,7 @@ bool JavaFXOutput::saveDocument(Document *doc, gchar const *filename_utf8) */ void JavaFXOutput::save(Inkscape::Extension::Output */*mod*/, - Document *doc, gchar const *filename_utf8) + SPDocument *doc, gchar const *filename_utf8) { /* N.B. The name `filename_utf8' represents the fact that we want it to be in utf8; whereas in * fact we know that some callers of Extension::save pass something in the filesystem's diff --git a/src/extension/internal/javafx-out.h b/src/extension/internal/javafx-out.h index 246172c23..9c1c8778b 100644 --- a/src/extension/internal/javafx-out.h +++ b/src/extension/internal/javafx-out.h @@ -56,7 +56,7 @@ public: * API call to perform the output to a file */ virtual void save(Inkscape::Extension::Output *mod, - Document *doc, gchar const *filename); + SPDocument *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -109,10 +109,10 @@ private: * Output the SVG document's curve data as JavaFX geometry types */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(Document *doc, SPObject *obj); - bool doTree(Document *doc); + bool doTreeRecursive(SPDocument *doc, SPObject *obj); + bool doTree(SPDocument *doc); - bool doBody(Document *doc, SPObject *obj); + bool doBody(SPDocument *doc, SPObject *obj); /** * Output the file footer @@ -124,7 +124,7 @@ private: /** * Actual method to save document */ - bool saveDocument(Document *doc, gchar const *filename); + bool saveDocument(SPDocument *doc, gchar const *filename); //For statistics int nrNodes; diff --git a/src/extension/internal/latex-pstricks-out.cpp b/src/extension/internal/latex-pstricks-out.cpp index 924f9697e..4a469a750 100644 --- a/src/extension/internal/latex-pstricks-out.cpp +++ b/src/extension/internal/latex-pstricks-out.cpp @@ -47,7 +47,7 @@ LatexOutput::check (Inkscape::Extension::Extension * module) void -LatexOutput::save(Inkscape::Extension::Output *mod2, Document *doc, gchar const *filename) +LatexOutput::save(Inkscape::Extension::Output *mod2, SPDocument *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; diff --git a/src/extension/internal/latex-pstricks-out.h b/src/extension/internal/latex-pstricks-out.h index a9910f4cc..a12cdc3c1 100644 --- a/src/extension/internal/latex-pstricks-out.h +++ b/src/extension/internal/latex-pstricks-out.h @@ -27,7 +27,7 @@ public: bool check(Inkscape::Extension::Extension *module); //Can this module load (always yes for now) void save(Inkscape::Extension::Output *mod, // Save the given document to the given filename - Document *doc, + SPDocument *doc, gchar const *filename); static void init(void);//Initialize the class diff --git a/src/extension/internal/latex-pstricks.cpp b/src/extension/internal/latex-pstricks.cpp index afc985e14..789e5ea34 100644 --- a/src/extension/internal/latex-pstricks.cpp +++ b/src/extension/internal/latex-pstricks.cpp @@ -64,7 +64,7 @@ PrintLatex::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintLatex::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintLatex::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { Inkscape::SVGOStringStream os; int res; diff --git a/src/extension/internal/latex-pstricks.h b/src/extension/internal/latex-pstricks.h index 4e310d6fd..a33e169e8 100644 --- a/src/extension/internal/latex-pstricks.h +++ b/src/extension/internal/latex-pstricks.h @@ -43,7 +43,7 @@ public: /* Print functions */ virtual unsigned int setup (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index e7e22414a..cc8489302 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -2367,7 +2367,7 @@ OdfOutput::reset() * Descends into the SVG tree, mapping things to ODF when appropriate */ void -OdfOutput::save(Inkscape::Extension::Output */*mod*/, Document *doc, gchar const *filename) +OdfOutput::save(Inkscape::Extension::Output */*mod*/, SPDocument *doc, gchar const *filename) { reset(); diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h index 5ad1f1137..3854ddfe1 100644 --- a/src/extension/internal/odf.h +++ b/src/extension/internal/odf.h @@ -272,7 +272,7 @@ public: bool check (Inkscape::Extension::Extension * module); void save (Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename); static void init (void); diff --git a/src/extension/internal/pdf-input-cairo.cpp b/src/extension/internal/pdf-input-cairo.cpp index 76759259d..937fefb11 100644 --- a/src/extension/internal/pdf-input-cairo.cpp +++ b/src/extension/internal/pdf-input-cairo.cpp @@ -32,7 +32,7 @@ namespace Internal { static cairo_status_t _write_ustring_cb(void *closure, const unsigned char *data, unsigned int length); -Document * +SPDocument * PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { printf("Attempting to open using PdfInputCairo\n"); @@ -58,7 +58,7 @@ PdfInputCairo::open(Inkscape::Extension::Input * /*mod*/, const gchar * uri) { cairo_destroy(cr); cairo_surface_destroy(surface); - Document * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); + SPDocument * doc = sp_document_new_from_mem(output->c_str(), output->length(), TRUE); delete output; g_object_unref(page); diff --git a/src/extension/internal/pdf-input-cairo.h b/src/extension/internal/pdf-input-cairo.h index 15080bc14..5715b57c9 100644 --- a/src/extension/internal/pdf-input-cairo.h +++ b/src/extension/internal/pdf-input-cairo.h @@ -27,7 +27,7 @@ namespace Internal { class PdfInputCairo: public Inkscape::Extension::Implementation::Implementation { PdfInputCairo () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pdfinput/pdf-input.cpp b/src/extension/internal/pdfinput/pdf-input.cpp index 476f0daf6..c2d417f2c 100644 --- a/src/extension/internal/pdfinput/pdf-input.cpp +++ b/src/extension/internal/pdfinput/pdf-input.cpp @@ -589,7 +589,7 @@ void PdfImportDialog::_setPreviewPage(int page) { /** * Parses the selected page of the given PDF document using PdfParser. */ -Document * +SPDocument * PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { // Initialize the globalParams variable for poppler @@ -661,7 +661,7 @@ PdfInput::open(::Inkscape::Extension::Input * /*mod*/, const gchar * uri) { Catalog *catalog = pdf_doc->getCatalog(); Page *page = catalog->getPage(page_num); - Document *doc = sp_document_new(NULL, TRUE, TRUE); + SPDocument *doc = sp_document_new(NULL, TRUE, TRUE); bool saved = sp_document_get_undo_sensitive(doc); sp_document_set_undo_sensitive(doc, false); // No need to undo in this temporary document diff --git a/src/extension/internal/pdfinput/pdf-input.h b/src/extension/internal/pdfinput/pdf-input.h index 968114ef3..6bf0f11a2 100644 --- a/src/extension/internal/pdfinput/pdf-input.h +++ b/src/extension/internal/pdfinput/pdf-input.h @@ -113,7 +113,7 @@ private: class PdfInput: public Inkscape::Extension::Implementation::Implementation { PdfInput () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/pdfinput/svg-builder.cpp b/src/extension/internal/pdfinput/svg-builder.cpp index 686e44bb1..00bd8fa4d 100644 --- a/src/extension/internal/pdfinput/svg-builder.cpp +++ b/src/extension/internal/pdfinput/svg-builder.cpp @@ -77,7 +77,7 @@ struct SvgTransparencyGroup { * */ -SvgBuilder::SvgBuilder(Document *document, gchar *docname, XRef *xref) { +SvgBuilder::SvgBuilder(SPDocument *document, gchar *docname, XRef *xref) { _is_top_level = true; _doc = document; _docname = docname; diff --git a/src/extension/internal/pdfinput/svg-builder.h b/src/extension/internal/pdfinput/svg-builder.h index 1f84ffcc3..3b9192d31 100644 --- a/src/extension/internal/pdfinput/svg-builder.h +++ b/src/extension/internal/pdfinput/svg-builder.h @@ -18,7 +18,7 @@ #ifdef HAVE_POPPLER -class Document; +class SPDocument; namespace Inkscape { namespace XML { class Document; @@ -95,7 +95,7 @@ struct SvgGlyph { */ class SvgBuilder { public: - SvgBuilder(Document *document, gchar *docname, XRef *xref); + SvgBuilder(SPDocument *document, gchar *docname, XRef *xref); SvgBuilder(SvgBuilder *parent, Inkscape::XML::Node *root); virtual ~SvgBuilder(); @@ -220,7 +220,7 @@ private: std::vector _availableFontNames; // Full names, used for matching font names (Bug LP #179589). bool _is_top_level; // Whether this SvgBuilder is the top-level one - Document *_doc; + SPDocument *_doc; gchar *_docname; // Basename of the URI from which this document is created XRef *_xref; // Cross-reference table from the PDF doc we're converting from Inkscape::XML::Document *_xml_doc; diff --git a/src/extension/internal/pov-out.cpp b/src/extension/internal/pov-out.cpp index d3ed39d1f..f30cbc317 100644 --- a/src/extension/internal/pov-out.cpp +++ b/src/extension/internal/pov-out.cpp @@ -417,7 +417,7 @@ bool PovOutput::doCurve(SPItem *item, const String &id) /** * Descend the svg tree recursively, translating data */ -bool PovOutput::doTreeRecursive(Document *doc, SPObject *obj) +bool PovOutput::doTreeRecursive(SPDocument *doc, SPObject *obj) { String id; @@ -454,7 +454,7 @@ bool PovOutput::doTreeRecursive(Document *doc, SPObject *obj) /** * Output the curve data to buffer */ -bool PovOutput::doTree(Document *doc) +bool PovOutput::doTree(SPDocument *doc) { double bignum = 1000000.0; minx = bignum; @@ -576,7 +576,7 @@ void PovOutput::reset() /** * Saves the Shapes of an Inkscape SVG file as PovRay spline definitions */ -void PovOutput::saveDocument(Document *doc, gchar const *filename_utf8) +void PovOutput::saveDocument(SPDocument *doc, gchar const *filename_utf8) { reset(); @@ -641,7 +641,7 @@ void PovOutput::saveDocument(Document *doc, gchar const *filename_utf8) */ void PovOutput::save(Inkscape::Extension::Output */*mod*/, - Document *doc, gchar const *filename_utf8) + SPDocument *doc, gchar const *filename_utf8) { /* See comments in JavaFSOutput::save re the name `filename_utf8'. */ saveDocument(doc, filename_utf8); diff --git a/src/extension/internal/pov-out.h b/src/extension/internal/pov-out.h index 02ba6da82..0c3b73a7f 100644 --- a/src/extension/internal/pov-out.h +++ b/src/extension/internal/pov-out.h @@ -57,7 +57,7 @@ public: * API call to perform the output to a file */ void save(Inkscape::Extension::Output *mod, - Document *doc, gchar const *filename); + SPDocument *doc, gchar const *filename); /** * Inkscape runtime startup call. @@ -120,13 +120,13 @@ private: * Output the SVG document's curve data as POV curves */ bool doCurve(SPItem *item, const String &id); - bool doTreeRecursive(Document *doc, SPObject *obj); - bool doTree(Document *doc); + bool doTreeRecursive(SPDocument *doc, SPObject *obj); + bool doTree(SPDocument *doc); /** * Actual method to save document */ - void saveDocument(Document *doc, gchar const *filename); + void saveDocument(SPDocument *doc, gchar const *filename); /** diff --git a/src/extension/internal/svg.cpp b/src/extension/internal/svg.cpp index 317811088..a3589e905 100644 --- a/src/extension/internal/svg.cpp +++ b/src/extension/internal/svg.cpp @@ -138,13 +138,13 @@ _load_uri (const gchar *uri) /** \return A new document just for you! \brief This function takes in a filename of a SVG document and - turns it into a Document. + turns it into a SPDocument. \param mod Module to use \param uri The path to the file (UTF-8) This function is really simple, it just calls sp_document_new... */ -Document * +SPDocument * Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) { #ifdef WITH_GNOME_VFS @@ -157,7 +157,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) g_warning("Error: Could not open file '%s' with VFS\n", uri); return NULL; } - Document * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); + SPDocument * doc = sp_document_new_from_mem(buffer, strlen(buffer), 1); g_free(buffer); return doc; @@ -191,7 +191,7 @@ Svg::open (Inkscape::Extension::Input */*mod*/, const gchar *uri) all of this code. I just stole it. */ void -Svg::save(Inkscape::Extension::Output *mod, Document *doc, gchar const *filename) +Svg::save(Inkscape::Extension::Output *mod, SPDocument *doc, gchar const *filename) { g_return_if_fail(doc != NULL); g_return_if_fail(filename != NULL); diff --git a/src/extension/internal/svg.h b/src/extension/internal/svg.h index 48b57c8c5..b97735dd8 100644 --- a/src/extension/internal/svg.h +++ b/src/extension/internal/svg.h @@ -25,9 +25,9 @@ class Svg : public Inkscape::Extension::Implementation::Implementation { public: virtual void save( Inkscape::Extension::Output *mod, - Document *doc, + SPDocument *doc, gchar const *filename ); - virtual Document *open( Inkscape::Extension::Input *mod, + virtual SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/internal/win32.cpp b/src/extension/internal/win32.cpp index f272292b5..21f278858 100644 --- a/src/extension/internal/win32.cpp +++ b/src/extension/internal/win32.cpp @@ -215,7 +215,7 @@ PrintWin32::setup (Inkscape::Extension::Print *mod) } unsigned int -PrintWin32::begin (Inkscape::Extension::Print *mod, Document *doc) +PrintWin32::begin (Inkscape::Extension::Print *mod, SPDocument *doc) { DOCINFO di = { sizeof (DOCINFO), diff --git a/src/extension/internal/win32.h b/src/extension/internal/win32.h index 7f4b9352d..9462115c6 100644 --- a/src/extension/internal/win32.h +++ b/src/extension/internal/win32.h @@ -65,7 +65,7 @@ public: virtual unsigned int setup (Inkscape::Extension::Print * module); //virtual unsigned int set_preview (Inkscape::Extension::Print * module); - virtual unsigned int begin (Inkscape::Extension::Print * module, Document *doc); + virtual unsigned int begin (Inkscape::Extension::Print * module, SPDocument *doc); virtual unsigned int finish (Inkscape::Extension::Print * module); /* Rendering methods */ diff --git a/src/extension/internal/wpg-input.cpp b/src/extension/internal/wpg-input.cpp index e7177e5e3..c37d5705b 100644 --- a/src/extension/internal/wpg-input.cpp +++ b/src/extension/internal/wpg-input.cpp @@ -59,7 +59,7 @@ namespace Extension { namespace Internal { -Document * +SPDocument * WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { WPXInputStream* input = new libwpg::WPGFileStream(uri); if (input->isOLEStream()) { @@ -86,7 +86,7 @@ WpgInput::open(Inkscape::Extension::Input * mod, const gchar * uri) { //printf("I've got a doc: \n%s", painter.document.c_str()); - Document * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); + SPDocument * doc = sp_document_new_from_mem(output.cstr(), strlen(output.cstr()), TRUE); delete input; return doc; } diff --git a/src/extension/internal/wpg-input.h b/src/extension/internal/wpg-input.h index e5c2838d5..ca882039b 100644 --- a/src/extension/internal/wpg-input.h +++ b/src/extension/internal/wpg-input.h @@ -24,7 +24,7 @@ namespace Internal { class WpgInput : public Inkscape::Extension::Implementation::Implementation { WpgInput () { }; public: - Document *open( Inkscape::Extension::Input *mod, + SPDocument *open( Inkscape::Extension::Input *mod, const gchar *uri ); static void init( void ); diff --git a/src/extension/output.cpp b/src/extension/output.cpp index 8e2fa5486..742e938de 100644 --- a/src/extension/output.cpp +++ b/src/extension/output.cpp @@ -212,7 +212,7 @@ Output::prefs (void) could be changed, and old files will still work properly. */ void -Output::save(Document *doc, gchar const *filename) +Output::save(SPDocument *doc, gchar const *filename) { try { imp->save(this, doc, filename); diff --git a/src/extension/output.h b/src/extension/output.h index 455b4a8ae..b52a96211 100644 --- a/src/extension/output.h +++ b/src/extension/output.h @@ -15,7 +15,7 @@ #include #include "extension.h" -struct Document; +struct SPDocument; namespace Inkscape { namespace Extension { @@ -36,7 +36,7 @@ public: Implementation::Implementation * in_imp); virtual ~Output (void); virtual bool check (void); - void save (Document *doc, + void save (SPDocument *doc, gchar const *uri); bool prefs (void); gchar * get_mimetype(void); diff --git a/src/extension/param/bool.cpp b/src/extension/param/bool.cpp index 07170587a..1dda3d73f 100644 --- a/src/extension/param/bool.cpp +++ b/src/extension/param/bool.cpp @@ -53,7 +53,7 @@ ParamBool::ParamBool (const gchar * name, const gchar * guitext, const gchar * d and \c pref_name() are used. */ bool -ParamBool::set( bool in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamBool::set( bool in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -67,7 +67,7 @@ ParamBool::set( bool in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) /** \brief Returns \c _value */ bool -ParamBool::get (const Document * doc, const Inkscape::XML::Node * node) +ParamBool::get (const SPDocument * doc, const Inkscape::XML::Node * node) { return _value; } @@ -79,7 +79,7 @@ class ParamBoolCheckButton : public Gtk::CheckButton { private: /** \brief Param to change */ ParamBool * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -89,7 +89,7 @@ public: This function sets the value of the checkbox to be that of the parameter, and then sets up a callback to \c on_toggle. */ - ParamBoolCheckButton (ParamBool * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamBoolCheckButton (ParamBool * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::CheckButton(), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_active(_pref->get(NULL, NULL) /**\todo fix */); this->signal_toggled().connect(sigc::mem_fun(this, &ParamBoolCheckButton::on_toggle)); @@ -132,7 +132,7 @@ ParamBool::string (std::string &string) Builds a hbox with a label and a check button in it. */ Gtk::Widget * -ParamBool::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamBool::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox(false, 4)); diff --git a/src/extension/param/bool.h b/src/extension/param/bool.h index 23b15596d..a1cd4ce4a 100644 --- a/src/extension/param/bool.h +++ b/src/extension/param/bool.h @@ -22,9 +22,9 @@ private: bool _value; public: ParamBool(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - bool get (const Document * doc, const Inkscape::XML::Node * node); - bool set (bool in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + bool get (const SPDocument * doc, const Inkscape::XML::Node * node); + bool set (bool in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/color.cpp b/src/extension/param/color.cpp index 080356e71..58db85748 100644 --- a/src/extension/param/color.cpp +++ b/src/extension/param/color.cpp @@ -41,7 +41,7 @@ ParamColor::~ParamColor(void) } guint32 -ParamColor::set( guint32 in, Document * /*doc*/, Inkscape::XML::Node * /*node*/ ) +ParamColor::set( guint32 in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/ ) { _value = in; @@ -87,7 +87,7 @@ ParamColor::string (std::string &string) } Gtk::Widget * -ParamColor::get_widget( Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) +ParamColor::get_widget( SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * changeSignal ) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/color.h b/src/extension/param/color.h index 89aac7be7..e6b44fbcb 100644 --- a/src/extension/param/color.h +++ b/src/extension/param/color.h @@ -23,9 +23,9 @@ public: ParamColor(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamColor(void); /** \brief Returns \c _value, with a \i const to protect it. */ - guint32 get( const Document * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } - guint32 set (guint32 in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + guint32 get( const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/ ) { return _value; } + guint32 set (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); sigc::signal * _changeSignal; }; /* class ParamColor */ diff --git a/src/extension/param/description.cpp b/src/extension/param/description.cpp index 3641695cc..656e58c49 100644 --- a/src/extension/param/description.cpp +++ b/src/extension/param/description.cpp @@ -46,7 +46,7 @@ ParamDescription::ParamDescription (const gchar * name, const gchar * guitext, c /** \brief Create a label for the description */ Gtk::Widget * -ParamDescription::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +ParamDescription::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/description.h b/src/extension/param/description.h index 42441e5a9..c305ea6df 100644 --- a/src/extension/param/description.h +++ b/src/extension/param/description.h @@ -23,7 +23,7 @@ private: gchar * _value; public: ParamDescription(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); }; } /* namespace Extension */ diff --git a/src/extension/param/enum.cpp b/src/extension/param/enum.cpp index 9de3f60dd..03c1f839b 100644 --- a/src/extension/param/enum.cpp +++ b/src/extension/param/enum.cpp @@ -129,7 +129,7 @@ ParamComboBox::~ParamComboBox (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamComboBox::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamComboBox::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -177,7 +177,7 @@ ParamComboBox::string (std::string &string) class ParamComboBoxEntry : public Gtk::ComboBoxText { private: ParamComboBox * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -185,7 +185,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamComboBoxEntry (ParamComboBox * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamComboBoxEntry (ParamComboBox * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::ComboBoxText(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { this->signal_changed().connect(sigc::mem_fun(this, &ParamComboBoxEntry::changed)); }; @@ -211,7 +211,7 @@ ParamComboBoxEntry::changed (void) \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamComboBox::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamComboBox::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/enum.h b/src/extension/param/enum.h index e1af8fd2b..3f9707c34 100644 --- a/src/extension/param/enum.h +++ b/src/extension/param/enum.h @@ -39,11 +39,11 @@ private: public: ParamComboBox(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamComboBox(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); void changed (void); }; /* class ParamComboBox */ diff --git a/src/extension/param/float.cpp b/src/extension/param/float.cpp index 516249c3c..11e3a8d97 100644 --- a/src/extension/param/float.cpp +++ b/src/extension/param/float.cpp @@ -75,7 +75,7 @@ ParamFloat::ParamFloat (const gchar * name, const gchar * guitext, const gchar * and \c pref_name() are used. */ float -ParamFloat::set (float in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamFloat::set (float in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -103,13 +103,13 @@ ParamFloat::string (std::string &string) class ParamFloatAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamFloat * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamFloatAdjustment (ParamFloat * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamFloatAdjustment (ParamFloat * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 0.1, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamFloatAdjustment::val_changed)); @@ -142,7 +142,7 @@ ParamFloatAdjustment::val_changed (void) Builds a hbox with a label and a float adjustment in it. */ Gtk::Widget * -ParamFloat::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamFloat::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/float.h b/src/extension/param/float.h index 32ab7a796..f105d8f0e 100644 --- a/src/extension/param/float.h +++ b/src/extension/param/float.h @@ -26,12 +26,12 @@ private: public: ParamFloat (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - float get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - float set (float in, Document * doc, Inkscape::XML::Node * node); + float get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + float set (float in, SPDocument * doc, Inkscape::XML::Node * node); float max (void) { return _max; } float min (void) { return _min; } float precision (void) { return _precision; } - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/int.cpp b/src/extension/param/int.cpp index 2818bb57b..301d54ed0 100644 --- a/src/extension/param/int.cpp +++ b/src/extension/param/int.cpp @@ -70,7 +70,7 @@ ParamInt::ParamInt (const gchar * name, const gchar * guitext, const gchar * des and \c pref_name() are used. */ int -ParamInt::set (int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamInt::set (int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { _value = in; if (_value > _max) _value = _max; @@ -88,13 +88,13 @@ ParamInt::set (int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) class ParamIntAdjustment : public Gtk::Adjustment { /** The parameter to adjust */ ParamInt * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: /** \brief Make the adjustment using an extension and the string describing the parameter. */ - ParamIntAdjustment (ParamInt * param, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamIntAdjustment (ParamInt * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Adjustment(0.0, param->min(), param->max(), 1.0, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) { this->set_value(_pref->get(NULL, NULL) /* \todo fix */); this->signal_value_changed().connect(sigc::mem_fun(this, &ParamIntAdjustment::val_changed)); @@ -127,7 +127,7 @@ ParamIntAdjustment::val_changed (void) Builds a hbox with a label and a int adjustment in it. */ Gtk::Widget * -ParamInt::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/int.h b/src/extension/param/int.h index 6d44a10b3..a4eb54c81 100644 --- a/src/extension/param/int.h +++ b/src/extension/param/int.h @@ -25,11 +25,11 @@ private: public: ParamInt (const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); /** \brief Returns \c _value */ - int get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - int set (int in, Document * doc, Inkscape::XML::Node * node); + int get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + int set (int in, SPDocument * doc, Inkscape::XML::Node * node); int max (void) { return _max; } int min (void) { return _min; } - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); }; diff --git a/src/extension/param/notebook.cpp b/src/extension/param/notebook.cpp index 6ad338ffa..1c30b7e0e 100644 --- a/src/extension/param/notebook.cpp +++ b/src/extension/param/notebook.cpp @@ -54,7 +54,7 @@ public: ParamNotebookPage(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); ~ParamNotebookPage(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void paramString (std::list &list); gchar * get_guitext (void) {return _text;}; @@ -196,7 +196,7 @@ ParamNotebookPage::makepage (Inkscape::XML::Node * in_repr, Inkscape::Extension: Builds a notebook page (a vbox) and puts parameters on it. */ Gtk::Widget * -ParamNotebookPage::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebookPage::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; @@ -295,7 +295,7 @@ ParamNotebook::~ParamNotebook (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamNotebook::set (const int in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamNotebook::set (const int in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { ParamNotebookPage * page = NULL; int i = 0; @@ -347,14 +347,14 @@ ParamNotebook::string (std::list &list) class ParamNotebookWdg : public Gtk::Notebook { private: ParamNotebook * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; public: /** \brief Build a notebookpage preference for the given parameter \param pref Where to get the string (pagename) from, and where to put it when it changes. */ - ParamNotebookWdg (ParamNotebook * pref, Document * doc, Inkscape::XML::Node * node) : + ParamNotebookWdg (ParamNotebook * pref, SPDocument * doc, Inkscape::XML::Node * node) : Gtk::Notebook(), _pref(pref), _doc(doc), _node(node), activated(false) { // don't have to set the correct page: this is done in ParamNotebook::get_widget. // hook function @@ -389,7 +389,7 @@ ParamNotebookWdg::changed_page(GtkNotebookPage */*page*/, Builds a notebook and puts pages in it. */ Gtk::Widget * -ParamNotebook::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamNotebook::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/notebook.h b/src/extension/param/notebook.h index 6efd3c5f1..24d4ebfc1 100644 --- a/src/extension/param/notebook.h +++ b/src/extension/param/notebook.h @@ -40,11 +40,11 @@ private: public: ParamNotebook(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamNotebook(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::list &list); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const int in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const int in, SPDocument * doc, Inkscape::XML::Node * node); }; /* class ParamNotebook */ diff --git a/src/extension/param/parameter.cpp b/src/extension/param/parameter.cpp index 1094a5d3f..2773af61d 100644 --- a/src/extension/param/parameter.cpp +++ b/src/extension/param/parameter.cpp @@ -156,7 +156,7 @@ Parameter::make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::get_bool (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_bool (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -166,7 +166,7 @@ Parameter::get_bool (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::get_int (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_int (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -176,7 +176,7 @@ Parameter::get_int (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::get_float (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_float (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamFloat * floatpntr = dynamic_cast(this); if (floatpntr == NULL) @@ -186,7 +186,7 @@ Parameter::get_float (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_string (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_string (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -196,7 +196,7 @@ Parameter::get_string (const Document * doc, const Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::get_enum (const Document * doc, const Inkscape::XML::Node * node) +Parameter::get_enum (const SPDocument * doc, const Inkscape::XML::Node * node) { ParamComboBox * param = dynamic_cast(this); if (param == NULL) @@ -205,7 +205,7 @@ Parameter::get_enum (const Document * doc, const Inkscape::XML::Node * node) } guint32 -Parameter::get_color(const Document* doc, const Inkscape::XML::Node* node) +Parameter::get_color(const SPDocument* doc, const Inkscape::XML::Node* node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -215,7 +215,7 @@ Parameter::get_color(const Document* doc, const Inkscape::XML::Node* node) /** \brief Wrapper to cast to the object and use it's function. */ bool -Parameter::set_bool (bool in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node) { ParamBool * boolpntr = dynamic_cast(this); if (boolpntr == NULL) @@ -225,7 +225,7 @@ Parameter::set_bool (bool in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ int -Parameter::set_int (int in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_int (int in, SPDocument * doc, Inkscape::XML::Node * node) { ParamInt * intpntr = dynamic_cast(this); if (intpntr == NULL) @@ -235,7 +235,7 @@ Parameter::set_int (int in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ float -Parameter::set_float (float in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_float (float in, SPDocument * doc, Inkscape::XML::Node * node) { ParamFloat * floatpntr; floatpntr = dynamic_cast(this); @@ -246,7 +246,7 @@ Parameter::set_float (float in, Document * doc, Inkscape::XML::Node * node) /** \brief Wrapper to cast to the object and use it's function. */ const gchar * -Parameter::set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node) { ParamString * stringpntr = dynamic_cast(this); if (stringpntr == NULL) @@ -255,7 +255,7 @@ Parameter::set_string (const gchar * in, Document * doc, Inkscape::XML::Node * n } /** \brief Wrapper to cast to the object and use it's function. */ guint32 -Parameter::set_color (guint32 in, Document * doc, Inkscape::XML::Node * node) +Parameter::set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node) { ParamColor* param = dynamic_cast(this); if (param == NULL) @@ -323,7 +323,7 @@ Parameter::new_child (Inkscape::XML::Node * parent) } Inkscape::XML::Node * -Parameter::document_param_node (Document * doc) +Parameter::document_param_node (SPDocument * doc) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node * defs = SP_OBJECT_REPR(SP_DOCUMENT_DEFS(doc)); @@ -353,7 +353,7 @@ Parameter::document_param_node (Document * doc) /** \brief Basically, if there is no widget pass a NULL. */ Gtk::Widget * -Parameter::get_widget (Document * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) +Parameter::get_widget (SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/, sigc::signal * /*changeSignal*/) { return NULL; } diff --git a/src/extension/param/parameter.h b/src/extension/param/parameter.h index a79b2fd6b..54249c12e 100644 --- a/src/extension/param/parameter.h +++ b/src/extension/param/parameter.h @@ -68,7 +68,7 @@ protected: /* **** funcs **** */ gchar * pref_name (void); Inkscape::XML::Node * find_child (Inkscape::XML::Node * adult); - Inkscape::XML::Node * document_param_node (Document * doc); + Inkscape::XML::Node * document_param_node (SPDocument * doc); Inkscape::XML::Node * new_child (Inkscape::XML::Node * parent); public: @@ -85,29 +85,29 @@ public: Parameter(name, guitext, NULL, Parameter::SCOPE_USER, false, NULL, ext); }; virtual ~Parameter (void); - bool get_bool (const Document * doc, + bool get_bool (const SPDocument * doc, const Inkscape::XML::Node * node); - int get_int (const Document * doc, + int get_int (const SPDocument * doc, const Inkscape::XML::Node * node); - float get_float (const Document * doc, + float get_float (const SPDocument * doc, const Inkscape::XML::Node * node); - const gchar * get_string (const Document * doc, + const gchar * get_string (const SPDocument * doc, const Inkscape::XML::Node * node); - guint32 get_color (const Document * doc, + guint32 get_color (const SPDocument * doc, const Inkscape::XML::Node * node); - const gchar * get_enum (const Document * doc, + const gchar * get_enum (const SPDocument * doc, const Inkscape::XML::Node * node); - bool set_bool (bool in, Document * doc, Inkscape::XML::Node * node); - int set_int (int in, Document * doc, Inkscape::XML::Node * node); - float set_float (float in, Document * doc, Inkscape::XML::Node * node); - const gchar * set_string (const gchar * in, Document * doc, Inkscape::XML::Node * node); - guint32 set_color (guint32 in, Document * doc, Inkscape::XML::Node * node); + bool set_bool (bool in, SPDocument * doc, Inkscape::XML::Node * node); + int set_int (int in, SPDocument * doc, Inkscape::XML::Node * node); + float set_float (float in, SPDocument * doc, Inkscape::XML::Node * node); + const gchar * set_string (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + guint32 set_color (guint32 in, SPDocument * doc, Inkscape::XML::Node * node); const gchar * name (void) {return _name;} static Parameter * make (Inkscape::XML::Node * in_repr, Inkscape::Extension::Extension * in_ext); - virtual Gtk::Widget * get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + virtual Gtk::Widget * get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); gchar const * get_tooltip (void) { return _desc; } diff --git a/src/extension/param/radiobutton.cpp b/src/extension/param/radiobutton.cpp index 315984e17..c17839001 100644 --- a/src/extension/param/radiobutton.cpp +++ b/src/extension/param/radiobutton.cpp @@ -149,7 +149,7 @@ ParamRadioButton::~ParamRadioButton (void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamRadioButton::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamRadioButton::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -189,7 +189,7 @@ ParamRadioButton::string (std::string &string) class ParamRadioButtonWdg : public Gtk::RadioButton { private: ParamRadioButton * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -197,12 +197,12 @@ public: \param pref Where to put the radiobutton's string when it is selected. */ ParamRadioButtonWdg ( Gtk::RadioButtonGroup& group, const Glib::ustring& label, - ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal ) : Gtk::RadioButton(group, label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; ParamRadioButtonWdg ( const Glib::ustring& label, - ParamRadioButton * pref, Document * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : + ParamRadioButton * pref, SPDocument * doc, Inkscape::XML::Node * node , sigc::signal * changeSignal) : Gtk::RadioButton(label), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { add_changesignal(); }; @@ -232,7 +232,7 @@ ParamRadioButtonWdg::changed (void) class ComboWdg : public Gtk::ComboBoxText { public: - ComboWdg(ParamRadioButton* base, Document * doc, Inkscape::XML::Node * node) : + ComboWdg(ParamRadioButton* base, SPDocument * doc, Inkscape::XML::Node * node) : Gtk::ComboBoxText(), base(base), doc(doc), @@ -243,7 +243,7 @@ public: protected: ParamRadioButton* base; - Document* doc; + SPDocument* doc; Inkscape::XML::Node* node; virtual void on_changed() { @@ -257,7 +257,7 @@ protected: \brief Creates a combobox widget for an enumeration parameter */ Gtk::Widget * -ParamRadioButton::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamRadioButton::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/radiobutton.h b/src/extension/param/radiobutton.h index ec35c2c53..ea8440de2 100644 --- a/src/extension/param/radiobutton.h +++ b/src/extension/param/radiobutton.h @@ -43,11 +43,11 @@ public: Inkscape::XML::Node * xml, AppearanceMode mode); virtual ~ParamRadioButton(void); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); private: /** \brief Internal value. This should point to a string that has diff --git a/src/extension/param/string.cpp b/src/extension/param/string.cpp index 6427f6f76..e32224332 100644 --- a/src/extension/param/string.cpp +++ b/src/extension/param/string.cpp @@ -42,7 +42,7 @@ ParamString::~ParamString(void) the passed in value is duplicated using \c g_strdup(). */ const gchar * -ParamString::set (const gchar * in, Document * /*doc*/, Inkscape::XML::Node * /*node*/) +ParamString::set (const gchar * in, SPDocument * /*doc*/, Inkscape::XML::Node * /*node*/) { if (in == NULL) return NULL; /* Can't have NULL string */ @@ -96,7 +96,7 @@ ParamString::ParamString (const gchar * name, const gchar * guitext, const gchar class ParamStringEntry : public Gtk::Entry { private: ParamString * _pref; - Document * _doc; + SPDocument * _doc; Inkscape::XML::Node * _node; sigc::signal * _changeSignal; public: @@ -104,7 +104,7 @@ public: \param pref Where to get the string from, and where to put it when it changes. */ - ParamStringEntry (ParamString * pref, Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : + ParamStringEntry (ParamString * pref, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) : Gtk::Entry(), _pref(pref), _doc(doc), _node(node), _changeSignal(changeSignal) { if (_pref->get(NULL, NULL) != NULL) this->set_text(Glib::ustring(_pref->get(NULL, NULL))); @@ -137,7 +137,7 @@ ParamStringEntry::changed_text (void) Builds a hbox with a label and a text box in it. */ Gtk::Widget * -ParamString::get_widget (Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) +ParamString::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal) { if (_gui_hidden) return NULL; diff --git a/src/extension/param/string.h b/src/extension/param/string.h index 0eb116a53..10f45e5ac 100644 --- a/src/extension/param/string.h +++ b/src/extension/param/string.h @@ -28,9 +28,9 @@ public: ParamString(const gchar * name, const gchar * guitext, const gchar * desc, const Parameter::_scope_t scope, bool gui_hidden, const gchar * gui_tip, Inkscape::Extension::Extension * ext, Inkscape::XML::Node * xml); virtual ~ParamString(void); /** \brief Returns \c _value, with a \i const to protect it. */ - const gchar * get (const Document * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } - const gchar * set (const gchar * in, Document * doc, Inkscape::XML::Node * node); - Gtk::Widget * get_widget(Document * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); + const gchar * get (const SPDocument * /*doc*/, const Inkscape::XML::Node * /*node*/) { return _value; } + const gchar * set (const gchar * in, SPDocument * doc, Inkscape::XML::Node * node); + Gtk::Widget * get_widget(SPDocument * doc, Inkscape::XML::Node * node, sigc::signal * changeSignal); void string (std::string &string); void setMaxLength(int maxLenght) { _max_length = maxLenght; } int getMaxLength(void) { return _max_length; } diff --git a/src/extension/patheffect.cpp b/src/extension/patheffect.cpp index f6fa84f5b..8e3fc13f1 100644 --- a/src/extension/patheffect.cpp +++ b/src/extension/patheffect.cpp @@ -28,14 +28,14 @@ PathEffect::~PathEffect (void) } void -PathEffect::processPath (Document * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) +PathEffect::processPath (SPDocument * /*doc*/, Inkscape::XML::Node * /*path*/, Inkscape::XML::Node * /*def*/) { } void -PathEffect::processPathEffects (Document * doc, Inkscape::XML::Node * path) +PathEffect::processPathEffects (SPDocument * doc, Inkscape::XML::Node * path) { gchar const * patheffectlist = path->attribute("inkscape:path-effects"); if (patheffectlist == NULL) diff --git a/src/extension/patheffect.h b/src/extension/patheffect.h index 7ad875048..0c00ae093 100644 --- a/src/extension/patheffect.h +++ b/src/extension/patheffect.h @@ -22,10 +22,10 @@ public: PathEffect (Inkscape::XML::Node * in_repr, Implementation::Implementation * in_imp); virtual ~PathEffect (void); - void processPath (Document * doc, + void processPath (SPDocument * doc, Inkscape::XML::Node * path, Inkscape::XML::Node * def); - static void processPathEffects (Document * doc, + static void processPathEffects (SPDocument * doc, Inkscape::XML::Node * path); }; /* PathEffect */ diff --git a/src/extension/print.cpp b/src/extension/print.cpp index f6f6bb1e5..2d4177d60 100644 --- a/src/extension/print.cpp +++ b/src/extension/print.cpp @@ -49,7 +49,7 @@ Print::set_preview (void) } unsigned int -Print::begin (Document *doc) +Print::begin (SPDocument *doc) { return imp->begin(this, doc); } diff --git a/src/extension/print.h b/src/extension/print.h index 3240942d7..8ae71b8e6 100644 --- a/src/extension/print.h +++ b/src/extension/print.h @@ -36,7 +36,7 @@ public: unsigned int setup (void); unsigned int set_preview (void); - unsigned int begin (Document *doc); + unsigned int begin (SPDocument *doc); unsigned int finish (void); /* Rendering methods */ diff --git a/src/extension/system.cpp b/src/extension/system.cpp index ad49c3d2a..d7e0eebf3 100644 --- a/src/extension/system.cpp +++ b/src/extension/system.cpp @@ -59,7 +59,7 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio * * Lastly, the open function is called in the module itself. */ -Document * +SPDocument * open(Extension *key, gchar const *filename) { Input *imod = NULL; @@ -91,7 +91,7 @@ open(Extension *key, gchar const *filename) if (!imod->prefs(filename)) return NULL; - Document *doc = imod->open(filename); + SPDocument *doc = imod->open(filename); if (!doc) { throw Input::open_failed(); } @@ -184,7 +184,7 @@ open_internal(Extension *in_plug, gpointer in_data) * Lastly, the save function is called in the module itself. */ void -save(Extension *key, Document *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) +save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official) { Output *omod; if (key == NULL) { diff --git a/src/extension/system.h b/src/extension/system.h index ada5f799c..6c23b2f0d 100644 --- a/src/extension/system.h +++ b/src/extension/system.h @@ -21,8 +21,8 @@ namespace Inkscape { namespace Extension { -Document *open(Extension *key, gchar const *filename); -void save(Extension *key, Document *doc, gchar const *filename, +SPDocument *open(Extension *key, gchar const *filename); +void save(Extension *key, SPDocument *doc, gchar const *filename, bool setextension, bool check_overwrite, bool official); Print *get_print(gchar const *key); Extension *build_from_file(gchar const *filename); diff --git a/src/file.cpp b/src/file.cpp index 22425547e..049c1acb4 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -1,4 +1,3 @@ - /** @file * @brief File/Print operations */ @@ -66,14 +65,6 @@ #include "uri.h" #include "xml/rebase-hrefs.h" -#include "streams-handles.h" -#include "streams-webdav.h" -#include "streams-ftp.h" -#include "streams-http.h" - -//#include "buffersystem.h" -#include - #ifdef WITH_GNOME_VFS # include #endif @@ -128,7 +119,7 @@ sp_file_new(const Glib::ustring &templ) char *templName = NULL; if (templ.size()>0) templName = (char *)templ.c_str(); - Document *doc = sp_document_new(templName, TRUE, true); + SPDocument *doc = sp_document_new(templName, TRUE, true); g_return_val_if_fail(doc != NULL, NULL); SPDesktop *dt; @@ -210,7 +201,7 @@ sp_file_open(const Glib::ustring &uri, if (desktop) desktop->setWaitingCursor(); - Document *doc = NULL; + SPDocument *doc = NULL; try { doc = Inkscape::Extension::open(key, uri.c_str()); } catch (Inkscape::Extension::Input::no_extension_found &e) { @@ -223,7 +214,7 @@ sp_file_open(const Glib::ustring &uri, desktop->clearWaitingCursor(); if (doc) { - Document *existing = desktop ? sp_desktop_document(desktop) : NULL; + SPDocument *existing = desktop ? sp_desktop_document(desktop) : NULL; if (existing && existing->virgin && replace_empty) { // If the current desktop is empty, open the document there @@ -263,137 +254,6 @@ sp_file_open(const Glib::ustring &uri, } } - - - -//NOTE1 -bool -sp_file_open_uri(const Inkscape::URI &uri, - Inkscape::Extension::Extension *key, - bool add_to_recent, bool replace_empty) -{ - Document *doc = NULL; - try { - doc = Inkscape::Extension::open(key, uri.toNativeFilename()); - } catch (Inkscape::Extension::Input::no_extension_found &e) { - doc = NULL; - } catch (Inkscape::Extension::Input::open_failed &e) { - doc = NULL; - } - - //FIXME1 KLUDGE switch - - //WebDAV - /* - if (std::strstr(uri.toString(), "http") != NULL) - { - if (strcmp(uri.toString(), "/http") >= 5//FIXME3 skip begining '/' - || - strcmp(uri.toString(), "http") >= 4 - ) - { - - std::cout<<"+++ 'http' uri.toString->"< FTP , HTTP etc."<= 4//FIXME3 skip begining '/' - || - strcmp(uri.toString(), "ftp") >= 3 - ) - { - std::cout<<"+++ 'ftp' uri.toString->"<> buf; - std::cout<<"buf->"<= 5//FIXME3 skip begining '/' - || - strcmp(uri.toString(), "http") >= 4 - ) - { - std::cout<<"+++ 'http' uri.toString->"<> buf; - std::cout<<"buf->"<virgin && replace_empty) { - // If the current desktop is empty, open the document there - sp_document_ensure_up_to_date (doc); - desktop->change_document(doc); - sp_document_resized_signal_emit (doc, sp_document_width(doc), sp_document_height(doc)); - } else { - if (!Inkscape::NSApplication::Application::getNewGui()) { - // create a whole new desktop and window - SPViewWidget *dtw = sp_desktop_widget_new(sp_document_namedview(doc, NULL)); - sp_create_window(dtw, TRUE); - desktop = static_cast(dtw->view); - } else { - desktop = Inkscape::NSApplication::Editor::createDesktop (doc); - } - } - - doc->virgin = FALSE; - // everyone who cares now has a reference, get rid of ours - sp_document_unref(doc); - // resize the window to match the document properties - sp_namedview_window_from_document(desktop); - sp_namedview_update_layers_from_document(desktop); - - if (add_to_recent) { -//--tullarisc prefs_set_recent_file(SP_DOCUMENT_URI(doc), SP_DOCUMENT_NAME(doc)); - } - - return TRUE; - } else { - //FIXME 1 - //gchar *safeUri = Inkscape::IO::sanitizeString(uri.toNativeFilename()); - //gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), safeUri); - //sp_ui_error_dialog(text); - //g_free(text); - //g_free(safeUri); - return FALSE; - } -} - - /** * Handle prompting user for "do you want to revert"? Revert on "OK" */ @@ -403,7 +263,7 @@ sp_file_revert_dialog() SPDesktop *desktop = SP_ACTIVE_DESKTOP; g_assert(desktop != NULL); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); g_assert(doc != NULL); Inkscape::XML::Node *repr = sp_document_repr_root(doc); @@ -537,7 +397,6 @@ void dump_ustr(Glib::ustring const &ustr) /** * Display an file Open selector. Open a document if OK is pressed. * Can select single or multiple files for opening. - * NOTE1 */ void sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*data*/) @@ -662,7 +521,7 @@ sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d open_path.append(G_DIR_SEPARATOR_S); prefs->setString("/dialogs/open/path", open_path); - sp_file_open_uri(Inkscape::URI(fileName.c_str()), selection); + sp_file_open(fileName, selection); } return; @@ -681,7 +540,7 @@ sp_file_open_dialog(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d void sp_file_vacuum() { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; unsigned int diff = vacuum_document (doc); @@ -713,7 +572,7 @@ sp_file_vacuum() * document; is true for normal save, false for temporary saves */ static bool -file_save(Gtk::Window &parentWindow, Document *doc, const Glib::ustring &uri, +file_save(Gtk::Window &parentWindow, SPDocument *doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key, bool saveas, bool official) { if (!doc || uri.size()<1) //Safety check @@ -755,7 +614,7 @@ file_save(Gtk::Window &parentWindow, Document *doc, const Glib::ustring &uri, * Used only for remote saving using VFS and a specific uri. Gets the file at the /tmp. */ bool -file_save_remote(Document */*doc*/, +file_save_remote(SPDocument */*doc*/, #ifdef WITH_GNOME_VFS const Glib::ustring &uri, #else @@ -843,7 +702,7 @@ file_save_remote(Document */*doc*/, * \param ascopy (optional) wether to set the documents->uri to the new filename or not */ bool -sp_file_save_dialog(Gtk::Window &parentWindow, Document *doc, bool is_copy) +sp_file_save_dialog(Gtk::Window &parentWindow, SPDocument *doc, bool is_copy) { Inkscape::XML::Node *repr = sp_document_repr_root(doc); @@ -978,7 +837,7 @@ sp_file_save_dialog(Gtk::Window &parentWindow, Document *doc, bool is_copy) * Save a document, displaying a SaveAs dialog if necessary. */ bool -sp_file_save_document(Gtk::Window &parentWindow, Document *doc) +sp_file_save_document(Gtk::Window &parentWindow, SPDocument *doc) { bool success = true; @@ -1054,13 +913,13 @@ sp_file_save_a_copy(Gtk::Window &parentWindow, gpointer /*object*/, gpointer /*d * Import a resource. Called by sp_file_import() */ void -file_import(Document *in_doc, const Glib::ustring &uri, +file_import(SPDocument *in_doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; //DEBUG_MESSAGE( fileImport, "file_import( in_doc:%p uri:[%s], key:%p", in_doc, uri, key ); - Document *doc; + SPDocument *doc; try { doc = Inkscape::Extension::open(key, uri.c_str()); } catch (Inkscape::Extension::Input::no_extension_found &e) { @@ -1070,7 +929,7 @@ file_import(Document *in_doc, const Glib::ustring &uri, } if (doc != NULL) { - Inkscape::XML::rebase_hrefs((Inkscape::XML::Document *)doc, in_doc->base, true); + Inkscape::XML::rebase_hrefs(doc, in_doc->base, true); Inkscape::XML::Document *xml_in_doc = sp_document_repr_doc(in_doc); prevent_id_clashes(doc, in_doc); @@ -1191,7 +1050,7 @@ sp_file_import(Gtk::Window &parentWindow) { static Glib::ustring import_path; - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (!doc) return; @@ -1274,7 +1133,7 @@ bool sp_file_export_dialog(void *widget) { //# temp hack for 'doc' until we can switch to this dialog - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; Glib::ustring export_path; Glib::ustring export_loc; @@ -1410,7 +1269,7 @@ sp_file_export_to_ocal_dialog(Gtk::Window &parentWindow) if (!SP_ACTIVE_DOCUMENT) return false; - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; Glib::ustring export_path; Glib::ustring export_loc; @@ -1568,7 +1427,7 @@ sp_file_import_from_ocal(Gtk::Window &parentWindow) { static Glib::ustring import_path; - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (!doc) return; @@ -1626,7 +1485,7 @@ sp_file_import_from_ocal(Gtk::Window &parentWindow) void sp_file_print(Gtk::Window& parentWindow) { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (doc) sp_print_document(parentWindow, doc); } @@ -1639,7 +1498,7 @@ void sp_file_print_preview(gpointer /*object*/, gpointer /*data*/) { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (doc) sp_print_preview_document(doc); diff --git a/src/file.h b/src/file.h index 2eaace640..ce75a61a7 100644 --- a/src/file.h +++ b/src/file.h @@ -21,15 +21,8 @@ #include "extension/extension-forward.h" -#include -#include -#include - -#include "uri.h" -#include "streams-webdav.h" - struct SPDesktop; -struct Document; +struct SPDocument; namespace Inkscape { namespace Extension { @@ -71,17 +64,6 @@ bool sp_file_open( bool replace_empty = true ); -//NOTE1 -/* - * Opens a new file and window from the given URI (class) - */ -bool sp_file_open_uri( - const Inkscape::URI &uri, - Inkscape::Extension::Extension *key, - bool add_to_recent = true, - bool replace_empty = true - ); - /** * Displays a file open dialog. Calls sp_file_open on * an OK. @@ -101,7 +83,7 @@ void sp_file_revert_dialog (); * Added to make only the remote savings. */ -bool file_save_remote(Document *doc, const Glib::ustring &uri, +bool file_save_remote(SPDocument *doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key, bool saveas, bool official); /** @@ -126,10 +108,10 @@ bool sp_file_save_a_copy (Gtk::Window &parentWindow, gpointer object, gpointer d * Saves the given document. Displays a file select dialog * if needed. */ -bool sp_file_save_document (Gtk::Window &parentWindow, Document *document); +bool sp_file_save_document (Gtk::Window &parentWindow, SPDocument *document); /* Do the saveas dialog with a document as the parameter */ -bool sp_file_save_dialog (Gtk::Window &parentWindow, Document *doc, bool bAsCopy = FALSE); +bool sp_file_save_dialog (Gtk::Window &parentWindow, SPDocument *doc, bool bAsCopy = FALSE); /*###################### @@ -145,7 +127,7 @@ void sp_file_import (Gtk::Window &parentWindow); /** * Imports a resource */ -void file_import(Document *in_doc, const Glib::ustring &uri, +void file_import(SPDocument *in_doc, const Glib::ustring &uri, Inkscape::Extension::Extension *key); /*###################### @@ -217,15 +199,6 @@ void sp_file_vacuum (); #endif -//namespace Inkscape { -//namespace Net { - - - -//} -//} -// #endif - /* Local Variables: mode:c++ diff --git a/src/filter-chemistry.cpp b/src/filter-chemistry.cpp index d40347889..363663ac3 100644 --- a/src/filter-chemistry.cpp +++ b/src/filter-chemistry.cpp @@ -88,7 +88,7 @@ static void set_filter_area(Inkscape::XML::Node *repr, gdouble radius, } } -SPFilter *new_filter(Document *document) +SPFilter *new_filter(SPDocument *document) { g_return_val_if_fail(document != NULL, NULL); @@ -184,7 +184,7 @@ filter_add_primitive(SPFilter *filter, const Inkscape::Filters::FilterPrimitiveT * Creates a filter with blur primitive of specified radius for an item with the given matrix expansion, width and height */ SPFilter * -new_filter_gaussian_blur (Document *document, gdouble radius, double expansion, double expansionX, double expansionY, double width, double height) +new_filter_gaussian_blur (SPDocument *document, gdouble radius, double expansion, double expansionX, double expansionY, double width, double height) { g_return_val_if_fail(document != NULL, NULL); @@ -238,7 +238,7 @@ new_filter_gaussian_blur (Document *document, gdouble radius, double expansion, * an item with the given matrix expansion, width and height */ SPFilter * -new_filter_blend_gaussian_blur (Document *document, const char *blendmode, gdouble radius, double expansion, +new_filter_blend_gaussian_blur (SPDocument *document, const char *blendmode, gdouble radius, double expansion, double expansionX, double expansionY, double width, double height) { g_return_val_if_fail(document != NULL, NULL); @@ -317,7 +317,7 @@ new_filter_blend_gaussian_blur (Document *document, const char *blendmode, gdoub * specified mode and radius, respectively */ SPFilter * -new_filter_simple_from_item (Document *document, SPItem *item, const char *mode, gdouble radius) +new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble radius) { Geom::OptRect const r = sp_item_bbox_desktop(item, SPItem::GEOMETRIC_BBOX); @@ -345,7 +345,7 @@ new_filter_simple_from_item (Document *document, SPItem *item, const char *mode, */ /* TODO: this should be made more generic, not just for blurs */ SPFilter * -modify_filter_gaussian_blur_from_item(Document *document, SPItem *item, +modify_filter_gaussian_blur_from_item(SPDocument *document, SPItem *item, gdouble radius) { if (!item->style || !item->style->filter.set) { diff --git a/src/filter-chemistry.h b/src/filter-chemistry.h index ee249d6f2..1b18ec11a 100644 --- a/src/filter-chemistry.h +++ b/src/filter-chemistry.h @@ -18,10 +18,10 @@ #include "sp-filter.h" SPFilterPrimitive *filter_add_primitive(SPFilter *filter, Inkscape::Filters::FilterPrimitiveType); -SPFilter *new_filter (Document *document); -SPFilter *new_filter_gaussian_blur (Document *document, gdouble stdDeviation, double expansion, double expansionX, double expansionY, double width, double height); -SPFilter *new_filter_simple_from_item (Document *document, SPItem *item, const char *mode, gdouble stdDeviation); -SPFilter *modify_filter_gaussian_blur_from_item (Document *document, SPItem *item, gdouble stdDeviation); +SPFilter *new_filter (SPDocument *document); +SPFilter *new_filter_gaussian_blur (SPDocument *document, gdouble stdDeviation, double expansion, double expansionX, double expansionY, double width, double height); +SPFilter *new_filter_simple_from_item (SPDocument *document, SPItem *item, const char *mode, gdouble stdDeviation); +SPFilter *modify_filter_gaussian_blur_from_item (SPDocument *document, SPItem *item, gdouble stdDeviation); void remove_filter (SPObject *item, bool recursive); void remove_filter_gaussian_blur (SPObject *item); bool filter_is_single_gaussian_blur(SPFilter *filter); diff --git a/src/filters/blend.cpp b/src/filters/blend.cpp index 26db781a0..5998d7be3 100644 --- a/src/filters/blend.cpp +++ b/src/filters/blend.cpp @@ -35,7 +35,7 @@ static void sp_feBlend_class_init(SPFeBlendClass *klass); static void sp_feBlend_init(SPFeBlend *feBlend); -static void sp_feBlend_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feBlend_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feBlend_release(SPObject *object); static void sp_feBlend_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feBlend_update(SPObject *object, SPCtx *ctx, guint flags); @@ -94,7 +94,7 @@ sp_feBlend_init(SPFeBlend *feBlend) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feBlend_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feBlend_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPFeBlend *blend = SP_FEBLEND(object); diff --git a/src/filters/colormatrix.cpp b/src/filters/colormatrix.cpp index f3c336d71..55cfcbeb7 100644 --- a/src/filters/colormatrix.cpp +++ b/src/filters/colormatrix.cpp @@ -34,7 +34,7 @@ static void sp_feColorMatrix_class_init(SPFeColorMatrixClass *klass); static void sp_feColorMatrix_init(SPFeColorMatrix *feColorMatrix); -static void sp_feColorMatrix_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feColorMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feColorMatrix_release(SPObject *object); static void sp_feColorMatrix_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feColorMatrix_update(SPObject *object, SPCtx *ctx, guint flags); @@ -91,7 +91,7 @@ sp_feColorMatrix_init(SPFeColorMatrix */*feColorMatrix*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feColorMatrix_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feColorMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feColorMatrix_parent_class)->build) { ((SPObjectClass *) feColorMatrix_parent_class)->build(object, document, repr); diff --git a/src/filters/componenttransfer-funcnode.cpp b/src/filters/componenttransfer-funcnode.cpp index f74da8154..e66f85e70 100644 --- a/src/filters/componenttransfer-funcnode.cpp +++ b/src/filters/componenttransfer-funcnode.cpp @@ -36,7 +36,7 @@ static void sp_fefuncnode_class_init(SPFeFuncNodeClass *klass); static void sp_fefuncnode_init(SPFeFuncNode *fefuncnode); -static void sp_fefuncnode_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_fefuncnode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_fefuncnode_release(SPObject *object); static void sp_fefuncnode_set(SPObject *object, unsigned int key, gchar const *value); static void sp_fefuncnode_update(SPObject *object, SPCtx *ctx, guint flags); @@ -161,7 +161,7 @@ sp_fefuncnode_init(SPFeFuncNode *fefuncnode) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_fefuncnode_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_fefuncnode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feFuncNode_parent_class)->build) { ((SPObjectClass *) feFuncNode_parent_class)->build(object, document, repr); diff --git a/src/filters/componenttransfer.cpp b/src/filters/componenttransfer.cpp index fbfca3a35..557d884e0 100644 --- a/src/filters/componenttransfer.cpp +++ b/src/filters/componenttransfer.cpp @@ -32,7 +32,7 @@ static void sp_feComponentTransfer_class_init(SPFeComponentTransferClass *klass); static void sp_feComponentTransfer_init(SPFeComponentTransfer *feComponentTransfer); -static void sp_feComponentTransfer_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feComponentTransfer_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feComponentTransfer_release(SPObject *object); static void sp_feComponentTransfer_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feComponentTransfer_update(SPObject *object, SPCtx *ctx, guint flags); @@ -91,7 +91,7 @@ sp_feComponentTransfer_init(SPFeComponentTransfer */*feComponentTransfer*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feComponentTransfer_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feComponentTransfer_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feComponentTransfer_parent_class)->build) { ((SPObjectClass *) feComponentTransfer_parent_class)->build(object, document, repr); diff --git a/src/filters/composite.cpp b/src/filters/composite.cpp index 8265a611c..93c692f94 100644 --- a/src/filters/composite.cpp +++ b/src/filters/composite.cpp @@ -29,7 +29,7 @@ static void sp_feComposite_class_init(SPFeCompositeClass *klass); static void sp_feComposite_init(SPFeComposite *feComposite); -static void sp_feComposite_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feComposite_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feComposite_release(SPObject *object); static void sp_feComposite_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feComposite_update(SPObject *object, SPCtx *ctx, guint flags); @@ -93,7 +93,7 @@ sp_feComposite_init(SPFeComposite *feComposite) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feComposite_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feComposite_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feComposite_parent_class)->build) { ((SPObjectClass *) feComposite_parent_class)->build(object, document, repr); diff --git a/src/filters/convolvematrix.cpp b/src/filters/convolvematrix.cpp index cc9d62f8f..3e1c36f0a 100644 --- a/src/filters/convolvematrix.cpp +++ b/src/filters/convolvematrix.cpp @@ -34,7 +34,7 @@ static void sp_feConvolveMatrix_class_init(SPFeConvolveMatrixClass *klass); static void sp_feConvolveMatrix_init(SPFeConvolveMatrix *feConvolveMatrix); -static void sp_feConvolveMatrix_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feConvolveMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feConvolveMatrix_release(SPObject *object); static void sp_feConvolveMatrix_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feConvolveMatrix_update(SPObject *object, SPCtx *ctx, guint flags); @@ -103,7 +103,7 @@ sp_feConvolveMatrix_init(SPFeConvolveMatrix *feConvolveMatrix) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feConvolveMatrix_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feConvolveMatrix_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feConvolveMatrix_parent_class)->build) { ((SPObjectClass *) feConvolveMatrix_parent_class)->build(object, document, repr); diff --git a/src/filters/diffuselighting.cpp b/src/filters/diffuselighting.cpp index e494e8ccd..bdc569083 100644 --- a/src/filters/diffuselighting.cpp +++ b/src/filters/diffuselighting.cpp @@ -32,7 +32,7 @@ static void sp_feDiffuseLighting_class_init(SPFeDiffuseLightingClass *klass); static void sp_feDiffuseLighting_init(SPFeDiffuseLighting *feDiffuseLighting); -static void sp_feDiffuseLighting_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feDiffuseLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feDiffuseLighting_release(SPObject *object); static void sp_feDiffuseLighting_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feDiffuseLighting_update(SPObject *object, SPCtx *ctx, guint flags); @@ -111,7 +111,7 @@ sp_feDiffuseLighting_init(SPFeDiffuseLighting *feDiffuseLighting) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feDiffuseLighting_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feDiffuseLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feDiffuseLighting_parent_class)->build) { ((SPObjectClass *) feDiffuseLighting_parent_class)->build(object, document, repr); diff --git a/src/filters/displacementmap.cpp b/src/filters/displacementmap.cpp index b05ee4db1..baa17d785 100644 --- a/src/filters/displacementmap.cpp +++ b/src/filters/displacementmap.cpp @@ -29,7 +29,7 @@ static void sp_feDisplacementMap_class_init(SPFeDisplacementMapClass *klass); static void sp_feDisplacementMap_init(SPFeDisplacementMap *feDisplacementMap); -static void sp_feDisplacementMap_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feDisplacementMap_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feDisplacementMap_release(SPObject *object); static void sp_feDisplacementMap_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feDisplacementMap_update(SPObject *object, SPCtx *ctx, guint flags); @@ -90,7 +90,7 @@ sp_feDisplacementMap_init(SPFeDisplacementMap *feDisplacementMap) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feDisplacementMap_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feDisplacementMap_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feDisplacementMap_parent_class)->build) { ((SPObjectClass *) feDisplacementMap_parent_class)->build(object, document, repr); diff --git a/src/filters/distantlight.cpp b/src/filters/distantlight.cpp index f25094798..41584c4a4 100644 --- a/src/filters/distantlight.cpp +++ b/src/filters/distantlight.cpp @@ -35,7 +35,7 @@ static void sp_fedistantlight_class_init(SPFeDistantLightClass *klass); static void sp_fedistantlight_init(SPFeDistantLight *fedistantlight); -static void sp_fedistantlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_fedistantlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_fedistantlight_release(SPObject *object); static void sp_fedistantlight_set(SPObject *object, unsigned int key, gchar const *value); static void sp_fedistantlight_update(SPObject *object, SPCtx *ctx, guint flags); @@ -94,7 +94,7 @@ sp_fedistantlight_init(SPFeDistantLight *fedistantlight) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_fedistantlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_fedistantlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feDistantLight_parent_class)->build) { ((SPObjectClass *) feDistantLight_parent_class)->build(object, document, repr); diff --git a/src/filters/flood.cpp b/src/filters/flood.cpp index 941f36113..625e35d42 100644 --- a/src/filters/flood.cpp +++ b/src/filters/flood.cpp @@ -29,7 +29,7 @@ static void sp_feFlood_class_init(SPFeFloodClass *klass); static void sp_feFlood_init(SPFeFlood *feFlood); -static void sp_feFlood_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feFlood_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feFlood_release(SPObject *object); static void sp_feFlood_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feFlood_update(SPObject *object, SPCtx *ctx, guint flags); @@ -87,7 +87,7 @@ sp_feFlood_init(SPFeFlood *feFlood) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feFlood_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feFlood_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feFlood_parent_class)->build) { ((SPObjectClass *) feFlood_parent_class)->build(object, document, repr); diff --git a/src/filters/image.cpp b/src/filters/image.cpp index bdfbadee0..0002ef94c 100644 --- a/src/filters/image.cpp +++ b/src/filters/image.cpp @@ -34,7 +34,7 @@ static void sp_feImage_class_init(SPFeImageClass *klass); static void sp_feImage_init(SPFeImage *feImage); -static void sp_feImage_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feImage_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feImage_release(SPObject *object); static void sp_feImage_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feImage_update(SPObject *object, SPCtx *ctx, guint flags); @@ -92,7 +92,7 @@ sp_feImage_init(SPFeImage */*feImage*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feImage_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feImage_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { // Save document reference so we can load images with relative paths. SPFeImage *feImage = SP_FEIMAGE(object); diff --git a/src/filters/image.h b/src/filters/image.h index 74352db80..7207918e1 100644 --- a/src/filters/image.h +++ b/src/filters/image.h @@ -27,7 +27,7 @@ struct SPFeImage : public SPFilterPrimitive { /** IMAGE ATTRIBUTES HERE */ gchar *href; SVGLength x, y, height, width; - Document *document; + SPDocument *document; bool from_element; SPItem* SVGElem; Inkscape::URIReference* SVGElemRef; diff --git a/src/filters/merge.cpp b/src/filters/merge.cpp index 9d82da7ae..437cb4b55 100644 --- a/src/filters/merge.cpp +++ b/src/filters/merge.cpp @@ -30,7 +30,7 @@ static void sp_feMerge_class_init(SPFeMergeClass *klass); static void sp_feMerge_init(SPFeMerge *feMerge); -static void sp_feMerge_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feMerge_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feMerge_release(SPObject *object); static void sp_feMerge_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feMerge_update(SPObject *object, SPCtx *ctx, guint flags); @@ -88,7 +88,7 @@ sp_feMerge_init(SPFeMerge */*feMerge*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feMerge_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feMerge_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feMerge_parent_class)->build) { ((SPObjectClass *) feMerge_parent_class)->build(object, document, repr); diff --git a/src/filters/mergenode.cpp b/src/filters/mergenode.cpp index 42b4bc8db..8a4e0dd0a 100644 --- a/src/filters/mergenode.cpp +++ b/src/filters/mergenode.cpp @@ -26,7 +26,7 @@ static void sp_feMergeNode_class_init(SPFeMergeNodeClass *klass); static void sp_feMergeNode_init(SPFeMergeNode *skeleton); -static void sp_feMergeNode_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feMergeNode_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feMergeNode_release(SPObject *object); static void sp_feMergeNode_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feMergeNode_update(SPObject *object, SPCtx *ctx, guint flags); @@ -82,7 +82,7 @@ sp_feMergeNode_init(SPFeMergeNode *feMergeNode) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feMergeNode_build(SPObject *object, Document */*document*/, Inkscape::XML::Node */*repr*/) +sp_feMergeNode_build(SPObject *object, SPDocument */*document*/, Inkscape::XML::Node */*repr*/) { sp_object_read_attr(object, "in"); } diff --git a/src/filters/morphology.cpp b/src/filters/morphology.cpp index 6d91d9905..9a34bbccb 100644 --- a/src/filters/morphology.cpp +++ b/src/filters/morphology.cpp @@ -31,7 +31,7 @@ static void sp_feMorphology_class_init(SPFeMorphologyClass *klass); static void sp_feMorphology_init(SPFeMorphology *feMorphology); -static void sp_feMorphology_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feMorphology_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feMorphology_release(SPObject *object); static void sp_feMorphology_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feMorphology_update(SPObject *object, SPCtx *ctx, guint flags); @@ -90,7 +90,7 @@ sp_feMorphology_init(SPFeMorphology *feMorphology) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feMorphology_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feMorphology_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feMorphology_parent_class)->build) { ((SPObjectClass *) feMorphology_parent_class)->build(object, document, repr); diff --git a/src/filters/offset.cpp b/src/filters/offset.cpp index 3ae6994ce..61ea45ff2 100644 --- a/src/filters/offset.cpp +++ b/src/filters/offset.cpp @@ -30,7 +30,7 @@ static void sp_feOffset_class_init(SPFeOffsetClass *klass); static void sp_feOffset_init(SPFeOffset *feOffset); -static void sp_feOffset_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feOffset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feOffset_release(SPObject *object); static void sp_feOffset_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feOffset_update(SPObject *object, SPCtx *ctx, guint flags); @@ -90,7 +90,7 @@ sp_feOffset_init(SPFeOffset *feOffset) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feOffset_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feOffset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feOffset_parent_class)->build) { ((SPObjectClass *) feOffset_parent_class)->build(object, document, repr); diff --git a/src/filters/pointlight.cpp b/src/filters/pointlight.cpp index cc56b5f01..ce58cf13e 100644 --- a/src/filters/pointlight.cpp +++ b/src/filters/pointlight.cpp @@ -35,7 +35,7 @@ static void sp_fepointlight_class_init(SPFePointLightClass *klass); static void sp_fepointlight_init(SPFePointLight *fepointlight); -static void sp_fepointlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_fepointlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_fepointlight_release(SPObject *object); static void sp_fepointlight_set(SPObject *object, unsigned int key, gchar const *value); static void sp_fepointlight_update(SPObject *object, SPCtx *ctx, guint flags); @@ -97,7 +97,7 @@ sp_fepointlight_init(SPFePointLight *fepointlight) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_fepointlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_fepointlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) fePointLight_parent_class)->build) { ((SPObjectClass *) fePointLight_parent_class)->build(object, document, repr); diff --git a/src/filters/specularlighting.cpp b/src/filters/specularlighting.cpp index 9a3ac6811..03a0c7f96 100644 --- a/src/filters/specularlighting.cpp +++ b/src/filters/specularlighting.cpp @@ -32,7 +32,7 @@ static void sp_feSpecularLighting_class_init(SPFeSpecularLightingClass *klass); static void sp_feSpecularLighting_init(SPFeSpecularLighting *feSpecularLighting); -static void sp_feSpecularLighting_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feSpecularLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feSpecularLighting_release(SPObject *object); static void sp_feSpecularLighting_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feSpecularLighting_update(SPObject *object, SPCtx *ctx, guint flags); @@ -113,7 +113,7 @@ sp_feSpecularLighting_init(SPFeSpecularLighting *feSpecularLighting) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feSpecularLighting_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feSpecularLighting_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feSpecularLighting_parent_class)->build) { ((SPObjectClass *) feSpecularLighting_parent_class)->build(object, document, repr); diff --git a/src/filters/spotlight.cpp b/src/filters/spotlight.cpp index bd5d06f73..3b518f0b4 100644 --- a/src/filters/spotlight.cpp +++ b/src/filters/spotlight.cpp @@ -35,7 +35,7 @@ static void sp_fespotlight_class_init(SPFeSpotLightClass *klass); static void sp_fespotlight_init(SPFeSpotLight *fespotlight); -static void sp_fespotlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_fespotlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_fespotlight_release(SPObject *object); static void sp_fespotlight_set(SPObject *object, unsigned int key, gchar const *value); static void sp_fespotlight_update(SPObject *object, SPCtx *ctx, guint flags); @@ -107,7 +107,7 @@ sp_fespotlight_init(SPFeSpotLight *fespotlight) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_fespotlight_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_fespotlight_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feSpotLight_parent_class)->build) { ((SPObjectClass *) feSpotLight_parent_class)->build(object, document, repr); diff --git a/src/filters/tile.cpp b/src/filters/tile.cpp index 7bf03cde3..877f70b27 100644 --- a/src/filters/tile.cpp +++ b/src/filters/tile.cpp @@ -28,7 +28,7 @@ static void sp_feTile_class_init(SPFeTileClass *klass); static void sp_feTile_init(SPFeTile *feTile); -static void sp_feTile_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feTile_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feTile_release(SPObject *object); static void sp_feTile_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feTile_update(SPObject *object, SPCtx *ctx, guint flags); @@ -85,7 +85,7 @@ sp_feTile_init(SPFeTile */*feTile*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feTile_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feTile_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feTile_parent_class)->build) { ((SPObjectClass *) feTile_parent_class)->build(object, document, repr); diff --git a/src/filters/turbulence.cpp b/src/filters/turbulence.cpp index e348f796f..f3c143056 100644 --- a/src/filters/turbulence.cpp +++ b/src/filters/turbulence.cpp @@ -34,7 +34,7 @@ static void sp_feTurbulence_class_init(SPFeTurbulenceClass *klass); static void sp_feTurbulence_init(SPFeTurbulence *feTurbulence); -static void sp_feTurbulence_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_feTurbulence_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_feTurbulence_release(SPObject *object); static void sp_feTurbulence_set(SPObject *object, unsigned int key, gchar const *value); static void sp_feTurbulence_update(SPObject *object, SPCtx *ctx, guint flags); @@ -93,7 +93,7 @@ sp_feTurbulence_init(SPFeTurbulence *feTurbulence) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_feTurbulence_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_feTurbulence_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) feTurbulence_parent_class)->build) { ((SPObjectClass *) feTurbulence_parent_class)->build(object, document, repr); diff --git a/src/flood-context.cpp b/src/flood-context.cpp index 9855c42f1..7b6223384 100644 --- a/src/flood-context.cpp +++ b/src/flood-context.cpp @@ -394,7 +394,7 @@ inline static bool check_if_pixel_is_paintable(guchar *px, unsigned char *trace_ * \param union_with_selection If true, merge the final SVG path with the current selection. */ static void do_trace(bitmap_coords_info bci, guchar *trace_px, SPDesktop *desktop, Geom::Matrix transform, unsigned int min_x, unsigned int max_x, unsigned int min_y, unsigned int max_y, bool union_with_selection) { - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); unsigned char *trace_t; @@ -770,7 +770,7 @@ static bool sort_fill_queue_horizontal(Geom::Point a, Geom::Point b) { */ static void sp_flood_do_flood_fill(SPEventContext *event_context, GdkEvent *event, bool union_with_selection, bool is_point_fill, bool is_touch_fill) { SPDesktop *desktop = event_context->desktop; - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); /* Create new arena */ NRArena *arena = NRArena::create(); diff --git a/src/forward.h b/src/forward.h index 4ac08c126..d4a98fbff 100644 --- a/src/forward.h +++ b/src/forward.h @@ -20,10 +20,6 @@ namespace Inkscape { struct Application; struct ApplicationClass; -namespace XML { -class Document; -class DocumentTree; -} } /* Editing window */ @@ -47,10 +43,11 @@ GType sp_event_context_get_type (); /* Document tree */ +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, Document)) +#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 (); diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 85e4e2c55..4abd7483f 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -92,7 +92,7 @@ sp_gradient_ensure_vector_normalized(SPGradient *gr) */ static SPGradient * -sp_gradient_get_private_normalized(Document *document, SPGradient *vector, SPGradientType type) +sp_gradient_get_private_normalized(SPDocument *document, SPGradient *vector, SPGradientType type) { g_return_val_if_fail(document != NULL, NULL); g_return_val_if_fail(vector != NULL, NULL); @@ -199,7 +199,7 @@ sp_gradient_fork_private_if_necessary(SPGradient *gr, SPGradient *vector, return gr; } - Document *doc = SP_OBJECT_DOCUMENT(gr); + SPDocument *doc = SP_OBJECT_DOCUMENT(gr); SPObject *defs = SP_DOCUMENT_DEFS(doc); if ((gr->has_stops) || @@ -245,7 +245,7 @@ sp_gradient_fork_vector_if_necessary (SPGradient *gr) return gr; if (SP_OBJECT_HREFCOUNT(gr) > 1) { - Document *doc = SP_OBJECT_DOCUMENT(gr); + SPDocument *doc = SP_OBJECT_DOCUMENT(gr); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = SP_OBJECT_REPR (gr)->duplicate(xml_doc); @@ -1210,7 +1210,7 @@ sp_gradient_repr_set_link(Inkscape::XML::Node *repr, SPGradient *link) */ SPGradient * -sp_document_default_gradient_vector(Document *document, guint32 color) +sp_document_default_gradient_vector(SPDocument *document, guint32 color) { SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); @@ -1271,7 +1271,7 @@ Return the preferred vector for \a o, made from (in order of preference) its cur current fill or stroke color, or from desktop style if \a o is NULL or doesn't have style. */ SPGradient * -sp_gradient_vector_for_object(Document *const doc, SPDesktop *const desktop, +sp_gradient_vector_for_object(SPDocument *const doc, SPDesktop *const desktop, SPObject *const o, bool const is_fill) { guint32 rgba = 0; diff --git a/src/gradient-chemistry.h b/src/gradient-chemistry.h index 94351d483..73b9893bc 100644 --- a/src/gradient-chemistry.h +++ b/src/gradient-chemistry.h @@ -41,8 +41,8 @@ SPGradient *sp_item_set_gradient (SPItem *item, SPGradient *gr, SPGradientType t * Get default normalized gradient vector of document, create if there is none */ -SPGradient *sp_document_default_gradient_vector (Document *document, guint32 color = 0); -SPGradient *sp_gradient_vector_for_object (Document *doc, SPDesktop *desktop, SPObject *o, bool is_fill); +SPGradient *sp_document_default_gradient_vector (SPDocument *document, guint32 color = 0); +SPGradient *sp_gradient_vector_for_object (SPDocument *doc, SPDesktop *desktop, SPObject *o, bool is_fill); void sp_object_ensure_fill_gradient_normalized (SPObject *object); void sp_object_ensure_stroke_gradient_normalized (SPObject *object); diff --git a/src/gradient-context.cpp b/src/gradient-context.cpp index 64a836b8f..fc5c1af44 100644 --- a/src/gradient-context.cpp +++ b/src/gradient-context.cpp @@ -346,7 +346,7 @@ sp_gradient_context_get_stop_intervals (GrDrag *drag, GSList **these_stops, GSLi static void sp_gradient_context_add_stops_between_selected_stops (SPGradientContext *rc) { - Document *doc = NULL; + SPDocument *doc = NULL; GrDrag *drag = rc->_grdrag; GSList *these_stops = NULL; @@ -403,7 +403,7 @@ double sqr(double x) {return x*x;} static void sp_gradient_simplify(SPGradientContext *rc, double tolerance) { - Document *doc = NULL; + SPDocument *doc = NULL; GrDrag *drag = rc->_grdrag; GSList *these_stops = NULL; @@ -861,7 +861,7 @@ static void sp_gradient_drag(SPGradientContext &rc, Geom::Point const pt, guint { SPDesktop *desktop = SP_EVENT_CONTEXT(&rc)->desktop; Inkscape::Selection *selection = sp_desktop_selection(desktop); - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); SPEventContext *ec = SP_EVENT_CONTEXT(&rc); if (!selection->isEmpty()) { diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 65f310e6a..c16ed2456 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -1914,7 +1914,7 @@ GrDrag::deleteSelected (bool just_one) { if (!selected) return; - Document *document = false; + SPDocument *document = false; struct StructStopInfo { SPStop * spstop; diff --git a/src/helper/action.cpp b/src/helper/action.cpp index 8c2705e45..84d150615 100644 --- a/src/helper/action.cpp +++ b/src/helper/action.cpp @@ -132,7 +132,7 @@ public: { _addProperty(share_static_string("timestamp"), timestamp()); if (action->view) { - Document *document = action->view->doc(); + SPDocument *document = action->view->doc(); if (document) { _addProperty(share_static_string("document"), document->serial()); } diff --git a/src/helper/pixbuf-ops.cpp b/src/helper/pixbuf-ops.cpp index 1e364a37c..f41342e42 100644 --- a/src/helper/pixbuf-ops.cpp +++ b/src/helper/pixbuf-ops.cpp @@ -66,7 +66,7 @@ hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey) // to the call for the interface to the png writing. bool -sp_export_jpg_file(Document *doc, gchar const *filename, +sp_export_jpg_file(SPDocument *doc, gchar const *filename, double x0, double y0, double x1, double y1, unsigned width, unsigned height, double xdpi, double ydpi, unsigned long bgcolor, double quality,GSList *items) @@ -90,7 +90,7 @@ sp_export_jpg_file(Document *doc, gchar const *filename, } GdkPixbuf* -sp_generate_internal_bitmap(Document *doc, gchar const */*filename*/, +sp_generate_internal_bitmap(SPDocument *doc, gchar const */*filename*/, double x0, double y0, double x1, double y1, unsigned width, unsigned height, double xdpi, double ydpi, unsigned long bgcolor, diff --git a/src/helper/pixbuf-ops.h b/src/helper/pixbuf-ops.h index de6a80181..a985be297 100644 --- a/src/helper/pixbuf-ops.h +++ b/src/helper/pixbuf-ops.h @@ -14,12 +14,12 @@ #include -struct Document; +struct SPDocument; -bool sp_export_jpg_file (Document *doc, gchar const *filename, double x0, double y0, double x1, double y1, +bool sp_export_jpg_file (SPDocument *doc, gchar const *filename, double x0, double y0, double x1, double y1, unsigned int width, unsigned int height, double xdpi, double ydpi, unsigned long bgcolor, double quality, GSList *items_only = NULL); -GdkPixbuf* sp_generate_internal_bitmap(Document *doc, gchar const *filename, +GdkPixbuf* sp_generate_internal_bitmap(SPDocument *doc, gchar const *filename, double x0, double y0, double x1, double y1, unsigned width, unsigned height, double xdpi, double ydpi, unsigned long bgcolor, GSList *items_only = NULL); diff --git a/src/helper/png-write.cpp b/src/helper/png-write.cpp index ad1b43c55..3ac900680 100644 --- a/src/helper/png-write.cpp +++ b/src/helper/png-write.cpp @@ -120,7 +120,7 @@ void PngTextList::add(gchar const* key, gchar const* text) } static bool -sp_png_write_rgba_striped(Document *doc, +sp_png_write_rgba_striped(SPDocument *doc, gchar const *filename, unsigned long int width, unsigned long int height, double xdpi, double ydpi, int (* get_rows)(guchar const **rows, int row, int num_rows, void *data), void *data) @@ -388,7 +388,7 @@ hide_other_items_recursively(SPObject *o, GSList *list, unsigned dkey) * * \return true if succeeded (or if no action was taken), false if an error occurred. */ -bool sp_export_png_file (Document *doc, gchar const *filename, +bool sp_export_png_file (SPDocument *doc, gchar const *filename, double x0, double y0, double x1, double y1, unsigned long int width, unsigned long int height, double xdpi, double ydpi, unsigned long bgcolor, @@ -400,7 +400,7 @@ bool sp_export_png_file (Document *doc, gchar const *filename, width, height, xdpi, ydpi, bgcolor, status, data, force_overwrite, items_only); } bool -sp_export_png_file(Document *doc, gchar const *filename, +sp_export_png_file(SPDocument *doc, gchar const *filename, Geom::Rect const &area, unsigned long width, unsigned long height, double xdpi, double ydpi, unsigned long bgcolor, diff --git a/src/helper/png-write.h b/src/helper/png-write.h index f7e372e0b..83321aa4e 100644 --- a/src/helper/png-write.h +++ b/src/helper/png-write.h @@ -14,14 +14,14 @@ #include #include <2geom/forward.h> -struct Document; +struct SPDocument; -bool sp_export_png_file (Document *doc, gchar const *filename, +bool sp_export_png_file (SPDocument *doc, gchar const *filename, double x0, double y0, double x1, double y1, unsigned long int width, unsigned long int height, double xdpi, double ydpi, unsigned long bgcolor, unsigned int (*status) (float, void *), void *data, bool force_overwrite = false, GSList *items_only = NULL); -bool sp_export_png_file (Document *doc, gchar const *filename, +bool sp_export_png_file (SPDocument *doc, gchar const *filename, Geom::Rect const &area, unsigned long int width, unsigned long int height, double xdpi, double ydpi, unsigned long bgcolor, diff --git a/src/helper/stock-items.cpp b/src/helper/stock-items.cpp index 936397480..575197fee 100644 --- a/src/helper/stock-items.cpp +++ b/src/helper/stock-items.cpp @@ -35,9 +35,9 @@ -static SPObject *sp_gradient_load_from_svg(gchar const *name, Document *current_doc); -static SPObject *sp_marker_load_from_svg(gchar const *name, Document *current_doc); -static SPObject *sp_gradient_load_from_svg(gchar const *name, Document *current_doc); +static SPObject *sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc); +static SPObject *sp_marker_load_from_svg(gchar const *name, SPDocument *current_doc); +static SPObject *sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc); // FIXME: these should be merged with the icon loading code so they @@ -45,9 +45,9 @@ static SPObject *sp_gradient_load_from_svg(gchar const *name, Document *current_ // take the dir to look in, and the file to check for, and cache // against that, rather than the existing copy/paste code seen here. -static SPObject * sp_marker_load_from_svg(gchar const *name, Document *current_doc) +static SPObject * sp_marker_load_from_svg(gchar const *name, SPDocument *current_doc) { - static Document *doc = NULL; + static SPDocument *doc = NULL; static unsigned int edoc = FALSE; if (!current_doc) { return NULL; @@ -83,9 +83,9 @@ static SPObject * sp_marker_load_from_svg(gchar const *name, Document *current_d static SPObject * -sp_pattern_load_from_svg(gchar const *name, Document *current_doc) +sp_pattern_load_from_svg(gchar const *name, SPDocument *current_doc) { - static Document *doc = NULL; + static SPDocument *doc = NULL; static unsigned int edoc = FALSE; if (!current_doc) { return NULL; @@ -126,9 +126,9 @@ sp_pattern_load_from_svg(gchar const *name, Document *current_doc) static SPObject * -sp_gradient_load_from_svg(gchar const *name, Document *current_doc) +sp_gradient_load_from_svg(gchar const *name, SPDocument *current_doc) { - static Document *doc = NULL; + static SPDocument *doc = NULL; static unsigned int edoc = FALSE; if (!current_doc) { return NULL; @@ -194,7 +194,7 @@ SPObject *get_stock_item(gchar const *urn) gchar * base = g_strndup(e, a); SPDesktop *desktop = inkscape_active_desktop(); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); SPDefs *defs= (SPDefs *) SP_DOCUMENT_DEFS(doc); SPObject *object = NULL; @@ -263,7 +263,7 @@ SPObject *get_stock_item(gchar const *urn) else { SPDesktop *desktop = inkscape_active_desktop(); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); SPObject *object = doc->getObjectById(urn); return object; diff --git a/src/id-clash.cpp b/src/id-clash.cpp index e739c4e4c..b215576a4 100644 --- a/src/id-clash.cpp +++ b/src/id-clash.cpp @@ -177,7 +177,7 @@ find_references(SPObject *elem, refmap_type *refmap) * a list of those changes that will require fixing up references. */ static void -change_clashing_ids(Document *imported_doc, Document *current_doc, +change_clashing_ids(SPDocument *imported_doc, SPDocument *current_doc, SPObject *elem, const refmap_type *refmap, id_changelist_type *id_changes) { @@ -259,7 +259,7 @@ fix_up_refs(const refmap_type *refmap, const id_changelist_type &id_changes) * those IDs are updated accordingly. */ void -prevent_id_clashes(Document *imported_doc, Document *current_doc) +prevent_id_clashes(SPDocument *imported_doc, SPDocument *current_doc) { refmap_type *refmap = new refmap_type; id_changelist_type id_changes; diff --git a/src/id-clash.h b/src/id-clash.h index 1abd1dd83..418642738 100644 --- a/src/id-clash.h +++ b/src/id-clash.h @@ -3,7 +3,7 @@ #include "document.h" -void prevent_id_clashes(Document *imported_doc, Document *current_doc); +void prevent_id_clashes(SPDocument *imported_doc, SPDocument *current_doc); #endif /* !SEEN_ID_CLASH_H */ diff --git a/src/inkscape-private.h b/src/inkscape-private.h index 001d1201a..cb7f98729 100644 --- a/src/inkscape-private.h +++ b/src/inkscape-private.h @@ -47,8 +47,8 @@ void inkscape_add_desktop (SPDesktop * desktop); void inkscape_remove_desktop (SPDesktop * desktop); void inkscape_activate_desktop (SPDesktop * desktop); void inkscape_reactivate_desktop (SPDesktop * desktop); -void inkscape_add_document (Document *document); -bool inkscape_remove_document (Document *document); +void inkscape_add_document (SPDocument *document); +bool inkscape_remove_document (SPDocument *document); void inkscape_set_color (SPColor *color, float opacity); diff --git a/src/inkscape.cpp b/src/inkscape.cpp index c2c45d3bb..60ab895ed 100644 --- a/src/inkscape.cpp +++ b/src/inkscape.cpp @@ -105,7 +105,7 @@ static void inkscape_deactivate_desktop_private (Inkscape::Application *inkscape struct Inkscape::Application { GObject object; Inkscape::XML::Document *menus; - std::map document_set; + std::map document_set; GSList *desktops; gchar *argv0; gboolean dialogs_toggle; @@ -126,7 +126,7 @@ struct Inkscape::ApplicationClass { void (* set_eventcontext) (Inkscape::Application * inkscape, SPEventContext * eventcontext); void (* activate_desktop) (Inkscape::Application * inkscape, SPDesktop * desktop); void (* deactivate_desktop) (Inkscape::Application * inkscape, SPDesktop * desktop); - void (* destroy_document) (Inkscape::Application *inkscape, Document *doc); + void (* destroy_document) (Inkscape::Application *inkscape, SPDocument *doc); void (* color_set) (Inkscape::Application *inkscape, SPColor *color, double opacity); void (* shut_down) (Inkscape::Application *inkscape); void (* dialogs_hide) (Inkscape::Application *inkscape); @@ -326,11 +326,11 @@ static gint inkscape_autosave(gpointer) gint docnum = 0; SP_ACTIVE_DESKTOP->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Autosaving documents...")); - for (std::map::iterator iter = inkscape->document_set.begin(); + for (std::map::iterator iter = inkscape->document_set.begin(); iter != inkscape->document_set.end(); ++iter) { - Document *doc = iter->first; + SPDocument *doc = iter->first; ++docnum; @@ -463,7 +463,7 @@ inkscape_init (SPObject * object) g_assert_not_reached (); } - new (&inkscape->document_set) std::map(); + new (&inkscape->document_set) std::map(); inkscape->menus = sp_repr_read_mem (_(menus_skeleton), MENUS_SKELETON_SIZE, NULL); inkscape->desktops = NULL; @@ -597,10 +597,10 @@ inkscape_crash_handler (int /*signum*/) gint count = 0; GSList *savednames = NULL; GSList *failednames = NULL; - for (std::map::iterator iter = inkscape->document_set.begin(); + for (std::map::iterator iter = inkscape->document_set.begin(); iter != inkscape->document_set.end(); ++iter) { - Document *doc = iter->first; + SPDocument *doc = iter->first; Inkscape::XML::Node *repr; repr = sp_document_repr_root (doc); if (doc->isModifiedSinceSave()) { @@ -1219,7 +1219,7 @@ inkscape_external_change () * fixme: These need probably signals too */ void -inkscape_add_document (Document *document) +inkscape_add_document (SPDocument *document) { g_return_if_fail (document != NULL); @@ -1228,7 +1228,7 @@ inkscape_add_document (Document *document) // try to insert the pair into the list if (!(inkscape->document_set.insert(std::make_pair(document, 1)).second)) { //insert failed, this key (document) is already in the list - for (std::map::iterator iter = inkscape->document_set.begin(); + for (std::map::iterator iter = inkscape->document_set.begin(); iter != inkscape->document_set.end(); ++iter) { if (iter->first == document) { @@ -1247,13 +1247,13 @@ inkscape_add_document (Document *document) // returns true if this was last reference to this document, so you can delete it bool -inkscape_remove_document (Document *document) +inkscape_remove_document (SPDocument *document) { g_return_val_if_fail (document != NULL, false); if (!Inkscape::NSApplication::Application::getNewGui()) { - for (std::map::iterator iter = inkscape->document_set.begin(); + for (std::map::iterator iter = inkscape->document_set.begin(); iter != inkscape->document_set.end(); ++iter) { if (iter->first == document) { @@ -1290,7 +1290,7 @@ inkscape_active_desktop (void) return (SPDesktop *) inkscape->desktops->data; } -Document * +SPDocument * inkscape_active_document (void) { if (Inkscape::NSApplication::Application::getNewGui()) @@ -1304,13 +1304,13 @@ inkscape_active_document (void) } bool inkscape_is_sole_desktop_for_document(SPDesktop const &desktop) { - Document const* document = desktop.doc(); + SPDocument const* document = desktop.doc(); if (!document) { return false; } for ( GSList *iter = inkscape->desktops ; iter ; iter = iter->next ) { SPDesktop *other_desktop=(SPDesktop *)iter->data; - Document *other_document=other_desktop->doc(); + SPDocument *other_document=other_desktop->doc(); if ( other_document == document && other_desktop != &desktop ) { return false; } diff --git a/src/inkscape.h b/src/inkscape.h index e611af49b..ca2894227 100644 --- a/src/inkscape.h +++ b/src/inkscape.h @@ -16,7 +16,7 @@ #include struct SPDesktop; -struct Document; +struct SPDocument; struct SPEventContext; namespace Inkscape { @@ -46,7 +46,7 @@ Inkscape::Application *inkscape_get_instance(); SPEventContext * inkscape_active_event_context (void); #define SP_ACTIVE_DOCUMENT inkscape_active_document () -Document * inkscape_active_document (void); +SPDocument * inkscape_active_document (void); #define SP_ACTIVE_DESKTOP inkscape_active_desktop () SPDesktop * inkscape_active_desktop (void); diff --git a/src/inkview.cpp b/src/inkview.cpp index 0278d3029..5cfde2c81 100644 --- a/src/inkview.cpp +++ b/src/inkview.cpp @@ -84,7 +84,7 @@ struct SPSlideShow { int size; int length; int current; - Document *doc; + SPDocument *doc; GtkWidget *view; GtkWidget *window; bool fullscreen; @@ -441,7 +441,7 @@ sp_svgview_normal_cursor(struct SPSlideShow *ss) } static void -sp_svgview_set_document(struct SPSlideShow *ss, Document *doc, int current) +sp_svgview_set_document(struct SPSlideShow *ss, SPDocument *doc, int current) { if (doc && doc != ss->doc) { sp_document_ensure_up_to_date (doc); @@ -459,7 +459,7 @@ sp_svgview_show_next (struct SPSlideShow *ss) { sp_svgview_waiting_cursor(ss); - Document *doc = NULL; + SPDocument *doc = NULL; int current = ss->current; while (!doc && (current < ss->length - 1)) { doc = sp_document_new (ss->slides[++current], TRUE, false); @@ -475,7 +475,7 @@ sp_svgview_show_prev (struct SPSlideShow *ss) { sp_svgview_waiting_cursor(ss); - Document *doc = NULL; + SPDocument *doc = NULL; int current = ss->current; while (!doc && (current > 0)) { doc = sp_document_new (ss->slides[--current], TRUE, false); @@ -491,7 +491,7 @@ sp_svgview_goto_first (struct SPSlideShow *ss) { sp_svgview_waiting_cursor(ss); - Document *doc = NULL; + SPDocument *doc = NULL; int current = 0; while ( !doc && (current < ss->length - 1)) { if (current == ss->current) @@ -509,7 +509,7 @@ sp_svgview_goto_last (struct SPSlideShow *ss) { sp_svgview_waiting_cursor(ss); - Document *doc = NULL; + SPDocument *doc = NULL; int current = ss->length - 1; while (!doc && (current >= 0)) { if (current == ss->current) @@ -555,8 +555,8 @@ static void usage() Inkscape::Application *inkscape_get_instance() { return NULL; } void inkscape_ref (void) {} void inkscape_unref (void) {} -void inkscape_add_document (Document *document) {} -void inkscape_remove_document (Document *document) {} +void inkscape_add_document (SPDocument *document) {} +void inkscape_remove_document (SPDocument *document) {} #endif diff --git a/src/interface.cpp b/src/interface.cpp index 475ecdf16..cf7072064 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -271,7 +271,7 @@ sp_create_window(SPViewWidget *vw, gboolean editable) void sp_ui_new_view() { - Document *document; + SPDocument *document; SPViewWidget *dtw; document = SP_ACTIVE_DOCUMENT; @@ -290,7 +290,7 @@ sp_ui_new_view() void sp_ui_new_view_preview() { - Document *document; + SPDocument *document; SPViewWidget *dtw; document = SP_ACTIVE_DOCUMENT; @@ -1125,7 +1125,7 @@ sp_ui_drag_data_received(GtkWidget *widget, guint /*event_time*/, gpointer /*user_data*/) { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; SPDesktop *desktop = SP_ACTIVE_DESKTOP; switch (info) { @@ -1508,7 +1508,7 @@ void sp_ui_drag_motion( GtkWidget */*widget*/, guint /*event_time*/, gpointer /*user_data*/) { -// Document *doc = SP_ACTIVE_DOCUMENT; +// SPDocument *doc = SP_ACTIVE_DOCUMENT; // SPDesktop *desktop = SP_ACTIVE_DESKTOP; @@ -1546,7 +1546,7 @@ sp_ui_import_one_file_with_check(gpointer filename, gpointer /*unused*/) static void sp_ui_import_one_file(char const *filename) { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (!doc) return; if (filename == NULL) return; diff --git a/src/jabber_whiteboard/node-tracker.h b/src/jabber_whiteboard/node-tracker.h index 01087d04e..66814c5ca 100644 --- a/src/jabber_whiteboard/node-tracker.h +++ b/src/jabber_whiteboard/node-tracker.h @@ -168,7 +168,7 @@ public: const Glib::ustring &name); /** - * Returns whether or not the given node is the root node of the Document associated + * Returns whether or not the given node is the root node of the SPDocument associated * with an XMLNodeTracker's SessionManager. * * \param Reference to an XML::Node to test. diff --git a/src/jabber_whiteboard/session-manager.cpp b/src/jabber_whiteboard/session-manager.cpp index b6d236be9..a04ab05f0 100644 --- a/src/jabber_whiteboard/session-manager.cpp +++ b/src/jabber_whiteboard/session-manager.cpp @@ -95,7 +95,7 @@ void SessionManager::initialiseSession(Glib::ustring const& to, State::SessionType type) { - Document* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", type, to); + SPDocument* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", type, to); InkboardDocument* inkdoc = dynamic_cast< InkboardDocument* >(doc->rdoc); if(inkdoc == NULL) return; @@ -317,7 +317,7 @@ SessionManager::checkInvitationQueue() Dialog::DialogReply reply = static_cast< Dialog::DialogReply >(dialog.run()); - Document* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", State::WHITEBOARD_PEER, from); + SPDocument* doc = makeInkboardDocument(g_quark_from_static_string("xml"), "svg:svg", State::WHITEBOARD_PEER, from); InkboardDocument* inkdoc = dynamic_cast< InkboardDocument* >(doc->rdoc); if(inkdoc == NULL) return true; @@ -350,10 +350,10 @@ SessionManager::checkInvitationQueue() //# HELPER FUNCTIONS //######################################################################### -Document* +SPDocument* makeInkboardDocument(int code, gchar const* rootname, State::SessionType type, Glib::ustring const& to) { - Document* doc; + SPDocument* doc; InkboardDocument* rdoc = new InkboardDocument(g_quark_from_static_string("xml"), type, to); rdoc->setAttribute("version", "1.0"); @@ -382,7 +382,7 @@ makeInkboardDocument(int code, gchar const* rootname, State::SessionType type, G // // \see sp_file_new SPDesktop* -makeInkboardDesktop(Document* doc) +makeInkboardDesktop(SPDocument* doc) { SPDesktop* dt; diff --git a/src/jabber_whiteboard/session-manager.h b/src/jabber_whiteboard/session-manager.h index 48e912265..53cc8f5b4 100644 --- a/src/jabber_whiteboard/session-manager.h +++ b/src/jabber_whiteboard/session-manager.h @@ -26,7 +26,7 @@ #include "gc-alloc.h" -class Document; +class SPDocument; class SPDesktop; @@ -118,10 +118,10 @@ private: }; -Document* makeInkboardDocument(int code, gchar const* rootname, +SPDocument* makeInkboardDocument(int code, gchar const* rootname, State::SessionType type, Glib::ustring const& to); -SPDesktop* makeInkboardDesktop(Document* doc); +SPDesktop* makeInkboardDesktop(SPDocument* doc); } // namespace Whiteboard diff --git a/src/layer-fns.cpp b/src/layer-fns.cpp index 2431b0758..75bb89bcf 100644 --- a/src/layer-fns.cpp +++ b/src/layer-fns.cpp @@ -165,7 +165,7 @@ SPObject *previous_layer(SPObject *root, SPObject *layer) { * \pre \a root should be either \a layer or an ancestor of it */ SPObject *create_layer(SPObject *root, SPObject *layer, LayerRelativePosition position) { - Document *document=SP_OBJECT_DOCUMENT(root); + SPDocument *document=SP_OBJECT_DOCUMENT(root); static int layer_suffix=1; gchar *id=NULL; diff --git a/src/layer-manager.cpp b/src/layer-manager.cpp index fe0d41904..8c45c7e53 100644 --- a/src/layer-manager.cpp +++ b/src/layer-manager.cpp @@ -126,12 +126,12 @@ LayerManager::LayerManager(SPDesktop *desktop) { _layer_connection = desktop->connectCurrentLayerChanged( sigc::mem_fun(*this, &LayerManager::_selectedLayerChanged) ); - sigc::bound_mem_functor1 first = sigc::mem_fun(*this, &LayerManager::_setDocument); + sigc::bound_mem_functor1 first = sigc::mem_fun(*this, &LayerManager::_setDocument); // This next line has problems on gcc 4.0.2 - sigc::slot base2 = first; + sigc::slot base2 = first; - sigc::slot slot2 = sigc::hide<0>( base2 ); + sigc::slot slot2 = sigc::hide<0>( base2 ); _document_connection = desktop->connectDocumentReplaced( slot2 ); _setDocument(desktop->doc()); @@ -211,7 +211,7 @@ void LayerManager::renameLayer( SPObject* obj, gchar const *label, bool uniquify -void LayerManager::_setDocument(Document *document) { +void LayerManager::_setDocument(SPDocument *document) { if (_document) { _resource_connection.disconnect(); } diff --git a/src/layer-manager.h b/src/layer-manager.h index bbd5ccafb..81f75e002 100644 --- a/src/layer-manager.h +++ b/src/layer-manager.h @@ -17,7 +17,7 @@ #include class SPDesktop; -class Document; +class SPDocument; namespace Inkscape { @@ -44,7 +44,7 @@ private: class LayerWatcher; void _objectModified( SPObject* obj, guint flags ); - void _setDocument(Document *document); + void _setDocument(SPDocument *document); void _rebuild(); void _selectedLayerChanged(SPObject *layer); @@ -53,7 +53,7 @@ private: sigc::connection _resource_connection; GC::soft_ptr _desktop; - Document *_document; + SPDocument *_document; std::vector _watchers; diff --git a/src/livarot/LivarotDefs.h b/src/livarot/LivarotDefs.h index c34559a29..49f954586 100644 --- a/src/livarot/LivarotDefs.h +++ b/src/livarot/LivarotDefs.h @@ -20,9 +20,9 @@ #ifdef HAVE_INTTYPES_H # include #else -//--tullarisc # ifdef HAVE_STDINT_H +# ifdef HAVE_STDINT_H # include -//# endif +# endif #endif // error codes (mostly obsolete) diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp index f92f7c2ab..de0535448 100644 --- a/src/live_effects/effect.cpp +++ b/src/live_effects/effect.cpp @@ -246,7 +246,7 @@ Effect::New(EffectType lpenr, LivePathEffectObject *lpeobj) } void -Effect::createAndApply(const char* name, Document *doc, SPItem *item) +Effect::createAndApply(const char* name, SPDocument *doc, SPItem *item) { // Path effect definition Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); @@ -263,7 +263,7 @@ Effect::createAndApply(const char* name, Document *doc, SPItem *item) } void -Effect::createAndApply(EffectType type, Document *doc, SPItem *item) +Effect::createAndApply(EffectType type, SPDocument *doc, SPItem *item) { createAndApply(LPETypeConverter.get_key(type).c_str(), doc, item); } @@ -576,7 +576,7 @@ Effect::getRepr() return SP_OBJECT_REPR(lpeobj); } -Document * +SPDocument * Effect::getSPDoc() { if (SP_OBJECT_DOCUMENT(lpeobj) == NULL) g_message("Effect::getSPDoc() returns NULL"); diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h index 461073c3f..6f195b176 100644 --- a/src/live_effects/effect.h +++ b/src/live_effects/effect.h @@ -23,7 +23,7 @@ #define LPE_CONVERSION_TOLERANCE 0.01 // FIXME: find good solution for this. -struct Document; +struct SPDocument; struct SPDesktop; struct SPItem; class SPNodeContext; @@ -56,8 +56,8 @@ enum LPEPathFlashType { class Effect { public: static Effect* New(EffectType lpenr, LivePathEffectObject *lpeobj); - static void createAndApply(const char* name, Document *doc, SPItem *item); - static void createAndApply(EffectType type, Document *doc, SPItem *item); + static void createAndApply(const char* name, SPDocument *doc, SPItem *item); + static void createAndApply(EffectType type, SPDocument *doc, SPItem *item); virtual ~Effect(); @@ -111,7 +111,7 @@ public: Glib::ustring getName(); Inkscape::XML::Node * getRepr(); - Document * getSPDoc(); + SPDocument * getSPDoc(); LivePathEffectObject * getLPEObj() {return lpeobj;}; Parameter * getParameter(const char * key); diff --git a/src/live_effects/lpeobject.cpp b/src/live_effects/lpeobject.cpp index c7ca5e4aa..ec0dee0be 100644 --- a/src/live_effects/lpeobject.cpp +++ b/src/live_effects/lpeobject.cpp @@ -93,7 +93,7 @@ LivePathEffectObject::livepatheffect_init(LivePathEffectObject *lpeobj) * Virtual build: set livepatheffect attributes from its associated XML node. */ void -LivePathEffectObject::livepatheffect_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +LivePathEffectObject::livepatheffect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { #ifdef LIVEPATHEFFECT_VERBOSE g_message("Build livepatheffect"); @@ -250,7 +250,7 @@ LivePathEffectObject * LivePathEffectObject::fork_private_if_necessary(unsigned int nr_of_allowed_users) { if (SP_OBJECT_HREFCOUNT(this) > nr_of_allowed_users) { - Document *doc = SP_OBJECT_DOCUMENT(this); + SPDocument *doc = SP_OBJECT_DOCUMENT(this); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = SP_OBJECT_REPR (this)->duplicate(xml_doc); diff --git a/src/live_effects/lpeobject.h b/src/live_effects/lpeobject.h index 842b84c45..dc631a5c1 100644 --- a/src/live_effects/lpeobject.h +++ b/src/live_effects/lpeobject.h @@ -49,7 +49,7 @@ public: private: static void livepatheffect_class_init(LivePathEffectObjectClass *klass); static void livepatheffect_init(LivePathEffectObject *stop); - static void livepatheffect_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); + static void livepatheffect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void livepatheffect_release(SPObject *object); static void livepatheffect_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *livepatheffect_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); diff --git a/src/lpe-tool-context.cpp b/src/lpe-tool-context.cpp index 5f7cb0277..be465e324 100644 --- a/src/lpe-tool-context.cpp +++ b/src/lpe-tool-context.cpp @@ -422,7 +422,7 @@ lpetool_context_switch_mode(SPLPEToolContext *lc, Inkscape::LivePathEffect::Effe } void -lpetool_get_limiting_bbox_corners(Document *document, Geom::Point &A, Geom::Point &B) { +lpetool_get_limiting_bbox_corners(SPDocument *document, Geom::Point &A, Geom::Point &B) { Geom::Coord w = sp_document_width(document); Geom::Coord h = sp_document_height(document); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); @@ -452,7 +452,7 @@ lpetool_context_reset_limiting_bbox(SPLPEToolContext *lc) if (!prefs->getBool("/tools/lpetool/show_bbox", true)) return; - Document *document = sp_desktop_document(lc->desktop); + SPDocument *document = sp_desktop_document(lc->desktop); Geom::Point A, B; lpetool_get_limiting_bbox_corners(document, A, B); diff --git a/src/lpe-tool-context.h b/src/lpe-tool-context.h index f710e9321..8a52ba97c 100644 --- a/src/lpe-tool-context.h +++ b/src/lpe-tool-context.h @@ -67,7 +67,7 @@ int lpetool_mode_to_index(Inkscape::LivePathEffect::EffectType const type); int lpetool_item_has_construction(SPLPEToolContext *lc, SPItem *item); bool lpetool_try_construction(SPLPEToolContext *lc, Inkscape::LivePathEffect::EffectType const type); void lpetool_context_switch_mode(SPLPEToolContext *lc, Inkscape::LivePathEffect::EffectType const type); -void lpetool_get_limiting_bbox_corners(Document *document, Geom::Point &A, Geom::Point &B); +void lpetool_get_limiting_bbox_corners(SPDocument *document, Geom::Point &A, Geom::Point &B); void lpetool_context_reset_limiting_bbox(SPLPEToolContext *lc); void lpetool_create_measuring_items(SPLPEToolContext *lc, Inkscape::Selection *selection = NULL); void lpetool_delete_measuring_items(SPLPEToolContext *lc); diff --git a/src/main-cmdlineact.cpp b/src/main-cmdlineact.cpp index 6ab192095..dc59e1a93 100644 --- a/src/main-cmdlineact.cpp +++ b/src/main-cmdlineact.cpp @@ -55,7 +55,7 @@ CmdLineAction::doIt (Inkscape::UI::View::View * view) { SPDesktop * desktop = dynamic_cast(view); if (desktop == NULL) { return; } - Document * doc = view->doc(); + SPDocument * doc = view->doc(); SPObject * obj = doc->getObjectById(_arg); if (obj == NULL) { printf(_("Unable to find node ID: '%s'\n"), _arg); diff --git a/src/main.cpp b/src/main.cpp index 64fcb664d..9c33688ed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -165,13 +165,13 @@ enum { int sp_main_gui(int argc, char const **argv); int sp_main_console(int argc, char const **argv); -static void sp_do_export_png(Document *doc); -static void do_export_ps_pdf(Document* doc, gchar const* uri, char const *mime); +static void sp_do_export_png(SPDocument *doc); +static void do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const *mime); #ifdef WIN32 -static void do_export_emf(Document* doc, gchar const* uri, char const *mime); +static void do_export_emf(SPDocument* doc, gchar const* uri, char const *mime); #endif //WIN32 -static void do_query_dimension (Document *doc, bool extent, Geom::Dim2 const axis, const gchar *id); -static void do_query_all (Document *doc); +static void do_query_dimension (SPDocument *doc, bool extent, Geom::Dim2 const axis, const gchar *id); +static void do_query_all (SPDocument *doc); static void do_query_all_recurse (SPObject *o); static gchar *sp_global_printer = NULL; @@ -962,7 +962,7 @@ void sp_process_file_list(GSList *fl) { while (fl) { const gchar *filename = (gchar *)fl->data; - Document *doc = Inkscape::Extension::open(NULL, filename); + SPDocument *doc = Inkscape::Extension::open(NULL, filename); if (doc == NULL) { doc = Inkscape::Extension::open(Inkscape::Extension::db.get(SP_MODULE_KEY_INPUT_SVG), filename); } @@ -1127,7 +1127,7 @@ int sp_main_console(int argc, char const **argv) } static void -do_query_dimension (Document *doc, bool extent, Geom::Dim2 const axis, const gchar *id) +do_query_dimension (SPDocument *doc, bool extent, Geom::Dim2 const axis, const gchar *id) { SPObject *o = NULL; @@ -1167,7 +1167,7 @@ do_query_dimension (Document *doc, bool extent, Geom::Dim2 const axis, const gch } static void -do_query_all (Document *doc) +do_query_all (SPDocument *doc) { SPObject *o = NULL; @@ -1205,7 +1205,7 @@ do_query_all_recurse (SPObject *o) static void -sp_do_export_png(Document *doc) +sp_do_export_png(SPDocument *doc) { const gchar *filename = NULL; gdouble dpi = 0.0; @@ -1417,7 +1417,7 @@ sp_do_export_png(Document *doc) * \param mime MIME type to export as. */ -static void do_export_ps_pdf(Document* doc, gchar const* uri, char const* mime) +static void do_export_ps_pdf(SPDocument* doc, gchar const* uri, char const* mime) { Inkscape::Extension::DB::OutputList o; Inkscape::Extension::db.get_output_list(o); @@ -1507,7 +1507,7 @@ static void do_export_ps_pdf(Document* doc, gchar const* uri, char const* mime) * \param mime MIME type to export as (should be "image/x-emf") */ -static void do_export_emf(Document* doc, gchar const* uri, char const* mime) +static void do_export_emf(SPDocument* doc, gchar const* uri, char const* mime) { Inkscape::Extension::DB::OutputList o; Inkscape::Extension::db.get_output_list(o); diff --git a/src/marker.cpp b/src/marker.cpp index 2efcde1b9..c66acc192 100644 --- a/src/marker.cpp +++ b/src/marker.cpp @@ -43,7 +43,7 @@ struct SPMarkerView { static void sp_marker_class_init (SPMarkerClass *klass); static void sp_marker_init (SPMarker *marker); -static void sp_marker_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_marker_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_marker_release (SPObject *object); static void sp_marker_set (SPObject *object, unsigned int key, const gchar *value); static void sp_marker_update (SPObject *object, SPCtx *ctx, guint flags); @@ -133,7 +133,7 @@ sp_marker_init (SPMarker *marker) * \see sp_object_build() */ static void -sp_marker_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_marker_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPGroup *group; SPMarker *marker; @@ -723,7 +723,7 @@ sp_marker_view_remove (SPMarker *marker, SPMarkerView *view, unsigned int destro } const gchar * -generate_marker (GSList *reprs, Geom::Rect bounds, Document *document, Geom::Matrix /*transform*/, Geom::Matrix move) +generate_marker (GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Matrix /*transform*/, Geom::Matrix move) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document)); diff --git a/src/marker.h b/src/marker.h index 5206a9c89..f2d74a3a6 100644 --- a/src/marker.h +++ b/src/marker.h @@ -89,7 +89,7 @@ NRArenaItem *sp_marker_show_instance (SPMarker *marker, NRArenaItem *parent, unsigned int key, unsigned int pos, Geom::Matrix const &base, float linewidth); void sp_marker_hide (SPMarker *marker, unsigned int key); -const gchar *generate_marker (GSList *reprs, Geom::Rect bounds, Document *document, Geom::Matrix transform, Geom::Matrix move); +const gchar *generate_marker (GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Matrix transform, Geom::Matrix move); #endif diff --git a/src/nodepath.cpp b/src/nodepath.cpp index e2c4f3fa3..f9a615583 100644 --- a/src/nodepath.cpp +++ b/src/nodepath.cpp @@ -2582,7 +2582,7 @@ void sp_node_delete_preserve(GList *nodes_to_delete) //FIXME: a closed path CAN legally have one node, it's only an open one which must be //at least 2 sp_nodepath_get_node_count(nodepath) < 2) { - Document *document = sp_desktop_document (nodepath->desktop); + SPDocument *document = sp_desktop_document (nodepath->desktop); //FIXME: The following line will be wrong when we have mltiple nodepaths: we only want to //delete this nodepath's object, not the entire selection! (though at this time, this //does not matter) @@ -2621,7 +2621,7 @@ void sp_node_selected_delete(Inkscape::NodePath::Path *nodepath) // if the entire nodepath is removed, delete the selected object. if (nodepath->subpaths == NULL || sp_nodepath_get_node_count(nodepath) < 2) { - Document *document = sp_desktop_document (nodepath->desktop); + SPDocument *document = sp_desktop_document (nodepath->desktop); sp_selection_delete(nodepath->desktop); sp_document_done (document, SP_VERB_CONTEXT_NODE, _("Delete nodes")); diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index 3b5cd3136..99ee78ade 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -43,7 +43,7 @@ void sp_selected_path_combine(SPDesktop *desktop) { Inkscape::Selection *selection = sp_desktop_selection(desktop); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); if (g_slist_length((GSList *) selection->itemList()) < 1) { sp_desktop_message_stack(desktop)->flash(Inkscape::WARNING_MESSAGE, _("Select object(s) to combine.")); @@ -328,7 +328,7 @@ sp_item_list_to_curves(const GSList *items, GSList **selected, GSList **to_selec items = items->next) { SPItem *item = SP_ITEM(items->data); - Document *document = item->document; + SPDocument *document = item->document; if (SP_IS_PATH(item) && !SP_PATH(item)->original_curve) { continue; // already a path, and no path effect diff --git a/src/persp3d.cpp b/src/persp3d.cpp index 978a8952c..916e9f25f 100644 --- a/src/persp3d.cpp +++ b/src/persp3d.cpp @@ -26,7 +26,7 @@ static void persp3d_class_init(Persp3DClass *klass); static void persp3d_init(Persp3D *stop); -static void persp3d_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void persp3d_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void persp3d_release(SPObject *object); static void persp3d_set(SPObject *object, unsigned key, gchar const *value); static void persp3d_update(SPObject *object, SPCtx *ctx, guint flags); @@ -103,7 +103,7 @@ persp3d_init(Persp3D *persp) /** * Virtual build: set persp3d attributes from its associated XML node. */ -static void persp3d_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void persp3d_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) persp3d_parent_class)->build) (* ((SPObjectClass *) persp3d_parent_class)->build)(object, document, repr); @@ -201,7 +201,7 @@ persp3d_update(SPObject *object, SPCtx *ctx, guint flags) } Persp3D * -persp3d_create_xml_element (Document *document, Persp3D *dup) {// if dup is given, copy the attributes over +persp3d_create_xml_element (SPDocument *document, Persp3D *dup) {// if dup is given, copy the attributes over SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *repr; @@ -240,7 +240,7 @@ persp3d_create_xml_element (Document *document, Persp3D *dup) {// if dup is give } Persp3D * -persp3d_document_first_persp (Document *document) { +persp3d_document_first_persp (SPDocument *document) { SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); Inkscape::XML::Node *repr; for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) { @@ -653,7 +653,7 @@ persp3d_print_debugging_info (Persp3D *persp) { } void -persp3d_print_debugging_info_all(Document *document) { +persp3d_print_debugging_info_all(SPDocument *document) { SPDefs *defs = (SPDefs *) SP_DOCUMENT_DEFS(document); Inkscape::XML::Node *repr; for (SPObject *child = sp_object_first_child(defs); child != NULL; child = SP_OBJECT_NEXT(child) ) { diff --git a/src/persp3d.h b/src/persp3d.h index cbad0b873..79bec0232 100644 --- a/src/persp3d.h +++ b/src/persp3d.h @@ -35,7 +35,7 @@ struct Persp3D : public SPObject { // Also write the list of boxes into the xml repr and vice versa link boxes to their persp3d? std::vector boxes; std::map* boxes_transformed; // TODO: eventually we should merge this with 'boxes' - Document *document; // should this rather be the SPDesktop? + SPDocument *document; // should this rather be the SPDesktop? // for debugging only int my_counter; @@ -89,15 +89,15 @@ std::list persp3d_list_of_boxes(Persp3D *persp); bool persp3d_perspectives_coincide(const Persp3D *lhs, const Persp3D *rhs); void persp3d_absorb(Persp3D *persp1, Persp3D *persp2); -Persp3D * persp3d_create_xml_element (Document *document, Persp3D *dup = NULL); -Persp3D * persp3d_document_first_persp (Document *document); +Persp3D * persp3d_create_xml_element (SPDocument *document, Persp3D *dup = NULL); +Persp3D * persp3d_document_first_persp (SPDocument *document); bool persp3d_has_all_boxes_in_selection (Persp3D *persp); std::map > persp3d_unselected_boxes(Inkscape::Selection *selection); void persp3d_split_perspectives_according_to_selection(Inkscape::Selection *selection); void persp3d_print_debugging_info (Persp3D *persp); -void persp3d_print_debugging_info_all(Document *doc); +void persp3d_print_debugging_info_all(SPDocument *doc); void persp3d_print_all_selected(); #endif /* __PERSP3D_H__ */ diff --git a/src/print.cpp b/src/print.cpp index 7fbaa53e9..044dffe34 100644 --- a/src/print.cpp +++ b/src/print.cpp @@ -85,7 +85,7 @@ unsigned int sp_print_text(SPPrintContext *ctx, char const *text, Geom::Point p, /* UI */ void -sp_print_preview_document(Document *doc) +sp_print_preview_document(SPDocument *doc) { Inkscape::Extension::Print *mod; unsigned int ret; @@ -122,7 +122,7 @@ sp_print_preview_document(Document *doc) } void -sp_print_document(Gtk::Window& parentWindow, Document *doc) +sp_print_document(Gtk::Window& parentWindow, SPDocument *doc) { sp_document_ensure_up_to_date(doc); @@ -143,7 +143,7 @@ sp_print_document(Gtk::Window& parentWindow, Document *doc) } void -sp_print_document_to_file(Document *doc, gchar const *filename) +sp_print_document_to_file(SPDocument *doc, gchar const *filename) { Inkscape::Extension::Print *mod; SPPrintContext context; diff --git a/src/print.h b/src/print.h index 11efced7b..577a169cf 100644 --- a/src/print.h +++ b/src/print.h @@ -41,9 +41,9 @@ void sp_print_get_param(SPPrintContext *ctx, gchar *name, bool *value); /* UI */ -void sp_print_preview_document(Document *doc); -void sp_print_document(Gtk::Window& parentWindow, Document *doc); -void sp_print_document_to_file(Document *doc, gchar const *filename); +void sp_print_preview_document(SPDocument *doc); +void sp_print_document(Gtk::Window& parentWindow, SPDocument *doc); +void sp_print_document_to_file(SPDocument *doc, gchar const *filename); #endif /* !PRINT_H_INKSCAPE */ diff --git a/src/profile-manager.cpp b/src/profile-manager.cpp index 75fd12e4b..1cd965e39 100644 --- a/src/profile-manager.cpp +++ b/src/profile-manager.cpp @@ -14,7 +14,7 @@ namespace Inkscape { -ProfileManager::ProfileManager(Document *document) : +ProfileManager::ProfileManager(SPDocument *document) : _doc(document), _knownProfiles() { diff --git a/src/profile-manager.h b/src/profile-manager.h index d72ad3dd8..61e22615f 100644 --- a/src/profile-manager.h +++ b/src/profile-manager.h @@ -13,7 +13,7 @@ #include "gc-finalized.h" #include -class Document; +class SPDocument; namespace Inkscape { @@ -23,7 +23,7 @@ class ProfileManager : public DocumentSubset, public GC::Finalized { public: - ProfileManager(Document *document); + ProfileManager(SPDocument *document); ~ProfileManager(); ColorProfile* find(gchar const* name); @@ -34,7 +34,7 @@ private: void _resourcesChanged(); - Document* _doc; + SPDocument* _doc; sigc::connection _resource_connection; std::vector _knownProfiles; }; diff --git a/src/rdf.cpp b/src/rdf.cpp index 5559526f1..f0b174922 100644 --- a/src/rdf.cpp +++ b/src/rdf.cpp @@ -531,7 +531,7 @@ rdf_set_repr_text ( Inkscape::XML::Node * repr, // set document's title element to the RDF title if (!strcmp(entity->name, "title")) { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if(doc && doc->root) doc->root->setTitle(text); } @@ -644,7 +644,7 @@ rdf_set_repr_text ( Inkscape::XML::Node * repr, } Inkscape::XML::Node * -rdf_get_rdf_root_repr ( Document * doc, bool build ) +rdf_get_rdf_root_repr ( SPDocument * doc, bool build ) { g_return_val_if_fail (doc != NULL, NULL); g_return_val_if_fail (doc->rroot != NULL, NULL); @@ -705,7 +705,7 @@ rdf_get_rdf_root_repr ( Document * doc, bool build ) } Inkscape::XML::Node * -rdf_get_xml_repr( Document * doc, gchar const * name, bool build ) +rdf_get_xml_repr( SPDocument * doc, gchar const * name, bool build ) { g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (doc != NULL, NULL); @@ -735,7 +735,7 @@ rdf_get_xml_repr( Document * doc, gchar const * name, bool build ) } Inkscape::XML::Node * -rdf_get_work_repr( Document * doc, gchar const * name, bool build ) +rdf_get_work_repr( SPDocument * doc, gchar const * name, bool build ) { g_return_val_if_fail (name != NULL, NULL); g_return_val_if_fail (doc != NULL, NULL); @@ -771,7 +771,7 @@ rdf_get_work_repr( Document * doc, gchar const * name, bool build ) * */ const gchar * -rdf_get_work_entity(Document * doc, struct rdf_work_entity_t * entity) +rdf_get_work_entity(SPDocument * doc, struct rdf_work_entity_t * entity) { g_return_val_if_fail (doc != NULL, NULL); if ( entity == NULL ) return NULL; @@ -802,7 +802,7 @@ rdf_get_work_entity(Document * doc, struct rdf_work_entity_t * entity) * */ unsigned int -rdf_set_work_entity(Document * doc, struct rdf_work_entity_t * entity, +rdf_set_work_entity(SPDocument * doc, struct rdf_work_entity_t * entity, const gchar * text) { g_return_val_if_fail ( entity != NULL, 0 ); @@ -918,7 +918,7 @@ rdf_match_license(Inkscape::XML::Node const *repr, struct rdf_license_t const *l * */ struct rdf_license_t * -rdf_get_license(Document * document) +rdf_get_license(SPDocument * document) { Inkscape::XML::Node const *repr = rdf_get_xml_repr ( document, XML_TAG_NAME_LICENSE, FALSE ); if (repr) { @@ -942,7 +942,7 @@ rdf_get_license(Document * document) * */ void -rdf_set_license(Document * doc, struct rdf_license_t const * license) +rdf_set_license(SPDocument * doc, struct rdf_license_t const * license) { // drop old license section Inkscape::XML::Node * repr = rdf_get_xml_repr ( doc, XML_TAG_NAME_LICENSE, FALSE ); @@ -981,7 +981,7 @@ struct rdf_entity_default_t rdf_defaults[] = { }; void -rdf_set_defaults ( Document * doc ) +rdf_set_defaults ( SPDocument * doc ) { g_assert ( doc != NULL ); diff --git a/src/rdf.h b/src/rdf.h index 57ae79cb8..a98f5a1e4 100644 --- a/src/rdf.h +++ b/src/rdf.h @@ -94,17 +94,17 @@ struct rdf_t { struct rdf_work_entity_t * rdf_find_entity(gchar const * name); -const gchar * rdf_get_work_entity(Document * doc, +const gchar * rdf_get_work_entity(SPDocument * doc, struct rdf_work_entity_t * entity); -unsigned int rdf_set_work_entity(Document * doc, +unsigned int rdf_set_work_entity(SPDocument * doc, struct rdf_work_entity_t * entity, const gchar * text); -struct rdf_license_t * rdf_get_license(Document * doc); -void rdf_set_license(Document * doc, +struct rdf_license_t * rdf_get_license(SPDocument * doc); +void rdf_set_license(SPDocument * doc, struct rdf_license_t const * license); -void rdf_set_defaults ( Document * doc ); +void rdf_set_defaults ( SPDocument * doc ); #endif // _RDF_H_ diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index 0e2fe43d1..e55bba2a5 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -139,7 +139,7 @@ void sp_selection_copy_impl(GSList const *items, GSList **clip, Inkscape::XML::D g_slist_free((GSList *) sorted_items); } -GSList *sp_selection_paste_impl(Document *doc, SPObject *parent, GSList **clip) +GSList *sp_selection_paste_impl(SPDocument *doc, SPObject *parent, GSList **clip) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); @@ -240,7 +240,7 @@ void sp_selection_duplicate(SPDesktop *desktop, bool suppressDone) if (desktop == NULL) return; - Document *doc = desktop->doc(); + SPDocument *doc = desktop->doc(); Inkscape::XML::Document* xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -326,7 +326,7 @@ void sp_edit_clear_all(SPDesktop *dt) if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); sp_desktop_selection(dt)->clear(); g_return_if_fail(SP_IS_GROUP(dt->currentLayer())); @@ -454,7 +454,7 @@ void sp_selection_group(SPDesktop *desktop) if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -741,7 +741,7 @@ void sp_selection_raise_to_top(SPDesktop *desktop) if (desktop == NULL) return; - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); Inkscape::Selection *selection = sp_desktop_selection(desktop); if (selection->isEmpty()) { @@ -839,7 +839,7 @@ void sp_selection_lower_to_bottom(SPDesktop *desktop) if (desktop == NULL) return; - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); Inkscape::Selection *selection = sp_desktop_selection(desktop); if (selection->isEmpty()) { @@ -882,14 +882,14 @@ void sp_selection_lower_to_bottom(SPDesktop *desktop) } void -sp_undo(SPDesktop *desktop, Document *) +sp_undo(SPDesktop *desktop, SPDocument *) { if (!sp_document_undo(sp_desktop_document(desktop))) desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to undo.")); } void -sp_redo(SPDesktop *desktop, Document *) +sp_redo(SPDesktop *desktop, SPDocument *) { if (!sp_document_redo(sp_desktop_document(desktop))) desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Nothing to redo.")); @@ -1672,7 +1672,7 @@ sp_selection_item_next(SPDesktop *desktop) void sp_selection_item_prev(SPDesktop *desktop) { - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); g_return_if_fail(document != NULL); g_return_if_fail(desktop != NULL); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2114,7 +2114,7 @@ void sp_selection_to_marker(SPDesktop *desktop, bool apply) if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2211,7 +2211,7 @@ void sp_selection_to_guides(SPDesktop *desktop) if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::Selection *selection = sp_desktop_selection(desktop); // we need to copy the list because it gets reset when objects are deleted GSList *items = g_slist_copy((GSList *) selection->itemList()); @@ -2238,7 +2238,7 @@ sp_selection_tile(SPDesktop *desktop, bool apply) if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2342,7 +2342,7 @@ sp_selection_untile(SPDesktop *desktop) if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2457,7 +2457,7 @@ sp_selection_get_export_hints(Inkscape::Selection *selection, char const **filen } void -sp_document_get_export_hints(Document *doc, char const **filename, float *xdpi, float *ydpi) +sp_document_get_export_hints(SPDocument *doc, char const **filename, float *xdpi, float *ydpi) { Inkscape::XML::Node * repr = sp_document_repr_root(doc); gchar const *dpi_string; @@ -2483,7 +2483,7 @@ sp_selection_create_bitmap_copy(SPDesktop *desktop) if (desktop == NULL) return; - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2697,7 +2697,7 @@ sp_selection_set_mask(SPDesktop *desktop, bool apply_clip_path, bool apply_to_la if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2824,7 +2824,7 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path) { if (desktop == NULL) return; - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -2915,7 +2915,7 @@ bool fit_canvas_to_selection(SPDesktop *desktop) { g_return_val_if_fail(desktop != NULL, false); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); g_return_val_if_fail(doc != NULL, false); g_return_val_if_fail(desktop->selection != NULL, false); @@ -2946,7 +2946,7 @@ verb_fit_canvas_to_selection(SPDesktop *const desktop) } bool -fit_canvas_to_drawing(Document *doc) +fit_canvas_to_drawing(SPDocument *doc) { g_return_val_if_fail(doc != NULL, false); @@ -2972,7 +2972,7 @@ verb_fit_canvas_to_drawing(SPDesktop *desktop) void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) { g_return_if_fail(desktop != NULL); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); g_return_if_fail(doc != NULL); g_return_if_fail(desktop->selection != NULL); diff --git a/src/selection-chemistry.h b/src/selection-chemistry.h index 4a8c8901e..67e772a00 100644 --- a/src/selection-chemistry.h +++ b/src/selection-chemistry.h @@ -104,11 +104,11 @@ void sp_selection_edit_clip_or_mask(SPDesktop * dt, bool clip); void scroll_to_show_item(SPDesktop *desktop, SPItem *item); -void sp_undo (SPDesktop *desktop, Document *doc); -void sp_redo (SPDesktop *desktop, Document *doc); +void sp_undo (SPDesktop *desktop, SPDocument *doc); +void sp_redo (SPDesktop *desktop, SPDocument *doc); void sp_selection_get_export_hints (Inkscape::Selection *selection, const char **filename, float *xdpi, float *ydpi); -void sp_document_get_export_hints (Document * doc, const char **filename, float *xdpi, float *ydpi); +void sp_document_get_export_hints (SPDocument * doc, const char **filename, float *xdpi, float *ydpi); void sp_selection_create_bitmap_copy (SPDesktop *desktop); @@ -117,7 +117,7 @@ void sp_selection_unset_mask(SPDesktop *desktop, bool apply_clip_path); bool fit_canvas_to_selection(SPDesktop *); void verb_fit_canvas_to_selection(SPDesktop *); -bool fit_canvas_to_drawing(Document *); +bool fit_canvas_to_drawing(SPDocument *); void verb_fit_canvas_to_drawing(SPDesktop *); void fit_canvas_to_selection_or_drawing(SPDesktop *); diff --git a/src/snap.cpp b/src/snap.cpp index 48f3a8fea..f0769e0a1 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -1092,7 +1092,7 @@ void SnapManager::setup(SPDesktop const *desktop, _guide_to_ignore = guide_to_ignore; } -Document *SnapManager::getDocument() const +SPDocument *SnapManager::getDocument() const { return _named_view->document; } diff --git a/src/snap.h b/src/snap.h index 18820f78e..e621bdb60 100644 --- a/src/snap.h +++ b/src/snap.h @@ -162,7 +162,7 @@ public: SPDesktop const *getDesktop() const {return _desktop;} SPNamedView const *getNamedView() const {return _named_view;} - Document *getDocument() const; + SPDocument *getDocument() const; SPGuide const *getGuideToIgnore() const {return _guide_to_ignore;} bool getSnapIndicator() const {return _snapindicator;} diff --git a/src/sp-anchor.cpp b/src/sp-anchor.cpp index ec1b4e53f..aabefdfdb 100644 --- a/src/sp-anchor.cpp +++ b/src/sp-anchor.cpp @@ -29,7 +29,7 @@ static void sp_anchor_class_init(SPAnchorClass *ac); static void sp_anchor_init(SPAnchor *anchor); -static void sp_anchor_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_anchor_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_anchor_release(SPObject *object); static void sp_anchor_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_anchor_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -83,7 +83,7 @@ static void sp_anchor_init(SPAnchor *anchor) anchor->href = NULL; } -static void sp_anchor_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_anchor_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-animation.cpp b/src/sp-animation.cpp index b5f0e8605..2d9f2e941 100644 --- a/src/sp-animation.cpp +++ b/src/sp-animation.cpp @@ -37,7 +37,7 @@ log_set_attr(char const *const classname, unsigned int const key, char const *co static void sp_animation_class_init(SPAnimationClass *klass); static void sp_animation_init(SPAnimation *animation); -static void sp_animation_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_animation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_animation_release(SPObject *object); static void sp_animation_set(SPObject *object, unsigned int key, gchar const *value); @@ -84,7 +84,7 @@ sp_animation_init(SPAnimation */*animation*/) static void -sp_animation_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_animation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) animation_parent_class)->build) ((SPObjectClass *) animation_parent_class)->build(object, document, repr); @@ -124,7 +124,7 @@ sp_animation_set(SPObject *object, unsigned int key, gchar const *value) static void sp_ianimation_class_init(SPIAnimationClass *klass); static void sp_ianimation_init(SPIAnimation *animation); -static void sp_ianimation_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_ianimation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_ianimation_release(SPObject *object); static void sp_ianimation_set(SPObject *object, unsigned int key, gchar const *value); @@ -171,7 +171,7 @@ sp_ianimation_init(SPIAnimation */*animation*/) static void -sp_ianimation_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_ianimation_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) ianimation_parent_class)->build) ((SPObjectClass *) ianimation_parent_class)->build(object, document, repr); @@ -208,7 +208,7 @@ sp_ianimation_set(SPObject *object, unsigned int key, gchar const *value) static void sp_animate_class_init(SPAnimateClass *klass); static void sp_animate_init(SPAnimate *animate); -static void sp_animate_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_animate_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_animate_release(SPObject *object); static void sp_animate_set(SPObject *object, unsigned int key, gchar const *value); @@ -255,7 +255,7 @@ sp_animate_init(SPAnimate */*animate*/) static void -sp_animate_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_animate_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) animate_parent_class)->build) ((SPObjectClass *) animate_parent_class)->build(object, document, repr); diff --git a/src/sp-clippath.cpp b/src/sp-clippath.cpp index 1dab31e34..4bbabc965 100644 --- a/src/sp-clippath.cpp +++ b/src/sp-clippath.cpp @@ -40,7 +40,7 @@ struct SPClipPathView { static void sp_clippath_class_init(SPClipPathClass *klass); static void sp_clippath_init(SPClipPath *clippath); -static void sp_clippath_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +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); @@ -99,7 +99,7 @@ sp_clippath_init(SPClipPath *cp) } static void -sp_clippath_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_clippath_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build(object, document, repr); @@ -381,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, Document *document, Geom::Matrix const* applyTransform) +sp_clippath_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 d6a4e6f0b..199b29f3b 100644 --- a/src/sp-clippath.h +++ b/src/sp-clippath.h @@ -59,6 +59,6 @@ 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); -const gchar *sp_clippath_create (GSList *reprs, Document *document, Geom::Matrix const* applyTransform); +const gchar *sp_clippath_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform); #endif diff --git a/src/sp-ellipse.cpp b/src/sp-ellipse.cpp index 2847d23e9..ff2e39044 100644 --- a/src/sp-ellipse.cpp +++ b/src/sp-ellipse.cpp @@ -366,7 +366,7 @@ static Inkscape::XML::Node *sp_genericellipse_write(SPObject *object, Inkscape:: static void sp_ellipse_class_init(SPEllipseClass *klass); static void sp_ellipse_init(SPEllipse *ellipse); -static void sp_ellipse_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *sp_ellipse_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_ellipse_set(SPObject *object, unsigned int key, gchar const *value); static gchar *sp_ellipse_description(SPItem *item); @@ -416,7 +416,7 @@ sp_ellipse_init(SPEllipse */*ellipse*/) } static void -sp_ellipse_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_ellipse_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) ellipse_parent_class)->build) (* ((SPObjectClass *) ellipse_parent_class)->build) (object, document, repr); @@ -513,7 +513,7 @@ sp_ellipse_position_set(SPEllipse *ellipse, gdouble x, gdouble y, gdouble rx, gd static void sp_circle_class_init(SPCircleClass *klass); static void sp_circle_init(SPCircle *circle); -static void sp_circle_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *sp_circle_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_circle_set(SPObject *object, unsigned int key, gchar const *value); static gchar *sp_circle_description(SPItem *item); @@ -564,7 +564,7 @@ sp_circle_init(SPCircle */*circle*/) } static void -sp_circle_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_circle_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) circle_parent_class)->build) (* ((SPObjectClass *) circle_parent_class)->build)(object, document, repr); @@ -635,7 +635,7 @@ static gchar *sp_circle_description(SPItem */*item*/) static void sp_arc_class_init(SPArcClass *klass); static void sp_arc_init(SPArc *arc); -static void sp_arc_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *sp_arc_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_arc_set(SPObject *object, unsigned int key, gchar const *value); static void sp_arc_modified(SPObject *object, guint flags); @@ -689,7 +689,7 @@ sp_arc_init(SPArc */*arc*/) } static void -sp_arc_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_arc_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) arc_parent_class)->build) (* ((SPObjectClass *) arc_parent_class)->build) (object, document, repr); diff --git a/src/sp-filter-primitive.cpp b/src/sp-filter-primitive.cpp index e090a27b2..77325c4b1 100644 --- a/src/sp-filter-primitive.cpp +++ b/src/sp-filter-primitive.cpp @@ -32,7 +32,7 @@ static void sp_filter_primitive_class_init(SPFilterPrimitiveClass *klass); static void sp_filter_primitive_init(SPFilterPrimitive *filter_primitive); -static void sp_filter_primitive_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_filter_primitive_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_filter_primitive_release(SPObject *object); static void sp_filter_primitive_set(SPObject *object, unsigned int key, gchar const *value); static void sp_filter_primitive_update(SPObject *object, SPCtx *ctx, guint flags); @@ -93,7 +93,7 @@ sp_filter_primitive_init(SPFilterPrimitive *filter_primitive) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_filter_primitive_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_filter_primitive_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) filter_primitive_parent_class)->build) { ((SPObjectClass *) filter_primitive_parent_class)->build(object, document, repr); diff --git a/src/sp-filter-reference.h b/src/sp-filter-reference.h index 31ef5ef11..216ff1d6f 100644 --- a/src/sp-filter-reference.h +++ b/src/sp-filter-reference.h @@ -8,7 +8,7 @@ class SPObject; class SPFilterReference : public Inkscape::URIReference { public: SPFilterReference(SPObject *obj) : URIReference(obj) {} - SPFilterReference(Document *doc) : URIReference(doc) {} + SPFilterReference(SPDocument *doc) : URIReference(doc) {} SPFilter *getObject() const { return (SPFilter *)URIReference::getObject(); diff --git a/src/sp-filter.cpp b/src/sp-filter.cpp index 7c819af1f..7197c1ec9 100644 --- a/src/sp-filter.cpp +++ b/src/sp-filter.cpp @@ -43,7 +43,7 @@ using std::pair; static void sp_filter_class_init(SPFilterClass *klass); static void sp_filter_init(SPFilter *filter); -static void sp_filter_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_filter_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_filter_release(SPObject *object); static void sp_filter_set(SPObject *object, unsigned int key, gchar const *value); static void sp_filter_update(SPObject *object, SPCtx *ctx, guint flags); @@ -129,7 +129,7 @@ sp_filter_init(SPFilter *filter) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_filter_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_filter_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) filter_parent_class)->build) { ((SPObjectClass *) filter_parent_class)->build(object, document, repr); diff --git a/src/sp-flowdiv.cpp b/src/sp-flowdiv.cpp index 78aab7cb3..6d679701f 100644 --- a/src/sp-flowdiv.cpp +++ b/src/sp-flowdiv.cpp @@ -23,7 +23,7 @@ static void sp_flowdiv_release (SPObject *object); static Inkscape::XML::Node *sp_flowdiv_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_flowdiv_update (SPObject *object, SPCtx *ctx, unsigned int flags); static void sp_flowdiv_modified (SPObject *object, guint flags); -static void sp_flowdiv_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr); +static void sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr); static void sp_flowdiv_set (SPObject *object, unsigned int key, const gchar *value); static void sp_flowtspan_class_init (SPFlowtspanClass *klass); @@ -32,7 +32,7 @@ static void sp_flowtspan_release (SPObject *object); static Inkscape::XML::Node *sp_flowtspan_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_flowtspan_update (SPObject *object, SPCtx *ctx, unsigned int flags); static void sp_flowtspan_modified (SPObject *object, guint flags); -static void sp_flowtspan_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr); +static void sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr); static void sp_flowtspan_set (SPObject *object, unsigned int key, const gchar *value); static void sp_flowpara_class_init (SPFlowparaClass *klass); @@ -41,7 +41,7 @@ static void sp_flowpara_release (SPObject *object); static Inkscape::XML::Node *sp_flowpara_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_flowpara_update (SPObject *object, SPCtx *ctx, unsigned int flags); static void sp_flowpara_modified (SPObject *object, guint flags); -static void sp_flowpara_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr); +static void sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr); static void sp_flowpara_set (SPObject *object, unsigned int key, const gchar *value); static void sp_flowline_class_init (SPFlowlineClass *klass); @@ -177,7 +177,7 @@ sp_flowdiv_modified (SPObject *object, guint flags) } static void -sp_flowdiv_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_flowdiv_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { object->_requireSVGVersion(Inkscape::Version(1, 2)); @@ -354,7 +354,7 @@ sp_flowtspan_modified (SPObject *object, guint flags) } } static void -sp_flowtspan_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_flowtspan_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { if (((SPObjectClass *) flowtspan_parent_class)->build) ((SPObjectClass *) flowtspan_parent_class)->build (object, doc, repr); @@ -525,7 +525,7 @@ sp_flowpara_modified (SPObject *object, guint flags) } } static void -sp_flowpara_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_flowpara_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { if (((SPObjectClass *) flowpara_parent_class)->build) ((SPObjectClass *) flowpara_parent_class)->build (object, doc, repr); diff --git a/src/sp-flowtext.cpp b/src/sp-flowtext.cpp index ff4a2fda5..6af2f7169 100644 --- a/src/sp-flowtext.cpp +++ b/src/sp-flowtext.cpp @@ -43,7 +43,7 @@ static void sp_flowtext_remove_child(SPObject *object, Inkscape::XML::Node *chil static void sp_flowtext_update(SPObject *object, SPCtx *ctx, guint flags); static void sp_flowtext_modified(SPObject *object, guint flags); static Inkscape::XML::Node *sp_flowtext_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); -static void sp_flowtext_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_flowtext_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_flowtext_set(SPObject *object, unsigned key, gchar const *value); static void sp_flowtext_bbox(SPItem const *item, NRRect *bbox, Geom::Matrix const &transform, unsigned const flags); @@ -220,7 +220,7 @@ sp_flowtext_modified(SPObject *object, guint flags) } static void -sp_flowtext_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_flowtext_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { object->_requireSVGVersion(Inkscape::Version(1, 2)); @@ -677,7 +677,7 @@ bool SPFlowtext::has_internal_frame() SPItem *create_flowtext_with_internal_frame (SPDesktop *desktop, Geom::Point p0, Geom::Point p1) { - Document *doc = sp_desktop_document (desktop); + SPDocument *doc = sp_desktop_document (desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *root_repr = xml_doc->createElement("svg:flowRoot"); diff --git a/src/sp-font-face.cpp b/src/sp-font-face.cpp index 166262bc9..1ec6f4601 100644 --- a/src/sp-font-face.cpp +++ b/src/sp-font-face.cpp @@ -295,7 +295,7 @@ static std::vector sp_read_fontFaceStretchType(gchar const static void sp_fontface_class_init(SPFontFaceClass *fc); static void sp_fontface_init(SPFontFace *font); -static void sp_fontface_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_fontface_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_fontface_release(SPObject *object); static void sp_fontface_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_fontface_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -398,7 +398,7 @@ static void sp_fontface_init(SPFontFace *face) */ } -static void sp_fontface_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_fontface_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-font.cpp b/src/sp-font.cpp index c960d0fe9..75fb18638 100644 --- a/src/sp-font.cpp +++ b/src/sp-font.cpp @@ -28,7 +28,7 @@ static void sp_font_class_init(SPFontClass *fc); static void sp_font_init(SPFont *font); -static void sp_font_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_font_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_font_release(SPObject *object); static void sp_font_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_font_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -90,7 +90,7 @@ static void sp_font_init(SPFont *font) font->vert_adv_y = 0; } -static void sp_font_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_font_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-gaussian-blur.cpp b/src/sp-gaussian-blur.cpp index 8544e03fe..e6eab5032 100644 --- a/src/sp-gaussian-blur.cpp +++ b/src/sp-gaussian-blur.cpp @@ -36,7 +36,7 @@ static void sp_gaussianBlur_class_init(SPGaussianBlurClass *klass); static void sp_gaussianBlur_init(SPGaussianBlur *gaussianBlur); -static void sp_gaussianBlur_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_gaussianBlur_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_gaussianBlur_release(SPObject *object); static void sp_gaussianBlur_set(SPObject *object, unsigned int key, gchar const *value); static void sp_gaussianBlur_update(SPObject *object, SPCtx *ctx, guint flags); @@ -94,7 +94,7 @@ sp_gaussianBlur_init(SPGaussianBlur */*gaussianBlur*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_gaussianBlur_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_gaussianBlur_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) gaussianBlur_parent_class)->build) { ((SPObjectClass *) gaussianBlur_parent_class)->build(object, document, repr); diff --git a/src/sp-glyph-kerning.cpp b/src/sp-glyph-kerning.cpp index 7b61f1c3d..6d08f212c 100644 --- a/src/sp-glyph-kerning.cpp +++ b/src/sp-glyph-kerning.cpp @@ -28,7 +28,7 @@ static void sp_glyph_kerning_class_init(SPGlyphKerningClass *gc); static void sp_glyph_kerning_init(SPGlyphKerning *glyph); -static void sp_glyph_kerning_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_glyph_kerning_release(SPObject *object); static void sp_glyph_kerning_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_glyph_kerning_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -105,7 +105,7 @@ static void sp_glyph_kerning_init(SPGlyphKerning *glyph) glyph->k = 0; } -static void sp_glyph_kerning_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_glyph_kerning_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-glyph.cpp b/src/sp-glyph.cpp index 6102954f2..8af78a0aa 100644 --- a/src/sp-glyph.cpp +++ b/src/sp-glyph.cpp @@ -25,7 +25,7 @@ static void sp_glyph_class_init(SPGlyphClass *gc); static void sp_glyph_init(SPGlyph *glyph); -static void sp_glyph_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_glyph_release(SPObject *object); static void sp_glyph_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_glyph_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -85,7 +85,7 @@ static void sp_glyph_init(SPGlyph *glyph) glyph->vert_adv_y = 0; } -static void sp_glyph_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-gradient-test.h b/src/sp-gradient-test.h index 1771b7c3e..bc188401b 100644 --- a/src/sp-gradient-test.h +++ b/src/sp-gradient-test.h @@ -14,7 +14,7 @@ class SPGradientTest : public DocumentUsingTest { public: - Document* _doc; + SPDocument* _doc; SPGradientTest() : _doc(0) diff --git a/src/sp-gradient.cpp b/src/sp-gradient.cpp index c9ceeabf0..84a0a9870 100644 --- a/src/sp-gradient.cpp +++ b/src/sp-gradient.cpp @@ -56,7 +56,7 @@ static void sp_stop_class_init(SPStopClass *klass); static void sp_stop_init(SPStop *stop); -static void sp_stop_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_stop_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_stop_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_stop_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -114,7 +114,7 @@ sp_stop_init(SPStop *stop) /** * Virtual build: set stop attributes from its associated XML node. */ -static void sp_stop_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_stop_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) stop_parent_class)->build) (* ((SPObjectClass *) stop_parent_class)->build)(object, document, repr); @@ -294,7 +294,7 @@ sp_stop_get_color(SPStop const *const stop) static void sp_gradient_class_init(SPGradientClass *klass); static void sp_gradient_init(SPGradient *gr); -static void sp_gradient_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_gradient_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_gradient_release(SPObject *object); static void sp_gradient_set(SPObject *object, unsigned key, gchar const *value); static void sp_gradient_child_added(SPObject *object, @@ -398,7 +398,7 @@ sp_gradient_init(SPGradient *gr) * Virtual build: set gradient attributes from its associated repr. */ static void -sp_gradient_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_gradient_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPGradient *gradient = SP_GRADIENT(object); @@ -1402,7 +1402,7 @@ static void sp_lineargradient_class_init(SPLinearGradientClass *klass); static void sp_lineargradient_init(SPLinearGradient *lg); static void sp_lineargradient_build(SPObject *object, - Document *document, + SPDocument *document, Inkscape::XML::Node *repr); static void sp_lineargradient_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_lineargradient_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, @@ -1474,7 +1474,7 @@ static void sp_lineargradient_init(SPLinearGradient *lg) * Callback: set attributes from associated repr. */ static void sp_lineargradient_build(SPObject *object, - Document *document, + SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) lg_parent_class)->build) @@ -1677,7 +1677,7 @@ static void sp_radialgradient_class_init(SPRadialGradientClass *klass); static void sp_radialgradient_init(SPRadialGradient *rg); static void sp_radialgradient_build(SPObject *object, - Document *document, + SPDocument *document, Inkscape::XML::Node *repr); static void sp_radialgradient_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_radialgradient_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, @@ -1751,7 +1751,7 @@ sp_radialgradient_init(SPRadialGradient *rg) * Set radial gradient attributes from associated repr. */ static void -sp_radialgradient_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_radialgradient_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) rg_parent_class)->build) (* ((SPObjectClass *) rg_parent_class)->build)(object, document, repr); diff --git a/src/sp-guide.cpp b/src/sp-guide.cpp index 170dfa375..f5edf7d97 100644 --- a/src/sp-guide.cpp +++ b/src/sp-guide.cpp @@ -54,7 +54,7 @@ static void sp_guide_init(SPGuide *guide); static void sp_guide_set_property(GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void sp_guide_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_guide_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_guide_release(SPObject *object); static void sp_guide_set(SPObject *object, unsigned int key, const gchar *value); @@ -152,7 +152,7 @@ static void sp_guide_get_property(GObject *object, guint prop_id, GValue *value, } } -static void sp_guide_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_guide_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { (* ((SPObjectClass *) (parent_class))->build)(object, document, repr); @@ -243,7 +243,7 @@ static void sp_guide_set(SPObject *object, unsigned int key, const gchar *value) SPGuide * sp_guide_create(SPDesktop *desktop, Geom::Point const &pt1, Geom::Point const &pt2) { - Document *doc=sp_desktop_document(desktop); + SPDocument *doc=sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = xml_doc->createElement("sodipodi:guide"); @@ -269,7 +269,7 @@ sp_guide_pt_pairs_to_guides(SPDesktop *dt, std::list > pts; Geom::Point A(0, 0); diff --git a/src/sp-image.cpp b/src/sp-image.cpp index 5284bb923..65aad1e2d 100644 --- a/src/sp-image.cpp +++ b/src/sp-image.cpp @@ -69,7 +69,7 @@ static void sp_image_class_init (SPImageClass * klass); static void sp_image_init (SPImage * image); -static void sp_image_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_image_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_image_release (SPObject * object); static void sp_image_set (SPObject *object, unsigned int key, const gchar *value); static void sp_image_update (SPObject *object, SPCtx *ctx, unsigned int flags); @@ -625,7 +625,7 @@ static void sp_image_init( SPImage *image ) } static void -sp_image_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_image_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) { ((SPObjectClass *) parent_class)->build (object, document, repr); @@ -811,7 +811,7 @@ static void sp_image_update (SPObject *object, SPCtx *ctx, unsigned int flags) { SPImage *image = SP_IMAGE(object); - Document *doc = SP_OBJECT_DOCUMENT(object); + SPDocument *doc = SP_OBJECT_DOCUMENT(object); if (((SPObjectClass *) (parent_class))->update) { ((SPObjectClass *) (parent_class))->update (object, ctx, flags); diff --git a/src/sp-item-group.cpp b/src/sp-item-group.cpp index f9570a885..9c19ce75a 100644 --- a/src/sp-item-group.cpp +++ b/src/sp-item-group.cpp @@ -51,7 +51,7 @@ static void sp_group_class_init (SPGroupClass *klass); static void sp_group_init (SPGroup *group); -static void sp_group_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_group_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_group_release(SPObject *object); static void sp_group_dispose(GObject *object); @@ -144,7 +144,7 @@ sp_group_init (SPGroup *group) new (&group->_display_modes) std::map(); } -static void sp_group_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_group_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { sp_object_read_attr(object, "inkscape:groupmode"); @@ -358,7 +358,7 @@ sp_item_group_ungroup (SPGroup *group, GSList **children, bool do_done) g_return_if_fail (group != NULL); g_return_if_fail (SP_IS_GROUP (group)); - Document *doc = SP_OBJECT_DOCUMENT (group); + SPDocument *doc = SP_OBJECT_DOCUMENT (group); SPObject *root = SP_DOCUMENT_ROOT (doc); SPObject *defs = SP_OBJECT (SP_ROOT (root)->defs); diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 16efe677f..662dc1cac 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -83,7 +83,7 @@ static void sp_item_class_init(SPItemClass *klass); static void sp_item_init(SPItem *item); -static void sp_item_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_item_release(SPObject *object); static void sp_item_set(SPObject *object, unsigned key, gchar const *value); static void sp_item_update(SPObject *object, SPCtx *ctx, guint flags); @@ -401,7 +401,7 @@ void SPItem::lowerToBottom() { } static void -sp_item_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { sp_object_read_attr(object, "style"); sp_object_read_attr(object, "transform"); diff --git a/src/sp-line.cpp b/src/sp-line.cpp index 36ac643ec..d0ce32397 100644 --- a/src/sp-line.cpp +++ b/src/sp-line.cpp @@ -28,7 +28,7 @@ static void sp_line_class_init (SPLineClass *klass); static void sp_line_init (SPLine *line); -static void sp_line_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_line_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_line_set (SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_line_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -96,7 +96,7 @@ sp_line_init (SPLine * line) static void -sp_line_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +sp_line_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) { ((SPObjectClass *) parent_class)->build (object, document, repr); diff --git a/src/sp-lpe-item.cpp b/src/sp-lpe-item.cpp index fdf348b78..90e9b2d6d 100644 --- a/src/sp-lpe-item.cpp +++ b/src/sp-lpe-item.cpp @@ -44,7 +44,7 @@ static void sp_lpe_item_class_init(SPLPEItemClass *klass); static void sp_lpe_item_init(SPLPEItem *lpe_item); static void sp_lpe_item_finalize(GObject *object); -static void sp_lpe_item_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_lpe_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_lpe_item_release(SPObject *object); static void sp_lpe_item_set(SPObject *object, unsigned int key, gchar const *value); static void sp_lpe_item_update(SPObject *object, SPCtx *ctx, guint flags); @@ -137,7 +137,7 @@ sp_lpe_item_finalize(GObject *object) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_lpe_item_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_lpe_item_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { sp_object_read_attr(object, "inkscape:path-effect"); diff --git a/src/sp-mask.cpp b/src/sp-mask.cpp index 12876d69a..20cb38297 100644 --- a/src/sp-mask.cpp +++ b/src/sp-mask.cpp @@ -37,7 +37,7 @@ struct SPMaskView { static void sp_mask_class_init (SPMaskClass *klass); static void sp_mask_init (SPMask *mask); -static void sp_mask_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_mask_release (SPObject * object); static void sp_mask_set (SPObject *object, unsigned int key, const gchar *value); static void sp_mask_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); @@ -98,7 +98,7 @@ sp_mask_init (SPMask *mask) } static void -sp_mask_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_mask_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) { ((SPObjectClass *) parent_class)->build (object, document, repr); @@ -270,7 +270,7 @@ sp_mask_write (SPObject *object, Inkscape::XML::Document *xml_doc, Inkscape::XML // Create a mask element (using passed elements), add it to const gchar * -sp_mask_create (GSList *reprs, Document *document, Geom::Matrix const* applyTransform) +sp_mask_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-mask.h b/src/sp-mask.h index 293be8cee..d5bddd332 100644 --- a/src/sp-mask.h +++ b/src/sp-mask.h @@ -60,6 +60,6 @@ void sp_mask_hide (SPMask *mask, unsigned int key); void sp_mask_set_bbox (SPMask *mask, unsigned int key, NRRect *bbox); -const gchar *sp_mask_create (GSList *reprs, Document *document, Geom::Matrix const* applyTransform); +const gchar *sp_mask_create (GSList *reprs, SPDocument *document, Geom::Matrix const* applyTransform); #endif diff --git a/src/sp-metadata.cpp b/src/sp-metadata.cpp index 1b9be0188..920b7d64d 100644 --- a/src/sp-metadata.cpp +++ b/src/sp-metadata.cpp @@ -37,7 +37,7 @@ static void sp_metadata_class_init (SPMetadataClass *klass); static void sp_metadata_init (SPMetadata *metadata); -static void sp_metadata_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_metadata_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_metadata_release (SPObject *object); static void sp_metadata_set (SPObject *object, unsigned int key, const gchar *value); static void sp_metadata_update(SPObject *object, SPCtx *ctx, guint flags); @@ -109,7 +109,7 @@ void strip_ids_recursively(Inkscape::XML::Node *node) { * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_metadata_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_metadata_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { using Inkscape::XML::NodeSiblingIterator; @@ -207,7 +207,7 @@ sp_metadata_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML: * \brief Retrieves the metadata object associated with a document */ SPMetadata * -sp_document_metadata (Document *document) +sp_document_metadata (SPDocument *document) { SPObject *nv; diff --git a/src/sp-metadata.h b/src/sp-metadata.h index 1de463479..82b7c4fc5 100644 --- a/src/sp-metadata.h +++ b/src/sp-metadata.h @@ -33,7 +33,7 @@ struct SPMetadataClass { GType sp_metadata_get_type (void); -SPMetadata * sp_document_metadata (Document *document); +SPMetadata * sp_document_metadata (SPDocument *document); #endif // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 : diff --git a/src/sp-missing-glyph.cpp b/src/sp-missing-glyph.cpp index 4b120717a..ffc29a71e 100644 --- a/src/sp-missing-glyph.cpp +++ b/src/sp-missing-glyph.cpp @@ -25,7 +25,7 @@ static void sp_missing_glyph_class_init(SPMissingGlyphClass *gc); static void sp_missing_glyph_init(SPMissingGlyph *glyph); -static void sp_missing_glyph_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_missing_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_missing_glyph_release(SPObject *object); static void sp_missing_glyph_set(SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_missing_glyph_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -77,7 +77,7 @@ static void sp_missing_glyph_init(SPMissingGlyph *glyph) glyph->vert_adv_y = 0; } -static void sp_missing_glyph_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_missing_glyph_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { ((SPObjectClass *) (parent_class))->build(object, document, repr); diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 4def33f75..47720c5d6 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -46,7 +46,7 @@ static void sp_namedview_class_init(SPNamedViewClass *klass); static void sp_namedview_init(SPNamedView *namedview); -static void sp_namedview_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_namedview_release(SPObject *object); static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *value); static void sp_namedview_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); @@ -120,7 +120,7 @@ static void sp_namedview_init(SPNamedView *nv) new (&nv->snap_manager) SnapManager(nv); } -static void sp_namedview_generate_old_grid(SPNamedView * /*nv*/, Document *document, Inkscape::XML::Node *repr) { +static void sp_namedview_generate_old_grid(SPNamedView * /*nv*/, SPDocument *document, Inkscape::XML::Node *repr) { bool old_grid_settings_present = false; // set old settings @@ -208,7 +208,7 @@ static void sp_namedview_generate_old_grid(SPNamedView * /*nv*/, Document *docum } } -static void sp_namedview_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPNamedView *nv = (SPNamedView *) object; SPObjectGroup *og = (SPObjectGroup *) object; @@ -777,7 +777,7 @@ void sp_namedview_window_from_document(SPDesktop *desktop) void sp_namedview_update_layers_from_document (SPDesktop *desktop) { SPObject *layer = NULL; - Document *document = desktop->doc(); + SPDocument *document = desktop->doc(); SPNamedView *nv = desktop->namedview; if ( nv->default_layer_id != 0 ) { layer = document->getObjectById(g_quark_to_string(nv->default_layer_id)); @@ -878,7 +878,7 @@ static void sp_namedview_show_single_guide(SPGuide* guide, bool show) } } -void sp_namedview_toggle_guides(Document *doc, Inkscape::XML::Node *repr) +void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr) { unsigned int v; unsigned int set = sp_repr_get_boolean(repr, "showguides", &v); @@ -900,7 +900,7 @@ void sp_namedview_show_grids(SPNamedView * namedview, bool show, bool dirty_docu { namedview->grids_visible = show; - Document *doc = SP_OBJECT_DOCUMENT (namedview); + SPDocument *doc = SP_OBJECT_DOCUMENT (namedview); Inkscape::XML::Node *repr = SP_OBJECT_REPR(namedview); bool saved = sp_document_get_undo_sensitive(doc); @@ -966,7 +966,7 @@ static gboolean sp_nv_read_opacity(const gchar *str, guint32 *color) return TRUE; } -SPNamedView *sp_document_namedview(Document *document, const gchar *id) +SPNamedView *sp_document_namedview(SPDocument *document, const gchar *id) { g_return_val_if_fail(document != NULL, NULL); diff --git a/src/sp-namedview.h b/src/sp-namedview.h index 450e80d47..048096d8c 100644 --- a/src/sp-namedview.h +++ b/src/sp-namedview.h @@ -88,13 +88,13 @@ struct SPNamedViewClass { GType sp_namedview_get_type(); -SPNamedView *sp_document_namedview(Document *document, gchar const *name); +SPNamedView *sp_document_namedview(SPDocument *document, gchar const *name); void sp_namedview_window_from_document(SPDesktop *desktop); void sp_namedview_document_from_window(SPDesktop *desktop); void sp_namedview_update_layers_from_document (SPDesktop *desktop); -void sp_namedview_toggle_guides(Document *doc, Inkscape::XML::Node *repr); +void sp_namedview_toggle_guides(SPDocument *doc, Inkscape::XML::Node *repr); void sp_namedview_show_grids(SPNamedView *namedview, bool show, bool dirty_document); Inkscape::CanvasGrid * sp_namedview_get_first_enabled_grid(SPNamedView *namedview); diff --git a/src/sp-object-repr.cpp b/src/sp-object-repr.cpp index 7583049dc..4c3d5196e 100644 --- a/src/sp-object-repr.cpp +++ b/src/sp-object-repr.cpp @@ -94,7 +94,7 @@ static GType name_to_gtype(NameType name_type, gchar const *name); * Construct an SPRoot and all its descendents from the given repr. */ SPObject * -sp_object_repr_build_tree(Document *document, Inkscape::XML::Node *repr) +sp_object_repr_build_tree(SPDocument *document, Inkscape::XML::Node *repr) { g_assert(document != NULL); g_assert(repr != NULL); diff --git a/src/sp-object-repr.h b/src/sp-object-repr.h index 5a6b1772f..f3a80f83c 100644 --- a/src/sp-object-repr.h +++ b/src/sp-object-repr.h @@ -21,7 +21,7 @@ class Node; } -SPObject *sp_object_repr_build_tree (Document *document, Inkscape::XML::Node *repr); +SPObject *sp_object_repr_build_tree (SPDocument *document, Inkscape::XML::Node *repr); GType sp_repr_type_lookup (Inkscape::XML::Node *repr); diff --git a/src/sp-object.cpp b/src/sp-object.cpp index fade379bd..85e8a4e9a 100644 --- a/src/sp-object.cpp +++ b/src/sp-object.cpp @@ -27,7 +27,7 @@ * propagate to the SPRepr layer. This is important for implementation of * the undo stack, animations and other features. * - * SPObjects are bound to the higher-level container Document, which + * SPObjects are bound to the higher-level container SPDocument, which * provides document level functionality such as the undo stack, * dictionary and so on. Source: doc/architecture.txt */ @@ -84,7 +84,7 @@ static void sp_object_remove_child(SPObject *object, Inkscape::XML::Node *child) static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *old_ref, Inkscape::XML::Node *new_ref); static void sp_object_release(SPObject *object); -static void sp_object_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_object_private_set(SPObject *object, unsigned int key, gchar const *value); static Inkscape::XML::Node *sp_object_private_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -783,11 +783,11 @@ static void sp_object_order_changed(SPObject *object, Inkscape::XML::Node *child * the document and repr; implementation then will parse all of the attributes, * generate the children objects and so on. Invoking build on the SPRoot * object results in creation of the whole document tree (this is, what - * Document does after the creation of the XML tree). + * SPDocument does after the creation of the XML tree). * \see sp_object_release() */ static void -sp_object_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_object_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { /* Nothing specific here */ debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object)); @@ -809,7 +809,7 @@ sp_object_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) } void -sp_object_invoke_build(SPObject *object, Document *document, Inkscape::XML::Node *repr, unsigned int cloned) +sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned) { debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object)); @@ -960,7 +960,7 @@ sp_object_private_set(SPObject *object, unsigned int key, gchar const *value) switch (key) { case SP_ATTR_ID: if ( !SP_OBJECT_IS_CLONED(object) && object->repr->type() == Inkscape::XML::ELEMENT_NODE ) { - Document *document=object->document; + SPDocument *document=object->document; SPObject *conflict=NULL; gchar const *new_id = value; diff --git a/src/sp-object.h b/src/sp-object.h index 9a4f8fd4d..bbb8ecbd0 100644 --- a/src/sp-object.h +++ b/src/sp-object.h @@ -149,7 +149,7 @@ struct SPObject : public GObject { SPIXmlSpace xml_space; unsigned int hrefcount; /* number of xlink:href references */ unsigned int _total_hrefcount; /* our hrefcount + total descendants */ - Inkscape::XML::Document *document; /* Document we are part of */ + SPDocument *document; /* Document we are part of */ SPObject *parent; /* Our parent (only one allowed) */ SPObject *children; /* Our children */ SPObject *_last_child; /* Remembered last child */ @@ -429,7 +429,7 @@ struct SPObject : public GObject { /** @brief Updates the object's display immediately * - * This method is called during the idle loop by Document in order to update the object's + * This method is called during the idle loop by SPDocument in order to update the object's * display. * * One additional flag is legal here: @@ -501,7 +501,7 @@ private: struct SPObjectClass { GObjectClass parent_class; - void (* build) (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr); + void (* build) (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr); void (* release) (SPObject *object); /* Virtual handlers of repr signals */ @@ -519,7 +519,7 @@ struct SPObjectClass { /* Modification handler */ void (* modified) (SPObject *object, unsigned int flags); - Inkscape::XML::Node * (* write) (SPObject *object, Inkscape::XML::DocumentTree *doc, Inkscape::XML::Node *repr, unsigned int flags); + Inkscape::XML::Node * (* write) (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, unsigned int flags); }; @@ -536,7 +536,7 @@ inline SPObject *sp_object_first_child(SPObject *parent) { } SPObject *sp_object_get_child_by_repr(SPObject *object, Inkscape::XML::Node *repr); -void sp_object_invoke_build(SPObject *object, Inkscape::XML::Document *document, Inkscape::XML::Node *repr, unsigned int cloned); +void sp_object_invoke_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr, unsigned int cloned); void sp_object_set(SPObject *object, unsigned int key, gchar const *value); diff --git a/src/sp-offset.cpp b/src/sp-offset.cpp index 12e98d5ef..ae0f7bf19 100644 --- a/src/sp-offset.cpp +++ b/src/sp-offset.cpp @@ -42,7 +42,7 @@ #include "xml/repr.h" -class Document; +class SPDocument; #define noOFFSET_VERBOSE @@ -73,7 +73,7 @@ static void sp_offset_class_init (SPOffsetClass * klass); static void sp_offset_init (SPOffset * offset); static void sp_offset_finalize(GObject *obj); -static void sp_offset_build (SPObject * object, Document * document, +static void sp_offset_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static Inkscape::XML::Node *sp_offset_write (SPObject * object, Inkscape::XML::Document *doc, Inkscape::XML::Node * repr, guint flags); @@ -212,7 +212,7 @@ sp_offset_finalize(GObject *obj) * Virtual build: set offset attributes from corresponding repr. */ static void -sp_offset_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_offset_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); diff --git a/src/sp-paint-server.h b/src/sp-paint-server.h index 0402ac3ce..998f1556b 100644 --- a/src/sp-paint-server.h +++ b/src/sp-paint-server.h @@ -63,7 +63,7 @@ SPPainter *sp_painter_free (SPPainter *painter); class SPPaintServerReference : public Inkscape::URIReference { public: SPPaintServerReference (SPObject *obj) : URIReference(obj) {} - SPPaintServerReference (Document *doc) : URIReference(doc) {} + SPPaintServerReference (SPDocument *doc) : URIReference(doc) {} SPPaintServer *getObject() const { return (SPPaintServer *)URIReference::getObject(); } diff --git a/src/sp-path.cpp b/src/sp-path.cpp index b6637e9d1..04ad386d9 100644 --- a/src/sp-path.cpp +++ b/src/sp-path.cpp @@ -56,7 +56,7 @@ static void sp_path_init(SPPath *path); static void sp_path_finalize(GObject *obj); static void sp_path_release(SPObject *object); -static void sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_path_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_path_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -211,7 +211,7 @@ sp_path_finalize(GObject *obj) * fill & style attributes, markers, and CSS properties. */ static void -sp_path_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_path_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { /* Are these calls actually necessary? */ sp_object_read_attr(object, "marker"); diff --git a/src/sp-pattern.cpp b/src/sp-pattern.cpp index 60d2254f7..90af65b97 100644 --- a/src/sp-pattern.cpp +++ b/src/sp-pattern.cpp @@ -64,7 +64,7 @@ struct SPPatPainter { static void sp_pattern_class_init (SPPatternClass *klass); static void sp_pattern_init (SPPattern *gr); -static void sp_pattern_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_pattern_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_pattern_release (SPObject *object); static void sp_pattern_set (SPObject *object, unsigned int key, const gchar *value); static void sp_pattern_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); @@ -151,7 +151,7 @@ sp_pattern_init (SPPattern *pat) } static void -sp_pattern_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_pattern_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) pattern_parent_class)->build) (* ((SPObjectClass *) pattern_parent_class)->build) (object, document, repr); @@ -443,7 +443,7 @@ pattern_users (SPPattern *pattern) SPPattern * pattern_chain (SPPattern *pattern) { - Document *document = SP_OBJECT_DOCUMENT (pattern); + SPDocument *document = SP_OBJECT_DOCUMENT (pattern); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document)); @@ -496,7 +496,7 @@ sp_pattern_transform_multiply (SPPattern *pattern, Geom::Matrix postmul, bool se } const gchar * -pattern_tile (GSList *reprs, Geom::Rect bounds, Document *document, Geom::Matrix transform, Geom::Matrix move) +pattern_tile (GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Matrix transform, Geom::Matrix move) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *defsrepr = SP_OBJECT_REPR (SP_DOCUMENT_DEFS (document)); diff --git a/src/sp-pattern.h b/src/sp-pattern.h index 48c450425..f15285e27 100644 --- a/src/sp-pattern.h +++ b/src/sp-pattern.h @@ -86,7 +86,7 @@ SPPattern *pattern_chain (SPPattern *pattern); SPPattern *sp_pattern_clone_if_necessary (SPItem *item, SPPattern *pattern, const gchar *property); void sp_pattern_transform_multiply (SPPattern *pattern, Geom::Matrix postmul, bool set); -const gchar *pattern_tile (GSList *reprs, Geom::Rect bounds, Document *document, Geom::Matrix transform, Geom::Matrix move); +const gchar *pattern_tile (GSList *reprs, Geom::Rect bounds, SPDocument *document, Geom::Matrix transform, Geom::Matrix move); SPPattern *pattern_getroot (SPPattern *pat); diff --git a/src/sp-polygon.cpp b/src/sp-polygon.cpp index 0f9003f34..014c68c9b 100644 --- a/src/sp-polygon.cpp +++ b/src/sp-polygon.cpp @@ -29,7 +29,7 @@ static void sp_polygon_class_init(SPPolygonClass *pc); static void sp_polygon_init(SPPolygon *polygon); -static void sp_polygon_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_polygon_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *sp_polygon_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static gchar *sp_polygon_description(SPItem *item); @@ -78,7 +78,7 @@ static void sp_polygon_init(SPPolygon */*polygon*/) /* Nothing here */ } -static void sp_polygon_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +static void sp_polygon_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) { ((SPObjectClass *) parent_class)->build(object, document, repr); diff --git a/src/sp-polyline.cpp b/src/sp-polyline.cpp index ff7951992..08f446d61 100644 --- a/src/sp-polyline.cpp +++ b/src/sp-polyline.cpp @@ -23,7 +23,7 @@ static void sp_polyline_class_init (SPPolyLineClass *klass); static void sp_polyline_init (SPPolyLine *polyline); -static void sp_polyline_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_polyline_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_polyline_set (SPObject *object, unsigned int key, const gchar *value); static Inkscape::XML::Node *sp_polyline_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -81,7 +81,7 @@ sp_polyline_init (SPPolyLine * /*polyline*/) } static void -sp_polyline_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +sp_polyline_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) diff --git a/src/sp-rect.cpp b/src/sp-rect.cpp index 6e4b515c0..aa026abb3 100644 --- a/src/sp-rect.cpp +++ b/src/sp-rect.cpp @@ -36,7 +36,7 @@ static void sp_rect_class_init(SPRectClass *klass); static void sp_rect_init(SPRect *rect); -static void sp_rect_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_rect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_rect_set(SPObject *object, unsigned key, gchar const *value); static void sp_rect_update(SPObject *object, SPCtx *ctx, guint flags); static Inkscape::XML::Node *sp_rect_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -108,7 +108,7 @@ sp_rect_init(SPRect */*rect*/) } static void -sp_rect_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_rect_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build(object, document, repr); diff --git a/src/sp-root.cpp b/src/sp-root.cpp index e06405df5..bd935074d 100644 --- a/src/sp-root.cpp +++ b/src/sp-root.cpp @@ -41,7 +41,7 @@ class SPDesktop; static void sp_root_class_init(SPRootClass *klass); static void sp_root_init(SPRoot *root); -static void sp_root_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_root_release(SPObject *object); static void sp_root_set(SPObject *object, unsigned int key, gchar const *value); static void sp_root_child_added(SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); @@ -141,7 +141,7 @@ sp_root_init(SPRoot *root) * It then calls the object's parent class object's build function. */ static void -sp_root_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_root_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPGroup *group = (SPGroup *) object; SPRoot *root = (SPRoot *) object; diff --git a/src/sp-script.cpp b/src/sp-script.cpp index d495ac51f..a40132450 100644 --- a/src/sp-script.cpp +++ b/src/sp-script.cpp @@ -23,7 +23,7 @@ static void sp_script_release(SPObject *object); static void sp_script_update(SPObject *object, SPCtx *ctx, guint flags); static void sp_script_modified(SPObject *object, guint flags); static void sp_script_set(SPObject *object, unsigned int key, gchar const *value); -static void sp_script_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_script_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static Inkscape::XML::Node *sp_script_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static SPObjectClass *parent_class; @@ -76,7 +76,7 @@ static void sp_script_init(SPScript */*script*/) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_script_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_script_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) { ((SPObjectClass *) parent_class)->build(object, document, repr); diff --git a/src/sp-shape.cpp b/src/sp-shape.cpp index 638d2b040..e7ded6303 100644 --- a/src/sp-shape.cpp +++ b/src/sp-shape.cpp @@ -56,7 +56,7 @@ static void sp_shape_class_init (SPShapeClass *klass); static void sp_shape_init (SPShape *shape); static void sp_shape_finalize (GObject *object); -static void sp_shape_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_shape_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_shape_release (SPObject *object); static void sp_shape_set(SPObject *object, unsigned key, gchar const *value); @@ -169,7 +169,7 @@ sp_shape_finalize (GObject *object) * \see sp_object_build() */ static void -sp_shape_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_shape_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) (parent_class))->build) { (*((SPObjectClass *) (parent_class))->build) (object, document, repr); diff --git a/src/sp-skeleton.cpp b/src/sp-skeleton.cpp index b92f738db..ec6c9b437 100644 --- a/src/sp-skeleton.cpp +++ b/src/sp-skeleton.cpp @@ -44,7 +44,7 @@ static void sp_skeleton_class_init(SPSkeletonClass *klass); static void sp_skeleton_init(SPSkeleton *skeleton); -static void sp_skeleton_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_skeleton_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_skeleton_release(SPObject *object); static void sp_skeleton_set(SPObject *object, unsigned int key, gchar const *value); static void sp_skeleton_update(SPObject *object, SPCtx *ctx, guint flags); @@ -100,7 +100,7 @@ sp_skeleton_init(SPSkeleton *skeleton) * sp-object-repr.cpp's repr_name_entries array. */ static void -sp_skeleton_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_skeleton_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { debug("0x%p",object); if (((SPObjectClass *) skeleton_parent_class)->build) { diff --git a/src/sp-spiral.cpp b/src/sp-spiral.cpp index f0f95fb9c..71906fcc0 100644 --- a/src/sp-spiral.cpp +++ b/src/sp-spiral.cpp @@ -30,7 +30,7 @@ static void sp_spiral_class_init (SPSpiralClass *klass); static void sp_spiral_init (SPSpiral *spiral); -static void sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static Inkscape::XML::Node *sp_spiral_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_spiral_set (SPObject *object, unsigned int key, const gchar *value); static void sp_spiral_update (SPObject *object, SPCtx *ctx, guint flags); @@ -123,7 +123,7 @@ sp_spiral_init (SPSpiral * spiral) * Virtual build: set spiral properties from corresponding repr. */ static void -sp_spiral_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +sp_spiral_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); diff --git a/src/sp-star.cpp b/src/sp-star.cpp index 88b24aa77..71c9ad1c7 100644 --- a/src/sp-star.cpp +++ b/src/sp-star.cpp @@ -33,7 +33,7 @@ static void sp_star_class_init (SPStarClass *klass); static void sp_star_init (SPStar *star); -static void sp_star_build (SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static Inkscape::XML::Node *sp_star_write (SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); static void sp_star_set (SPObject *object, unsigned int key, const gchar *value); static void sp_star_update (SPObject *object, SPCtx *ctx, guint flags); @@ -111,7 +111,7 @@ sp_star_init (SPStar * star) } static void -sp_star_build (SPObject * object, Document * document, Inkscape::XML::Node * repr) +sp_star_build (SPObject * object, SPDocument * document, Inkscape::XML::Node * repr) { if (((SPObjectClass *) parent_class)->build) ((SPObjectClass *) parent_class)->build (object, document, repr); diff --git a/src/sp-string.cpp b/src/sp-string.cpp index a1a974310..871338ad5 100644 --- a/src/sp-string.cpp +++ b/src/sp-string.cpp @@ -40,7 +40,7 @@ static void sp_string_class_init(SPStringClass *classname); static void sp_string_init(SPString *string); -static void sp_string_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_string_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_string_release(SPObject *object); static void sp_string_read_content(SPObject *object); static void sp_string_update(SPObject *object, SPCtx *ctx, unsigned flags); @@ -91,7 +91,7 @@ sp_string_init(SPString *string) } static void -sp_string_build(SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_string_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { sp_string_read_content(object); diff --git a/src/sp-style-elem-test.h b/src/sp-style-elem-test.h index 75e2d450c..6e24ee28c 100644 --- a/src/sp-style-elem-test.h +++ b/src/sp-style-elem-test.h @@ -12,7 +12,7 @@ class SPStyleElemTest : public CxxTest::TestSuite { public: - Document* _doc; + SPDocument* _doc; SPStyleElemTest() : _doc(0) diff --git a/src/sp-style-elem.cpp b/src/sp-style-elem.cpp index 1becc4221..46c311920 100644 --- a/src/sp-style-elem.cpp +++ b/src/sp-style-elem.cpp @@ -9,7 +9,7 @@ using Inkscape::XML::TEXT_NODE; static void sp_style_elem_init(SPStyleElem *style_elem); static void sp_style_elem_class_init(SPStyleElemClass *klass); -static void sp_style_elem_build(SPObject *object, Document *doc, Inkscape::XML::Node *repr); +static void sp_style_elem_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr); static void sp_style_elem_set(SPObject *object, unsigned const key, gchar const *const value); static void sp_style_elem_read_content(SPObject *); static Inkscape::XML::Node *sp_style_elem_write(SPObject *, Inkscape::XML::Document *, Inkscape::XML::Node *, guint flags); @@ -385,7 +385,7 @@ rec_add_listener(Inkscape::XML::Node &repr, } static void -sp_style_elem_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_style_elem_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { sp_style_elem_read_content(object); diff --git a/src/sp-symbol.cpp b/src/sp-symbol.cpp index 8b176fb0a..41004db6e 100644 --- a/src/sp-symbol.cpp +++ b/src/sp-symbol.cpp @@ -31,7 +31,7 @@ static void sp_symbol_class_init (SPSymbolClass *klass); static void sp_symbol_init (SPSymbol *symbol); -static void sp_symbol_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_symbol_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_symbol_release (SPObject *object); static void sp_symbol_set (SPObject *object, unsigned int key, const gchar *value); static void sp_symbol_child_added (SPObject *object, Inkscape::XML::Node *child, Inkscape::XML::Node *ref); @@ -102,7 +102,7 @@ sp_symbol_init (SPSymbol *symbol) } static void -sp_symbol_build (SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_symbol_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { SPGroup *group; SPSymbol *symbol; diff --git a/src/sp-text.cpp b/src/sp-text.cpp index 325b3b381..61947311c 100644 --- a/src/sp-text.cpp +++ b/src/sp-text.cpp @@ -62,7 +62,7 @@ static void sp_text_class_init (SPTextClass *classname); static void sp_text_init (SPText *text); static void sp_text_release (SPObject *object); -static void sp_text_build (SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_text_build (SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_text_set (SPObject *object, unsigned key, gchar const *value); static void sp_text_child_added (SPObject *object, Inkscape::XML::Node *rch, Inkscape::XML::Node *ref); static void sp_text_remove_child (SPObject *object, Inkscape::XML::Node *rch); @@ -147,7 +147,7 @@ sp_text_release (SPObject *object) } static void -sp_text_build (SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_text_build (SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { sp_object_read_attr(object, "x"); sp_object_read_attr(object, "y"); diff --git a/src/sp-tref.cpp b/src/sp-tref.cpp index 5323cde84..83f9ecfa6 100644 --- a/src/sp-tref.cpp +++ b/src/sp-tref.cpp @@ -58,7 +58,7 @@ static void sp_tref_class_init(SPTRefClass *tref_class); static void sp_tref_init(SPTRef *tref); static void sp_tref_finalize(GObject *obj); -static void sp_tref_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_tref_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_tref_release(SPObject *object); static void sp_tref_set(SPObject *object, unsigned int key, gchar const *value); static void sp_tref_update(SPObject *object, SPCtx *ctx, guint flags); @@ -148,7 +148,7 @@ sp_tref_finalize(GObject *obj) * Reads the Inkscape::XML::Node, and initializes SPTRef variables. */ static void -sp_tref_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_tref_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) tref_parent_class)->build) { ((SPObjectClass *) tref_parent_class)->build(object, document, repr); @@ -585,7 +585,7 @@ sp_tref_convert_to_tspan(SPObject *obj) Inkscape::XML::Node *tref_repr = SP_OBJECT_REPR(tref); Inkscape::XML::Node *tref_parent = sp_repr_parent(tref_repr); - Document *document = SP_OBJECT(tref)->document; + SPDocument *document = SP_OBJECT(tref)->document; Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); Inkscape::XML::Node *new_tspan_repr = xml_doc->createElement("svg:tspan"); diff --git a/src/sp-tspan.cpp b/src/sp-tspan.cpp index a35ceae72..89a86218e 100644 --- a/src/sp-tspan.cpp +++ b/src/sp-tspan.cpp @@ -52,7 +52,7 @@ static void sp_tspan_class_init(SPTSpanClass *classname); static void sp_tspan_init(SPTSpan *tspan); -static void sp_tspan_build(SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_tspan_build(SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_tspan_release(SPObject *object); static void sp_tspan_set(SPObject *object, unsigned key, gchar const *value); static void sp_tspan_update(SPObject *object, SPCtx *ctx, guint flags); @@ -129,7 +129,7 @@ sp_tspan_release(SPObject *object) } static void -sp_tspan_build(SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_tspan_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { //SPTSpan *tspan = SP_TSPAN(object); @@ -293,7 +293,7 @@ static void sp_textpath_class_init(SPTextPathClass *classname); static void sp_textpath_init(SPTextPath *textpath); static void sp_textpath_finalize(GObject *obj); -static void sp_textpath_build(SPObject * object, Document * document, Inkscape::XML::Node * repr); +static void sp_textpath_build(SPObject * object, SPDocument * document, Inkscape::XML::Node * repr); static void sp_textpath_release(SPObject *object); static void sp_textpath_set(SPObject *object, unsigned key, gchar const *value); static void sp_textpath_update(SPObject *object, SPCtx *ctx, guint flags); @@ -388,7 +388,7 @@ sp_textpath_release(SPObject *object) } static void -sp_textpath_build(SPObject *object, Document *doc, Inkscape::XML::Node *repr) +sp_textpath_build(SPObject *object, SPDocument *doc, Inkscape::XML::Node *repr) { //SPTextPath *textpath = SP_TEXTPATH(object); diff --git a/src/sp-use.cpp b/src/sp-use.cpp index 5e3c7ee10..76930086c 100644 --- a/src/sp-use.cpp +++ b/src/sp-use.cpp @@ -44,7 +44,7 @@ static void sp_use_class_init(SPUseClass *classname); static void sp_use_init(SPUse *use); static void sp_use_finalize(GObject *obj); -static void sp_use_build(SPObject *object, Document *document, Inkscape::XML::Node *repr); +static void sp_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr); static void sp_use_release(SPObject *object); static void sp_use_set(SPObject *object, unsigned key, gchar const *value); static Inkscape::XML::Node *sp_use_write(SPObject *object, Inkscape::XML::Document *doc, Inkscape::XML::Node *repr, guint flags); @@ -154,7 +154,7 @@ sp_use_finalize(GObject *obj) } static void -sp_use_build(SPObject *object, Document *document, Inkscape::XML::Node *repr) +sp_use_build(SPObject *object, SPDocument *document, Inkscape::XML::Node *repr) { if (((SPObjectClass *) parent_class)->build) { (* ((SPObjectClass *) parent_class)->build)(object, document, repr); @@ -666,7 +666,7 @@ sp_use_unlink(SPUse *use) if (!repr) return NULL; Inkscape::XML::Node *parent = sp_repr_parent(repr); - Document *document = SP_OBJECT(use)->document; + SPDocument *document = SP_OBJECT(use)->document; Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); // Track the ultimate source of a chain of uses. diff --git a/src/splivarot.cpp b/src/splivarot.cpp index 87f3dd890..feba2cab6 100644 --- a/src/splivarot.cpp +++ b/src/splivarot.cpp @@ -602,7 +602,7 @@ sp_selected_path_boolop(SPDesktop *desktop, bool_op bop, const unsigned int verb static void sp_selected_path_outline_add_marker( SPObject *marker_object, Geom::Matrix marker_transform, Geom::Scale stroke_scale, Geom::Matrix transform, - Inkscape::XML::Node *g_repr, Inkscape::XML::Document *xml_doc, Document * doc ) + Inkscape::XML::Node *g_repr, Inkscape::XML::Document *xml_doc, SPDocument * doc ) { SPMarker* marker = SP_MARKER (marker_object); SPItem* marker_item = sp_item_first_item_child (SP_OBJECT (marker_object)); @@ -813,7 +813,7 @@ sp_selected_path_outline(SPDesktop *desktop) if (res->descr_cmd.size() > 1) { // if there's 0 or 1 node left, drop this path altogether - Document * doc = sp_desktop_document(desktop); + SPDocument * doc = sp_desktop_document(desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *repr = xml_doc->createElement("svg:path"); diff --git a/src/style-test.h b/src/style-test.h index 7ebbf08be..a2d5fcf24 100644 --- a/src/style-test.h +++ b/src/style-test.h @@ -11,7 +11,7 @@ class StyleTest : public CxxTest::TestSuite { public: - Document* _doc; + SPDocument* _doc; StyleTest() : _doc(0) diff --git a/src/style.cpp b/src/style.cpp index e564aa60b..dd8169282 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -84,10 +84,10 @@ static void sp_style_read_istring(SPIString *val, gchar const *str); static void sp_style_read_ilength(SPILength *val, gchar const *str); static void sp_style_read_ilengthornormal(SPILengthOrNormal *val, gchar const *str); static void sp_style_read_itextdecoration(SPITextDecoration *val, gchar const *str); -static void sp_style_read_icolor(SPIPaint *paint, gchar const *str, SPStyle *style, Document *document); -static void sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, Document *document); +static void sp_style_read_icolor(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocument *document); +static void sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocument *document); static void sp_style_read_ifontsize(SPIFontSize *val, gchar const *str); -static void sp_style_read_ifilter(gchar const *str, SPStyle *style, Document *document); +static void sp_style_read_ifilter(gchar const *str, SPStyle *style, SPDocument *document); static void sp_style_read_penum(SPIEnum *val, Inkscape::XML::Node *repr, gchar const *key, SPStyleEnum const *dict, bool can_explicitly_inherit); static void sp_style_read_plength(SPILength *val, Inkscape::XML::Node *repr, gchar const *key); @@ -443,7 +443,7 @@ sp_style_stroke_paint_server_ref_changed(SPObject *old_ref, SPObject *ref, SPSty * Returns a new SPStyle object with settings as per sp_style_clear(). */ SPStyle * -sp_style_new(Document *document) +sp_style_new(SPDocument *document) { SPStyle *const style = g_new0(SPStyle, 1); @@ -1086,7 +1086,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val) break; } case SP_PROP_MARKER: - /* TODO: Call sp_uri_reference_resolve(Document *document, guchar const *uri) */ + /* TODO: Call sp_uri_reference_resolve(SPDocument *document, guchar const *uri) */ /* style->marker[SP_MARKER_LOC] = g_quark_from_string(val); */ if (!style->marker[SP_MARKER_LOC].set) { g_free(style->marker[SP_MARKER_LOC].value); @@ -1097,7 +1097,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val) break; case SP_PROP_MARKER_START: - /* TODO: Call sp_uri_reference_resolve(Document *document, guchar const *uri) */ + /* TODO: Call sp_uri_reference_resolve(SPDocument *document, guchar const *uri) */ if (!style->marker[SP_MARKER_LOC_START].set) { g_free(style->marker[SP_MARKER_LOC_START].value); style->marker[SP_MARKER_LOC_START].value = g_strdup(val); @@ -1106,7 +1106,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val) } break; case SP_PROP_MARKER_MID: - /* TODO: Call sp_uri_reference_resolve(Document *document, guchar const *uri) */ + /* TODO: Call sp_uri_reference_resolve(SPDocument *document, guchar const *uri) */ if (!style->marker[SP_MARKER_LOC_MID].set) { g_free(style->marker[SP_MARKER_LOC_MID].value); style->marker[SP_MARKER_LOC_MID].value = g_strdup(val); @@ -1115,7 +1115,7 @@ sp_style_merge_property(SPStyle *style, gint id, gchar const *val) } break; case SP_PROP_MARKER_END: - /* TODO: Call sp_uri_reference_resolve(Document *document, guchar const *uri) */ + /* TODO: Call sp_uri_reference_resolve(SPDocument *document, guchar const *uri) */ if (!style->marker[SP_MARKER_LOC_END].set) { g_free(style->marker[SP_MARKER_LOC_END].value); style->marker[SP_MARKER_LOC_END].value = g_strdup(val); @@ -2111,7 +2111,7 @@ sp_style_merge_from_dying_parent(SPStyle *const style, SPStyle const *const pare static void -sp_style_set_ipaint_to_uri(SPStyle *style, SPIPaint *paint, const Inkscape::URI *uri, Document *document) +sp_style_set_ipaint_to_uri(SPStyle *style, SPIPaint *paint, const Inkscape::URI *uri, SPDocument *document) { // it may be that this style's SPIPaint has not yet created its URIReference; // now that we have a document, we can create it here @@ -2561,7 +2561,7 @@ sp_style_clear(SPStyle *style) /** \todo fixme: Do that text manipulation via parents */ SPObject *object = style->object; - Document *document = style->document; + SPDocument *document = style->document; gint const refcount = style->refcount; SPTextStyle *text = style->text; unsigned const text_private = style->text_private; @@ -3089,7 +3089,7 @@ sp_style_read_itextdecoration(SPITextDecoration *val, gchar const *str) * \param document Ignored */ static void -sp_style_read_icolor(SPIPaint *paint, gchar const *str, SPStyle *style, Document *document) +sp_style_read_icolor(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocument *document) { (void)style; // TODO (void)document; // TODO @@ -3114,7 +3114,7 @@ sp_style_read_icolor(SPIPaint *paint, gchar const *str, SPStyle *style, Document * \pre paint == \&style.fill || paint == \&style.stroke. */ static void -sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, Document *document) +sp_style_read_ipaint(SPIPaint *paint, gchar const *str, SPStyle *style, SPDocument *document) { while (g_ascii_isspace(*str)) { ++str; @@ -3248,7 +3248,7 @@ sp_style_read_ifontsize(SPIFontSize *val, gchar const *str) * Set SPIFilter object from string. */ static void -sp_style_read_ifilter(gchar const *str, SPStyle * style, Document *document) +sp_style_read_ifilter(gchar const *str, SPStyle * style, SPDocument *document) { SPIFilter *f = &(style->filter); /* Try all possible values: inherit, none, uri */ diff --git a/src/style.h b/src/style.h index 87d427547..d5ccc4901 100644 --- a/src/style.h +++ b/src/style.h @@ -243,7 +243,7 @@ struct SPStyle { /** Object we are attached to */ SPObject *object; /** Document we are associated with */ - Document *document; + SPDocument *document; /** Our text style component */ SPTextStyle *text; @@ -372,7 +372,7 @@ struct SPStyle { const gchar *getStrokeURI() {if (stroke.value.href) return stroke.value.href->getURI()->toString(); else return NULL;} }; -SPStyle *sp_style_new(Document *document); +SPStyle *sp_style_new(SPDocument *document); SPStyle *sp_style_new_from_object(SPObject *object); diff --git a/src/svg-view-widget.cpp b/src/svg-view-widget.cpp index 5c33075c9..10d997656 100644 --- a/src/svg-view-widget.cpp +++ b/src/svg-view-widget.cpp @@ -205,7 +205,7 @@ sp_svg_view_widget_view_resized (SPViewWidget *vw, Inkscape::UI::View::View */*v * Constructs new SPSVGSPViewWidget object and returns pointer to it. */ GtkWidget * -sp_svg_view_widget_new (Document *doc) +sp_svg_view_widget_new (SPDocument *doc) { GtkWidget *widget; diff --git a/src/svg-view-widget.h b/src/svg-view-widget.h index 9f6410f67..cd609b07a 100644 --- a/src/svg-view-widget.h +++ b/src/svg-view-widget.h @@ -16,7 +16,7 @@ #include "display/display-forward.h" #include "ui/view/view-widget.h" -class Document; +class SPDocument; class SPSVGSPViewWidget; class SPSVGSPViewWidgetClass; @@ -28,7 +28,7 @@ class SPSVGSPViewWidgetClass; GtkType sp_svg_view_widget_get_type (void); -GtkWidget *sp_svg_view_widget_new (Document *doc); +GtkWidget *sp_svg_view_widget_new (SPDocument *doc); void sp_svg_view_widget_set_resize (SPSVGSPViewWidget *vw, bool resize, gdouble width, gdouble height); diff --git a/src/svg-view.cpp b/src/svg-view.cpp index 35a51cfcd..bd46dd17a 100644 --- a/src/svg-view.cpp +++ b/src/svg-view.cpp @@ -188,7 +188,7 @@ arena_handler (SPCanvasArena */*arena*/, NRArenaItem *ai, GdkEvent *event, SPSVG * Callback connected with set_document signal. */ void -SPSVGView::setDocument (Document *document) +SPSVGView::setDocument (SPDocument *document) { if (doc()) { sp_item_invoke_hide (SP_ITEM (sp_document_root (doc())), _dkey); diff --git a/src/svg-view.h b/src/svg-view.h index ab59ca417..838a95b03 100644 --- a/src/svg-view.h +++ b/src/svg-view.h @@ -47,7 +47,7 @@ public: void doRescale (bool event); - virtual void setDocument (Document*); + virtual void setDocument (SPDocument*); virtual void mouseover(); virtual void mouseout(); virtual bool shutdown() { return true; } diff --git a/src/test-helpers.h b/src/test-helpers.h index 3eacb7d13..8dba0c942 100644 --- a/src/test-helpers.h +++ b/src/test-helpers.h @@ -32,7 +32,7 @@ T* createSuiteAndDocument( void (*fun)(T*&) ) static_cast(g_object_new(inkscape_get_type(), NULL)); } - Document* tmp = sp_document_new( NULL, TRUE, true ); + SPDocument* tmp = sp_document_new( NULL, TRUE, true ); if ( tmp ) { fun( suite ); if ( suite ) diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 61960086a..f574b69fb 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -301,7 +301,7 @@ text_flow_into_shape() if (!desktop) return; - Document *doc = sp_desktop_document (desktop); + SPDocument *doc = sp_desktop_document (desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); @@ -393,7 +393,7 @@ text_unflow () if (!desktop) return; - Document *doc = sp_desktop_document (desktop); + SPDocument *doc = sp_desktop_document (desktop); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); Inkscape::Selection *selection = sp_desktop_selection(desktop); diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index 9afadbeaf..e2bd0e9f5 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -442,7 +442,7 @@ void Tracer::traceThread() engine = NULL; return; } - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; sp_document_ensure_up_to_date(doc); diff --git a/src/tweak-context.cpp b/src/tweak-context.cpp index 692e22112..3f55d040b 100644 --- a/src/tweak-context.cpp +++ b/src/tweak-context.cpp @@ -415,7 +415,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P GSList *items = g_slist_prepend (NULL, item); GSList *selected = NULL; GSList *to_select = NULL; - Document *doc = SP_OBJECT_DOCUMENT(item); + SPDocument *doc = SP_OBJECT_DOCUMENT(item); sp_item_list_to_curves (items, &selected, &to_select); g_slist_free (items); SPObject* newObj = doc->getObjectByRepr((Inkscape::XML::Node *) to_select->data); @@ -524,7 +524,7 @@ sp_tweak_dilate_recursive (Inkscape::Selection *selection, SPItem *item, Geom::P SP_OBJECT(item)->deleteObject(true, true); sp_object_unref(SP_OBJECT(item), NULL); } else { // duplicate - Document *doc = SP_OBJECT_DOCUMENT(item); + SPDocument *doc = SP_OBJECT_DOCUMENT(item); Inkscape::XML::Document* xml_doc = sp_document_repr_doc(doc); Inkscape::XML::Node *old_repr = SP_OBJECT_REPR(item); SPObject *old_obj = doc->getObjectByRepr(old_repr); diff --git a/src/ui/clipboard.cpp b/src/ui/clipboard.cpp index e7e8a29dc..7e41006be 100644 --- a/src/ui/clipboard.cpp +++ b/src/ui/clipboard.cpp @@ -126,13 +126,13 @@ private: void _copyTextPath(SPTextPath *); Inkscape::XML::Node *_copyNode(Inkscape::XML::Node *, Inkscape::XML::Document *, Inkscape::XML::Node *); - void _pasteDocument(Document *, bool in_place); - void _pasteDefs(Document *); + void _pasteDocument(SPDocument *, bool in_place); + void _pasteDefs(SPDocument *); bool _pasteImage(); bool _pasteText(); SPCSSAttr *_parseColor(const Glib::ustring &); void _applyPathEffect(SPItem *, gchar const *); - Document *_retrieveClipboard(Glib::ustring = ""); + SPDocument *_retrieveClipboard(Glib::ustring = ""); // clipboard callbacks void _onGet(Gtk::SelectionData &, guint); @@ -149,7 +149,7 @@ private: void _userWarn(SPDesktop *, char const *); // private properites - Document *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it + SPDocument *_clipboardSPDoc; ///< Document that stores the clipboard until someone requests it Inkscape::XML::Node *_defs; ///< Reference to the clipboard document's defs node Inkscape::XML::Node *_root; ///< Reference to the clipboard's root node Inkscape::XML::Node *_clipnode; ///< The node that holds extra information @@ -311,7 +311,7 @@ bool ClipboardManagerImpl::paste(bool in_place) if ( target == CLIPBOARD_TEXT_TARGET ) return _pasteText(); // otherwise, use the import extensions - Document *tempdoc = _retrieveClipboard(target); + SPDocument *tempdoc = _retrieveClipboard(target); if ( tempdoc == NULL ) { _userWarn(desktop, _("Nothing on the clipboard.")); return false; @@ -328,7 +328,7 @@ bool ClipboardManagerImpl::paste(bool in_place) */ const gchar *ClipboardManagerImpl::getFirstObjectID() { - Document *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); + SPDocument *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); if ( tempdoc == NULL ) { return NULL; } @@ -373,7 +373,7 @@ bool ClipboardManagerImpl::pasteStyle() return false; } - Document *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); + SPDocument *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); if ( tempdoc == NULL ) { // no document, but we can try _text_style if (_text_style) { @@ -425,7 +425,7 @@ bool ClipboardManagerImpl::pasteSize(bool separately, bool apply_x, bool apply_y } // FIXME: actually, this should accept arbitrary documents - Document *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); + SPDocument *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); if ( tempdoc == NULL ) { _userWarn(desktop, _("No size on the clipboard.")); return false; @@ -482,7 +482,7 @@ bool ClipboardManagerImpl::pastePathEffect() return false; } - Document *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); + SPDocument *tempdoc = _retrieveClipboard("image/x-inkscape-svg"); if ( tempdoc ) { Inkscape::XML::Node *root = sp_document_repr_root(tempdoc); Inkscape::XML::Node *clipnode = sp_repr_lookup_name(root, "inkscape:clipboard", 1); @@ -513,7 +513,7 @@ bool ClipboardManagerImpl::pastePathEffect() */ Glib::ustring ClipboardManagerImpl::getPathParameter() { - Document *tempdoc = _retrieveClipboard(); // any target will do here + SPDocument *tempdoc = _retrieveClipboard(); // any target will do here if ( tempdoc == NULL ) { _userWarn(SP_ACTIVE_DESKTOP, _("Nothing on the clipboard.")); return ""; @@ -537,7 +537,7 @@ Glib::ustring ClipboardManagerImpl::getPathParameter() */ Glib::ustring ClipboardManagerImpl::getShapeOrTextObjectId() { - Document *tempdoc = _retrieveClipboard(); // any target will do here + SPDocument *tempdoc = _retrieveClipboard(); // any target will do here if ( tempdoc == NULL ) { _userWarn(SP_ACTIVE_DESKTOP, _("Nothing on the clipboard.")); return ""; @@ -769,10 +769,10 @@ Inkscape::XML::Node *ClipboardManagerImpl::_copyNode(Inkscape::XML::Node *node, * @param in_place Whether to paste the selection where it was when copied * @pre @c clipdoc is not empty and items can be added to the current layer */ -void ClipboardManagerImpl::_pasteDocument(Document *clipdoc, bool in_place) +void ClipboardManagerImpl::_pasteDocument(SPDocument *clipdoc, bool in_place) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Document *target_document = sp_desktop_document(desktop); + SPDocument *target_document = sp_desktop_document(desktop); Inkscape::XML::Node *root = sp_document_repr_root(clipdoc), *target_parent = SP_OBJECT_REPR(desktop->currentLayer()); @@ -839,11 +839,11 @@ void ClipboardManagerImpl::_pasteDocument(Document *clipdoc, bool in_place) * @param clipdoc The document to paste * @pre @c clipdoc != NULL and pasting into the active document is possible */ -void ClipboardManagerImpl::_pasteDefs(Document *clipdoc) +void ClipboardManagerImpl::_pasteDefs(SPDocument *clipdoc) { // boilerplate vars copied from _pasteDocument SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Document *target_document = sp_desktop_document(desktop); + SPDocument *target_document = sp_desktop_document(desktop); Inkscape::XML::Node *root = sp_document_repr_root(clipdoc), *defs = sp_repr_lookup_name(root, "svg:defs", 1), @@ -863,7 +863,7 @@ void ClipboardManagerImpl::_pasteDefs(Document *clipdoc) */ bool ClipboardManagerImpl::_pasteImage() { - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if ( doc == NULL ) return false; // retrieve image data @@ -993,9 +993,9 @@ void ClipboardManagerImpl::_applyPathEffect(SPItem *item, gchar const *effect) /** * @brief Retrieve the clipboard contents as a document - * @return Clipboard contents converted to Document, or NULL if no suitable content was present + * @return Clipboard contents converted to SPDocument, or NULL if no suitable content was present */ -Document *ClipboardManagerImpl::_retrieveClipboard(Glib::ustring required_target) +SPDocument *ClipboardManagerImpl::_retrieveClipboard(Glib::ustring required_target) { Glib::ustring best_target; if ( required_target == "" ) @@ -1061,7 +1061,7 @@ Document *ClipboardManagerImpl::_retrieveClipboard(Glib::ustring required_target if ( in == inlist.end() ) return NULL; // this shouldn't happen unless _getBestTarget returns something bogus - Document *tempdoc = NULL; + SPDocument *tempdoc = NULL; try { tempdoc = (*in)->open(filename); } catch (...) { diff --git a/src/ui/clipboard.h b/src/ui/clipboard.h index 467888ed7..54c05ac0d 100644 --- a/src/ui/clipboard.h +++ b/src/ui/clipboard.h @@ -31,7 +31,7 @@ namespace UI { * @brief System-wide clipboard manager * * ClipboardManager takes care of manipulating the system clipboard in response - * to user actions. It holds a complete Document as the contents. This document + * to user actions. It holds a complete SPDocument as the contents. This document * is exported using output extensions when other applications request data. * Copying to another instance of Inkscape is special-cased, because of the extra * data required (i.e. style, size, Live Path Effects parameters, etc.) diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index af6a0c516..025bec37a 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -147,7 +147,7 @@ Gtk::Widget *build_splash_widget() { // should be in UTF-*8.. char *about=g_build_filename(INKSCAPE_SCREENSDIR, _("about.svg"), NULL); - Document *doc=sp_document_new (about, TRUE); + SPDocument *doc=sp_document_new (about, TRUE); g_free(about); g_return_val_if_fail(doc != NULL, NULL); diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp index f69d80fe5..96cad1fbe 100644 --- a/src/ui/dialog/document-metadata.cpp +++ b/src/ui/dialog/document-metadata.cpp @@ -207,7 +207,7 @@ DocumentMetadata::update() } void -DocumentMetadata::_handleDocumentReplaced(SPDesktop* desktop, Document *) +DocumentMetadata::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *) { Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(desktop)); repr->addListener (&_repr_events, this); diff --git a/src/ui/dialog/document-metadata.h b/src/ui/dialog/document-metadata.h index 2bc94836b..7f718e9f7 100644 --- a/src/ui/dialog/document-metadata.h +++ b/src/ui/dialog/document-metadata.h @@ -49,7 +49,7 @@ protected: void build_metadata(); void init(); - void _handleDocumentReplaced(SPDesktop* desktop, Document *document); + void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document); void _handleActivateDesktop(Inkscape::Application *application, SPDesktop *desktop); void _handleDeactivateDesktop(Inkscape::Application *application, SPDesktop *desktop); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 0e928a9eb..423778276 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -851,7 +851,7 @@ DocumentProperties::on_response (int id) } void -DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, Document *document) +DocumentProperties::_handleDocumentReplaced(SPDesktop* desktop, SPDocument *document) { Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(desktop)); repr->addListener(&_repr_events, this); @@ -915,7 +915,7 @@ DocumentProperties::onNewGrid() { SPDesktop *dt = getDesktop(); Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt)); - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); Glib::ustring typestring = _grids_combo_gridtype.get_active_text(); CanvasGrid::writeNewGridToRepr(repr, doc, CanvasGrid::getGridTypeFromName(typestring.c_str())); diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index 5aa8d446d..136ae2c89 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -70,7 +70,7 @@ protected: void removeExternalScript(); void scripting_create_popup_menu(Gtk::Widget& parent, sigc::slot rem); - void _handleDocumentReplaced(SPDesktop* desktop, Document *document); + void _handleDocumentReplaced(SPDesktop* desktop, SPDocument *document); void _handleActivateDesktop(Inkscape::Application *application, SPDesktop *desktop); void _handleDeactivateDesktop(Inkscape::Application *application, SPDesktop *desktop); diff --git a/src/ui/dialog/filedialogimpl-gtkmm.cpp b/src/ui/dialog/filedialogimpl-gtkmm.cpp index 30a7e7c2a..70f2f2ae5 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.cpp +++ b/src/ui/dialog/filedialogimpl-gtkmm.cpp @@ -120,7 +120,7 @@ findExpanderWidgets(Gtk::Container *parent, ### SVG Preview Widget #########################################################################*/ -bool SVGPreview::setDocument(Document *doc) +bool SVGPreview::setDocument(SPDocument *doc) { if (document) sp_document_unref(document); @@ -151,7 +151,7 @@ bool SVGPreview::setFileName(Glib::ustring &theFileName) * I don't know why passing false to keepalive is bad. But it * prevents the display of an svg with a non-ascii filename */ - Document *doc = sp_document_new (fileName.c_str(), true); + SPDocument *doc = sp_document_new (fileName.c_str(), true); if (!doc) { g_warning("SVGView: error loading document '%s'\n", fileName.c_str()); return false; @@ -172,7 +172,7 @@ bool SVGPreview::setFromMem(char const *xmlBuffer) return false; gint len = (gint)strlen(xmlBuffer); - Document *doc = sp_document_new_from_mem(xmlBuffer, len, 0); + SPDocument *doc = sp_document_new_from_mem(xmlBuffer, len, 0); if (!doc) { g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer); return false; diff --git a/src/ui/dialog/filedialogimpl-gtkmm.h b/src/ui/dialog/filedialogimpl-gtkmm.h index bd0477b30..90dddce59 100644 --- a/src/ui/dialog/filedialogimpl-gtkmm.h +++ b/src/ui/dialog/filedialogimpl-gtkmm.h @@ -99,7 +99,7 @@ public: ~SVGPreview(); - bool setDocument(Document *doc); + bool setDocument(SPDocument *doc); bool setFileName(Glib::ustring &fileName); @@ -128,7 +128,7 @@ private: /** * The svg document we are currently showing */ - Document *document; + SPDocument *document; /** * The sp_svg_view widget diff --git a/src/ui/dialog/filedialogimpl-win32.cpp b/src/ui/dialog/filedialogimpl-win32.cpp index 4a2cc879d..0d8f0de5f 100644 --- a/src/ui/dialog/filedialogimpl-win32.cpp +++ b/src/ui/dialog/filedialogimpl-win32.cpp @@ -887,7 +887,7 @@ bool FileOpenDialogImplWin32::set_svg_preview() gchar *utf8string = g_utf16_to_utf8((const gunichar2*)_path_string, _MAX_PATH, NULL, NULL, NULL); - Document *svgDoc = sp_document_new (utf8string, true); + SPDocument *svgDoc = sp_document_new (utf8string, true); g_free(utf8string); // Check the document loaded properly diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index 026af2c9f..baf46970a 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1222,7 +1222,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri if(iter) { SPDesktop *desktop = _dialog.getDesktop(); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); SPFilter* filter = (*iter)[_columns.filter]; Inkscape::Selection *sel = sp_desktop_selection(desktop); @@ -1255,7 +1255,7 @@ void FilterEffectsDialog::FilterModifier::on_selection_toggled(const Glib::ustri void FilterEffectsDialog::FilterModifier::update_filters() { SPDesktop* desktop = _dialog.getDesktop(); - Document* document = sp_desktop_document(desktop); + SPDocument* document = sp_desktop_document(desktop); const GSList* filters = sp_document_get_resource_list(document, "filter"); _model->clear(); @@ -1310,7 +1310,7 @@ void FilterEffectsDialog::FilterModifier::filter_list_button_release(GdkEventBut void FilterEffectsDialog::FilterModifier::add_filter() { - Document* doc = sp_desktop_document(_dialog.getDesktop()); + SPDocument* doc = sp_desktop_document(_dialog.getDesktop()); SPFilter* filter = new_filter(doc); const int count = _model->children().size(); @@ -1330,7 +1330,7 @@ void FilterEffectsDialog::FilterModifier::remove_filter() SPFilter *filter = get_selected_filter(); if(filter) { - Document* doc = filter->document; + SPDocument* doc = filter->document; sp_repr_unparent(filter->repr); sp_document_done(doc, SP_VERB_DIALOG_FILTER_EFFECTS, _("Remove filter")); diff --git a/src/ui/dialog/filter-effects-dialog.h b/src/ui/dialog/filter-effects-dialog.h index 28c714905..3fb9a46fb 100644 --- a/src/ui/dialog/filter-effects-dialog.h +++ b/src/ui/dialog/filter-effects-dialog.h @@ -88,7 +88,7 @@ private: static void on_activate_desktop(Application*, SPDesktop*, FilterModifier*); static void on_deactivate_desktop(Application*, SPDesktop*, FilterModifier*); - void on_document_replaced(SPDesktop*, Document*) + void on_document_replaced(SPDesktop*, SPDocument*) { update_filters(); } diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index 2d7f7cb5b..3a7964ba2 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -119,7 +119,7 @@ void GuidelinePropertiesDialog::_onOK() void GuidelinePropertiesDialog::_onDelete() { - Document *doc = SP_OBJECT_DOCUMENT(_guide); + SPDocument *doc = SP_OBJECT_DOCUMENT(_guide); sp_guide_remove(_guide); sp_document_done(doc, SP_VERB_NONE, _("Delete guide")); diff --git a/src/ui/dialog/icon-preview.cpp b/src/ui/dialog/icon-preview.cpp index 1490e5b73..336afc3c5 100644 --- a/src/ui/dialog/icon-preview.cpp +++ b/src/ui/dialog/icon-preview.cpp @@ -36,7 +36,7 @@ extern "C" { // takes doc, root, icon, and icon name to produce pixels guchar * -sp_icon_doc_icon( Document *doc, NRArenaItem *root, +sp_icon_doc_icon( SPDocument *doc, NRArenaItem *root, const gchar *name, unsigned int psize ); } @@ -247,7 +247,7 @@ void IconPreviewPanel::modeToggled() void IconPreviewPanel::renderPreview( SPObject* obj ) { - Document * doc = SP_OBJECT_DOCUMENT(obj); + SPDocument * doc = SP_OBJECT_DOCUMENT(obj); gchar * id = SP_OBJECT_ID(obj); // g_message(" setting up to render '%s' as the icon", id ); diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp index 0298042ef..fa47ad88d 100644 --- a/src/ui/dialog/layers.cpp +++ b/src/ui/dialog/layers.cpp @@ -349,7 +349,7 @@ bool LayersPanel::_checkForSelected(const Gtk::TreePath &path, const Gtk::TreeIt void LayersPanel::_layersChanged() { // g_message("_layersChanged()"); - Document* document = _desktop->doc(); + SPDocument* document = _desktop->doc(); SPObject* root = document->root; if ( root ) { _selectedConnection.block(); @@ -366,7 +366,7 @@ void LayersPanel::_layersChanged() } } -void LayersPanel::_addLayer( Document* doc, SPObject* layer, Gtk::TreeModel::Row* parentRow, SPObject* target, int level ) +void LayersPanel::_addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::Row* parentRow, SPObject* target, int level ) { if ( layer && (level < _maxNestDepth) ) { unsigned int counter = _mgr->childCount(layer); diff --git a/src/ui/dialog/layers.h b/src/ui/dialog/layers.h index c5f945437..16b3be350 100644 --- a/src/ui/dialog/layers.h +++ b/src/ui/dialog/layers.h @@ -86,7 +86,7 @@ private: bool _checkForSelected(const Gtk::TreePath& path, const Gtk::TreeIter& iter, SPObject* layer); void _layersChanged(); - void _addLayer( Document* doc, SPObject* layer, Gtk::TreeModel::Row* parentRow, SPObject* target, int level ); + void _addLayer( SPDocument* doc, SPObject* layer, Gtk::TreeModel::Row* parentRow, SPObject* target, int level ); SPObject* _selectedLayer(); diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index bea8a096e..dd2dc8250 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -357,7 +357,7 @@ LivePathEffectEditor::onApply() if ( sel && !sel->isEmpty() ) { SPItem *item = sel->singleItem(); if ( item && SP_IS_LPE_ITEM(item) ) { - Document *doc = current_desktop->doc(); + SPDocument *doc = current_desktop->doc(); const Util::EnumData* data = combo_effecttype.get_active_data(); if (!data) return; diff --git a/src/ui/dialog/panel-dialog.h b/src/ui/dialog/panel-dialog.h index 5fc4a9134..7dbb6dd4a 100644 --- a/src/ui/dialog/panel-dialog.h +++ b/src/ui/dialog/panel-dialog.h @@ -50,7 +50,7 @@ protected: static_cast(data)->_propagateDesktopActivated(application, desktop); } - inline virtual void _propagateDocumentReplaced(SPDesktop* desktop, Document *document); + inline virtual void _propagateDocumentReplaced(SPDesktop* desktop, SPDocument *document); inline virtual void _propagateDesktopActivated(Inkscape::Application *, SPDesktop *); inline virtual void _propagateDesktopDeactivated(Inkscape::Application *, SPDesktop *); @@ -106,7 +106,7 @@ private: void -PanelDialogBase::_propagateDocumentReplaced(SPDesktop *desktop, Document *document) +PanelDialogBase::_propagateDocumentReplaced(SPDesktop *desktop, SPDocument *document) { _panel.signalDocumentReplaced().emit(desktop, document); } diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp index 198495f74..d15773ecb 100644 --- a/src/ui/dialog/print.cpp +++ b/src/ui/dialog/print.cpp @@ -148,7 +148,7 @@ namespace Inkscape { namespace UI { namespace Dialog { -Print::Print(Document *doc, SPItem *base) : +Print::Print(SPDocument *doc, SPItem *base) : _doc (doc), _base (base) { diff --git a/src/ui/dialog/print.h b/src/ui/dialog/print.h index e8904d744..ea89ebdf2 100644 --- a/src/ui/dialog/print.h +++ b/src/ui/dialog/print.h @@ -30,7 +30,7 @@ */ struct workaround_gtkmm { - Document *_doc; + SPDocument *_doc; SPItem *_base; Inkscape::UI::Widget::RenderingOptions *_tab; }; @@ -41,14 +41,14 @@ namespace Dialog { class Print { public: - Print(Document *doc, SPItem *base); + Print(SPDocument *doc, SPItem *base); Gtk::PrintOperationResult run(Gtk::PrintOperationAction, Gtk::Window &parent_window); protected: private: GtkPrintOperation *_printop; - Document *_doc; + SPDocument *_doc; SPItem *_base; Inkscape::UI::Widget::RenderingOptions _tab; diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 64ea07877..5f86196b1 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -161,7 +161,7 @@ void GlyphComboBox::update(SPFont* spfont){ void SvgFontsDialog::on_kerning_value_changed(){ if (!this->kerning_pair) return; - Document* document = sp_desktop_document(this->getDesktop()); + SPDocument* document = sp_desktop_document(this->getDesktop()); //TODO: I am unsure whether this is the correct way of calling sp_document_maybe_done Glib::ustring undokey = "svgfonts:hkern:k:"; @@ -242,7 +242,7 @@ void SvgFontsDialog::update_sensitiveness(){ void SvgFontsDialog::update_fonts() { SPDesktop* desktop = this->getDesktop(); - Document* document = sp_desktop_document(desktop); + SPDocument* document = sp_desktop_document(desktop); const GSList* fonts = sp_document_get_resource_list(document, "font"); _model->clear(); @@ -420,7 +420,7 @@ SvgFontsDialog::populate_kerning_pairs_box() } } -SPGlyph *new_glyph(Document* document, SPFont *font, const int count) +SPGlyph *new_glyph(SPDocument* document, SPFont *font, const int count) { g_return_val_if_fail(font != NULL, NULL); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); @@ -459,7 +459,7 @@ void SvgFontsDialog::update_glyphs(){ void SvgFontsDialog::add_glyph(){ const int count = _GlyphsListStore->children().size(); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); /* SPGlyph* glyph =*/ new_glyph(doc, get_selected_spfont(), count+1); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Add glyph")); @@ -475,7 +475,7 @@ void SvgFontsDialog::set_glyph_description_from_selected_path(){ } Inkscape::MessageStack *msgStack = sp_desktop_message_stack(desktop); - Document* doc = sp_desktop_document(desktop); + SPDocument* doc = sp_desktop_document(desktop); Inkscape::Selection* sel = sp_desktop_selection(desktop); if (sel->isEmpty()){ char *msg = _("Select a path to define the curves of a glyph"); @@ -519,7 +519,7 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){ } Inkscape::MessageStack *msgStack = sp_desktop_message_stack(desktop); - Document* doc = sp_desktop_document(desktop); + SPDocument* doc = sp_desktop_document(desktop); Inkscape::Selection* sel = sp_desktop_selection(desktop); if (sel->isEmpty()){ char *msg = _("Select a path to define the curves of a glyph"); @@ -562,7 +562,7 @@ void SvgFontsDialog::reset_missing_glyph_description(){ return; } - Document* doc = sp_desktop_document(desktop); + SPDocument* doc = sp_desktop_document(desktop); SPObject* obj; for (obj = get_selected_spfont()->children; obj; obj=obj->next){ if (SP_IS_MISSING_GLYPH(obj)){ @@ -581,7 +581,7 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring& SPGlyph* glyph = (*i)[_GlyphsListColumns.glyph_node]; glyph->repr->setAttribute("glyph-name", str.c_str()); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Edit glyph name")); update_glyphs(); @@ -594,7 +594,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin SPGlyph* glyph = (*i)[_GlyphsListColumns.glyph_node]; glyph->repr->setAttribute("unicode", str.c_str()); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Set glyph unicode")); update_glyphs(); @@ -604,7 +604,7 @@ void SvgFontsDialog::remove_selected_font(){ SPFont* font = get_selected_spfont(); sp_repr_unparent(font->repr); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove font")); update_fonts(); @@ -619,7 +619,7 @@ void SvgFontsDialog::remove_selected_glyph(){ SPGlyph* glyph = (*i)[_GlyphsListColumns.glyph_node]; sp_repr_unparent(glyph->repr); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove glyph")); update_glyphs(); @@ -634,7 +634,7 @@ void SvgFontsDialog::remove_selected_kerning_pair(){ SPGlyphKerning* pair = (*i)[_KerningPairsListColumns.spnode]; sp_repr_unparent(pair->repr); - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); sp_document_done(doc, SP_VERB_DIALOG_SVG_FONTS, _("Remove kerning pair")); update_glyphs(); @@ -705,7 +705,7 @@ void SvgFontsDialog::add_kerning_pair(){ if (this->kerning_pair) return; //We already have this kerning pair - Document* document = sp_desktop_document(this->getDesktop()); + SPDocument* document = sp_desktop_document(this->getDesktop()); Inkscape::XML::Document *xml_doc = sp_document_repr_doc(document); // create a new hkern node @@ -767,7 +767,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){ return &kerning_vbox; } -SPFont *new_font(Document *document) +SPFont *new_font(SPDocument *document) { g_return_val_if_fail(document != NULL, NULL); @@ -820,7 +820,7 @@ void set_font_family(SPFont* font, char* str){ } void SvgFontsDialog::add_font(){ - Document* doc = sp_desktop_document(this->getDesktop()); + SPDocument* doc = sp_desktop_document(this->getDesktop()); SPFont* font = new_font(doc); const int count = _model->children().size(); diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index cdd479e9d..e273a827c 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -377,7 +377,7 @@ static void editGradient( GtkMenuItem */*menuitem*/, gpointer /*user_data*/ ) if ( bounceTarget ) { SwatchesPanel* swp = bounceTarget->ptr ? reinterpret_cast(bounceTarget->ptr) : 0; SPDesktop* desktop = swp ? swp->getDesktop() : 0; - Document *doc = desktop ? desktop->doc() : 0; + SPDocument *doc = desktop ? desktop->doc() : 0; if (doc) { std::string targetName(bounceTarget->def.descr); const GSList *gradients = sp_document_get_resource_list(doc, "gradient"); @@ -397,7 +397,7 @@ static void addNewGradient( GtkMenuItem */*menuitem*/, gpointer /*user_data*/ ) if ( bounceTarget ) { SwatchesPanel* swp = bounceTarget->ptr ? reinterpret_cast(bounceTarget->ptr) : 0; SPDesktop* desktop = swp ? swp->getDesktop() : 0; - Document *doc = desktop ? desktop->doc() : 0; + SPDocument *doc = desktop ? desktop->doc() : 0; if (doc) { Inkscape::XML::Document *xml_doc = sp_document_repr_doc(doc); @@ -524,7 +524,7 @@ void ColorItem::_dropDataIn( GtkWidget */*widget*/, { } -static bool bruteForce( Document* document, Inkscape::XML::Node* node, Glib::ustring const& match, int r, int g, int b ) +static bool bruteForce( SPDocument* document, Inkscape::XML::Node* node, Glib::ustring const& match, int r, int g, int b ) { bool changed = false; @@ -612,7 +612,7 @@ void ColorItem::_colorDefChanged(void* data) { SPDesktop *desktop = SP_ACTIVE_DESKTOP; if ( desktop ) { - Document* document = sp_desktop_document( desktop ); + SPDocument* document = sp_desktop_document( desktop ); Inkscape::XML::Node *rroot = sp_document_repr_root( document ); if ( rroot ) { @@ -1362,9 +1362,9 @@ void SwatchesPanel::setDesktop( SPDesktop* desktop ) _currentDesktop->connectToolSubselectionChanged( sigc::hide(sigc::mem_fun(*this, &SwatchesPanel::_updateFromSelection))); - sigc::bound_mem_functor1 first = sigc::mem_fun(*this, &SwatchesPanel::_setDocument); - sigc::slot base2 = first; - sigc::slot slot2 = sigc::hide<0>( base2 ); + sigc::bound_mem_functor1 first = sigc::mem_fun(*this, &SwatchesPanel::_setDocument); + sigc::slot base2 = first; + sigc::slot slot2 = sigc::hide<0>( base2 ); _documentConnection = desktop->connectDocumentReplaced( slot2 ); _setDocument( desktop->doc() ); @@ -1374,7 +1374,7 @@ void SwatchesPanel::setDesktop( SPDesktop* desktop ) } } -void SwatchesPanel::_setDocument( Document *document ) +void SwatchesPanel::_setDocument( SPDocument *document ) { if ( document != _currentDocument ) { if ( _currentDocument ) { diff --git a/src/ui/dialog/swatches.h b/src/ui/dialog/swatches.h index 3ad5a38c1..35bcd8c78 100644 --- a/src/ui/dialog/swatches.h +++ b/src/ui/dialog/swatches.h @@ -45,7 +45,7 @@ public: protected: virtual void _updateFromSelection(); virtual void _handleAction( int setId, int itemId ); - virtual void _setDocument( Document *document ); + virtual void _setDocument( SPDocument *document ); virtual void _rebuild(); private: @@ -57,7 +57,7 @@ private: ColorItem* _remove; int _currentIndex; SPDesktop* _currentDesktop; - Document* _currentDocument; + SPDocument* _currentDocument; void* _ptr; sigc::connection _documentConnection; diff --git a/src/ui/dialog/undo-history.h b/src/ui/dialog/undo-history.h index 0e14b7d7b..82e04f3c9 100644 --- a/src/ui/dialog/undo-history.h +++ b/src/ui/dialog/undo-history.h @@ -122,7 +122,7 @@ public: protected: - Document *_document; + SPDocument *_document; EventLog *_event_log; const EventLog::EventModelColumns *_columns; diff --git a/src/ui/view/edit-widget.cpp b/src/ui/view/edit-widget.cpp index 9619380bb..756f4df73 100644 --- a/src/ui/view/edit-widget.cpp +++ b/src/ui/view/edit-widget.cpp @@ -71,7 +71,7 @@ namespace Inkscape { namespace UI { namespace View { -EditWidget::EditWidget (Document *doc) +EditWidget::EditWidget (SPDocument *doc) : _main_window_table(4), _viewport_table(3,3), _act_grp(Gtk::ActionGroup::create()), @@ -1191,7 +1191,7 @@ EditWidget::shutdown() if (Inkscape::NSApplication::Editor::isDuplicatedView (_desktop)) return false; - Document *doc = _desktop->doc(); + SPDocument *doc = _desktop->doc(); if (doc->isModifiedSinceSave()) { gchar *markup; /// \todo FIXME !!! obviously this will have problems if the document @@ -1389,7 +1389,7 @@ EditWidget::updateScrollbars (double scale) _update_s_f = true; /* The desktop region we always show unconditionally */ - Document *doc = _desktop->doc(); + SPDocument *doc = _desktop->doc(); Geom::Rect darea ( Geom::Point(-sp_document_width(doc), -sp_document_height(doc)), Geom::Point(2 * sp_document_width(doc), 2 * sp_document_height(doc)) ); SPObject* root = doc->root; @@ -1548,7 +1548,7 @@ void EditWidget::_namedview_modified (SPObject *obj, guint flags) { } void -EditWidget::initEdit (Document *doc) +EditWidget::initEdit (SPDocument *doc) { _desktop = new SPDesktop(); _desktop->registerEditWidget (this); diff --git a/src/ui/view/edit-widget.h b/src/ui/view/edit-widget.h index 28b4b52d2..2bb708305 100644 --- a/src/ui/view/edit-widget.h +++ b/src/ui/view/edit-widget.h @@ -36,7 +36,7 @@ #include "ui/widget/zoom-status.h" struct SPDesktop; -struct Document; +struct SPDocument; struct SPNamedView; namespace Inkscape { @@ -46,14 +46,14 @@ namespace View { class EditWidget : public Gtk::Window, public EditWidgetInterface { public: - EditWidget (Document*); + EditWidget (SPDocument*); ~EditWidget(); // Initialization void initActions(); void initUIManager(); void initLayout(); - void initEdit (Document*); + void initEdit (SPDocument*); void destroyEdit(); // Actions diff --git a/src/ui/view/view.cpp b/src/ui/view/view.cpp index 07bb6d2c1..1b498a846 100644 --- a/src/ui/view/view.cpp +++ b/src/ui/view/view.cpp @@ -137,7 +137,7 @@ void View::requestRedraw() * * \param doc The new document to connect the view to. */ -void View::setDocument(Document *doc) { +void View::setDocument(SPDocument *doc) { g_return_if_fail(doc != NULL); if (_doc) { diff --git a/src/ui/view/view.h b/src/ui/view/view.h index 6465807d6..882746cea 100644 --- a/src/ui/view/view.h +++ b/src/ui/view/view.h @@ -53,7 +53,7 @@ struct StopOnNonZero { } }; -class Document; +class SPDocument; namespace Inkscape { class MessageContext; @@ -80,7 +80,7 @@ public: void close() { _close(); } /// Returns a pointer to the view's document. - Document *doc() const + SPDocument *doc() const { return _doc; } /// Returns a pointer to the view's message stack. Inkscape::MessageStack *messageStack() const @@ -108,12 +108,12 @@ public: virtual void onDocumentResized (double, double) = 0; protected: - Document *_doc; + SPDocument *_doc; Inkscape::MessageStack *_message_stack; Inkscape::MessageContext *_tips_message_context; virtual void _close(); - virtual void setDocument(Document *doc); + virtual void setDocument(SPDocument *doc); sigc::signal _position_set_signal; sigc::signal _resized_signal; diff --git a/src/ui/widget/entity-entry.cpp b/src/ui/widget/entity-entry.cpp index f42b29760..e9f09f574 100644 --- a/src/ui/widget/entity-entry.cpp +++ b/src/ui/widget/entity-entry.cpp @@ -81,7 +81,7 @@ EntityLineEntry::~EntityLineEntry() } void -EntityLineEntry::update (Document *doc) +EntityLineEntry::update (SPDocument *doc) { const char *text = rdf_get_work_entity (doc, _entity); static_cast(_packable)->set_text (text ? text : ""); @@ -93,7 +93,7 @@ EntityLineEntry::on_changed() if (_wr->isUpdating()) return; _wr->setUpdating (true); - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; Glib::ustring text = static_cast(_packable)->get_text(); if (rdf_set_work_entity (doc, _entity, text.c_str())) sp_document_done (doc, SP_VERB_NONE, @@ -122,7 +122,7 @@ EntityMultiLineEntry::~EntityMultiLineEntry() } void -EntityMultiLineEntry::update (Document *doc) +EntityMultiLineEntry::update (SPDocument *doc) { const char *text = rdf_get_work_entity (doc, _entity); Gtk::ScrolledWindow *s = static_cast(_packable); @@ -136,7 +136,7 @@ EntityMultiLineEntry::on_changed() if (_wr->isUpdating()) return; _wr->setUpdating (true); - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; Gtk::ScrolledWindow *s = static_cast(_packable); Gtk::TextView *tv = static_cast(s->get_child()); Glib::ustring text = tv->get_buffer()->get_text(); diff --git a/src/ui/widget/entity-entry.h b/src/ui/widget/entity-entry.h index d080787c1..5bdee9a90 100644 --- a/src/ui/widget/entity-entry.h +++ b/src/ui/widget/entity-entry.h @@ -16,7 +16,7 @@ #include struct rdf_work_entity_t; -class Document; +class SPDocument; namespace Gtk { class TextBuffer; @@ -32,7 +32,7 @@ class EntityEntry { public: static EntityEntry* create (rdf_work_entity_t* ent, Gtk::Tooltips& tt, Registry& wr); virtual ~EntityEntry() = 0; - virtual void update (Document *doc) = 0; + virtual void update (SPDocument *doc) = 0; virtual void on_changed() = 0; Gtk::Label _label; Gtk::Widget *_packable; @@ -49,7 +49,7 @@ class EntityLineEntry : public EntityEntry { public: EntityLineEntry (rdf_work_entity_t* ent, Gtk::Tooltips& tt, Registry& wr); ~EntityLineEntry(); - void update (Document *doc); + void update (SPDocument *doc); protected: virtual void on_changed(); @@ -59,7 +59,7 @@ class EntityMultiLineEntry : public EntityEntry { public: EntityMultiLineEntry (rdf_work_entity_t* ent, Gtk::Tooltips& tt, Registry& wr); ~EntityMultiLineEntry(); - void update (Document *doc); + void update (SPDocument *doc); protected: virtual void on_changed(); diff --git a/src/ui/widget/imageicon.cpp b/src/ui/widget/imageicon.cpp index ead32b4b7..6a817e30d 100644 --- a/src/ui/widget/imageicon.cpp +++ b/src/ui/widget/imageicon.cpp @@ -94,13 +94,13 @@ void ImageIcon::init() } -bool ImageIcon::showSvgDocument(const Document *docArg) +bool ImageIcon::showSvgDocument(const SPDocument *docArg) { if (document) sp_document_unref(document); - Document *doc = (Document *)docArg; + SPDocument *doc = (SPDocument *)docArg; sp_document_ref(doc); document = doc; @@ -127,7 +127,7 @@ bool ImageIcon::showSvgFile(const Glib::ustring &theFileName) fileName = Glib::filename_to_utf8(fileName); - Document *doc = sp_document_new (fileName.c_str(), 0); + SPDocument *doc = sp_document_new (fileName.c_str(), 0); if (!doc) { g_warning("SVGView: error loading document '%s'\n", fileName.c_str()); return false; @@ -148,7 +148,7 @@ bool ImageIcon::showSvgFromMemory(const char *xmlBuffer) return false; gint len = (gint)strlen(xmlBuffer); - Document *doc = sp_document_new_from_mem(xmlBuffer, len, 0); + SPDocument *doc = sp_document_new_from_mem(xmlBuffer, len, 0); if (!doc) { g_warning("SVGView: error loading buffer '%s'\n",xmlBuffer); return false; diff --git a/src/ui/widget/imageicon.h b/src/ui/widget/imageicon.h index 3819a3c77..803b2f53f 100644 --- a/src/ui/widget/imageicon.h +++ b/src/ui/widget/imageicon.h @@ -16,7 +16,7 @@ #include -class Document; +class SPDocument; namespace Inkscape { @@ -62,7 +62,7 @@ public: /** * */ - bool showSvgDocument(const Document *doc); + bool showSvgDocument(const SPDocument *doc); /** * @@ -99,7 +99,7 @@ private: /** * The svg document we are currently showing */ - Document *document; + SPDocument *document; /** * The sp_svg_view widget diff --git a/src/ui/widget/layer-selector.h b/src/ui/widget/layer-selector.h index d9ef558a5..0b5300272 100644 --- a/src/ui/widget/layer-selector.h +++ b/src/ui/widget/layer-selector.h @@ -23,7 +23,7 @@ #include "util/list.h" class SPDesktop; -class Document; +class SPDocument; class SPObject; namespace Inkscape { namespace XML { diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 778fbc6cc..a5f1d89be 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -119,7 +119,7 @@ Licensor::init (Gtk::Tooltips& tt, Registry& wr) } void -Licensor::update (Document *doc) +Licensor::update (SPDocument *doc) { /* identify the license info */ struct rdf_license_t * license = rdf_get_license (doc); diff --git a/src/ui/widget/licensor.h b/src/ui/widget/licensor.h index 6738c48df..9f41a6d0d 100644 --- a/src/ui/widget/licensor.h +++ b/src/ui/widget/licensor.h @@ -15,7 +15,7 @@ #include -class Document; +class SPDocument; namespace Gtk { class Tooltips; @@ -34,7 +34,7 @@ public: Licensor(); virtual ~Licensor(); void init (Gtk::Tooltips&, Registry&); - void update (Document *doc); + void update (SPDocument *doc); protected: EntityEntry *_eentry; diff --git a/src/ui/widget/object-composite-settings.cpp b/src/ui/widget/object-composite-settings.cpp index 1b4251143..bfc291bc0 100644 --- a/src/ui/widget/object-composite-settings.cpp +++ b/src/ui/widget/object-composite-settings.cpp @@ -117,7 +117,7 @@ ObjectCompositeSettings::_blendBlurValueChanged() if (!desktop) { return; } - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); if (_blocked) return; diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp index 429442779..02688a55e 100644 --- a/src/ui/widget/page-sizer.cpp +++ b/src/ui/widget/page-sizer.cpp @@ -346,7 +346,7 @@ PageSizer::setDim (double w, double h, bool changeList) _changedh_connection.block(); if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) { - Document *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); + SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP); double const old_height = sp_document_height(doc); sp_document_set_width (doc, w, &_px_unit); sp_document_set_height (doc, h, &_px_unit); diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp index c2fafa001..93a950d1a 100644 --- a/src/ui/widget/panel.cpp +++ b/src/ui/widget/panel.cpp @@ -566,7 +566,7 @@ Panel::setResponseSensitive(int response_id, bool setting) _response_map[response_id]->set_sensitive(setting); } -sigc::signal & +sigc::signal & Panel::signalDocumentReplaced() { return _signal_document_replaced; diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h index 36f5ea804..d42548f16 100644 --- a/src/ui/widget/panel.h +++ b/src/ui/widget/panel.h @@ -71,7 +71,7 @@ public: void setDefaultResponse(int response_id); void setResponseSensitive(int response_id, bool setting); - virtual sigc::signal &signalDocumentReplaced(); + virtual sigc::signal &signalDocumentReplaced(); virtual sigc::signal &signalActivateDesktop(); virtual sigc::signal &signalDeactiveDesktop(); @@ -100,7 +100,7 @@ protected: /** Signals */ sigc::signal _signal_response; sigc::signal _signal_present; - sigc::signal _signal_document_replaced; + sigc::signal _signal_document_replaced; sigc::signal _signal_activate_desktop; sigc::signal _signal_deactive_desktop; diff --git a/src/ui/widget/registered-enums.h b/src/ui/widget/registered-enums.h index f9195d1f2..739745817 100644 --- a/src/ui/widget/registered-enums.h +++ b/src/ui/widget/registered-enums.h @@ -32,7 +32,7 @@ public: const Util::EnumDataConverter& c, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ) + SPDocument *doc_in = NULL ) : RegisteredWidget< LabelledComboBoxEnum >(label, tip, c) { RegisteredWidget< LabelledComboBoxEnum >::init_parent(key, wr, repr_in, doc_in); diff --git a/src/ui/widget/registered-widget.cpp b/src/ui/widget/registered-widget.cpp index 5780f74ed..95ddec286 100644 --- a/src/ui/widget/registered-widget.cpp +++ b/src/ui/widget/registered-widget.cpp @@ -50,7 +50,7 @@ RegisteredCheckButton::~RegisteredCheckButton() _toggled_connection.disconnect(); } -RegisteredCheckButton::RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, Document *doc_in) +RegisteredCheckButton::RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right, Inkscape::XML::Node* repr_in, SPDocument *doc_in) : RegisteredWidget() { init_parent(key, wr, repr_in, doc_in); @@ -108,7 +108,7 @@ RegisteredUnitMenu::~RegisteredUnitMenu() _changed_connection.disconnect(); } -RegisteredUnitMenu::RegisteredUnitMenu (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, Document *doc_in) +RegisteredUnitMenu::RegisteredUnitMenu (const Glib::ustring& label, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in) : RegisteredWidget (label, "" /*tooltip*/, new UnitMenu()) { init_parent(key, wr, repr_in, doc_in); @@ -149,7 +149,7 @@ RegisteredScalarUnit::~RegisteredScalarUnit() _value_changed_connection.disconnect(); } -RegisteredScalarUnit::RegisteredScalarUnit (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, const RegisteredUnitMenu &rum, Registry& wr, Inkscape::XML::Node* repr_in, Document *doc_in) +RegisteredScalarUnit::RegisteredScalarUnit (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, const RegisteredUnitMenu &rum, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in) : RegisteredWidget(label, tip, UNIT_TYPE_LINEAR, "", "", rum.getUnitMenu()), _um(0) { @@ -200,7 +200,7 @@ RegisteredScalar::~RegisteredScalar() RegisteredScalar::RegisteredScalar ( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, - Document * doc_in ) + SPDocument * doc_in ) : RegisteredWidget(label, tip) { init_parent(key, wr, repr_in, doc_in); @@ -248,7 +248,7 @@ RegisteredText::~RegisteredText() RegisteredText::RegisteredText ( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, - Document * doc_in ) + SPDocument * doc_in ) : RegisteredWidget(label, tip) { init_parent(key, wr, repr_in, doc_in); @@ -296,7 +296,7 @@ RegisteredColorPicker::RegisteredColorPicker(const Glib::ustring& label, const Glib::ustring& akey, Registry& wr, Inkscape::XML::Node* repr_in, - Document *doc_in) + SPDocument *doc_in) : RegisteredWidget (title, tip, 0, true) { init_parent("", wr, repr_in, doc_in); @@ -337,7 +337,7 @@ RegisteredColorPicker::on_changed (guint32 rgba) // Use local repr here. When repr is specified, use that one, but // if repr==NULL, get the repr of namedview of active desktop. Inkscape::XML::Node *local_repr = repr; - Document *local_doc = doc; + SPDocument *local_doc = doc; if (!local_repr) { // no repr specified, use active desktop's namedview's repr SPDesktop *dt = SP_ACTIVE_DESKTOP; @@ -372,7 +372,7 @@ RegisteredSuffixedInteger::~RegisteredSuffixedInteger() _changed_connection.disconnect(); } -RegisteredSuffixedInteger::RegisteredSuffixedInteger (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, Document *doc_in) +RegisteredSuffixedInteger::RegisteredSuffixedInteger (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& suffix, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in) : RegisteredWidget(label, tip, 0, suffix), setProgrammatically(false) { @@ -419,7 +419,7 @@ RegisteredRadioButtonPair::~RegisteredRadioButtonPair() RegisteredRadioButtonPair::RegisteredRadioButtonPair (const Glib::ustring& label, const Glib::ustring& label1, const Glib::ustring& label2, const Glib::ustring& tip1, const Glib::ustring& tip2, - const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, Document *doc_in) + const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in) : RegisteredWidget(), _rb1(NULL), _rb2(NULL) @@ -486,7 +486,7 @@ RegisteredPoint::~RegisteredPoint() RegisteredPoint::RegisteredPoint ( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, - Document* doc_in ) + SPDocument* doc_in ) : RegisteredWidget (label, tip) { init_parent(key, wr, repr_in, doc_in); @@ -531,7 +531,7 @@ RegisteredTransformedPoint::~RegisteredTransformedPoint() RegisteredTransformedPoint::RegisteredTransformedPoint ( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, - Document* doc_in ) + SPDocument* doc_in ) : RegisteredWidget (label, tip), to_svg(Geom::identity()) { @@ -598,7 +598,7 @@ RegisteredRandom::~RegisteredRandom() RegisteredRandom::RegisteredRandom ( const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, - Document * doc_in ) + SPDocument * doc_in ) : RegisteredWidget (label, tip) { init_parent(key, wr, repr_in, doc_in); diff --git a/src/ui/widget/registered-widget.h b/src/ui/widget/registered-widget.h index 32d6c93fa..a5c61f68a 100644 --- a/src/ui/widget/registered-widget.h +++ b/src/ui/widget/registered-widget.h @@ -35,7 +35,7 @@ #include "sp-namedview.h" class SPUnit; -class Document; +class SPDocument; namespace Gtk { class HScale; @@ -81,7 +81,7 @@ protected: virtual ~RegisteredWidget() {}; - void init_parent(const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, Document *doc_in) + void init_parent(const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in, SPDocument *doc_in) { _wr = ≀ _key = key; @@ -96,7 +96,7 @@ protected: // Use local repr here. When repr is specified, use that one, but // if repr==NULL, get the repr of namedview of active desktop. Inkscape::XML::Node *local_repr = repr; - Document *local_doc = doc; + SPDocument *local_doc = doc; if (!local_repr) { // no repr specified, use active desktop's namedview's repr SPDesktop* dt = SP_ACTIVE_DESKTOP; @@ -120,7 +120,7 @@ protected: Registry * _wr; Glib::ustring _key; Inkscape::XML::Node * repr; - Document * doc; + SPDocument * doc; unsigned int event_type; Glib::ustring event_description; bool write_undo; @@ -139,7 +139,7 @@ private: class RegisteredCheckButton : public RegisteredWidget { public: virtual ~RegisteredCheckButton(); - RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, Document *doc_in=NULL); + RegisteredCheckButton (const Glib::ustring& label, const Glib::ustring& tip, const Glib::ustring& key, Registry& wr, bool right=true, Inkscape::XML::Node* repr_in=NULL, SPDocument *doc_in=NULL); void setActive (bool); @@ -168,7 +168,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); void setUnit (const SPUnit*); Unit getUnit() const { return static_cast(_widget)->getUnit(); }; @@ -188,7 +188,7 @@ public: const RegisteredUnitMenu &rum, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); protected: sigc::connection _value_changed_connection; @@ -204,7 +204,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); protected: sigc::connection _value_changed_connection; @@ -219,7 +219,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); protected: sigc::connection _activate_connection; @@ -237,7 +237,7 @@ public: const Glib::ustring& akey, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL); + SPDocument *doc_in = NULL); void setRgba32 (guint32); void closeWindow(); @@ -259,7 +259,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); bool setProgrammatically; // true if the value was set by setValue, not changed by the user; // if a callback checks it, it must reset it back to false @@ -280,7 +280,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); void setValue (bool second); @@ -301,7 +301,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); protected: sigc::connection _value_x_changed_connection; @@ -318,7 +318,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL ); + SPDocument *doc_in = NULL ); // redefine setValue, because transform must be applied void setValue(Geom::Point const & p); @@ -342,7 +342,7 @@ public: const Glib::ustring& key, Registry& wr, Inkscape::XML::Node* repr_in = NULL, - Document *doc_in = NULL); + SPDocument *doc_in = NULL); void setValue (double val, long startseed); diff --git a/src/ui/widget/tolerance-slider.cpp b/src/ui/widget/tolerance-slider.cpp index bc5b45979..3a36127f4 100644 --- a/src/ui/widget/tolerance-slider.cpp +++ b/src/ui/widget/tolerance-slider.cpp @@ -185,7 +185,7 @@ ToleranceSlider::update (double val) _wr->setUpdating (true); - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); bool saved = sp_document_get_undo_sensitive (doc); sp_document_set_undo_sensitive (doc, false); Inkscape::XML::Node *repr = SP_OBJECT_REPR (sp_desktop_namedview(dt)); diff --git a/src/uri-references.cpp b/src/uri-references.cpp index 33d599180..d979fe292 100644 --- a/src/uri-references.cpp +++ b/src/uri-references.cpp @@ -32,7 +32,7 @@ URIReference::URIReference(SPObject *owner) /* FIXME !!! attach to owner's destroy signal to clean up in case */ } -URIReference::URIReference(Document *owner_document) +URIReference::URIReference(SPDocument *owner_document) : _owner(NULL), _owner_document(owner_document), _obj(NULL), _uri(NULL) { g_assert(_owner_document != NULL); @@ -45,7 +45,7 @@ URIReference::~URIReference() void URIReference::attach(const URI &uri) throw(BadURIException) { - Document *document; + SPDocument *document; if (_owner) { document = SP_OBJECT_DOCUMENT(_owner); } else if (_owner_document) { @@ -142,7 +142,7 @@ void URIReference::_release(SPObject *obj) -SPObject* sp_css_uri_reference_resolve( Document *document, const gchar *uri ) +SPObject* sp_css_uri_reference_resolve( SPDocument *document, const gchar *uri ) { SPObject* ref = 0; @@ -158,7 +158,7 @@ SPObject* sp_css_uri_reference_resolve( Document *document, const gchar *uri ) } SPObject * -sp_uri_reference_resolve (Document *document, const gchar *uri) +sp_uri_reference_resolve (SPDocument *document, const gchar *uri) { SPObject* ref = 0; diff --git a/src/uri-references.h b/src/uri-references.h index 0f7a724ba..a98c84153 100644 --- a/src/uri-references.h +++ b/src/uri-references.h @@ -41,7 +41,7 @@ public: * is holding a reference to the target object. */ URIReference(SPObject *owner); - URIReference(Document *owner_document); + URIReference(SPDocument *owner_document); /** * Destructor. Calls shutdown() if the reference has not been @@ -114,7 +114,7 @@ public: return (bool)_uri; } - Document *getOwnerDocument() { return _owner_document; } + SPDocument *getOwnerDocument() { return _owner_document; } SPObject *getOwnerObject() { return _owner; } protected: @@ -125,7 +125,7 @@ protected: private: SPObject *_owner; - Document *_owner_document; + SPDocument *_owner_document; sigc::connection _connection; sigc::connection _release_connection; SPObject *_obj; @@ -145,8 +145,8 @@ private: /** * Resolves an item referenced by a URI in CSS form contained in "url(...)" */ -SPObject* sp_css_uri_reference_resolve( Document *document, const gchar *uri ); +SPObject* sp_css_uri_reference_resolve( SPDocument *document, const gchar *uri ); -SPObject *sp_uri_reference_resolve (Document *document, const gchar *uri); +SPObject *sp_uri_reference_resolve (SPDocument *document, const gchar *uri); #endif diff --git a/src/vanishing-point.cpp b/src/vanishing-point.cpp index 133311625..ab46b21a6 100644 --- a/src/vanishing-point.cpp +++ b/src/vanishing-point.cpp @@ -462,7 +462,7 @@ VPDragger::printVPs() { } } -VPDrag::VPDrag (Document *document) +VPDrag::VPDrag (SPDocument *document) { this->document = document; this->selection = sp_desktop_selection(inkscape_active_desktop()); diff --git a/src/vanishing-point.h b/src/vanishing-point.h index 311315404..9fcb6bb46 100644 --- a/src/vanishing-point.h +++ b/src/vanishing-point.h @@ -158,14 +158,14 @@ public: struct VPDrag { public: - VPDrag(Document *document); + VPDrag(SPDocument *document); ~VPDrag(); VPDragger *getDraggerFor (VanishingPoint const &vp); bool dragging; - Document *document; + SPDocument *document; GList *draggers; GSList *lines; diff --git a/src/verbs.cpp b/src/verbs.cpp index 10f4f3acc..43ddc1459 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -607,7 +607,7 @@ Verb::get_action(Inkscape::UI::View::View *view) } void -Verb::sensitive(Document *in_doc, bool in_sensitive) +Verb::sensitive(SPDocument *in_doc, bool in_sensitive) { // printf("Setting sensitivity of \"%s\" to %d\n", _name, in_sensitive); if (_actions != NULL) { @@ -635,7 +635,7 @@ Verb::get_tip (void) } void -Verb::name(Document *in_doc, Glib::ustring in_name) +Verb::name(SPDocument *in_doc, Glib::ustring in_name) { if (_actions != NULL) { for (ActionTable::iterator cur_action = _actions->begin(); @@ -759,7 +759,7 @@ FileVerb::perform(SPAction *action, void *data, void */*pdata*/) /* These aren't used, but are here to remind people not to use the CURRENT_DOCUMENT macros unless they really have to. */ Inkscape::UI::View::View *current_view = sp_action_get_view(action); - Document *current_document = current_view->doc(); + SPDocument *current_document = current_view->doc(); #endif SPDesktop *desktop = dynamic_cast(sp_action_get_view(action)); @@ -1605,7 +1605,7 @@ TextVerb::perform(SPAction *action, void */*data*/, void */*pdata*/) if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); (void)doc; Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview); (void)repr; @@ -1620,7 +1620,7 @@ ZoomVerb::perform(SPAction *action, void *data, void */*pdata*/) return; SPEventContext *ec = dt->event_context; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); Inkscape::XML::Node *repr = SP_OBJECT_REPR(dt->namedview); @@ -2066,7 +2066,7 @@ EffectLastVerb::perform(SPAction *action, void *data, void */*pdata*/) /* These aren't used, but are here to remind people not to use the CURRENT_DOCUMENT macros unless they really have to. */ Inkscape::UI::View::View *current_view = sp_action_get_view(action); - // Document *current_document = SP_VIEW_DOCUMENT(current_view); + // SPDocument *current_document = SP_VIEW_DOCUMENT(current_view); Inkscape::Extension::Effect *effect = Inkscape::Extension::Effect::get_last_effect(); if (effect == NULL) return; @@ -2134,7 +2134,7 @@ FitCanvasVerb::perform(SPAction *action, void *data, void */*pdata*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; switch ((long) data) { @@ -2203,7 +2203,7 @@ LockAndHideVerb::perform(SPAction *action, void *data, void */*pdata*/) { SPDesktop *dt = static_cast(sp_action_get_view(action)); if (!dt) return; - Document *doc = sp_desktop_document(dt); + SPDocument *doc = sp_desktop_document(dt); if (!doc) return; switch ((long) data) { diff --git a/src/verbs.h b/src/verbs.h index de9eae68a..c3b88918b 100644 --- a/src/verbs.h +++ b/src/verbs.h @@ -437,8 +437,8 @@ public: static void delete_all_view (Inkscape::UI::View::View * view); void delete_view (Inkscape::UI::View::View * view); - void sensitive (Inkscape::XML::DocumentTree * in_doc = NULL, bool in_sensitive = true); - void name (Inkscape::XML::DocumentTree * in_doc = NULL, Glib::ustring in_name = ""); + void sensitive (SPDocument * in_doc = NULL, bool in_sensitive = true); + void name (SPDocument * in_doc = NULL, Glib::ustring in_name = ""); // Yes, multiple public, protected and private sections are bad. We'll clean that up later protected: diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index fc2e82722..a2f88c16d 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -820,7 +820,7 @@ SPDesktopWidget::shutdown() g_assert(desktop != NULL); if (inkscape_is_sole_desktop_for_document(*desktop)) { - Document *doc = desktop->doc(); + SPDocument *doc = desktop->doc(); if (doc->isModifiedSinceSave()) { GtkWidget *dialog; @@ -1721,7 +1721,7 @@ sp_desktop_widget_update_scrollbars (SPDesktopWidget *dtw, double scale) dtw->update = 1; /* The desktop region we always show unconditionally */ - Document *doc = dtw->desktop->doc(); + SPDocument *doc = dtw->desktop->doc(); Geom::Rect darea ( Geom::Point(-sp_document_width(doc), -sp_document_height(doc)), Geom::Point(2 * sp_document_width(doc), 2 * sp_document_height(doc)) ); SPObject* root = doc->root; diff --git a/src/widgets/fill-style.cpp b/src/widgets/fill-style.cpp index 683b041b0..5e9d30bcd 100644 --- a/src/widgets/fill-style.cpp +++ b/src/widgets/fill-style.cpp @@ -355,7 +355,7 @@ sp_fill_style_widget_paint_changed ( SPPaintSelector *psel, if (!desktop) { return; } - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); Inkscape::Selection *selection = sp_desktop_selection (desktop); GSList const *items = selection->itemList(); diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp index 15b65c239..f24a6781b 100644 --- a/src/widgets/gradient-selector.cpp +++ b/src/widgets/gradient-selector.cpp @@ -248,7 +248,7 @@ sp_gradient_selector_get_spread (SPGradientSelector *sel) } void -sp_gradient_selector_set_vector (SPGradientSelector *sel, Document *doc, SPGradient *vector) +sp_gradient_selector_set_vector (SPGradientSelector *sel, SPDocument *doc, SPGradient *vector) { g_return_if_fail (sel != NULL); g_return_if_fail (SP_IS_GRADIENT_SELECTOR (sel)); @@ -307,7 +307,7 @@ sp_gradient_selector_edit_vector_clicked (GtkWidget */*w*/, SPGradientSelector * static void sp_gradient_selector_add_vector_clicked (GtkWidget */*w*/, SPGradientSelector *sel) { - Document *doc = sp_gradient_vector_selector_get_document ( + SPDocument *doc = sp_gradient_vector_selector_get_document ( SP_GRADIENT_VECTOR_SELECTOR (sel->vectors)); if (!doc) diff --git a/src/widgets/gradient-selector.h b/src/widgets/gradient-selector.h index 63e18554d..e68dfecfc 100644 --- a/src/widgets/gradient-selector.h +++ b/src/widgets/gradient-selector.h @@ -68,7 +68,7 @@ GtkWidget *sp_gradient_selector_new (void); void sp_gradient_selector_set_mode (SPGradientSelector *sel, guint mode); void sp_gradient_selector_set_units (SPGradientSelector *sel, guint units); void sp_gradient_selector_set_spread (SPGradientSelector *sel, guint spread); -void sp_gradient_selector_set_vector (SPGradientSelector *sel, Document *doc, SPGradient *vector); +void sp_gradient_selector_set_vector (SPGradientSelector *sel, SPDocument *doc, SPGradient *vector); void sp_gradient_selector_set_bbox (SPGradientSelector *sel, gdouble x0, gdouble y0, gdouble x1, gdouble y1); SPGradientUnits sp_gradient_selector_get_units (SPGradientSelector *sel); diff --git a/src/widgets/gradient-toolbar.cpp b/src/widgets/gradient-toolbar.cpp index f64dc7bd8..ddd9fd96a 100644 --- a/src/widgets/gradient-toolbar.cpp +++ b/src/widgets/gradient-toolbar.cpp @@ -167,7 +167,7 @@ gr_prepare_label (SPObject *obj) GtkWidget * gr_vector_list (SPDesktop *desktop, bool selection_empty, SPGradient *gr_selected, bool gr_multi) { - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); GtkWidget *om = gtk_option_menu_new (); GtkWidget *m = gtk_menu_new (); @@ -435,7 +435,7 @@ GtkWidget * gr_change_widget (SPDesktop *desktop) { Inkscape::Selection *selection = sp_desktop_selection (desktop); - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); SPEventContext *ev = sp_desktop_event_context (desktop); SPGradient *gr_selected = NULL; diff --git a/src/widgets/gradient-vector.cpp b/src/widgets/gradient-vector.cpp index c6a7b37f4..1f0c07754 100644 --- a/src/widgets/gradient-vector.cpp +++ b/src/widgets/gradient-vector.cpp @@ -155,7 +155,7 @@ sp_gradient_vector_selector_destroy (GtkObject *object) } GtkWidget * -sp_gradient_vector_selector_new (Document *doc, SPGradient *gr) +sp_gradient_vector_selector_new (SPDocument *doc, SPGradient *gr) { GtkWidget *gvs; @@ -174,7 +174,7 @@ sp_gradient_vector_selector_new (Document *doc, SPGradient *gr) } void -sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, Document *doc, SPGradient *gr) +sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, SPDocument *doc, SPGradient *gr) { static gboolean suppress = FALSE; @@ -220,7 +220,7 @@ sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, Documen /* The case of setting NULL -> NULL is not very interesting */ } -Document * +SPDocument * sp_gradient_vector_selector_get_document (SPGradientVectorSelector *gvs) { g_return_val_if_fail (gvs != NULL, NULL); @@ -1037,7 +1037,7 @@ sp_gradient_vector_widget_load_gradient (GtkWidget *widget, SPGradient *gradient // Once the user edits a gradient, it stops being auto-collectable if (SP_OBJECT_REPR(gradient)->attribute("inkscape:collect")) { - Document *document = SP_OBJECT_DOCUMENT (gradient); + SPDocument *document = SP_OBJECT_DOCUMENT (gradient); bool saved = sp_document_get_undo_sensitive(document); sp_document_set_undo_sensitive (document, false); SP_OBJECT_REPR(gradient)->setAttribute("inkscape:collect", NULL); diff --git a/src/widgets/gradient-vector.h b/src/widgets/gradient-vector.h index aa5444755..ea1f5159f 100644 --- a/src/widgets/gradient-vector.h +++ b/src/widgets/gradient-vector.h @@ -31,7 +31,7 @@ struct SPGradientVectorSelector { guint idlabel : 1; - Document *doc; + SPDocument *doc; SPGradient *gr; /* Vector menu */ @@ -50,11 +50,11 @@ struct SPGradientVectorSelectorClass { GType sp_gradient_vector_selector_get_type(void); -GtkWidget *sp_gradient_vector_selector_new (Document *doc, SPGradient *gradient); +GtkWidget *sp_gradient_vector_selector_new (SPDocument *doc, SPGradient *gradient); -void sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, Document *doc, SPGradient *gr); +void sp_gradient_vector_selector_set_gradient (SPGradientVectorSelector *gvs, SPDocument *doc, SPGradient *gr); -Document *sp_gradient_vector_selector_get_document (SPGradientVectorSelector *gvs); +SPDocument *sp_gradient_vector_selector_get_document (SPGradientVectorSelector *gvs); SPGradient *sp_gradient_vector_selector_get_gradient (SPGradientVectorSelector *gvs); /* fixme: rethink this (Lauris) */ diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp index 56602962d..5824b102c 100644 --- a/src/widgets/icon.cpp +++ b/src/widgets/icon.cpp @@ -908,7 +908,7 @@ GdkPixbuf *sp_icon_image_load_pixmap(gchar const *name, unsigned /*lsize*/, unsi // takes doc, root, icon, and icon name to produce pixels extern "C" guchar * -sp_icon_doc_icon( Document *doc, NRArenaItem *root, +sp_icon_doc_icon( SPDocument *doc, NRArenaItem *root, gchar const *name, unsigned psize ) { bool const dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpSvg"); @@ -1038,7 +1038,7 @@ sp_icon_doc_icon( Document *doc, NRArenaItem *root, struct svg_doc_cache_t { - Document *doc; + SPDocument *doc; NRArenaItem *root; }; @@ -1081,7 +1081,7 @@ static std::list &icons_svg_paths() static guchar *load_svg_pixels(gchar const *name, unsigned /*lsize*/, unsigned psize) { - Document *doc = NULL; + SPDocument *doc = NULL; NRArenaItem *root = NULL; svg_doc_cache_t *info = NULL; diff --git a/src/widgets/paint-selector.cpp b/src/widgets/paint-selector.cpp index d203e094f..a101b9eeb 100644 --- a/src/widgets/paint-selector.cpp +++ b/src/widgets/paint-selector.cpp @@ -747,7 +747,7 @@ sp_psel_pattern_change(GtkWidget *widget, SPPaintSelector *psel) * Returns NULL if there are no patterns in the document. */ GSList * -ink_pattern_list_get (Document *source) +ink_pattern_list_get (SPDocument *source) { if (source == NULL) return NULL; @@ -768,7 +768,7 @@ ink_pattern_list_get (Document *source) * Adds menu items for pattern list - derived from marker code, left hb etc in to make addition of previews easier at some point. */ static void -sp_pattern_menu_build (GtkWidget *m, GSList *pattern_list, Document */*source*/) +sp_pattern_menu_build (GtkWidget *m, GSList *pattern_list, SPDocument */*source*/) { for (; pattern_list != NULL; pattern_list = pattern_list->next) { @@ -813,7 +813,7 @@ sp_pattern_menu_build (GtkWidget *m, GSList *pattern_list, Document */*source*/) * */ static void -sp_pattern_list_from_doc (GtkWidget *m, Document *current_doc, Document *source, Document *pattern_doc) +sp_pattern_list_from_doc (GtkWidget *m, SPDocument *current_doc, SPDocument *source, SPDocument *pattern_doc) { (void)current_doc; (void)pattern_doc; @@ -838,9 +838,9 @@ sp_pattern_list_from_doc (GtkWidget *m, Document *current_doc, Document *source, static void -ink_pattern_menu_populate_menu(GtkWidget *m, Document *doc) +ink_pattern_menu_populate_menu(GtkWidget *m, SPDocument *doc) { - static Document *patterns_doc = NULL; + static SPDocument *patterns_doc = NULL; // find and load patterns.svg if (patterns_doc == NULL) { @@ -878,7 +878,7 @@ ink_pattern_menu(GtkWidget *mnu) /* Create new menu widget */ GtkWidget *m = gtk_menu_new(); gtk_widget_show(m); - Document *doc = SP_ACTIVE_DOCUMENT; + SPDocument *doc = SP_ACTIVE_DOCUMENT; if (!doc) { GtkWidget *i; diff --git a/src/widgets/select-toolbar.cpp b/src/widgets/select-toolbar.cpp index 6d28f80e5..f168cedeb 100644 --- a/src/widgets/select-toolbar.cpp +++ b/src/widgets/select-toolbar.cpp @@ -153,7 +153,7 @@ sp_object_layout_any_value_changed(GtkAdjustment *adj, SPWidget *spw) SPDesktop *desktop = SP_ACTIVE_DESKTOP; Inkscape::Selection *selection = sp_desktop_selection(desktop); - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); sp_document_ensure_up_to_date (document); Inkscape::Preferences *prefs = Inkscape::Preferences::get(); diff --git a/src/widgets/stroke-style.cpp b/src/widgets/stroke-style.cpp index e0002e5c2..f502f87d3 100644 --- a/src/widgets/stroke-style.cpp +++ b/src/widgets/stroke-style.cpp @@ -81,7 +81,7 @@ sigc::connection marker_start_menu_connection; sigc::connection marker_mid_menu_connection; sigc::connection marker_end_menu_connection; -static SPObject *ink_extract_marker_name(gchar const *n, Document *doc); +static SPObject *ink_extract_marker_name(gchar const *n, SPDocument *doc); static void ink_markers_menu_update(Gtk::Container* spw, SPMarkerLoc const which); static Inkscape::UI::Cache::SvgPreview svg_preview_cache; @@ -307,7 +307,7 @@ sp_stroke_style_paint_changed(SPPaintSelector *psel, SPWidget *spw) g_object_set_data (G_OBJECT (spw), "update", GINT_TO_POINTER (TRUE)); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); Inkscape::Selection *selection = sp_desktop_selection (desktop); GSList const *items = selection->itemList(); @@ -550,7 +550,7 @@ sp_stroke_style_widget_transientize_callback(Inkscape::Application */*inkscape*/ */ static Gtk::Image * sp_marker_prev_new(unsigned psize, gchar const *mname, - Document *source, Document *sandbox, + SPDocument *source, SPDocument *sandbox, gchar const *menu_id, NRArena const */*arena*/, unsigned /*visionkey*/, NRArenaItem *root) { // Retrieve the marker named 'mname' from the source SVG document @@ -617,7 +617,7 @@ sp_marker_prev_new(unsigned psize, gchar const *mname, * Returns NULL if there are no markers in the document. */ GSList * -ink_marker_list_get (Document *source) +ink_marker_list_get (SPDocument *source) { if (source == NULL) return NULL; @@ -641,7 +641,7 @@ ink_marker_list_get (Document *source) * Adds previews of markers in marker_list to the given menu widget */ static void -sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, Document *source, Document *sandbox, gchar const *menu_id) +sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, SPDocument *source, SPDocument *sandbox, gchar const *menu_id) { // Do this here, outside of loop, to speed up preview generation: NRArena const *arena = NRArena::create(); @@ -695,7 +695,7 @@ sp_marker_menu_build (Gtk::Menu *m, GSList *marker_list, Document *source, Docum * */ static void -sp_marker_list_from_doc (Gtk::Menu *m, Document */*current_doc*/, Document *source, Document */*markers_doc*/, Document *sandbox, gchar const *menu_id) +sp_marker_list_from_doc (Gtk::Menu *m, SPDocument */*current_doc*/, SPDocument *source, SPDocument */*markers_doc*/, SPDocument *sandbox, gchar const *menu_id) { GSList *ml = ink_marker_list_get(source); GSList *clean_ml = NULL; @@ -716,7 +716,7 @@ sp_marker_list_from_doc (Gtk::Menu *m, Document */*current_doc*/, Document *sour /** * Returns a new document containing default start, mid, and end markers. */ -Document * +SPDocument * ink_markers_preview_doc () { gchar const *buffer = "" @@ -749,9 +749,9 @@ gchar const *buffer = "(spw->get_data("miterlimit")); SPDesktop *desktop = SP_ACTIVE_DESKTOP; - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); Inkscape::Selection *selection = sp_desktop_selection (desktop); GSList const *items = selection->itemList(); @@ -1833,7 +1833,7 @@ sp_stroke_style_update_marker_menus(Gtk::Container *spw, GSList const *objects) * the caller should free the buffer when they no longer need it. */ static SPObject* -ink_extract_marker_name(gchar const *n, Document *doc) +ink_extract_marker_name(gchar const *n, SPDocument *doc) { gchar const *p = n; while (*p != '\0' && *p != '#') { diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index c13ad9ba6..8bb15ae6f 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1886,7 +1886,7 @@ void toggle_snap_callback (GtkToggleAction *act, gpointer data) { //data points SPDesktop *dt = reinterpret_cast(ptr); SPNamedView *nv = sp_desktop_namedview(dt); - Document *doc = SP_OBJECT_DOCUMENT(nv); + SPDocument *doc = SP_OBJECT_DOCUMENT(nv); if (dt == NULL || nv == NULL) { g_warning("No desktop or namedview specified (in toggle_snap_callback)!"); @@ -3327,7 +3327,7 @@ static void box3d_angle_value_changed(GtkAdjustment *adj, GObject *dataKludge, Proj::Axis axis) { SPDesktop *desktop = (SPDesktop *) g_object_get_data( dataKludge, "desktop" ); - Document *document = sp_desktop_document(desktop); + SPDocument *document = sp_desktop_document(desktop); // quit if run by the attr_changed or selection changed listener if (g_object_get_data( dataKludge, "freeze" )) { @@ -3407,7 +3407,7 @@ static void box3d_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, { Inkscape::Preferences *prefs = Inkscape::Preferences::get(); EgeAdjustmentAction* eact = 0; - Document *document = sp_desktop_document (desktop); + SPDocument *document = sp_desktop_document (desktop); Persp3D *persp = document->current_persp3d; EgeAdjustmentAction* box3d_angle_x = 0; @@ -6845,7 +6845,7 @@ static void sp_connector_path_set_ignore(void) static void connector_spacing_changed(GtkAdjustment *adj, GObject* tbl) { SPDesktop *desktop = (SPDesktop *) g_object_get_data( tbl, "desktop" ); - Document *doc = sp_desktop_document(desktop); + SPDocument *doc = sp_desktop_document(desktop); if (!sp_document_get_undo_sensitive(doc)) { diff --git a/src/xml/document.h b/src/xml/document.h index a5f457fe8..2b9ea5cc3 100644 --- a/src/xml/document.h +++ b/src/xml/document.h @@ -12,8 +12,8 @@ * */ -#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H -#define SEEN_INKSCAPE_XML_SP_REPR_DOCTREE_H +#ifndef SEEN_INKSCAPE_XML_SP_REPR_DOC_H +#define SEEN_INKSCAPE_XML_SP_REPR_DOC_H #include "xml/xml-forward.h" #include "xml/node.h" @@ -41,7 +41,7 @@ namespace XML { * "restore point" by calling beginTransaction() again. There can be only one active * transaction at a time for a given document. */ -class DocumentTree : virtual public Node { +struct Document : virtual public Node { public: /** * @name Document transactions diff --git a/src/xml/node.h b/src/xml/node.h index 38f006d5c..abcccdb9a 100644 --- a/src/xml/node.h +++ b/src/xml/node.h @@ -80,8 +80,6 @@ public: * @{ */ - - /** * @brief Get the type of the node * @return NodeType enumeration member corresponding to the type of the node. diff --git a/src/xml/rebase-hrefs.cpp b/src/xml/rebase-hrefs.cpp index 0fa5c0337..ec43bb178 100644 --- a/src/xml/rebase-hrefs.cpp +++ b/src/xml/rebase-hrefs.cpp @@ -1,6 +1,6 @@ #include "xml/rebase-hrefs.h" #include "dir-util.h" -#include "document.h" /* Unfortunately there's a separate xml/document.h. */ +#include "../document.h" /* Unfortunately there's a separate xml/document.h. */ #include "io/sys.h" #include "sp-object.h" #include "streq.h" @@ -199,9 +199,9 @@ Inkscape::XML::calc_abs_doc_base(gchar const *const doc_base) * * \param spns True iff doc should contain sodipodi:absref attributes. */ -void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *const new_base, bool const spns) +void Inkscape::XML::rebase_hrefs(SPDocument *const doc, gchar const *const new_base, bool const spns) { - gchar *const old_abs_base = calc_abs_doc_base((Inkscape::XML::Document *)(doc)->base); + gchar *const old_abs_base = calc_abs_doc_base(doc->base); gchar *const new_abs_base = calc_abs_doc_base(new_base); /* TODO: Should handle not just image but also: @@ -224,7 +224,7 @@ void Inkscape::XML::rebase_hrefs(Inkscape::XML::Document *doc, gchar const *cons * * Note also that Inkscape only supports fragment hrefs (href="#pattern257") for many of these * cases. */ - GSList const *images = sp_document_get_resource_list((Inkscape::XML::Document *)doc, "image"); + GSList const *images = sp_document_get_resource_list(doc, "image"); for (GSList const *l = images; l != NULL; l = l->next) { Inkscape::XML::Node *ir = SP_OBJECT_REPR(l->data); diff --git a/src/xml/rebase-hrefs.h b/src/xml/rebase-hrefs.h index 36de6ba6e..b4f288c4d 100644 --- a/src/xml/rebase-hrefs.h +++ b/src/xml/rebase-hrefs.h @@ -4,15 +4,14 @@ #include #include "util/list.h" #include "xml/attribute-record.h" -#include "document.h" +struct SPDocument; namespace Inkscape { namespace XML { -//struct Document; gchar *calc_abs_doc_base(gchar const *doc_base); -void rebase_hrefs(Inkscape::XML::Document *doc, gchar const *new_base, bool spns); +void rebase_hrefs(SPDocument *doc, gchar const *new_base, bool spns); Inkscape::Util::List rebase_href_attrs( gchar const *old_abs_base, diff --git a/src/xml/repr-css.cpp b/src/xml/repr-css.cpp index a7e913853..be125f453 100644 --- a/src/xml/repr-css.cpp +++ b/src/xml/repr-css.cpp @@ -18,19 +18,19 @@ using Inkscape::XML::AttributeRecord; using Inkscape::XML::SimpleNode; using Inkscape::XML::Node; using Inkscape::XML::NodeType; -//using Inkscape::XML::Document; +using Inkscape::XML::Document; struct SPCSSAttrImpl : public SimpleNode, public SPCSSAttr { public: - SPCSSAttrImpl(Inkscape::XML::Document *doc) + SPCSSAttrImpl(Document *doc) : SimpleNode(g_quark_from_static_string("css"), doc) {} - SPCSSAttrImpl(SPCSSAttrImpl const &other, Inkscape::XML::Document *doc) - : SimpleNode(other, (Inkscape::XML::Document *)doc) {} + SPCSSAttrImpl(SPCSSAttrImpl const &other, Document *doc) + : SimpleNode(other, doc) {} NodeType type() const { return Inkscape::XML::ELEMENT_NODE; } protected: - SimpleNode *_duplicate(Inkscape::XML::Document* doc) const { return new SPCSSAttrImpl(*this, (Inkscape::XML::Document *)doc); } + SimpleNode *_duplicate(Document* doc) const { return new SPCSSAttrImpl(*this, doc); } }; static void sp_repr_css_add_components(SPCSSAttr *css, Node *repr, gchar const *attr); diff --git a/src/xml/repr.h b/src/xml/repr.h index b40fe63a9..549822e4e 100644 --- a/src/xml/repr.h +++ b/src/xml/repr.h @@ -148,7 +148,7 @@ Inkscape::XML::Node *sp_repr_lookup_child(Inkscape::XML::Node *repr, gchar const *value); -inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::DocumentTree const *doc) { +inline Inkscape::XML::Node *sp_repr_document_first_child(Inkscape::XML::Document const *doc) { return const_cast(doc->firstChild()); } diff --git a/src/xml/xml-forward.h b/src/xml/xml-forward.h index e3ebad183..33218c8ae 100644 --- a/src/xml/xml-forward.h +++ b/src/xml/xml-forward.h @@ -20,7 +20,7 @@ namespace XML { struct AttributeRecord; struct CommentNode; class CompositeNodeObserver; -class Document; +struct Document; class ElementNode; class Event; class EventAdd; -- 2.30.2