From: gouldtj Date: Tue, 30 Oct 2007 19:29:49 +0000 (+0000) Subject: r16893@shi: ted | 2007-10-30 07:31:04 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=04bf06c03aae461ffbda961b609f5cdb3b9277b2;p=inkscape.git r16893@shi: ted | 2007-10-30 07:31:04 -0700 Wow, that wasn't as hard as I thought it would be. Changing away from SPDocument. Sounded like a good idea, but we need to be able to get selections in the document cache. --- diff --git a/src/extension/effect.cpp b/src/extension/effect.cpp index f7caf125d..2c1c832ae 100644 --- a/src/extension/effect.cpp +++ b/src/extension/effect.cpp @@ -219,8 +219,7 @@ Effect::prefs (Inkscape::UI::View::View * doc) sigc::signal * changeSignal = new sigc::signal; Gtk::Widget * controls; - SPDesktop * spdesktop = (SPDesktop *)doc; - Implementation::ImplementationDocumentCache * docCache = imp->newDocCache(this, spdesktop->doc()); + Implementation::ImplementationDocumentCache * docCache = imp->newDocCache(this, doc); controls = imp->prefs_effect(this, doc, changeSignal, docCache); ExecutionEnv executionEnv(this, doc, controls, changeSignal, NULL, docCache); diff --git a/src/extension/execution-env.cpp b/src/extension/execution-env.cpp index 21df42b9d..0dbb32b11 100644 --- a/src/extension/execution-env.cpp +++ b/src/extension/execution-env.cpp @@ -103,8 +103,7 @@ void ExecutionEnv::genDocCache (void) { if (_docCache == NULL) { printf("Gen Doc Cache\n"); - SPDesktop * spdesktop = (SPDesktop *)_doc; - Implementation::ImplementationDocumentCache * _docCache = _effect->get_imp()->newDocCache(_effect, spdesktop->doc()); + Implementation::ImplementationDocumentCache * _docCache = _effect->get_imp()->newDocCache(_effect, _doc); } return; } diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index acec99041..9ad60fef2 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -1,6 +1,6 @@ /* Author: Ted Gould - Copyright (c) 2003-2005 + Copyright (c) 2003-2005,2007 This code is licensed under the GNU GPL. See COPYING for details. @@ -48,7 +48,7 @@ Implementation::unload(Inkscape::Extension::Extension *module) { to reimplement it to do something useful. */ ImplementationDocumentCache * -Implementation::newDocCache (Inkscape::Extension::Extension * ext, SPDocument * doc) { +Implementation::newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * view) { return NULL; } diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index bd380c07e..ad1bbf1d2 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -1,6 +1,6 @@ /* Author: Ted Gould - Copyright (c) 2003-2005 + Copyright (c) 2003-2005,2007 This code is licensed under the GNU GPL. See COPYING for details. @@ -29,15 +29,15 @@ namespace Implementation { /** \brief A cache for the document and this implementation */ class ImplementationDocumentCache { /** \brief The document that this instance is working on */ - SPDocument * _doc; + Inkscape::UI::View::View * _view; public: - ImplementationDocumentCache (SPDocument * doc) : - _doc(doc) + ImplementationDocumentCache (Inkscape::UI::View::View * view) : + _view(view) { return; }; virtual ~ImplementationDocumentCache ( ) { return; }; - SPDocument const * doc ( ) { return _doc; }; + Inkscape::UI::View::View const * view ( ) { return _view; }; }; /** @@ -56,7 +56,7 @@ public: virtual bool load(Inkscape::Extension::Extension *module); virtual void unload(Inkscape::Extension::Extension *module); - ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, SPDocument * doc); + ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc); /** Verify any dependencies. */ virtual bool check(Inkscape::Extension::Extension *module); diff --git a/src/extension/internal/bitmap/imagemagick.h b/src/extension/internal/bitmap/imagemagick.h index 3060ddd33..1fb79f826 100644 --- a/src/extension/internal/bitmap/imagemagick.h +++ b/src/extension/internal/bitmap/imagemagick.h @@ -20,7 +20,7 @@ namespace Bitmap { class ImageMagickDocCache: public Inkscape::Extension::Implementation::ImplementationDocumentCache { public: - ImageMagickDocCache(SPDocument * doc) : Inkscape::Extension::Implementation::ImplementationDocumentCache(doc) { }; + ImageMagickDocCache(Inkscape::UI::View::View * view) : Inkscape::Extension::Implementation::ImplementationDocumentCache(view) { }; ~ImageMagickDocCache ( ) { }; };