Debian Codegraph @

editor/editor.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/Main/editor/editor.h $
21 * $Revision: 1.1.1.1 $
22 * $Date: 2003-08-26 03:57:37 $
23 * $Author: kevinb $
24 *
25 * CEditorApp main MFC header
26 *
27 * $Log: not supported by cvs2svn $
28 *
29 * 12 4/16/99 3:54p Nate
30 * Added Viewer Properties Dialog
31 *
32 * 11 1/19/99 6:53p Matt
33 * Fixed a problem when the viewer was instantaneously moved from inside
34 * to ourside or vise-versa.
35 *
36 * 10 12/23/98 4:00p Nate
37 * Added DallasModelessDlgPtr data member
38 *
39 * 9 7/10/98 2:12p Jeff
40 * added a flag for inventory information in objinfo
41 *
42 * 8 12/01/97 5:24p Samir
43 * Make initialdir and dirlen have predefined values of 0.
44 *
45 * 7 12/01/97 5:17p Samir
46 * New functions to open a file dialog.
47 *
48 * 6 9/06/97 3:06p Matt
49 * Removed old trigger stuff from registry load/save
50 * Added function PrintToDlgItem()
51 *
52 * 5 8/26/97 11:38a Samir
53 * Added Editor_active global to determine whether editor is currently
54 * active (useful for any window using the gr library.)
55 *
56 * 4 8/19/97 5:58p Samir
57 * OLE additions
58 *
59 * 3 8/01/97 2:36p Jeff
60 *
61 * 2 7/24/97 2:58p Matt
62 * Added functions to load and save D3EditState variables from/to the
63 * registry
64 *
65 * 13 6/30/97 3:55p Jeff
66 * Add object properties dialog
67 *
68 * 12 5/13/97 4:36p Samir
69 * call main-frame's onidle function
70 *
71 * 11 2/20/97 2:52p Samir
72 * Added main_view public var.
73 *
74 * 10 2/12/97 3:07p Samir
75 * pause and resume now flush keyboard queue to stop backspace from
76 * Int3ing.
77 *
78 * 9 2/11/97 1:42p Samir
79 * Added document variable and set modification flag.
80 *
81 * 8 1/21/97 12:48p Samir
82 * Added InitEditorState to define D3EditState info
83 *
84 * $NoKeywords: $
85 */
86
87 #ifndef __AFXWIN_H__
88 #error include 'stdafx.h' before including this file for PCH
89 #endif
90
91 #include "resource.h" // main symbols
92
93 #include "d3edit.h" // d3 editor header
94
95 class CTextureGrWnd;
96 class CWireframeGrWnd;
97 class CEditorView;
98 class CEditorDoc;
99 class CMainFrame;
100 class CDallasMainDlg;
101 class CViewerPropDlg;
102
103 /////////////////////////////////////////////////////////////////////////////
104 // CEditorApp:
105 // See editor.cpp for the implementation of this class
106 //
107
108 class CEditorApp : public CWinApp {
109 public:
110 CEditorApp();
111
112 // Overrides
113 // ClassWizard generated virtual function overrides
114 //{{AFX_VIRTUAL(CEditorApp)
115 public:
116 virtual BOOL InitInstance();
117 virtual BOOL OnIdle(LONG lCount);
118 virtual CDocument *OpenDocumentFile(LPCTSTR lpszFileName);
119 //}}AFX_VIRTUAL
120
121 // Implementation
122 // ADDED BY SAMIR FOR OLE SUPPORT
123 COleTemplateServer m_server;
124 // Server object for document creation
125 // ADDED BY SAMIR FOR OLE SUPPORT
126
127 //{{AFX_MSG(CEditorApp)
128 afx_msg void OnAppAbout();
129 // NOTE - the ClassWizard will add and remove member functions here.
130 // DO NOT EDIT what you see in these blocks of generated code !
131 //}}AFX_MSG
132 DECLARE_MESSAGE_MAP()
133
134 public:
135 CTextureGrWnd *textured_view; // GrWnd views for editor
136 CWireframeGrWnd *wireframe_view;
137 CEditorDoc *main_doc; // main doc object.
138 CEditorView *main_view; // main view
139 CMainFrame *main_frame; // the application's main_frame
140
141 CDallasMainDlg *m_DallasModelessDlgPtr; // modeless dialog for Dallas
142 CViewerPropDlg *m_ViewerPropDlgPtr; // modeless viewer properties dialog
143
144 void pause();
145 void resume();
146
147 BOOL paused() const { return m_Paused; };
148
149 private:
150 void InitEditorState();
151
152 private:
153 BOOL m_Paused;
154 };
155
156 extern CEditorApp theApp;
157 extern bool Editor_active; // this is false if we are running the game.
158
159 /////////////////////////////////////////////////////////////////////////////
160
161 // Load editor settings from the registry
162 void LoadEditorSettings();
163
164 // Save current editor settings to the registry
165 void SaveEditorSettings();
166
167 // Function to print to an edit box
168 // Parameters: dlg - the dialog that the edit box is in
169 // id - the ID of the edit box
170 // fmt - printf-style text & arguments
171 void PrintToDlgItem(CDialog *dlg, int id, char *fmt, ...);
172
173 // A quick way to use an openfiledialog/savefiledialog.
174 // wnd = parent window
175 // filter = a C string containing the extensions to look for in filenames when browsing (in MFC format)
176 // pathname = buffer where full pathname will be stored of file opened/saved
177 // initialdir = what directory to start browsing from. will also contain the new browsing directory if
178 // user changed directories.
179 // dirlen = max length of initialdir buffer including terminating null.
180 bool OpenFileDialog(CWnd *wnd, LPCTSTR filter, char *pathname, char *initialdir = NULL, int dirlen = 0);
181 bool SaveFileDialog(CWnd *wnd, LPCTSTR filter, char *pathname, char *initialdir = NULL, int dirlen = 0);
182
183 // Move the viewer object. This should be called whenever the viewer object is moved
184 void MoveViewer(vector *pos, int roomnum, matrix *orient);