diff -ru kicad.orig/include/appl_wxstruct.h kicad/include/appl_wxstruct.h --- kicad.orig/include/appl_wxstruct.h 2012-01-11 12:02:53.707180000 +0100 +++ kicad/include/appl_wxstruct.h 2012-01-11 12:05:27.024023137 +0100 @@ -52,6 +52,7 @@ class wxSingleInstanceChecker; class wxHtmlHelpController; +extern bool g_CmdLineMode; /** * Class EDA_APP @@ -185,6 +186,8 @@ */ void InitEDA_Appl( const wxString& aName, EDA_APP_T aId = APP_UNKNOWN_T ); + virtual int OnRun() { return g_CmdLineMode ? 0 : wxApp::OnRun(); } + /** * Function SetLanguage * sets the dictionary file name for internationalization. diff -ru kicad.orig/include/wxBasePcbFrame.h kicad/include/wxBasePcbFrame.h --- kicad.orig/include/wxBasePcbFrame.h 2012-01-11 12:02:53.707180000 +0100 +++ kicad/include/wxBasePcbFrame.h 2012-01-11 12:05:52.898833056 +0100 @@ -517,6 +517,7 @@ bool ExportToDxfFile( const wxString& aFullFileName, int aLayer, + bool aPlotOriginIsAuxAxis, EDA_DRAW_MODE_T aTraceMode ); void Plot_Layer( PLOTTER* plotter, diff -ru kicad.orig/include/wxEeschemaStruct.h kicad/include/wxEeschemaStruct.h --- kicad.orig/include/wxEeschemaStruct.h 2012-01-11 12:02:53.707180000 +0100 +++ kicad/include/wxEeschemaStruct.h 2012-01-11 12:05:27.038023036 +0100 @@ -593,6 +593,8 @@ void SVG_Print( wxCommandEvent& event ); // Plot functions: + void CmdLineToPlot_PS( bool PlotBW, bool PlotSheetRef ); + void CmdLineToPlot_DXF( bool PlotBW, bool PlotSheetRef ); void ToPlot_PS( wxCommandEvent& event ); void ToPlot_HPGL( wxCommandEvent& event ); void ToPlot_DXF( wxCommandEvent& event ); diff -ru kicad.orig/include/wxPcbStruct.h kicad/include/wxPcbStruct.h --- kicad.orig/include/wxPcbStruct.h 2012-01-11 12:02:53.707180000 +0100 +++ kicad/include/wxPcbStruct.h 2012-01-11 12:05:27.041023014 +0100 @@ -75,6 +75,7 @@ class PCB_EDIT_FRAME : public PCB_BASE_FRAME { friend class PCB_LAYER_WIDGET; + friend bool Pcbnew_CmdLine(); void updateTraceWidthSelectBox(); void updateViaSizeSelectBox(); diff -ru kicad.orig/common/confirm.cpp kicad/common/confirm.cpp --- kicad.orig/common/confirm.cpp 2012-01-11 12:02:53.707180000 +0100 +++ kicad/common/confirm.cpp 2012-01-11 12:05:27.044022991 +0100 @@ -9,11 +9,18 @@ #include "wx/html/htmlwin.h" #include "html_messagebox.h" +bool g_CmdLineMode = false; void DisplayError( wxWindow* parent, const wxString& text, int displaytime ) { wxMessageDialog* dialog; + if (g_CmdLineMode) + { + wxFprintf( stderr, text + _( "\n" ) ); + return; + } + if( displaytime > 0 ) dialog = new wxMessageDialog( parent, text, _( "Warning" ), wxOK | wxCENTRE | wxICON_INFORMATION ); @@ -30,6 +37,12 @@ { wxMessageDialog* dialog; + if (g_CmdLineMode) + { + wxPrintf( text + _( "\n" ) ); + return; + } + dialog = new wxMessageDialog( parent, text, _( "Info:" ), wxOK | wxCENTRE | wxICON_INFORMATION ); @@ -41,6 +54,12 @@ void DisplayHtmlInfoMessage( wxWindow* parent, const wxString& title, const wxString& text, const wxSize& size ) { + if (g_CmdLineMode) + { + wxPrintf( title + _( "\n" ) + text + _( "\n" ) ); + return; + } + HTML_MESSAGE_BOX *dlg = new HTML_MESSAGE_BOX(parent,title, wxDefaultPosition, size ); dlg->AddHTML_Text( text ); dlg->ShowModal(); diff -ru kicad.orig/common/edaappl.cpp kicad/common/edaappl.cpp --- kicad.orig/common/edaappl.cpp 2012-01-11 12:02:53.707180000 +0100 +++ kicad/common/edaappl.cpp 2012-01-11 12:05:27.045022984 +0100 @@ -306,6 +306,7 @@ wxString EnvLang; m_Id = aId; +if (!g_CmdLineMode) m_Checker = new wxSingleInstanceChecker( aName.Lower() + wxT( "-" ) + wxGetUserId() ); /* Init KiCad environment