PTBatcherGUI.h

Go to the documentation of this file.
00001 // -*- c-basic-offset: 4 -*-
00002 
00027 #include "RunStitchFrame.h"
00028 #include "Batch.h"
00029 #include "BatchFrame.h"
00030 
00031 #include <wx/dir.h>
00032 #include <wx/wfstream.h>
00033 #include <wx/filefn.h>
00034 #include <wx/snglinst.h>
00035 #include <wx/ipc.h>
00036 
00037 #include <hugin_config.h>
00038 #include <wx/cmdline.h>
00039 
00040 #ifndef FRAMEARRAY
00041 #define FRAMEARRAY
00042 WX_DEFINE_ARRAY_PTR(RunStitchFrame*,FrameArray);
00043 #endif
00044 
00045 #ifndef PTBATCHERGUI_H
00046 #define PTBATCHERGUI_H
00047 // **********************************************************************
00048 
00054 class BatchIPCConnection : public wxConnection
00055 {
00056 public:
00058 #if wxCHECK_VERSION(2,9,0)
00059     virtual const void* OnRequest(const wxString& topic, const wxString& item, size_t* size = NULL, wxIPCFormat format = wxIPC_TEXT);
00060 #else
00061     virtual wxChar* OnRequest(const wxString& topic, const wxString& item, int* size = NULL, wxIPCFormat format = wxIPC_TEXT);
00062 #endif
00063 };
00064 
00066 class BatchIPCServer : public wxServer
00067 {
00068 public:
00070     virtual wxConnectionBase* OnAcceptConnection (const wxString& topic);
00071 };
00072 
00074 const wxString IPC_START(wxT("BatchStart"));
00075 
00080 class PTBatcherGUI : public wxApp
00081 {
00082 public:
00085     virtual bool OnInit();
00086     virtual int OnExit();
00087 #if wxUSE_ON_FATAL_EXCEPTION
00088 #if wxCHECK_VERSION(3,1,0)
00089     virtual void OnFatalException() wxOVERRIDE;
00090 #else
00091     virtual void OnFatalException();
00092 #endif
00093 #endif
00094 
00095     //Handles some input keys for the frame
00096     void OnItemActivated(wxListEvent& event);
00097     void OnKeyDown(wxKeyEvent& event);
00098 
00099     //Main batch list
00100     ProjectArray projList;
00101     //List of projects in progress (their RunStitchFrames)
00102     FrameArray stitchFrames;
00103     BatchFrame* GetFrame()
00104     {
00105         return m_frame;
00106     };
00107 
00108 #ifdef __WXMAC__
00109 
00110     // see comment in PTBatchGUI.cpp
00111     // void MacOpenFile(const wxString& fileName);
00112 #endif
00113 
00114 private:
00115     BatchFrame* m_frame;
00116     wxLocale m_locale;
00117     wxString m_xrcPrefix;
00118     wxSingleInstanceChecker* m_checker;
00119     BatchIPCServer* m_server;
00120 
00121 #ifdef __WXMAC__
00122     wxString m_macFileNameToOpenOnStart;
00123 #endif
00124 
00125     DECLARE_EVENT_TABLE()
00126 };
00127 
00128 DECLARE_APP(PTBatcherGUI)
00129 
00130 #endif //PTBATCHERGUI_H

Generated on 27 Aug 2015 for Hugintrunk by  doxygen 1.4.7