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 Gtk::Widget *
48 Implementation::prefs_input(Inkscape::Extension::Input *module, gchar const *filename) {
49 return module->autogui();
50 } /* Implementation::prefs_input */
52 SPDocument *
53 Implementation::open(Inkscape::Extension::Input *module, gchar const *filename) {
54 /* throw open_failed(); */
55 return NULL;
56 } /* Implementation::open */
58 Gtk::Widget *
59 Implementation::prefs_output(Inkscape::Extension::Output *module) {
60 return module->autogui();
61 } /* Implementation::prefs_output */
63 void
64 Implementation::save(Inkscape::Extension::Output *module, SPDocument *doc, gchar const *filename) {
65 /* throw save_fail */
66 return;
67 } /* Implementation::save */
69 Gtk::Widget *
70 Implementation::prefs_effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *view) {
71 return module->autogui();
72 } /* Implementation::prefs_effect */
74 void
75 Implementation::effect(Inkscape::Extension::Effect *module, Inkscape::UI::View::View *document) {
76 /* throw filter_fail */
77 return;
78 } /* Implementation::filter */
80 unsigned int
81 Implementation::setup(Inkscape::Extension::Print *module)
82 {
83 return 0;
84 }
86 unsigned int
87 Implementation::set_preview(Inkscape::Extension::Print *module)
88 {
89 return 0;
90 }
93 unsigned int
94 Implementation::begin(Inkscape::Extension::Print *module, SPDocument *doc)
95 {
96 return 0;
97 }
99 unsigned int
100 Implementation::finish(Inkscape::Extension::Print *module)
101 {
102 return 0;
103 }
106 /* Rendering methods */
107 unsigned int
108 Implementation::bind(Inkscape::Extension::Print *module, NRMatrix const *transform, float opacity)
109 {
110 return 0;
111 }
113 unsigned int
114 Implementation::release(Inkscape::Extension::Print *module)
115 {
116 return 0;
117 }
119 unsigned int
120 Implementation::comment(Inkscape::Extension::Print *module, char const *comment)
121 {
122 return 0;
123 }
125 unsigned int
126 Implementation::fill(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *ctm, SPStyle const *style,
127 NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
128 {
129 return 0;
130 }
132 unsigned int
133 Implementation::stroke(Inkscape::Extension::Print *module, NRBPath const *bpath, NRMatrix const *transform, SPStyle const *style,
134 NRRect const *pbox, NRRect const *dbox, NRRect const *bbox)
135 {
136 return 0;
137 }
139 unsigned int
140 Implementation::image(Inkscape::Extension::Print *module, unsigned char *px, unsigned int w, unsigned int h, unsigned int rs,
141 NRMatrix const *transform, SPStyle const *style)
142 {
143 return 0;
144 }
146 unsigned int
147 Implementation::text(Inkscape::Extension::Print *module, char const *text,
148 NR::Point p, SPStyle const *style)
149 {
150 return 0;
151 }
153 void
154 Implementation::processPath(Inkscape::XML::Node * node)
155 {
156 return;
157 }
159 /**
160 \brief Tell the printing engine whether text should be text or path
161 \retval true Render the text as a path
162 \retval false Render text using the text function (above)
164 Default value is false because most printing engines will support
165 paths more than they'll support text. (at least they do today)
166 */
167 bool
168 Implementation::textToPath(Inkscape::Extension::Print *ext)
169 {
170 return false;
171 }
174 } /* namespace Implementation */
175 } /* namespace Extension */
176 } /* namespace Inkscape */
178 /*
179 Local Variables:
180 mode:c++
181 c-file-style:"stroustrup"
182 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
183 indent-tabs-mode:nil
184 fill-column:99
185 End:
186 */
187 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :