24ef0a299f716cbaca41b4660d955e95e5a12055
[ctsim.git] / src / ctsim.h
1 /*****************************************************************************
2 ** FILE IDENTIFICATION
3 **
4 **   Name:          ctsim.cpp
5 **   Purpose:       Top-level routines for CTSim program
6 **   Programmer:    Kevin Rosenberg
7 **   Date Started:  July 2000
8 **
9 **  This is part of the CTSim program
10 **  Copyright (C) 1983-2000 Kevin Rosenberg
11 **
12 **  $Id: ctsim.h,v 1.13 2000/12/25 21:54:26 kevin Exp $
13 **
14 **  This program is free software; you can redistribute it and/or modify
15 **  it under the terms of the GNU General Public License (version 2) as
16 **  published by the Free Software Foundation.
17 **
18 **  This program is distributed in the hope that it will be useful,
19 **  but WITHOUT ANY WARRANTY; without even the implied warranty of
20 **  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21 **  GNU General Public License for more details.
22 **
23 **  You should have received a copy of the GNU General Public License
24 **  along with this program; if not, write to the Free Software
25 **  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26 ******************************************************************************/
27
28 #ifndef __CTSIMH__
29 #define __CTSIMH__
30
31 #ifdef HAVE_CONFIG_H
32 #include "config.h"
33 #endif
34 #ifdef HAVE_DMALLOC
35 #include <dmalloc.h>
36 #endif
37
38 class wxMenu;
39 class wxDocument;\r
40 class ImageFileDocument;\r
41 #include <vector>\r
42
43 #include "wx/docview.h"\r
44
45 // Define a new frame for main window
46 class MainFrame: public wxDocParentFrame
47 {
48     DECLARE_CLASS(MainFrame)
49 private:
50     wxTextCtrl* m_pLog;
51     wxMenu* m_pWindowMenu;
52
53     enum { MAX_WINDOW_MENUITEMS = 20 };
54     wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
55     wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
56
57 public:
58     MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
59     
60     void OnAbout (wxCommandEvent& event);
61     void OnHelpContents (wxCommandEvent& event);
62     void OnCreatePhantom (wxCommandEvent& event);
63     void OnExit (wxCommandEvent& event);
64
65     void OnUpdateUI (wxUpdateUIEvent& event);
66
67     wxTextCtrl* getLog() 
68         { return m_pLog; }
69
70     void OnWindowMenu0 (wxCommandEvent& event);
71     void OnWindowMenu1 (wxCommandEvent& event);
72     void OnWindowMenu2 (wxCommandEvent& event);
73     void OnWindowMenu3 (wxCommandEvent& event);
74     void OnWindowMenu4 (wxCommandEvent& event);
75     void OnWindowMenu5 (wxCommandEvent& event);
76     void OnWindowMenu6 (wxCommandEvent& event);
77     void OnWindowMenu7 (wxCommandEvent& event);
78     void OnWindowMenu8 (wxCommandEvent& event);
79     void OnWindowMenu9 (wxCommandEvent& event);
80     void OnWindowMenu10 (wxCommandEvent& event);
81     void OnWindowMenu11 (wxCommandEvent& event);
82     void OnWindowMenu12 (wxCommandEvent& event);
83     void OnWindowMenu13 (wxCommandEvent& event);
84     void OnWindowMenu14 (wxCommandEvent& event);
85     void OnWindowMenu15 (wxCommandEvent& event);
86     void OnWindowMenu16 (wxCommandEvent& event);
87     void OnWindowMenu17 (wxCommandEvent& event);
88     void OnWindowMenu18 (wxCommandEvent& event);
89     void OnWindowMenu19 (wxCommandEvent& event);
90
91     void DoWindowMenu (int iMenuPosition, wxCommandEvent& event);
92
93     DECLARE_EVENT_TABLE()
94 };
95
96
97 class wxDocManager;
98 class CTSimApp: public wxApp
99 {
100 public:
101     CTSimApp();
102     bool OnInit();
103     int OnExit();
104     MainFrame* getMainFrame() const
105       { return m_pFrame; }
106     wxTextCtrl* getLog()
107       { return m_pFrame->getLog(); }
108     wxDocManager* getDocManager() 
109         { return m_docManager; }
110
111     wxString getUntitledFilename();
112 \r
113     void getCompatibleImages (const ImageFileDocument* pIFDoc, std::vector<ImageFileDocument*>& vecIF);\r
114 \r
115     bool getSetModifyNewDocs() const\r
116     { return false; }\r
117
118 private:
119     wxDocManager* m_docManager;
120     MainFrame* m_pFrame;
121
122     void usage (const char* program);
123
124     static struct option ctsimOptions[];
125
126     enum { O_HELP, O_VERSION };
127 };
128
129 DECLARE_APP(CTSimApp)
130
131 extern class CTSimApp* theApp;
132
133
134 enum {
135     MAINMENU_HELP_ABOUT = 500,
136     MAINMENU_HELP_CONTENTS,
137     MAINMENU_FILE_CREATE_PHANTOM,
138     MAINMENU_FILE_EXIT,
139     IFMENU_FILE_PROPERTIES,
140     PJMENU_FILE_PROPERTIES,
141     PHMMENU_FILE_PROPERTIES,
142     PJMENU_PROCESS_RECONSTRUCT,\r
143         IFMENU_PLOT_ROW,\r
144         IFMENU_PLOT_COL,
145     IFMENU_VIEW_SCALE_AUTO,
146     IFMENU_VIEW_SCALE_MINMAX,\r
147         IFMENU_COMPARE_IMAGES,\r
148         IFMENU_COMPARE_ROW,\r
149         IFMENU_COMPARE_COL,\r
150     PHMMENU_PROCESS_RASTERIZE,
151     PHMMENU_PROCESS_PROJECTIONS,\r
152         PLOTMENU_VIEW_SCALE_MINMAX,\r
153         PLOTMENU_VIEW_SCALE_AUTO,
154     MAINMENU_WINDOW_BASE,
155 };
156
157 #endif