Code

Added code to initialize DBus (if enabled.)
[inkscape.git] / src / extension / script / InkscapeScript.h
index 88df2c82ad3ddf35cde9d4dd155634ead1384a87..98508e4e645ce56c8120536c90add9dd2602ae1c 100644 (file)
@@ -7,7 +7,7 @@
  * Authors:
  *   Bob Jamison <rjamison@titan.com>
  *
- * Copyright (C) 2004 Authors
+ * Copyright (C) 2004-2008 Bob Jamison
  *
  * Released under GNU GPL, read the file 'COPYING' for more information
  */
 
 #include <glibmm.h>
 
-namespace Inkscape {
-namespace Extension {
-namespace Script {
+namespace Inkscape
+{
+namespace Extension
+{
+namespace Script
+{
 
 
+
+/**
+ * This class is used to run scripts, either from a file or buffer
+ */
 class InkscapeScript
 {
 public:
@@ -30,32 +37,39 @@ public:
      */
     typedef enum
         {
+        JAVASCRIPT,
         PYTHON,
-        PERL
+        RUBY
         } ScriptLanguage;
 
     /**
-     *
+     * Creates a generic script interpreter.
      */
     InkscapeScript();
 
     /**
-     *
+     *  Destructor
      */
-    ~InkscapeScript();
+    virtual ~InkscapeScript();
 
     /**
-     *
+     * Interprets the script in the 'script' buffer,
+     * storing the stdout output in 'output', and any
+     * error messages in 'error.'  Language is one of the
+     * enumerated types in ScriptLanguage above.
      */
-    bool interpretScript(Glib::ustring &script,
+    bool interpretScript(const Glib::ustring &script,
                          Glib::ustring &output,
                          Glib::ustring &error,
                          ScriptLanguage language);
 
     /**
-     *
+     * Interprets the script in the named file,
+     * storing the stdout output in 'output', and any
+     * error messages in 'error.'  Language is one of the
+     * enumerated types in ScriptLanguage above.
      */
-    bool interpretUri(Glib::ustring &uri,
+    bool interpretFile(const Glib::ustring &fname,
                       Glib::ustring &output,
                       Glib::ustring &error,
                       ScriptLanguage language);