2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
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.
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.
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
22 #if !defined(INCLUDED_MAINFRAME_H)
23 #define INCLUDED_MAINFRAME_H
25 #include "gtkutil/window.h"
26 #include "gtkutil/idledraw.h"
27 #include "gtkutil/widget.h"
28 #include "string/string.h"
37 typedef struct _GtkWidget GtkWidget;
38 typedef struct _GtkWindow GtkWindow;
40 const int c_command_status = 0;
41 const int c_position_status = 1;
42 const int c_brushcount_status = 2;
43 const int c_texture_status = 3;
44 const int c_grid_status = 4;
45 const int c_count_status = 5;
63 CopiedString m_command_status;
64 CopiedString m_position_status;
65 CopiedString m_brushcount_status;
66 CopiedString m_texture_status;
67 CopiedString m_grid_status;
71 void SaveWindowInfo();
87 GtkWidget *m_pStatusLabel[c_count_status];
90 EViewStyle m_nCurrentStyle;
91 WindowPositionTracker m_position_tracker;
93 IdleDraw m_idleRedrawStatusText;
103 void SetStatusText(CopiedString& status_text, const char* pText);
104 void UpdateStatusText();
105 void RedrawStatusText();
106 typedef MemberCaller<MainFrame, &MainFrame::RedrawStatusText> RedrawStatusTextCaller;
108 void SetGridStatus();
109 typedef MemberCaller<MainFrame, &MainFrame::SetGridStatus> SetGridStatusCaller;
111 void SetActiveXY(XYWnd* p);
137 void ReleaseContexts();
138 void CreateContexts();
140 EViewStyle CurrentStyle()
142 return m_nCurrentStyle;
144 bool FloatingGroupDialog()
146 return CurrentStyle() == eFloating || CurrentStyle() == eSplit;
150 extern MainFrame* g_pParentWnd;
152 GtkWindow* MainFrame_getWindow();
154 enum EMouseButtonMode
160 struct glwindow_globals_t
164 glwindow_globals_t() :
165 m_nMouseType(EThreeButton)
170 void GLWindow_Construct();
171 void GLWindow_Destroy();
173 extern glwindow_globals_t g_glwindow_globals;
174 template<typename Value>
176 typedef LatchedValue<bool> LatchedBool;
177 extern LatchedBool g_Layout_enableDetachableMenus;
179 void deleteSelection();
182 void Sys_Status(const char* status);
185 void ScreenUpdates_Disable(const char* message, const char* title = "");
186 void ScreenUpdates_Enable();
187 bool ScreenUpdates_Enabled();
188 void ScreenUpdates_process();
190 class ScopeDisableScreenUpdates
193 ScopeDisableScreenUpdates(const char* message, const char* title = "")
195 ScreenUpdates_Disable(message, title);
197 ~ScopeDisableScreenUpdates()
199 ScreenUpdates_Enable();
204 void EnginePath_Realise();
205 void EnginePath_Unrealise();
207 class ModuleObserver;
209 void Radiant_attachEnginePathObserver(ModuleObserver& observer);
210 void Radiant_detachEnginePathObserver(ModuleObserver& observer);
212 void Radiant_attachGameToolsPathObserver(ModuleObserver& observer);
213 void Radiant_detachGameToolsPathObserver(ModuleObserver& observer);
215 extern CopiedString g_strEnginePath;
216 void EnginePath_verify();
217 const char* EnginePath_get();
218 const char* QERApp_GetGamePath();
220 extern CopiedString g_strAppPath;
221 const char* AppPath_get();
223 extern CopiedString g_strSettingsPath;
224 const char* SettingsPath_get();
226 const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath
227 const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath
229 extern CopiedString g_strGameToolsPath;
230 const char* GameToolsPath_get();
232 void Radiant_Initialise();
233 void Radiant_Shutdown();
238 void XY_UpdateAllWindows();
239 void UpdateAllWindows();
242 void ClipperChangeNotify();
246 const char* basegame_get();
247 const char* gamename_get();
248 void gamename_set(const char* gamename);
249 void Radiant_attachGameNameObserver(ModuleObserver& observer);
250 void Radiant_detachGameNameObserver(ModuleObserver& observer);
251 const char* gamemode_get();
252 void gamemode_set(const char* gamemode);
253 void Radiant_attachGameModeObserver(ModuleObserver& observer);
254 void Radiant_detachGameModeObserver(ModuleObserver& observer);
258 void VFS_Construct();
261 void HomePaths_Construct();
262 void HomePaths_Destroy();
263 void Radiant_attachHomePathsObserver(ModuleObserver& observer);
264 void Radiant_detachHomePathsObserver(ModuleObserver& observer);
267 void MainFrame_Construct();
268 void MainFrame_Destroy();
271 extern float (*GridStatus_getGridSize)();
272 extern int (*GridStatus_getRotateIncrement)();
273 extern int (*GridStatus_getFarClipDistance)();
274 extern bool (*GridStatus_getTextureLockEnabled)();
275 void GridStatus_onTextureLockEnabledChanged();