Code

r16676@shi: ted | 2007-10-12 21:09:50 -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 ImplementationDocumentCache *
42 Implementation::newDocCache (SPDocument * doc) {
43         return NULL;
44 }
46 bool
47 Implementation::check(Inkscape::Extension::Extension *module) {
48     /* If there are no checks, they all pass */
49     return TRUE;
50 } /* Implemenation::check */
52 bool
53 Implementation::cancelProcessing (void) {
54     return true;
55 }
57 void
58 Implementation::commitDocument (void) {
59     return;
60 }
62 Gtk::Widget *
63 Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const *filename) {
64     return module->autogui(NULL, NULL);
65 } /* Implementation::prefs_input */
67 SPDocument *
68 Implementation::open(Inkscape::Extension::Input *module, gchar const *filename) {
69     /* throw open_failed(); */
70     return NULL;
71 } /* Implementation::open */
73 Gtk::Widget *
74 Implementation::prefs_output(Inkscape::Extension::Output *module, ImplementationDocumentCache * docCache) {
75     return module->autogui(NULL, NULL);
76 } /* Implementation::prefs_output */
78 void
79 Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename, ImplementationDocumentCache * docCache) {
80     /* throw save_fail */
81     return;
82 } /* Implementation::save */
84 Gtk::Widget *
85 Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view, sigc::signal<void> * changeSignal, ImplementationDocumentCache * docCache) {
86     return module->autogui(NULL, NULL);
87 } /* Implementation::prefs_effect */
89 void
90 Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document, ImplementationDocumentCache * docCache) {
91     /* throw filter_fail */
92     return;
93 } /* Implementation::filter */
95 unsigned int
96 Implementation::setup(Inkscape::Extension::Print *module)
97 {
98     return 0;
99 }
101 unsigned int
102 Implementation::set_preview(Inkscape::Extension::Print *module)
104     return 0;
108 unsigned int
109 Implementation::begin(Inkscape::Extension::Print *module, SPDocument *doc)
111     return 0;
114 unsigned int
115 Implementation::finish(Inkscape::Extension::Print *module)
117     return 0;
121 /* Rendering methods */
122 unsigned int
123 Implementation::bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity)
125     return 0;
128 unsigned int
129 Implementation::release(Inkscape::Extension::Print *module)
131     return 0;
134 unsigned int
135 Implementation::comment(Inkscape::Extension::Print *module, char const *comment)
137     return 0;
140 unsigned int
141 Implementation::fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
142                      NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
144     return 0;
147 unsigned int
148 Implementation::stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
149                        NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
151     return 0;
154 unsigned int
155 Implementation::image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
156                       NRMatrix const *transform, SPStyle const *style)
158     return 0;
161 unsigned int
162 Implementation::text(Inkscape::Extension::Print *module, char const *text,
163                      NR::Point p, SPStyle const *style)
165     return 0;
168 void
169 Implementation::processPath(Inkscape::XML::Node * node)
171     return;
174 /**
175    \brief  Tell the printing engine whether text should be text or path
176    \retval true  Render the text as a path
177    \retval false Render text using the text function (above)
179     Default value is false because most printing engines will support
180     paths more than they'll support text.  (at least they do today)
181 */
182 bool
183 Implementation::textToPath(Inkscape::Extension::Print *ext)
185     return false;
188 /**
189    \brief Get "fontEmbedded" param, i.e. tell the printing engine whether fonts should be embedded
190    \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
191    \retval FALSE Not embed fonts
193    Only available for Adobe Type 1 fonts in EPS output as of now
194 */
196 bool
197 Implementation::fontEmbedded(Inkscape::Extension::Print * ext)
199     return false;
202 }  /* namespace Implementation */
203 }  /* namespace Extension */
204 }  /* namespace Inkscape */
206 /*
207   Local Variables:
208   mode:c++
209   c-file-style:"stroustrup"
210   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
211   indent-tabs-mode:nil
212   fill-column:99
213   End:
214 */
215 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :