Code

still WIP. added tree-descending code
[inkscape.git] / src / extension / implementation / script.h
1 /*
2  * Code for handling extensions (i.e., scripts)
3  *
4  * Authors:
5  *   Bryce Harrington <bryce@osdl.org>
6  *   Ted Gould <ted@gould.cx>
7  *
8  * Copyright (C) 2002-2005 Authors
9  *
10  * Released under GNU GPL, read the file 'COPYING' for more information
11  */
13 #ifndef __INKSCAPE_EXTENSION_IMPEMENTATION_SCRIPT_H__
14 #define __INKSCAPE_EXTENSION_IMPEMENTATION_SCRIPT_H__
16 #include "implementation.h"
17 #include <gtkmm/messagedialog.h>
19 namespace Inkscape {
20 namespace XML {
21 class Node;
22 }
23 }
26 namespace Inkscape {
27 namespace Extension {
28 namespace Implementation {
30 class Script : public Implementation {
31 private:
32     gchar *       command;     /**< The command that has been dirived from
33                                     the configuration file with appropriate
34                                     directories */
35     gchar *       helper_extension;
36                                /**< This is the extension that will be used
37                                     as the helper to read in or write out the
38                                     data */
39     /** This function actually does the work, everything else is preparing
40         for this function.  It is the core here */
41     int           execute      (gchar const *command,
42                                 gchar const *filein,
43                                 gchar const *fileout);
44     /** Just a quick function to find and resolve relative paths for
45         the incoming scripts */
46     gchar *       solve_reldir (Inkscape::XML::Node *reprin);
47     bool          check_existance (gchar const *command);
48     void          copy_doc (Inkscape::XML::Node * olddoc, Inkscape::XML::Node * newdoc);
49     void          checkStderr (gchar * filename, Gtk::MessageType type, gchar * message);
51 public:
52                           Script       (void);
53     virtual bool          load         (Inkscape::Extension::Extension *module);
54     virtual void          unload       (Inkscape::Extension::Extension *module);
55     virtual bool          check        (Inkscape::Extension::Extension *module);
56     virtual Gtk::Widget * prefs_input  (Inkscape::Extension::Input *module,
57                                         gchar const *filename);
58     virtual SPDocument *  open         (Inkscape::Extension::Input *module,
59                                         gchar const *filename);
60     virtual Gtk::Widget * prefs_output (Inkscape::Extension::Output *module);
61     virtual void          save         (Inkscape::Extension::Output *module,
62                                         SPDocument *doc,
63                                         gchar const *filename);
64     virtual Gtk::Widget *
65                           prefs_effect (Inkscape::Extension::Effect *module,
66                                         Inkscape::UI::View::View * view);
67     virtual void          effect       (Inkscape::Extension::Effect *module,
68                                         Inkscape::UI::View::View *doc);
70 };
72 }  /* Inkscape  */
73 }  /* Extension  */
74 }  /* Implementation  */
75 #endif /* __INKSCAPE_EXTENSION_IMPEMENTATION_SCRIPT_H__ */
77 /*
78   Local Variables:
79   mode:c++
80   c-file-style:"stroustrup"
81   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
82   indent-tabs-mode:nil
83   fill-column:99
84   End:
85 */
86 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :