FS2_Open
Open source remastering of the Freespace 2 engine
fred.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef __AFXWIN_H__
13  #error include 'stdafx.h' before including this file for PCH
14 #endif
15 
16 #include "globalincs/systemvars.h" // Low level variables, common to FreeSpace and Fred
17 #include "resource.h" // main symbols
18 #include "mission/missionparse.h"
19 #include "ShipEditorDlg.h"
20 #include "wing_editor.h"
21 #include "WaypointPathDlg.h"
22 #include "BgBitmapDlg.h"
23 #include "BriefingEditorDlg.h"
24 #include "globalincs/systemvars.h"
25 
26 #define MODIFY(a, b) do { \
27  if (a != (b)) { \
28  a = (b); \
29  set_modified(); \
30  } \
31 } while(0)
32 
33 #define F_RENDER_SHIP_MODELS 0x01
34 #define F_RENDER_SHIP_ICONS 0x02
35 
36 // user interface types
37 #define HOFFOSS_INTERFACE 1
38 #define ALLENDER_INTERFACE 2
39 
40 typedef struct window_data {
41  WINDOWPLACEMENT p;
42  int visible;
43  int valid;
44  int processed;
45 } window_data;
46 
48 // CFREDApp:
49 // See FRED.cpp for the implementation of this class
50 //
51 
52 class CFREDApp : public CWinApp
53 {
54  int app_init;
55  CString m_sInitialDir;
56 
57 public:
58  void record_window_data(window_data *wndd, CWnd *wnd);
59  int init_window(window_data *wndd, CWnd *wnd, int adjust = 0, int pre = 0);
60  void read_window(char *name, window_data *wndd);
61  void write_window(char *name, window_data *wndd);
62  void write_ini_file(int degree = 0);
63  CFREDApp();
64  ~CFREDApp();
65 
66  // Overrides
67  // ClassWizard generated virtual function overrides
68  //{{AFX_VIRTUAL(CFREDApp)
69  public:
70  virtual BOOL InitInstance();
71  virtual BOOL OnIdle(LONG lCount);
72  virtual int ExitInstance();
73  //}}AFX_VIRTUAL
74 
75 // Implementation
76 
77  //{{AFX_MSG(CFREDApp)
78  afx_msg void OnAppAbout();
79  afx_msg void OnFileOpen();
80  // NOTE - the ClassWizard will add and remove member functions here.
81  // DO NOT EDIT what you see in these blocks of generated code !
82  //}}AFX_MSG
83  DECLARE_MESSAGE_MAP()
84 };
85 
87 
88 // Add a message to be processed at the end of this frame.
89 // This is useful if you need the display to update before it's useful
90 // to process the message. For example, right click brings up a popup menu.
91 // But the menu it brings up depends on where you right clicked. If you
92 // right click on a ship, you get a message that pertains to the chosen
93 // ship. It is useful to have a visual indication that you have changed the
94 // current ship.
95 void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count);
96 void init_pending_messages(void);
97 void update_map_window();
98 
99 extern int User_interface;
100 extern int Fred_active;
101 extern int Update_window;
102 extern HCURSOR h_cursor_move, h_cursor_rotate;
103 
104 extern CWnd *Prev_window;
110 
111 extern CFREDApp theApp;
112 
121 extern window_data Bg_wnd_data;
void record_window_data(window_data *wndd, CWnd *wnd)
Definition: fred.cpp:670
window_data Main_wnd_data
Definition: fred.cpp:61
window_data Waypoint_wnd_data
Definition: fred.cpp:72
window_data Ship_wnd_data
Definition: fred.cpp:62
void * HWND
Definition: config.h:104
window_data Reinforcement_wnd_data
Definition: fred.cpp:71
void update_map_window()
Definition: fred.cpp:532
int visible
Definition: fred.h:42
int init_window(window_data *wndd, CWnd *wnd, int adjust=0, int pre=0)
Definition: fred.cpp:639
window_data Bg_wnd_data
Definition: fred.cpp:69
window_data Player_wnd_data
Definition: fred.cpp:67
void write_ini_file(int degree=0)
Definition: fred.cpp:552
afx_msg void OnFileOpen()
Definition: fred.cpp:325
void add_pending_message(HWND hwnd, int id, int wparam, int lparam, int skip_count)
Definition: fred.cpp:423
CShipEditorDlg Ship_editor_dialog
Definition: fred.cpp:55
window_data Briefing_wnd_data
Definition: fred.cpp:70
window_data Events_wnd_data
Definition: fred.cpp:68
WINDOWPLACEMENT p
Definition: fred.h:41
void init_pending_messages(void)
Definition: fred.cpp:437
CFREDApp()
Definition: fred.cpp:96
window_data Mission_goals_wnd_data
Definition: fred.cpp:65
waypoint_path_dlg Waypoint_editor_dialog
Definition: fred.cpp:57
virtual BOOL OnIdle(LONG lCount)
Definition: fred.cpp:469
Definition: fred.h:52
struct window_data window_data
HCURSOR h_cursor_rotate
Definition: fred.cpp:49
~CFREDApp()
Definition: fred.cpp:107
briefing_editor_dlg * Briefing_dialog
Definition: fred.cpp:59
window_data Mission_notes_wnd_data
Definition: fred.cpp:75
int valid
Definition: fred.h:43
CWnd * Prev_window
Definition: fred.cpp:54
virtual int ExitInstance()
Definition: fred.cpp:697
virtual BOOL InitInstance()
Definition: fred.cpp:121
long LONG
Definition: config.h:95
window_data Object_wnd_data
Definition: fred.cpp:64
GLuint const GLchar * name
Definition: Glext.h:5608
window_data Wing_wnd_data
Definition: fred.cpp:63
int BOOL
Definition: config.h:80
void write_window(char *name, window_data *wndd)
Definition: fred.cpp:604
bg_bitmap_dlg * Bg_bitmap_dialog
Definition: fred.cpp:58
wing_editor Wing_editor_dialog
Definition: fred.cpp:56
HCURSOR h_cursor_move
Definition: fred.cpp:49
int User_interface
Definition: fred.cpp:45
int Update_window
Definition: fred.cpp:48
window_data Messages_wnd_data
Definition: fred.cpp:66
afx_msg void OnAppAbout()
Definition: fred.cpp:318
void read_window(char *name, window_data *wndd)
Definition: fred.cpp:621
int processed
Definition: fred.h:44
int Fred_active
Definition: fred.cpp:47
CFREDApp theApp
Definition: fred.cpp:115
window_data Asteroid_wnd_data
Definition: fred.cpp:74
window_data Starfield_wnd_data
Definition: fred.cpp:73