r261: Use explicit std:: namespace
[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.8 2000/12/16 06:12:47 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;
40 #include "wx/docview.h"\r
41
42 // Define a new frame for main window
43 class MainFrame: public wxDocParentFrame
44 {
45     DECLARE_CLASS(MainFrame)
46 private:
47     wxTextCtrl* m_pLog;
48     wxMenu* m_pWindowMenu;
49
50     enum { MAX_WINDOW_MENUITEMS = 20 };
51     wxMenuItem* m_apWindowMenuItems[MAX_WINDOW_MENUITEMS];
52     wxDocument* m_apWindowMenuData[MAX_WINDOW_MENUITEMS];
53
54 public:
55     MainFrame(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long type);
56     
57     void OnAbout (wxCommandEvent& event);
58     void OnHelpContents (wxCommandEvent& event);
59     void OnCreatePhantom (wxCommandEvent& event);
60     void OnExit (wxCommandEvent& event);
61
62     void OnUpdateUI (wxUpdateUIEvent& event);
63
64     wxTextCtrl* getLog() 
65         { return m_pLog; }
66
67     void OnWindowMenu0 (wxCommandEvent& event);
68     void OnWindowMenu1 (wxCommandEvent& event);
69     void OnWindowMenu2 (wxCommandEvent& event);
70     void OnWindowMenu3 (wxCommandEvent& event);
71     void OnWindowMenu4 (wxCommandEvent& event);
72     void OnWindowMenu5 (wxCommandEvent& event);
73     void OnWindowMenu6 (wxCommandEvent& event);
74     void OnWindowMenu7 (wxCommandEvent& event);
75     void OnWindowMenu8 (wxCommandEvent& event);
76     void OnWindowMenu9 (wxCommandEvent& event);
77     void OnWindowMenu10 (wxCommandEvent& event);
78     void OnWindowMenu11 (wxCommandEvent& event);
79     void OnWindowMenu12 (wxCommandEvent& event);
80     void OnWindowMenu13 (wxCommandEvent& event);
81     void OnWindowMenu14 (wxCommandEvent& event);
82     void OnWindowMenu15 (wxCommandEvent& event);
83     void OnWindowMenu16 (wxCommandEvent& event);
84     void OnWindowMenu17 (wxCommandEvent& event);
85     void OnWindowMenu18 (wxCommandEvent& event);
86     void OnWindowMenu19 (wxCommandEvent& event);
87
88     void DoWindowMenu (int iMenuPosition, wxCommandEvent& event);
89
90     DECLARE_EVENT_TABLE()
91 };
92
93
94 class wxDocManager;
95 class CTSimApp: public wxApp
96 {
97 public:
98     CTSimApp();
99     bool OnInit();
100     int OnExit();
101     MainFrame* getMainFrame() const
102       { return m_pFrame; }
103     wxTextCtrl* getLog()
104       { return m_pFrame->getLog(); }
105     wxDocManager* getDocManager() 
106         { return m_docManager; }
107
108     wxString getUntitledFilename();
109
110 private:
111     wxDocManager* m_docManager;
112     MainFrame* m_pFrame;
113
114     void usage (const char* program);
115
116     static struct option ctsimOptions[];
117
118     enum { O_HELP, O_VERSION };
119 };
120
121 DECLARE_APP(CTSimApp)
122
123 extern class CTSimApp* theApp;
124
125
126 enum {
127     MAINMENU_HELP_ABOUT = 500,
128     MAINMENU_HELP_CONTENTS,
129     MAINMENU_FILE_CREATE_PHANTOM,
130     MAINMENU_FILE_EXIT,
131     IFMENU_FILE_PROPERTIES,
132     PJMENU_FILE_PROPERTIES,
133     PHMMENU_FILE_PROPERTIES,
134     PJMENU_PROCESS_RECONSTRUCT,
135     IFMENU_VIEW_SCALE_AUTO,
136     IFMENU_VIEW_SCALE_MINMAX,
137     PHMMENU_PROCESS_RASTERIZE,
138     PHMMENU_PROCESS_PROJECTIONS,
139     MAINMENU_WINDOW_BASE,
140 };
141
142 #endif