Code

r16564@tres: ted | 2007-09-12 20:45:12 -0700
[inkscape.git] / src / extension / implementation / implementation.cpp
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 void
53 Implementation::commitDocument (void) {
54     return;
55 }
57 Gtk::Widget *
58 Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const *filename) {
59     return module->autogui(NULL, NULL);
60 } /* Implementation::prefs_input */
62 SPDocument *
63 Implementation::open(Inkscape::Extension::Input *module, gchar const *filename) {
64     /* throw open_failed(); */
65     return NULL;
66 } /* Implementation::open */
68 Gtk::Widget *
69 Implementation::prefs_output(Inkscape::Extension::Output *module) {
70     return module->autogui(NULL, NULL);
71 } /* Implementation::prefs_output */
73 void
74 Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename) {
75     /* throw save_fail */
76     return;
77 } /* Implementation::save */
79 Gtk::Widget *
80 Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view, sigc::signal<void> * changeSignal) {
81     return module->autogui(NULL, NULL);
82 } /* Implementation::prefs_effect */
84 void
85 Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document) {
86     /* throw filter_fail */
87     return;
88 } /* Implementation::filter */
90 unsigned int
91 Implementation::setup(Inkscape::Extension::Print *module)
92 {
93     return 0;
94 }
96 unsigned int
97 Implementation::set_preview(Inkscape::Extension::Print *module)
98 {
99     return 0;
103 unsigned int
104 Implementation::begin(Inkscape::Extension::Print *module, SPDocument *doc)
106     return 0;
109 unsigned int
110 Implementation::finish(Inkscape::Extension::Print *module)
112     return 0;
116 /* Rendering methods */
117 unsigned int
118 Implementation::bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity)
120     return 0;
123 unsigned int
124 Implementation::release(Inkscape::Extension::Print *module)
126     return 0;
129 unsigned int
130 Implementation::comment(Inkscape::Extension::Print *module, char const *comment)
132     return 0;
135 unsigned int
136 Implementation::fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
137                      NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
139     return 0;
142 unsigned int
143 Implementation::stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
144                        NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
146     return 0;
149 unsigned int
150 Implementation::image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
151                       NRMatrix const *transform, SPStyle const *style)
153     return 0;
156 unsigned int
157 Implementation::text(Inkscape::Extension::Print *module, char const *text,
158                      NR::Point p, SPStyle const *style)
160     return 0;
163 void
164 Implementation::processPath(Inkscape::XML::Node * node)
166     return;
169 /**
170    \brief  Tell the printing engine whether text should be text or path
171    \retval true  Render the text as a path
172    \retval false Render text using the text function (above)
174     Default value is false because most printing engines will support
175     paths more than they'll support text.  (at least they do today)
176 */
177 bool
178 Implementation::textToPath(Inkscape::Extension::Print *ext)
180     return false;
183 /**
184    \brief Get "fontEmbedded" param, i.e. tell the printing engine whether fonts should be embedded
185    \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
186    \retval FALSE Not embed fonts
188    Only available for Adobe Type 1 fonts in EPS output as of now
189 */
191 bool
192 Implementation::fontEmbedded(Inkscape::Extension::Print * ext)
194     return false;
197 }  /* namespace Implementation */
198 }  /* namespace Extension */
199 }  /* namespace Inkscape */
201 /*
202   Local Variables:
203   mode:c++
204   c-file-style:"stroustrup"
205   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
206   indent-tabs-mode:nil
207   fill-column:99
208   End:
209 */
210 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :