]> icculus.org git repositories - taylor/freespace2.git/blob - include/fred.h
Initial revision
[taylor/freespace2.git] / include / fred.h
1 /*
2  * $Logfile: /Freespace2/code/FRED2/FRED.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * FRED.h : main header file for the FRED application
8  * Global editor dialog box classes are instantiated here, initializes the
9  * application (MFC level at least), processes the INI file.
10  *
11  * $Log$
12  * Revision 1.1  2002/05/03 03:28:12  root
13  * Initial revision
14  *
15  * 
16  * 2     10/07/98 6:28p Dave
17  * Initial checkin. Renamed all relevant stuff to be Fred2 instead of
18  * Fred. Globalized mission and campaign file extensions. Removed Silent
19  * Threat specific code.
20  * 
21  * 1     10/07/98 3:01p Dave
22  * 
23  * 1     10/07/98 3:00p Dave
24  * 
25  * 32    3/23/98 4:04p Hoffoss
26  * Fixed dialog window initialization so it looks better at startup (they
27  * don't flash on for a second).
28  * 
29  * 31    9/09/97 10:25a Hoffoss
30  * Fixed a potential problem.
31  * 
32  * 30    8/01/97 3:10p Hoffoss
33  * Made Sexp help hidable.
34  * 
35  * 29    6/18/97 11:46a Hoffoss
36  * Fixed initial order object reference updating and added briefing dialog
37  * window tracking data.
38  * 
39  * 28    6/05/97 6:10p Hoffoss
40  * Added features: Autosaving, object hiding.  Also fixed some minor bugs.
41  * 
42  * 27    6/02/97 11:52a Hoffoss
43  * Custom cursors displayed when over objects in different modes.
44  * 
45  * 26    5/29/97 5:15p Allender
46  * fixed macro for MODIFY so that it will work properly within 'if'
47  * statements
48  * 
49  * 25    4/29/97 12:24p Adam
50  * JAS:   Added code for delayed point to vec.   Fixed some FRED
51  * sequencing problems with g3_start_frame / g3_end_frame.
52  * 
53  * 24    4/17/97 2:01p Hoffoss
54  * All dialog box window states are saved between sessions now.
55  * 
56  * 23    4/01/97 11:07p Mike
57  * Clean up game sequencing functions.  Get rid of Multiplayer and add
58  * Game_mode.  Add SystemVars.cpp
59  * 
60  * 22    3/26/97 11:45a Hoffoss
61  * Fred uses fvi_ray_* functions now (as much as possible) for checking
62  * mouse selection stuff.
63  * 
64  * 21    2/28/97 11:31a Hoffoss
65  * Implemented modeless dialog saving and restoring, and changed some
66  * variables names.
67  * 
68  * 20    2/27/97 5:54p Hoffoss
69  * Implemented support for saving and restoring window positions.
70  * 
71  * 19    2/24/97 12:50p Hoffoss
72  * First attempt at non-continuous redrawing.
73  * 
74  * 18    2/20/97 5:42p Hoffoss
75  * Fixed bug in modification checking and updating macro.
76  * 
77  * 17    2/20/97 4:28p Hoffoss
78  * Added modification tracking to ship editor dialog box, and support
79  * functions.
80  * 
81  * 16    2/20/97 4:03p Hoffoss
82  * Several ToDo items: new reinforcement clears arrival cue, reinforcement
83  * control from ship and wing dialogs, show grid toggle.
84  * 
85  * 15    2/17/97 5:28p Hoffoss
86  * Checked RCS headers, added them were missing, changing description to
87  * something better, etc where needed.
88  * 
89  * 14    2/12/97 12:25p Hoffoss
90  * Expanded on global error checker, added initial orders conflict
91  * checking and warning, added waypoint editor dialog and code.
92  * 
93  * 13    1/30/97 2:24p Hoffoss
94  * Added remaining mission file structures and implemented load/save of
95  * them.
96  *
97  * $NoKeywords: $
98  */
99
100 #ifndef __AFXWIN_H__
101         #error include 'stdafx.h' before including this file for PCH
102 #endif
103
104 #include "systemvars.h"         //      Low level variables, common to FreeSpace and Fred
105 #include "resource.h"       // main symbols
106 #include "missionparse.h"
107 #include "shipeditordlg.h"
108 #include "wing_editor.h"
109 #include "waypointpathdlg.h"
110 #include "bgbitmapdlg.h"
111 #include "briefingeditordlg.h"
112 #include "systemvars.h"
113
114 #define MODIFY(a, b) do {       \
115         if (a != (b)) {                 \
116                 a = (b);                                        \
117                 set_modified();         \
118         }                                                               \
119 } while(0)
120
121 #define F_RENDER_SHIP_MODELS    0x01
122 #define F_RENDER_SHIP_ICONS     0x02
123
124 // user interface types
125 #define HOFFOSS_INTERFACE       1
126 #define ALLENDER_INTERFACE      2
127
128 typedef struct window_data {
129         WINDOWPLACEMENT p;
130         int visible;
131         int valid;
132         int processed;
133 } window_data;
134
135 /////////////////////////////////////////////////////////////////////////////
136 // CFREDApp:
137 // See FRED.cpp for the implementation of this class
138 //
139
140 class CFREDApp : public CWinApp
141 {
142         int app_init;
143
144 public:
145         void record_window_data(window_data *wndd, CWnd *wnd);
146         int init_window(window_data *wndd, CWnd *wnd, int adjust = 0, int pre = 0);
147         void read_window(char *name, window_data *wndd);
148         void write_window(char *name, window_data *wndd);
149         void write_ini_file(int degree = 0);
150         CFREDApp();
151
152         // Overrides
153         // ClassWizard generated virtual function overrides
154         //{{AFX_VIRTUAL(CFREDApp)
155         public:
156         virtual BOOL InitInstance();
157         virtual BOOL OnIdle(LONG lCount);
158         //}}AFX_VIRTUAL
159
160 // Implementation
161
162         //{{AFX_MSG(CFREDApp)
163         afx_msg void OnAppAbout();
164                 // NOTE - the ClassWizard will add and remove member functions here.
165                 //    DO NOT EDIT what you see in these blocks of generated code !
166         //}}AFX_MSG
167         DECLARE_MESSAGE_MAP()
168 };
169
170 /////////////////////////////////////////////////////////////////////////////
171
172 //      Add a message to be processed at the end of this frame.
173 //      This is useful if you need the display to update before it's useful
174 //      to process the message.  For example, right click brings up a popup menu.
175 //      But the menu it brings up depends on where you right clicked.  If you
176 //      right click on a ship, you get a message that pertains to the chosen
177 //      ship.  It is useful to have a visual indication that you have changed the
178 //      current ship.
179 void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count);
180 void init_pending_messages(void);
181 void update_map_window();
182
183 extern int User_interface;
184 extern int Fred_active;
185 extern int Update_window;
186 extern HCURSOR h_cursor_move, h_cursor_rotate;
187
188 extern CWnd *Prev_window;
189 extern CShipEditorDlg   Ship_editor_dialog;
190 extern wing_editor              Wing_editor_dialog;
191 extern waypoint_path_dlg        Waypoint_editor_dialog;
192 extern bg_bitmap_dlg            *Bg_bitmap_dialog;
193 extern briefing_editor_dlg      *Briefing_dialog;
194
195 extern CFREDApp theApp;
196
197 extern window_data Main_wnd_data;
198 extern window_data Ship_wnd_data;
199 extern window_data Wing_wnd_data;
200 extern window_data Object_wnd_data;
201 extern window_data Mission_goals_wnd_data;
202 extern window_data Messages_wnd_data;
203 extern window_data Player_wnd_data;
204 extern window_data Events_wnd_data;
205 extern window_data Bg_wnd_data;
206 extern window_data Briefing_wnd_data;
207 extern window_data Reinforcement_wnd_data;
208 extern window_data Waypoint_wnd_data;
209 extern window_data Starfield_wnd_data;
210 extern window_data Asteroid_wnd_data;
211 extern window_data Mission_notes_wnd_data;
212