[aacb50]: src / hugin1 / ptbatcher / PTBatcherGUI.h Maximize Restore History

Download this file

PTBatcherGUI.h    118 lines (99 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
// -*- c-basic-offset: 4 -*-
/** @file PTBatcherGUI.h
*
* @brief Batch processor for Hugin with GUI
*
* @author Marko Kuder <marko.kuder@gmail.com>
*
* $Id: PTBatcherGUI.h 3448 2008-09-23 3:42:07 mkuder $
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this software; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
#include "RunStitchFrame.h"
#include "Batch.h"
#include "BatchFrame.h"
//#include "FilePoller.h"
//#include "ProjectArray.h"
#include <wx/dir.h>
#include <wx/wfstream.h>
#include <wx/filefn.h>
#include <wx/snglinst.h>
#include <wx/ipc.h>
#include <hugin_config.h>
#include <wx/cmdline.h>
#ifndef FRAMEARRAY
#define FRAMEARRAY
WX_DEFINE_ARRAY_PTR(RunStitchFrame*,FrameArray);
#endif
#ifndef PTBATCHERGUI_H
#define PTBATCHERGUI_H
// **********************************************************************
/** class for communication between different PTBatcherGUI instances
*
* this class is used to transfer the commandline parameters of the second instance of PTBatcherGUI
* to the first and only running instance of PTBatcherGUI
*/
class BatchIPCConnection : public wxConnection
{
public:
/** request handler for transfer */
virtual wxChar *OnRequest(const wxString& topic, const wxString& item, int *size = NULL, wxIPCFormat format = wxIPC_TEXT);
};
/** server which implements the communication between different PTBatcherGUI instances (see BatchIPCConnection) */
class BatchIPCServer : public wxServer
{
public:
/**accept connection handler (establish the connection) */
virtual wxConnectionBase *OnAcceptConnection (const wxString& topic);
};
/** topic name for BatchIPCConnection and BatchIPCServer */
const wxString IPC_START(wxT("BatchStart"));
/** The application class for hugin_stitch_project
*
* it contains the main frame.
*/
class PTBatcherGUI : public wxApp
{
public:
/** pseudo constructor. with the ability to fail gracefully.
*/
virtual bool OnInit();
virtual int OnExit();
//Handles some input keys for the frame
void OnItemActivated(wxListEvent &event);
void OnKeyDown(wxKeyEvent &event);
//Main batch list
ProjectArray projList;
//List of projects in progress (their RunStitchFrames)
FrameArray stitchFrames;
BatchFrame* GetFrame() {return m_frame;};
#ifdef __WXMAC__
/** the wx calls this method when the app gets "Open file" AppleEvent */
void MacOpenFile(const wxString &fileName);
#endif
private:
BatchFrame *m_frame;
wxLocale m_locale;
wxString m_xrcPrefix;
wxSingleInstanceChecker *m_checker;
BatchIPCServer *m_server;
#ifdef __WXMAC__
wxString m_macFileNameToOpenOnStart;
#endif
DECLARE_EVENT_TABLE()
};
DECLARE_APP(PTBatcherGUI)
#endif //PTBATCHERGUI_H