Debian Codegraph @

radiant/mainframe.h

raw symbols SCIP
1 /*
2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
4
5 This file is part of GtkRadiant.
6
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 #if !defined( INCLUDED_MAINFRAME_H )
23 #define INCLUDED_MAINFRAME_H
24
25 #include <uilib/uilib.h>
26 #include "gtkutil/window.h"
27 #include "gtkutil/idledraw.h"
28 #include "gtkutil/widget.h"
29 #include "string/string.h"
30
31 #include "qerplugin.h"
32
33 class IPlugIn;
34 class IToolbarButton;
35
36 class XYWnd;
37 class CamWnd;
38 class ZWnd;
39
40
41 const int c_command_status = 0;
42 const int c_position_status = 1;
43 const int c_brushcount_status = 2;
44 const int c_texture_status = 3;
45 const int c_grid_status = 4;
46 const int c_count_status = 5;
47
48 class MainFrame
49 {
50 public:
51 enum EViewStyle
52 {
53 eRegular = 0,
54 eFloating = 1,
55 eSplit = 2,
56 eRegularLeft = 3,
57 eSingle = 4,
58 };
59
60 MainFrame();
61 ~MainFrame();
62
63 ui::Window m_window{ui::null};
64
65 CopiedString m_command_status;
66 CopiedString m_position_status;
67 CopiedString m_brushcount_status;
68 CopiedString m_texture_status;
69 CopiedString m_grid_status;
70 private:
71
72 void Create();
73 void SaveWindowInfo();
74 void Shutdown();
75
76 public:
77 ui::Widget m_vSplit{ui::null};
78 ui::Widget m_hSplit{ui::null};
79 ui::Widget m_vSplit2{ui::null};
80
81 private:
82
83 XYWnd* m_pXYWnd;
84 XYWnd* m_pYZWnd;
85 XYWnd* m_pXZWnd;
86 CamWnd* m_pCamWnd;
87 ZWnd* m_pZWnd;
88 XYWnd* m_pActiveXY;
89
90 bool m_bSleeping;
91
92 void *m_pStatusLabel[c_count_status];
93
94
95 EViewStyle m_nCurrentStyle;
96 WindowPositionTracker m_position_tracker;
97
98 IdleDraw m_idleRedrawStatusText;
99
100 public:
101
102 bool IsSleeping(){
103 return m_bSleeping;
104 }
105 void OnSleep();
106
107 void SetStatusText( CopiedString& status_text, const char* pText );
108 void UpdateStatusText();
109 void RedrawStatusText();
110 typedef MemberCaller<MainFrame, void(), &MainFrame::RedrawStatusText> RedrawStatusTextCaller;
111
112 void SetGridStatus();
113 typedef MemberCaller<MainFrame, void(), &MainFrame::SetGridStatus> SetGridStatusCaller;
114
115 void SetActiveXY( XYWnd* p );
116 XYWnd* ActiveXY(){
117 return m_pActiveXY;
118 };
119 XYWnd* GetXYWnd(){
120 return m_pXYWnd;
121 }
122 XYWnd* GetXZWnd(){
123 return m_pXZWnd;
124 }
125 XYWnd* GetYZWnd(){
126 return m_pYZWnd;
127 }
128 ZWnd* GetZWnd(){
129 return m_pZWnd;
130 }
131 CamWnd* GetCamWnd(){
132 return m_pCamWnd;
133 }
134
135 void ReleaseContexts();
136 void CreateContexts();
137
138 EViewStyle CurrentStyle(){
139 #if defined(WORKAROUND_GTK3_SINGLE_WINDOW_LAYOUT)
140 /* HACK: Disable the floating windows layouts because
141 GTK3 doesn't support context sharing accross windows. */
142 switch (m_nCurrentStyle) {
143 case eFloating:
144 case eRegularLeft:
145 return eSingle;
146 default:
147 return m_nCurrentStyle;
148 }
149 #else
150 return m_nCurrentStyle;
151 #endif
152 };
153 bool FloatingGroupDialog(){
154 return CurrentStyle() == eFloating || CurrentStyle() == eSplit;
155 };
156 };
157
158 extern MainFrame* g_pParentWnd;
159
160 ui::Window MainFrame_getWindow();
161 /*
162 enum EMouseButtonMode
163 {
164 ETwoButton = 0,
165 EThreeButton = 1,
166 };
167
168 struct glwindow_globals_t
169 {
170 int m_nMouseType;
171
172 glwindow_globals_t() :
173 m_nMouseType( EThreeButton ){
174 }
175 };
176 */
177 void GLWindow_Construct();
178 void GLWindow_Destroy();
179
180 //extern glwindow_globals_t g_glwindow_globals;
181 template<typename Value>
182 class LatchedValue;
183 extern LatchedValue<bool> g_Layout_enableDetachableMenus;
184
185 void deleteSelection();
186
187
188 void Sys_Status( const char* status );
189
190
191 void ScreenUpdates_Disable( const char* message, const char* title );
192 void ScreenUpdates_Enable();
193 bool ScreenUpdates_Enabled();
194 void ScreenUpdates_process();
195
196 class ScopeDisableScreenUpdates
197 {
198 public:
199 ScopeDisableScreenUpdates( const char* message, const char* title ){
200 ScreenUpdates_Disable( message, title );
201 }
202 ~ScopeDisableScreenUpdates(){
203 ScreenUpdates_Enable();
204 }
205 };
206
207
208 void EnginePath_Realise();
209 void EnginePath_Unrealise();
210
211 class ModuleObserver;
212
213 void Radiant_attachEnginePathObserver( ModuleObserver& observer );
214 void Radiant_detachEnginePathObserver( ModuleObserver& observer );
215
216 void Radiant_attachGameToolsPathObserver( ModuleObserver& observer );
217 void Radiant_detachGameToolsPathObserver( ModuleObserver& observer );
218
219 extern CopiedString g_strEnginePath;
220 void EnginePath_verify();
221 const char* EnginePath_get();
222 const char* QERApp_GetGamePath();
223
224 extern bool g_disableEnginePath;
225 extern bool g_disableHomePath;
226
227 const int g_pakPathCount = 5;
228 extern CopiedString g_strPakPath[g_pakPathCount];
229 const char* PakPath_get( int num );
230
231 extern CopiedString g_strAppFilePath;
232 extern CopiedString g_strAppPath;
233 extern CopiedString g_strLibPath;
234 extern CopiedString g_strDataPath;
235
236 const char* AppFilePath_get();
237 const char* AppPath_get();
238 const char *LibPath_get();
239 const char *DataPath_get();
240
241 extern CopiedString g_strSettingsPath;
242 const char* SettingsPath_get();
243
244 const char* LocalRcPath_get( void );
245
246 const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath
247 const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath
248
249 extern CopiedString g_strGameToolsPath;
250 const char* GameToolsPath_get();
251
252 void Radiant_Initialise();
253 void Radiant_Shutdown();
254
255 void SaveMapAs();
256
257
258 void XY_UpdateAllWindows();
259 void UpdateAllWindows();
260
261
262 void ClipperChangeNotify();
263 void ClipperMode();
264
265 void DefaultMode();
266
267 const char* basegame_get();
268 const char* gamename_get();
269 void gamename_set( const char* gamename );
270 void Radiant_attachGameNameObserver( ModuleObserver& observer );
271 void Radiant_detachGameNameObserver( ModuleObserver& observer );
272 const char* gamemode_get();
273 void gamemode_set( const char* gamemode );
274 void Radiant_attachGameModeObserver( ModuleObserver& observer );
275 void Radiant_detachGameModeObserver( ModuleObserver& observer );
276
277 void VFS_Refresh();
278 void VFS_Restart();
279 void VFS_Construct();
280 void VFS_Destroy();
281
282 void HomePaths_Construct();
283 void HomePaths_Destroy();
284 void Radiant_attachHomePathsObserver( ModuleObserver& observer );
285 void Radiant_detachHomePathsObserver( ModuleObserver& observer );
286
287
288 void MainFrame_Construct();
289 void MainFrame_Destroy();
290
291 extern char **environ;
292 void Radiant_Restart();
293
294 extern float ( *GridStatus_getGridSize )();
295 extern int ( *GridStatus_getRotateIncrement )();
296 extern int ( *GridStatus_getFarClipDistance )();
297 extern bool ( *GridStatus_getTextureLockEnabled )();
298 void GridStatus_onTextureLockEnabledChanged();
299
300 SignalHandlerId XYWindowDestroyed_connect( const SignalHandler& handler );
301 void XYWindowDestroyed_disconnect( SignalHandlerId id );
302 MouseEventHandlerId XYWindowMouseDown_connect( const MouseEventHandler& handler );
303 void XYWindowMouseDown_disconnect( MouseEventHandlerId id );
304
305 extern ui::Widget g_page_entity;
306
307 void FocusAllViews();
308
309 #endif