1 /*
2 Author: Ted Gould <ted@gould.cx>
3 Copyright (c) 2003-2005
5 This code is licensed under the GNU GPL. See COPYING for details.
7 This file is the backend to the extensions system. These are
8 the parts of the system that most users will never see, but are
9 important for implementing the extensions themselves. This file
10 contains the base class for all of that.
11 */
12 #ifndef __INKSCAPE_EXTENSION_IMPLEMENTATION_H__
13 #define __INKSCAPE_EXTENSION_IMPLEMENTATION_H__
15 #include <gtk/gtkdialog.h>
16 #include <gdkmm/types.h>
17 #include <gtkmm/widget.h>
19 #include "forward.h"
20 #include "extension/extension-forward.h"
21 #include "libnr/nr-forward.h"
22 #include "libnr/nr-point.h"
23 #include "xml/node.h"
25 namespace Inkscape {
26 namespace Extension {
27 namespace Implementation {
29 /**
30 * Base class for all implementations of modules. This is whether they are done systematically by
31 * having something like the scripting system, or they are implemented internally they all derive
32 * from this class.
33 */
34 class Implementation {
35 public:
36 /* ----- Constructor / destructor ----- */
37 Implementation() {}
39 virtual ~Implementation() {}
41 /* ----- Basic functions for all Extension ----- */
42 virtual bool load(Inkscape::Extension::Extension *module);
44 virtual void unload(Inkscape::Extension::Extension *module);
46 /** Verify any dependencies. */
47 virtual bool check(Inkscape::Extension::Extension *module);
50 /* ----- Input functions ----- */
51 /** Find out information about the file. */
52 virtual Gtk::Widget *prefs_input(Inkscape::Extension::Input *module,
53 gchar const *filename);
55 virtual SPDocument *open(Inkscape::Extension::Input *module,
56 gchar const *filename);
58 /* ----- Output functions ----- */
59 /** Find out information about the file. */
60 virtual Gtk::Widget *prefs_output(Inkscape::Extension::Output *module);
61 virtual void save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename);
63 /* ----- Effect functions ----- */
64 /** Find out information about the file. */
65 virtual Gtk::Widget * prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View * view);
66 /* TODO: need to figure out what we need here */
68 virtual void effect(Inkscape::Extension::Effect *module,
69 Inkscape::UI::View::View *document);
71 /* ----- Print functions ----- */
72 virtual unsigned setup(Inkscape::Extension::Print *module);
73 virtual unsigned set_preview(Inkscape::Extension::Print *module);
75 virtual unsigned begin(Inkscape::Extension::Print *module,
76 SPDocument *doc);
77 virtual unsigned finish(Inkscape::Extension::Print *module);
78 virtual bool textToPath(Inkscape::Extension::Print *ext);
79 virtual bool fontEmbedded(Inkscape::Extension::Print * ext);
81 /* ----- Rendering methods ----- */
82 virtual unsigned bind(Inkscape::Extension::Print *module,
83 NRMatrix const *transform,
84 float opacity);
85 virtual unsigned release(Inkscape::Extension::Print *module);
86 virtual unsigned comment(Inkscape::Extension::Print *module, const char * comment);
87 virtual unsigned fill(Inkscape::Extension::Print *module,
88 NRBPath const *bpath,
89 NRMatrix const *ctm,
90 SPStyle const *style,
91 NRRect const *pbox,
92 NRRect const *dbox,
93 NRRect const *bbox);
94 virtual unsigned stroke(Inkscape::Extension::Print *module,
95 NRBPath const *bpath,
96 NRMatrix const *transform,
97 SPStyle const *style,
98 NRRect const *pbox,
99 NRRect const *dbox,
100 NRRect const *bbox);
101 virtual unsigned image(Inkscape::Extension::Print *module,
102 unsigned char *px,
103 unsigned int w,
104 unsigned int h,
105 unsigned int rs,
106 NRMatrix const *transform,
107 SPStyle const *style);
108 virtual unsigned text(Inkscape::Extension::Print *module,
109 char const *text,
110 NR::Point p,
111 SPStyle const *style);
112 virtual void processPath(Inkscape::XML::Node * node);
113 };
115 } /* namespace Implementation */
116 } /* namespace Extension */
117 } /* namespace Inkscape */
119 #endif /* __INKSCAPE_EXTENSION_IMPLEMENTATION_H__ */
121 /*
122 Local Variables:
123 mode:c++
124 c-file-style:"stroustrup"
125 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
126 indent-tabs-mode:nil
127 fill-column:99
128 End:
129 */
130 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :