Code

Switch to newer binding stuff
[inkscape.git] / src / extension / script / InkscapeScript.h
1 #ifndef __INKSCAPE_SCRIPT_H__
2 #define __INKSCAPE_SCRIPT_H__
4 /**
5  * Inkscape Scripting container
6  *
7  * Authors:
8  *   Bob Jamison <rjamison@titan.com>
9  *
10  * Copyright (C) 2004-2006 Bob Jamison
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #include "config.h"
17 #include <glibmm.h>
19 namespace Inkscape {
20 namespace Extension {
21 namespace Script {
24 class InkscapeScript
25 {
26 public:
28     /**
29      * Which type of language?
30      */
31     typedef enum
32         {
33         JAVASCRIPT,
34         PYTHON,
35         RUBY
36         } ScriptLanguage;
38     /**
39      * Creates a generic script interpreter.
40      */
41     InkscapeScript();
43     /**
44      *  Destructor
45      */
46     virtual ~InkscapeScript();
48     /**
49      * Interprets the script in the 'script' buffer,
50      * storing the stdout output in 'output', and any
51      * error messages in 'error.'  Language is one of the
52      * enumerated types in ScriptLanguage above.
53      */
54     bool interpretScript(const Glib::ustring &script,
55                          Glib::ustring &output,
56                          Glib::ustring &error,
57                          ScriptLanguage language);
59     /**
60      * Interprets the script in the named file,
61      * storing the stdout output in 'output', and any
62      * error messages in 'error.'  Language is one of the
63      * enumerated types in ScriptLanguage above.
64      */
65     bool interpretFile(const Glib::ustring &fname,
66                       Glib::ustring &output,
67                       Glib::ustring &error,
68                       ScriptLanguage language);
72 }; //class InkscapeScript
77 }  // namespace Script
78 }  // namespace Extension
79 }  // namespace Inkscape
83 #endif  /* __INKSCAPE_SCRIPT_H__ */
85 /*
86   Local Variables:
87   mode:c++
88   c-file-style:"stroustrup"
89   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
90   indent-tabs-mode:nil
91   fill-column:99
92   End:
93 */
94 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :