98508e4e645ce56c8120536c90add9dd2602ae1c
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-2008 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 {
21 namespace Extension
22 {
23 namespace Script
24 {
28 /**
29 * This class is used to run scripts, either from a file or buffer
30 */
31 class InkscapeScript
32 {
33 public:
35 /**
36 * Which type of language?
37 */
38 typedef enum
39 {
40 JAVASCRIPT,
41 PYTHON,
42 RUBY
43 } ScriptLanguage;
45 /**
46 * Creates a generic script interpreter.
47 */
48 InkscapeScript();
50 /**
51 * Destructor
52 */
53 virtual ~InkscapeScript();
55 /**
56 * Interprets the script in the 'script' buffer,
57 * storing the stdout output in 'output', and any
58 * error messages in 'error.' Language is one of the
59 * enumerated types in ScriptLanguage above.
60 */
61 bool interpretScript(const Glib::ustring &script,
62 Glib::ustring &output,
63 Glib::ustring &error,
64 ScriptLanguage language);
66 /**
67 * Interprets the script in the named file,
68 * storing the stdout output in 'output', and any
69 * error messages in 'error.' Language is one of the
70 * enumerated types in ScriptLanguage above.
71 */
72 bool interpretFile(const Glib::ustring &fname,
73 Glib::ustring &output,
74 Glib::ustring &error,
75 ScriptLanguage language);
79 }; //class InkscapeScript
84 } // namespace Script
85 } // namespace Extension
86 } // namespace Inkscape
90 #endif /* __INKSCAPE_SCRIPT_H__ */
92 /*
93 Local Variables:
94 mode:c++
95 c-file-style:"stroustrup"
96 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
97 indent-tabs-mode:nil
98 fill-column:99
99 End:
100 */
101 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :