Code

restore rendering markers in outline mode
[inkscape.git] / src / main.cpp
index 778928f4c0ff309bb468f1ed744eba420af4bf76..f7be7d9400d86f3a4a1a044972d0d8d1c7726f30 100644 (file)
@@ -108,6 +108,8 @@ using Inkscape::Extension::Internal::PrintWin32;
 
 #include "application/application.h"
 
+#include "main-cmdlineact.h"
+
 enum {
     SP_ARG_NONE,
     SP_ARG_NOGUI,
@@ -387,44 +389,6 @@ struct poptOption options[] = {
     POPT_AUTOHELP POPT_TABLEEND
 };
 
-class CmdLineAction {
-    gint _type;
-    gchar * _arg;
-
-    static std::list <CmdLineAction *> _list;
-
-public:
-    CmdLineAction (gint type, gchar const * arg) : _type(type), _arg(NULL) {
-        if (arg != NULL) {
-            _arg = g_strdup(arg);
-        }
-
-        _list.insert(_list.end(), this);
-
-        return;
-    }
-
-    ~CmdLineAction () {
-        if (_arg != NULL) {
-            g_free(_arg);
-        }
-    }
-
-    void doIt (SPDocument * doc) {
-        printf("Doing: %s\n", _arg);
-    }
-
-    static void doList (SPDocument * doc) {
-        for (std::list<CmdLineAction *>::iterator i = _list.begin();
-                i != _list.end(); i++) {
-            CmdLineAction * entry = *i;
-            entry->doIt(doc);
-        }
-    }
-};
-std::list <CmdLineAction *> CmdLineAction::_list;
-
-
 static bool needToRecodeParams = true;
 gchar* blankParam = "";
 
@@ -710,6 +674,7 @@ sp_main_gui(int argc, char const **argv)
         }
     }
 
+    Glib::signal_idle().connect(sigc::ptr_fun(&Inkscape::CmdLineAction::idle));
     main_instance.run();
 
 #ifdef WIN32
@@ -791,8 +756,6 @@ sp_main_console(int argc, char const **argv)
             } else if (sp_query_x || sp_query_y) {
                 do_query_dimension (doc, false, sp_query_x? NR::X : NR::Y, sp_query_id);
             }
-
-            CmdLineAction::doList(doc);
         }
 
         fl = g_slist_remove(fl, fl->data);
@@ -1444,7 +1407,7 @@ sp_process_args(poptContext ctx)
                 gchar const *arg = poptGetOptArg(ctx);
                 if (arg != NULL) {
                     // printf("Adding in: %s\n", arg);
-                    new CmdLineAction(a, arg);
+                    new Inkscape::CmdLineAction((a == SP_ARG_VERB), arg);
                 }
                 break;
             }