From: gouldtj Date: Tue, 30 Oct 2007 19:28:07 +0000 (+0000) Subject: r16676@shi: ted | 2007-10-12 21:09:50 -0700 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c2b22c9f829b2eb90f50a77c15a37af0d1114849;p=inkscape.git r16676@shi: ted | 2007-10-12 21:09:50 -0700 Half fixed caching --- diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp index 70423472b..3bf9b0b75 100644 --- a/src/extension/implementation/implementation.cpp +++ b/src/extension/implementation/implementation.cpp @@ -38,6 +38,11 @@ Implementation::unload(Inkscape::Extension::Extension *module) { return; } /* Implementation::unload */ +ImplementationDocumentCache * +Implementation::newDocCache (SPDocument * doc) { + return NULL; +} + bool Implementation::check(Inkscape::Extension::Extension *module) { /* If there are no checks, they all pass */ @@ -66,23 +71,23 @@ Implementation::open(Inkscape::Extension::Input *module, gchar const *filename) } /* Implementation::open */ Gtk::Widget * -Implementation::prefs_output(Inkscape::Extension::Output *module) { +Implementation::prefs_output(Inkscape::Extension::Output *module, ImplementationDocumentCache * docCache) { return module->autogui(NULL, NULL); } /* Implementation::prefs_output */ void -Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename) { +Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename, ImplementationDocumentCache * docCache) { /* throw save_fail */ return; } /* Implementation::save */ Gtk::Widget * -Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view, sigc::signal * changeSignal) { +Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view, sigc::signal * changeSignal, ImplementationDocumentCache * docCache) { return module->autogui(NULL, NULL); } /* Implementation::prefs_effect */ void -Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document) { +Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, ImplementationDocumentCache * docCache) { /* throw filter_fail */ return; } /* Implementation::filter */ diff --git a/src/extension/implementation/implementation.h b/src/extension/implementation/implementation.h index e69686775..ca4f12069 100644 --- a/src/extension/implementation/implementation.h +++ b/src/extension/implementation/implementation.h @@ -26,6 +26,19 @@ namespace Inkscape { namespace Extension { namespace Implementation { +/** \brief A cache for the document and this implementation */ +class ImplementationDocumentCache { + /** \brief The document that this instance is working on */ + SPDocument * _doc; +public: + ImplementationDocumentCache (SPDocument * doc) : + _doc(doc) + { + return; + }; + virtual ~ImplementationDocumentCache ( ) { return; }; +}; + /** * Base class for all implementations of modules. This is whether they are done systematically by * having something like the scripting system, or they are implemented internally they all derive @@ -42,6 +55,7 @@ public: virtual bool load(Inkscape::Extension::Extension *module); virtual void unload(Inkscape::Extension::Extension *module); + ImplementationDocumentCache * newDocCache (SPDocument * doc); /** Verify any dependencies. */ virtual bool check(Inkscape::Extension::Extension *module); @@ -59,16 +73,18 @@ public: /* ----- Output functions ----- */ /** Find out information about the file. */ - virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module); - virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename); + virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module, ImplementationDocumentCache * docCache); + virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename, ImplementationDocumentCache * docCache); /* ----- Effect functions ----- */ /** Find out information about the file. */ - virtual Gtk::Widget * prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view, sigc::signal * changeSignal); - /* TODO: need to figure out what we need here */ - + virtual Gtk::Widget * prefs_effect(Inkscape::Extension::Effect *module, + Inkscape::UI::View::View * view, + sigc::signal * changeSignal, + ImplementationDocumentCache * docCache); virtual void effect(Inkscape::Extension::Effect *module, - Inkscape::UI::View::View *document); + Inkscape::UI::View::View *document, + ImplementationDocumentCache * docCache); /* ----- Print functions ----- */ virtual unsigned setup(Inkscape::Extension::Print *module); @@ -114,6 +130,7 @@ public: virtual void processPath(Inkscape::XML::Node * node); }; + } /* namespace Implementation */ } /* namespace Extension */ } /* namespace Inkscape */