summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 70d3ef4)
raw | patch | inline | side by side (parent: 70d3ef4)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Tue, 30 Oct 2007 19:29:36 +0000 (19:29 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Tue, 30 Oct 2007 19:29:36 +0000 (19:29 +0000) |
Okay, so now the caches get into the execution environment and can be passed around to the effects. Now it's a
matter of implementing the caches in the drivers.
matter of implementing the caches in the drivers.
index 6b03014f83bfe0286bbafbe5b45dc2e31c57e2b6..f7caf125d8b93d5d0f3739d0ee568b04ebd2f599 100644 (file)
--- a/src/extension/effect.cpp
+++ b/src/extension/effect.cpp
#include "desktop-handles.h"
#include "selection.h"
#include "sp-namedview.h"
-#include "document.h"
+#include "desktop.h"
#include "implementation/implementation.h"
#include "effect.h"
#include "execution-env.h"
sigc::signal<void> * changeSignal = new sigc::signal<void>;
Gtk::Widget * controls;
- controls = imp->prefs_effect(this, doc, changeSignal, NULL);
+ SPDesktop * spdesktop = (SPDesktop *)doc;
+ Implementation::ImplementationDocumentCache * docCache = imp->newDocCache(this, spdesktop->doc());
+ controls = imp->prefs_effect(this, doc, changeSignal, docCache);
- ExecutionEnv executionEnv(this, doc, controls, changeSignal);
+ ExecutionEnv executionEnv(this, doc, controls, changeSignal, NULL, docCache);
timer->lock();
executionEnv.run();
index b7746289e864bfce9a05697d78594b2d0f57833b..21df42b9dd023dead7a1ec5a7747237b19c93699 100644 (file)
#include "selection.h"
#include "effect.h"
#include "document.h"
+#include "desktop.h"
#include "ui/view/view.h"
#include "sp-namedview.h"
#include "desktop-handles.h"
namespace Extension {
-ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls, sigc::signal<void> * changeSignal, Gtk::Dialog * prefDialog) :
+ExecutionEnv::ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls, sigc::signal<void> * changeSignal, Gtk::Dialog * prefDialog, Implementation::ImplementationDocumentCache * docCache) :
_visibleDialog(NULL),
_prefsVisible(false),
_finished(false),
_selfdelete(false),
_changeSignal(changeSignal),
_doc(doc),
- _effect(effect) {
+ _effect(effect),
+ _docCache(docCache) {
SPDesktop *desktop = (SPDesktop *)_doc;
sp_namedview_document_from_window(desktop);
if (_changeSignal != NULL && !_shutdown) {
delete _changeSignal;
}
+ killDocCache();
return;
}
+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());
+ }
+ return;
+}
+
+void
+ExecutionEnv::killDocCache (void) {
+ if (_docCache != NULL) {
+ printf("Killed Doc Cache\n");
+ delete _docCache;
+ _docCache = NULL;
+ }
+ return;
+}
+
void
ExecutionEnv::preferencesChange (void) {
_timersig.disconnect();
_mainloop->run();
} else {
_prefsChanged = false;
- _effect->get_imp()->effect(_effect, _doc, NULL);
+ genDocCache();
+ _effect->get_imp()->effect(_effect, _doc, _docCache);
processingComplete();
}
if (_canceled) {
_humanWait = false;
}
_livePreview = state;
+ if (!_livePreview) {
+ killDocCache();
+ }
return;
}
index a6c4ebf647dba2fd79ee612d93c9e75fc4dfd786..7b35f33a23b297967ec78dd492eab5b11de2d811 100644 (file)
#include "forward.h"
#include "extension-forward.h"
+#include "extension.h"
namespace Inkscape {
namespace Extension {
sigc::connection _dialogsig;
sigc::connection _changesig;
sigc::connection _timersig;
+ Implementation::ImplementationDocumentCache * _docCache;
public:
Effect * _effect;
- ExecutionEnv (Effect * effect, Inkscape::UI::View::View * doc, Gtk::Widget * controls = NULL, sigc::signal<void> * changeSignal = NULL, Gtk::Dialog * prefDialog = NULL);
+ ExecutionEnv (Effect * effect,
+ Inkscape::UI::View::View * doc,
+ Gtk::Widget * controls = NULL,
+ sigc::signal<void> * changeSignal = NULL,
+ Gtk::Dialog * prefDialog = NULL,
+ Implementation::ImplementationDocumentCache * docCache = NULL);
~ExecutionEnv (void);
void run (void);
void documentCancel (void);
void documentCommit (void);
void reselect (void);
+ void genDocCache (void);
+ void killDocCache (void);
};
} } /* namespace Inkscape, Extension */
index f0346b488cd8cc8fdb3b4cf89c7376bb9a2e596d..d836c29abef23cc0a48796ccafd1e87c0362ed0a 100644 (file)
namespace Implementation {
class Implementation;
+class ImplementationDocumentCache;
}
} }