Code

Added missing (and very important) file.
[inkscape.git] / src / extension / implementation / implementation.h
index 68c2eb04c4044fcce2b2c3656f1944d665751d69..9de70dce76ca536fa9b4e8ecd0caa793bd554425 100644 (file)
@@ -1,6 +1,6 @@
 /*
     Author:  Ted Gould <ted@gould.cx>
-    Copyright (c) 2003-2005
+    Copyright (c) 2003-2005,2007
 
     This code is licensed under the GNU GPL.  See COPYING for details.
  
 #include "extension/extension-forward.h"
 #include "libnr/nr-forward.h"
 #include "libnr/nr-point.h"
+#include "xml/node.h"
+#include <2geom/forward.h>
 
 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 */
+       Inkscape::UI::View::View * _view;
+public:
+       ImplementationDocumentCache (Inkscape::UI::View::View * view) :
+                       _view(view)
+       {
+               return;
+       };
+       virtual ~ImplementationDocumentCache ( ) { return; };
+       Inkscape::UI::View::View const * view ( ) { return _view; };
+};
+
 /**
  * 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
@@ -41,10 +57,13 @@ public:
     virtual bool load(Inkscape::Extension::Extension *module);
 
     virtual void unload(Inkscape::Extension::Extension *module);
+       virtual ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * doc);
 
     /** Verify any dependencies. */
     virtual bool check(Inkscape::Extension::Extension *module);
 
+    virtual bool cancelProcessing (void);
+       virtual void commitDocument (void);
 
     /* ----- Input functions ----- */
     /** Find out information about the file. */
@@ -61,11 +80,13 @@ public:
 
     /* ----- Effect functions ----- */
     /** Find out information about the file. */
-    virtual Gtk::Widget * prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view);
-    /* 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);
@@ -75,23 +96,24 @@ public:
                            SPDocument *doc);
     virtual unsigned finish(Inkscape::Extension::Print *module);
     virtual bool     textToPath(Inkscape::Extension::Print *ext);
+    virtual bool     fontEmbedded(Inkscape::Extension::Print * ext);
 
     /* ----- Rendering methods ----- */
     virtual unsigned bind(Inkscape::Extension::Print *module,
-                          NRMatrix const *transform,
+                          Geom::Matrix const *transform,
                           float opacity);
     virtual unsigned release(Inkscape::Extension::Print *module);
     virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment);
     virtual unsigned fill(Inkscape::Extension::Print *module,
-                          NRBPath const *bpath,
-                          NRMatrix const *ctm,
+                          Geom::PathVector const &pathv,
+                          Geom::Matrix const *ctm,
                           SPStyle const *style,
                           NRRect const *pbox,
                           NRRect const *dbox,
                           NRRect const *bbox);
     virtual unsigned stroke(Inkscape::Extension::Print *module,
-                            NRBPath const *bpath,
-                            NRMatrix const *transform,
+                            Geom::PathVector const &pathv,
+                            Geom::Matrix const *transform,
                             SPStyle const *style,
                             NRRect const *pbox,
                             NRRect const *dbox,
@@ -101,14 +123,16 @@ public:
                            unsigned int w,
                            unsigned int h,
                            unsigned int rs,
-                           NRMatrix const *transform,
+                           Geom::Matrix const *transform,
                            SPStyle const *style);
     virtual unsigned text(Inkscape::Extension::Print *module,
                           char const *text,
-                          NR::Point p,
+                          Geom::Point p,
                           SPStyle const *style);
+    virtual void     processPath(Inkscape::XML::Node * node);
 };
 
+
 }  /* namespace Implementation */
 }  /* namespace Extension */
 }  /* namespace Inkscape */