d01f52cb425bfa6346e4672ce2f36046d8a4124c
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 */
13 #ifdef HAVE_CONFIG_H
14 # include <config.h>
15 #endif
16 #include "implementation.h"
18 #include <extension/output.h>
19 #include <extension/input.h>
20 #include <extension/effect.h>
22 namespace Inkscape {
23 namespace Extension {
24 namespace Implementation {
26 /**
27 * \return Was the load sucessful?
28 * \brief This function is the stub load. It just returns success.
29 * \param module The Extension that should be loaded.
30 */
31 bool
32 Implementation::load(Inkscape::Extension::Extension *module) {
33 return TRUE;
34 } /* Implementation::load */
36 void
37 Implementation::unload(Inkscape::Extension::Extension *module) {
38 return;
39 } /* Implementation::unload */
41 bool
42 Implementation::check(Inkscape::Extension::Extension *module) {
43 /* If there are no checks, they all pass */
44 return TRUE;
45 } /* Implemenation::check */
47 bool
48 Implementation::cancelProcessing (void) {
49 return true;
50 }
52 Gtk::Widget *
53 Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const *filename) {
54 return module->autogui(NULL, NULL);
55 } /* Implementation::prefs_input */
57 SPDocument *
58 Implementation::open(Inkscape::Extension::Input *module, gchar const *filename) {
59 /* throw open_failed(); */
60 return NULL;
61 } /* Implementation::open */
63 Gtk::Widget *
64 Implementation::prefs_output(Inkscape::Extension::Output *module) {
65 return module->autogui(NULL, NULL);
66 } /* Implementation::prefs_output */
68 void
69 Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename) {
70 /* throw save_fail */
71 return;
72 } /* Implementation::save */
74 Gtk::Widget *
75 Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view) {
76 return module->autogui(NULL, NULL);
77 } /* Implementation::prefs_effect */
79 void
80 Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document) {
81 /* throw filter_fail */
82 return;
83 } /* Implementation::filter */
85 unsigned int
86 Implementation::setup(Inkscape::Extension::Print *module)
87 {
88 return 0;
89 }
91 unsigned int
92 Implementation::set_preview(Inkscape::Extension::Print *module)
93 {
94 return 0;
95 }
98 unsigned int
99 Implementation::begin(Inkscape::Extension::Print *module, SPDocument *doc)
100 {
101 return 0;
102 }
104 unsigned int
105 Implementation::finish(Inkscape::Extension::Print *module)
106 {
107 return 0;
108 }
111 /* Rendering methods */
112 unsigned int
113 Implementation::bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity)
114 {
115 return 0;
116 }
118 unsigned int
119 Implementation::release(Inkscape::Extension::Print *module)
120 {
121 return 0;
122 }
124 unsigned int
125 Implementation::comment(Inkscape::Extension::Print *module, char const *comment)
126 {
127 return 0;
128 }
130 unsigned int
131 Implementation::fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
132 NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
133 {
134 return 0;
135 }
137 unsigned int
138 Implementation::stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
139 NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
140 {
141 return 0;
142 }
144 unsigned int
145 Implementation::image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
146 NRMatrix const *transform, SPStyle const *style)
147 {
148 return 0;
149 }
151 unsigned int
152 Implementation::text(Inkscape::Extension::Print *module, char const *text,
153 NR::Point p, SPStyle const *style)
154 {
155 return 0;
156 }
158 void
159 Implementation::processPath(Inkscape::XML::Node * node)
160 {
161 return;
162 }
164 /**
165 \brief Tell the printing engine whether text should be text or path
166 \retval true Render the text as a path
167 \retval false Render text using the text function (above)
169 Default value is false because most printing engines will support
170 paths more than they'll support text. (at least they do today)
171 */
172 bool
173 Implementation::textToPath(Inkscape::Extension::Print *ext)
174 {
175 return false;
176 }
178 /**
179 \brief Get "fontEmbedded" param, i.e. tell the printing engine whether fonts should be embedded
180 \retval TRUE Fonts have to be embedded in the output so that the user might not need to install fonts to have the interpreter read the document correctly
181 \retval FALSE Not embed fonts
183 Only available for Adobe Type 1 fonts in EPS output as of now
184 */
186 bool
187 Implementation::fontEmbedded(Inkscape::Extension::Print * ext)
188 {
189 return false;
190 }
192 } /* namespace Implementation */
193 } /* namespace Extension */
194 } /* namespace Inkscape */
196 /*
197 Local Variables:
198 mode:c++
199 c-file-style:"stroustrup"
200 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
201 indent-tabs-mode:nil
202 fill-column:99
203 End:
204 */
205 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :