summaryrefslogtreecommitdiffstats
path: root/src/extension/implementation
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-10-30 19:28:07 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-10-30 19:28:07 +0000
commit4d09b897026ce968395606745d36b473ddb85786 (patch)
treec3a6c46479a63b4356e42a28a2fc92736bb6ecf4 /src/extension/implementation
parentr16675@shi: ted | 2007-10-12 21:06:32 -0700 (diff)
downloadinkscape-4d09b897026ce968395606745d36b473ddb85786.tar.gz
inkscape-4d09b897026ce968395606745d36b473ddb85786.zip
r16676@shi: ted | 2007-10-12 21:09:50 -0700
Half fixed caching (bzr r3976)
Diffstat (limited to 'src/extension/implementation')
-rw-r--r--src/extension/implementation/implementation.cpp13
-rw-r--r--src/extension/implementation/implementation.h29
2 files changed, 32 insertions, 10 deletions
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<void> * changeSignal) {
+Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view, sigc::signal<void> * 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<void> * 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<void> * 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 */