X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=radiant%2Fmainframe.h;h=85e60f47eb6ba671cc61c10c75d90c276b2df0c2;hb=bbbc73e14382eac5aa5f4a3c802f2d9fbbd43811;hp=6ff808da8d2918c3f55cdfc6197a702070dfe351;hpb=9dfae1c9b270ee369c6362903a9205b30751b95f;p=xonotic%2Fnetradiant.git diff --git a/radiant/mainframe.h b/radiant/mainframe.h index 6ff808da..85e60f47 100644 --- a/radiant/mainframe.h +++ b/radiant/mainframe.h @@ -31,13 +31,10 @@ #include "qerplugin.h" class IPlugIn; - class IToolbarButton; class XYWnd; - class CamWnd; - class ZWnd; @@ -48,236 +45,194 @@ const int c_texture_status = 3; const int c_grid_status = 4; const int c_count_status = 5; -class MainFrame { +class MainFrame +{ public: - enum EViewStyle { - eRegular = 0, - eFloating = 1, - eSplit = 2, - eRegularLeft = 3, - }; - - MainFrame(); +enum EViewStyle +{ + eRegular = 0, + eFloating = 1, + eSplit = 2, + eRegularLeft = 3, +}; - ~MainFrame(); +MainFrame(); +~MainFrame(); - ui::Window m_window{ui::null}; +ui::Window m_window{ui::null}; - CopiedString m_command_status; - CopiedString m_position_status; - CopiedString m_brushcount_status; - CopiedString m_texture_status; - CopiedString m_grid_status; +CopiedString m_command_status; +CopiedString m_position_status; +CopiedString m_brushcount_status; +CopiedString m_texture_status; +CopiedString m_grid_status; private: - void Create(); +void Create(); +void SaveWindowInfo(); +void Shutdown(); - void SaveWindowInfo(); +ui::Widget m_vSplit{ui::null}; +ui::Widget m_hSplit{ui::null}; +ui::Widget m_vSplit2{ui::null}; - void Shutdown(); +XYWnd* m_pXYWnd; +XYWnd* m_pYZWnd; +XYWnd* m_pXZWnd; +CamWnd* m_pCamWnd; +ZWnd* m_pZWnd; +XYWnd* m_pActiveXY; - ui::Widget m_vSplit{ui::null}; - ui::Widget m_hSplit{ui::null}; - ui::Widget m_vSplit2{ui::null}; +bool m_bSleeping; - XYWnd *m_pXYWnd; - XYWnd *m_pYZWnd; - XYWnd *m_pXZWnd; - CamWnd *m_pCamWnd; - ZWnd *m_pZWnd; - XYWnd *m_pActiveXY; +void *m_pStatusLabel[c_count_status]; - bool m_bSleeping; - void *m_pStatusLabel[c_count_status]; +EViewStyle m_nCurrentStyle; +WindowPositionTracker m_position_tracker; - - EViewStyle m_nCurrentStyle; - WindowPositionTracker m_position_tracker; - - IdleDraw m_idleRedrawStatusText; +IdleDraw m_idleRedrawStatusText; public: - bool IsSleeping() - { - return m_bSleeping; - } - - void OnSleep(); - - void SetStatusText(CopiedString &status_text, const char *pText); - - void UpdateStatusText(); - - void RedrawStatusText(); - - typedef MemberCaller RedrawStatusTextCaller; - - void SetGridStatus(); - - typedef MemberCaller SetGridStatusCaller; - - void SetActiveXY(XYWnd *p); - - XYWnd *ActiveXY() - { - return m_pActiveXY; - }; - - XYWnd *GetXYWnd() - { - return m_pXYWnd; - } +bool IsSleeping(){ + return m_bSleeping; +} +void OnSleep(); - XYWnd *GetXZWnd() - { - return m_pXZWnd; - } +void SetStatusText( CopiedString& status_text, const char* pText ); +void UpdateStatusText(); +void RedrawStatusText(); +typedef MemberCaller RedrawStatusTextCaller; - XYWnd *GetYZWnd() - { - return m_pYZWnd; - } +void SetGridStatus(); +typedef MemberCaller SetGridStatusCaller; - ZWnd *GetZWnd() - { - return m_pZWnd; - } - - CamWnd *GetCamWnd() - { - return m_pCamWnd; - } - - void ReleaseContexts(); - - void CreateContexts(); - - EViewStyle CurrentStyle() - { - return m_nCurrentStyle; - }; - - bool FloatingGroupDialog() - { - return CurrentStyle() == eFloating || CurrentStyle() == eSplit; - }; +void SetActiveXY( XYWnd* p ); +XYWnd* ActiveXY(){ + return m_pActiveXY; +}; +XYWnd* GetXYWnd(){ + return m_pXYWnd; +} +XYWnd* GetXZWnd(){ + return m_pXZWnd; +} +XYWnd* GetYZWnd(){ + return m_pYZWnd; +} +ZWnd* GetZWnd(){ + return m_pZWnd; +} +CamWnd* GetCamWnd(){ + return m_pCamWnd; +} + +void ReleaseContexts(); +void CreateContexts(); + +EViewStyle CurrentStyle(){ + return m_nCurrentStyle; +}; +bool FloatingGroupDialog(){ + return CurrentStyle() == eFloating || CurrentStyle() == eSplit; +}; }; -extern MainFrame *g_pParentWnd; +extern MainFrame* g_pParentWnd; ui::Window MainFrame_getWindow(); -enum EMouseButtonMode { - ETwoButton = 0, - EThreeButton = 1, +enum EMouseButtonMode +{ + ETwoButton = 0, + EThreeButton = 1, }; -struct glwindow_globals_t { - int m_nMouseType; +struct glwindow_globals_t +{ + int m_nMouseType; - glwindow_globals_t() : - m_nMouseType(EThreeButton) - { - } + glwindow_globals_t() : + m_nMouseType( EThreeButton ){ + } }; void GLWindow_Construct(); - void GLWindow_Destroy(); extern glwindow_globals_t g_glwindow_globals; - template class LatchedValue; - extern LatchedValue g_Layout_enableDetachableMenus; void deleteSelection(); -void Sys_Status(const char *status); - +void Sys_Status( const char* status ); -void ScreenUpdates_Disable(const char *message, const char *title); +void ScreenUpdates_Disable( const char* message, const char* title ); void ScreenUpdates_Enable(); - bool ScreenUpdates_Enabled(); - void ScreenUpdates_process(); -class ScopeDisableScreenUpdates { +class ScopeDisableScreenUpdates +{ public: - ScopeDisableScreenUpdates(const char *message, const char *title) - { - ScreenUpdates_Disable(message, title); - } - - ~ScopeDisableScreenUpdates() - { - ScreenUpdates_Enable(); - } +ScopeDisableScreenUpdates( const char* message, const char* title ){ + ScreenUpdates_Disable( message, title ); +} +~ScopeDisableScreenUpdates(){ + ScreenUpdates_Enable(); +} }; void EnginePath_Realise(); - void EnginePath_Unrealise(); class ModuleObserver; -void Radiant_attachEnginePathObserver(ModuleObserver &observer); - -void Radiant_detachEnginePathObserver(ModuleObserver &observer); +void Radiant_attachEnginePathObserver( ModuleObserver& observer ); +void Radiant_detachEnginePathObserver( ModuleObserver& observer ); -void Radiant_attachGameToolsPathObserver(ModuleObserver &observer); - -void Radiant_detachGameToolsPathObserver(ModuleObserver &observer); +void Radiant_attachGameToolsPathObserver( ModuleObserver& observer ); +void Radiant_detachGameToolsPathObserver( ModuleObserver& observer ); extern CopiedString g_strEnginePath; - void EnginePath_verify(); - -const char *EnginePath_get(); - -const char *QERApp_GetGamePath(); +const char* EnginePath_get(); +const char* QERApp_GetGamePath(); extern bool g_disableEnginePath; extern bool g_disableHomePath; const int g_pakPathCount = 5; extern CopiedString g_strPakPath[g_pakPathCount]; - -const char *PakPath_get(int num); +const char* PakPath_get( int num ); extern CopiedString g_strAppPath; - -const char *AppPath_get(); +const char* AppPath_get(); extern CopiedString g_strSettingsPath; +const char* SettingsPath_get(); -const char *SettingsPath_get(); +const char* LocalRcPath_get( void ); -const char *LocalRcPath_get(void); - -const char *const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath -const char *const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath +const char* const g_pluginsDir = "plugins/"; ///< name of plugins directory, always sub-directory of toolspath +const char* const g_modulesDir = "modules/"; ///< name of modules directory, always sub-directory of toolspath extern CopiedString g_strGameToolsPath; - -const char *GameToolsPath_get(); +const char* GameToolsPath_get(); void Radiant_Initialise(); - void Radiant_Shutdown(); void SaveMapAs(); void XY_UpdateAllWindows(); - void UpdateAllWindows(); @@ -285,63 +240,41 @@ void ClipperChangeNotify(); void DefaultMode(); -const char *basegame_get(); - -const char *gamename_get(); - -void gamename_set(const char *gamename); - -void Radiant_attachGameNameObserver(ModuleObserver &observer); - -void Radiant_detachGameNameObserver(ModuleObserver &observer); - -const char *gamemode_get(); - -void gamemode_set(const char *gamemode); - -void Radiant_attachGameModeObserver(ModuleObserver &observer); - -void Radiant_detachGameModeObserver(ModuleObserver &observer); +const char* basegame_get(); +const char* gamename_get(); +void gamename_set( const char* gamename ); +void Radiant_attachGameNameObserver( ModuleObserver& observer ); +void Radiant_detachGameNameObserver( ModuleObserver& observer ); +const char* gamemode_get(); +void gamemode_set( const char* gamemode ); +void Radiant_attachGameModeObserver( ModuleObserver& observer ); +void Radiant_detachGameModeObserver( ModuleObserver& observer ); void VFS_Refresh(); - void VFS_Restart(); - void VFS_Construct(); - void VFS_Destroy(); void HomePaths_Construct(); - void HomePaths_Destroy(); - -void Radiant_attachHomePathsObserver(ModuleObserver &observer); - -void Radiant_detachHomePathsObserver(ModuleObserver &observer); +void Radiant_attachHomePathsObserver( ModuleObserver& observer ); +void Radiant_detachHomePathsObserver( ModuleObserver& observer ); void MainFrame_Construct(); - void MainFrame_Destroy(); extern float ( *GridStatus_getGridSize )(); - extern int ( *GridStatus_getRotateIncrement )(); - extern int ( *GridStatus_getFarClipDistance )(); - extern bool ( *GridStatus_getTextureLockEnabled )(); - void GridStatus_onTextureLockEnabledChanged(); -SignalHandlerId XYWindowDestroyed_connect(const SignalHandler &handler); - -void XYWindowDestroyed_disconnect(SignalHandlerId id); - -MouseEventHandlerId XYWindowMouseDown_connect(const MouseEventHandler &handler); - -void XYWindowMouseDown_disconnect(MouseEventHandlerId id); +SignalHandlerId XYWindowDestroyed_connect( const SignalHandler& handler ); +void XYWindowDestroyed_disconnect( SignalHandlerId id ); +MouseEventHandlerId XYWindowMouseDown_connect( const MouseEventHandler& handler ); +void XYWindowMouseDown_disconnect( MouseEventHandlerId id ); extern ui::Widget g_page_entity;