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 <uilib/uilib.h>
26 #include "gtkutil/window.h"
27 #include "gtkutil/idledraw.h"
28 #include "gtkutil/widget.h"
29 #include "string/string.h"
31 #include "qerplugin.h"
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;
64 CopiedString m_command_status;
65 CopiedString m_position_status;
66 CopiedString m_brushcount_status;
67 CopiedString m_texture_status;
68 CopiedString m_grid_status;
72 void SaveWindowInfo();
88 ui::Widget m_pStatusLabel[c_count_status];
91 EViewStyle m_nCurrentStyle;
92 WindowPositionTracker m_position_tracker;
94 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 );
131 void ReleaseContexts();
132 void CreateContexts();
134 EViewStyle CurrentStyle(){
135 return m_nCurrentStyle;
137 bool FloatingGroupDialog(){
138 return CurrentStyle() == eFloating || CurrentStyle() == eSplit;
142 extern MainFrame* g_pParentWnd;
144 ui::Window MainFrame_getWindow();
146 enum EMouseButtonMode
152 struct glwindow_globals_t
156 glwindow_globals_t() :
157 m_nMouseType( EThreeButton ){
161 void GLWindow_Construct();
162 void GLWindow_Destroy();
164 extern glwindow_globals_t g_glwindow_globals;
165 template<typename Value>
167 typedef LatchedValue<bool> LatchedBool;
168 extern LatchedBool g_Layout_enableDetachableMenus;
170 void deleteSelection();
173 void Sys_Status( const char* status );
176 void ScreenUpdates_Disable( const char* message, const char* title );
177 void ScreenUpdates_Enable();
178 bool ScreenUpdates_Enabled();
179 void ScreenUpdates_process();
181 class ScopeDisableScreenUpdates
184 ScopeDisableScreenUpdates( const char* message, const char* title ){
185 ScreenUpdates_Disable( message, title );
187 ~ScopeDisableScreenUpdates(){
188 ScreenUpdates_Enable();
193 void EnginePath_Realise();
194 void EnginePath_Unrealise();
196 class ModuleObserver;
198 void Radiant_attachEnginePathObserver( ModuleObserver& observer );
199 void Radiant_detachEnginePathObserver( ModuleObserver& observer );
201 void Radiant_attachGameToolsPathObserver( ModuleObserver& observer );
202 void Radiant_detachGameToolsPathObserver( ModuleObserver& observer );
204 extern CopiedString g_strEnginePath;
205 void EnginePath_verify();
206 const char* EnginePath_get();
207 const char* QERApp_GetGamePath();
209 extern CopiedString g_strAppPath;
210 const char* AppPath_get();
212 extern CopiedString g_strSettingsPath;
213 const char* SettingsPath_get();
215 const char* LocalRcPath_get( void );
217 const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath
218 const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath
220 extern CopiedString g_strGameToolsPath;
221 const char* GameToolsPath_get();
223 void Radiant_Initialise();
224 void Radiant_Shutdown();
229 void XY_UpdateAllWindows();
230 void UpdateAllWindows();
233 void ClipperChangeNotify();
237 const char* basegame_get();
238 const char* gamename_get();
239 void gamename_set( const char* gamename );
240 void Radiant_attachGameNameObserver( ModuleObserver& observer );
241 void Radiant_detachGameNameObserver( ModuleObserver& observer );
242 const char* gamemode_get();
243 void gamemode_set( const char* gamemode );
244 void Radiant_attachGameModeObserver( ModuleObserver& observer );
245 void Radiant_detachGameModeObserver( ModuleObserver& observer );
249 void VFS_Construct();
252 void HomePaths_Construct();
253 void HomePaths_Destroy();
254 void Radiant_attachHomePathsObserver( ModuleObserver& observer );
255 void Radiant_detachHomePathsObserver( ModuleObserver& observer );
258 void MainFrame_Construct();
259 void MainFrame_Destroy();
262 extern float ( *GridStatus_getGridSize )();
263 extern int ( *GridStatus_getRotateIncrement )();
264 extern int ( *GridStatus_getFarClipDistance )();
265 extern bool ( *GridStatus_getTextureLockEnabled )();
266 void GridStatus_onTextureLockEnabledChanged();
268 SignalHandlerId XYWindowDestroyed_connect( const SignalHandler& handler );
269 void XYWindowDestroyed_disconnect( SignalHandlerId id );
270 MouseEventHandlerId XYWindowMouseDown_connect( const MouseEventHandler& handler );
271 void XYWindowMouseDown_disconnect( MouseEventHandlerId id );
273 extern ui::Widget g_page_entity;