Code

FIX 309856 353847: correctly advertise exception leads to error message dialogue
[inkscape.git] / src / extension / implementation / script.h
index 6a6256f3c4a7f93f078cf9fb8a1b516b7f9f625b..8e25fb3517b53a74e249952442650a68c230ee1c 100644 (file)
@@ -62,6 +62,8 @@ public:
      */
     virtual bool check(Inkscape::Extension::Extension *module);
 
+       ImplementationDocumentCache * newDocCache (Inkscape::Extension::Extension * ext, Inkscape::UI::View::View * view);
+
     /**
      *
      */
@@ -85,13 +87,6 @@ public:
     virtual void save(Inkscape::Extension::Output *module,
                       SPDocument *doc,
                       gchar const *filename);
-    /**
-     *
-     */
-    virtual Gtk::Widget *prefs_effect(Inkscape::Extension::Effect *module,
-                                      Inkscape::UI::View::View * view,
-                                      sigc::signal<void> * changeSignal,
-                                                                         ImplementationDocumentCache * docCache);
 
     /**
      *
@@ -140,7 +135,7 @@ private:
     /**
      *
      */
-    void checkStderr (const Glib::ustring &filename, 
+    void checkStderr (const Glib::ustring &filename,
                       Gtk::MessageType type,
                       const Glib::ustring &message);
 
@@ -151,10 +146,10 @@ private:
         Glib::RefPtr<Glib::IOChannel> _channel;
         Glib::RefPtr<Glib::MainLoop> _main_loop;
         bool _dead;
-        
+
     public:
         file_listener () : _dead(false) { };
-        ~file_listener () {
+        virtual ~file_listener () {
             _conn.disconnect();
         };
 
@@ -192,10 +187,15 @@ private:
         // Note, doing a copy here, on purpose
         Glib::ustring string (void) { return _string; };
 
-        void toFile (const Glib::ustring &name) {
+        bool toFile (const Glib::ustring &name) {
+            try {
             Glib::RefPtr<Glib::IOChannel> stdout_file = Glib::IOChannel::create_from_file(name, "w");
+            stdout_file->set_encoding();
             stdout_file->write(_string);
-            return;
+            } catch (Glib::FileError &e) {
+                return false;
+            }
+            return true;
         };
     };
 
@@ -203,6 +203,20 @@ private:
                  const std::list<std::string> &in_params,
                  const Glib::ustring &filein,
                  file_listener &fileout);
+
+       void pump_events (void);
+
+       /** \brief  A definition of an interpreter, which can be specified
+                   in the INX file, but we need to know what to call */
+       struct interpreter_t {
+                       gchar const *identity;    /**< The ID that is in the INX file */
+                       gchar const *prefstring;  /**< The preferences key that can override the default */
+                       gchar const *defaultval;  /**< The default value if there are no preferences */
+       };
+    static interpreter_t const interpreterTab[];
+
+       Glib::ustring resolveInterpreterExecutable(const Glib::ustring &interpNameArg);
+
 }; // class Script