summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: dfa0e4a)
raw | patch | inline | side by side (parent: dfa0e4a)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Tue, 30 Oct 2007 19:28:07 +0000 (19:28 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Tue, 30 Oct 2007 19:28:07 +0000 (19:28 +0000) |
Half fixed caching
src/extension/implementation/implementation.cpp | patch | blob | history | |
src/extension/implementation/implementation.h | patch | blob | history |
diff --git a/src/extension/implementation/implementation.cpp b/src/extension/implementation/implementation.cpp
index 70423472b2d1d773375e2ebb4807aca83cacd23d..3bf9b0b750f311c2ae67f85d544abc480edda6c3 100644 (file)
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 */
} /* 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 e69686775dd0e6946508b8605ee19c7a5dacb859..ca4f120699195f7b735440b5d3bbec44f7246b63 100644 (file)
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
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);
/* ----- 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);
virtual void processPath(Inkscape::XML::Node * node);
};
+
} /* namespace Implementation */
} /* namespace Extension */
} /* namespace Inkscape */