Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
5.9 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef MAINFRM_H
  7. #define MAINFRM_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "MDIClientWnd.h"
  12. #include "FilterControl.h"
  13. #include "ObjectBar.h"
  14. #include "Texturebar.h"
  15. #include "MapAnimationDlg.h"
  16. #include "SelectModeDlgBar.h"
  17. #include "materialdlg.h"
  18. #include "ManifestDialog.h"
  19. class CChildFrame;
  20. class CObjectProperties;
  21. class CTextureBrowser;
  22. class CModelBrowser;
  23. class CSearchReplaceDlg;
  24. class CFaceEditSheet;
  25. class CMessageWnd;
  26. class CLightingPreviewResultsWindow;
  27. class CMainFrame : public CMDIFrameWnd
  28. {
  29. DECLARE_DYNAMIC( CMainFrame )
  30. public:
  31. CMainFrame();
  32. virtual ~CMainFrame();
  33. bool VerifyBarState(void);
  34. void BeginShellSession(void);
  35. void EndShellSession(void);
  36. bool IsShellSessionActive(void);
  37. BOOL IsUndoActive() { return m_bUndoActive; }
  38. void SetUndoActive(BOOL bActive);
  39. void SetBrightness(float fBrightness);
  40. void UpdateAllDocViews(DWORD dwCmd);
  41. void Configure();
  42. void GlobalNotify(int nCode);
  43. void OnDeleteActiveDocument(void);
  44. void LoadWindowStates(std::fstream *pFile = NULL);
  45. inline CFaceEditSheet *GetFaceEditSheet( void ) { return m_pFaceEditSheet; }
  46. inline CStatusBar *GetStatusBar() { return &m_wndStatusBar; }
  47. void ShowSearchReplaceDialog(void);
  48. void ShowFaceEditSheetOrTextureBar( bool bShowFaceEditSheet );
  49. HACCEL GetAccelTable( void ) { return m_hAccelTable; }
  50. CFaceSmoothingVisualDlg *GetSmoothingGroupDialog( void ) { return &m_SmoothingGroupDlg; }
  51. CModelBrowser *GetModelBrowser();
  52. void ResetAutosaveTimer();
  53. bool IsInFaceEditMode();
  54. #ifdef _DEBUG
  55. virtual void AssertValid() const;
  56. virtual void Dump(CDumpContext& dc) const;
  57. #endif
  58. void OpenURL(const char *pszURL);
  59. void OpenURL(UINT nID);
  60. //
  61. // Public attributes. FIXME: eliminate!
  62. //
  63. CTextureBrowser *pTextureBrowser;
  64. CObjectProperties *pObjectProperties;
  65. CFilterControl m_FilterControl;
  66. CObjectBar m_ObjectBar;
  67. CToolBar m_wndMapOps;
  68. CTextureBar m_TextureBar;
  69. CManifestFilter m_ManifestFilterControl;
  70. CFaceEditSheet *m_pFaceEditSheet;
  71. CLightingPreviewResultsWindow *m_pLightingPreviewOutputWindow;
  72. bool m_bLightingPreviewOutputWindowShowing;
  73. //CMapAnimationDlg m_AnimationDlg;
  74. // Overrides
  75. // ClassWizard generated virtual function overrides
  76. //{{AFX_VIRTUAL(CMainFrame)
  77. public:
  78. virtual void WinHelp(DWORD dwData, UINT nCmd);
  79. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  80. virtual BOOL PreTranslateMessage(MSG* pMsg);
  81. protected:
  82. //}}AFX_VIRTUAL
  83. protected:
  84. //{{AFX_MSG(CMainFrame)
  85. afx_msg void OnUpdateFoundrySendSelectedEntitiesToEngine( CCmdUI *pCmdUI );
  86. afx_msg void OnFoundrySendSelectedEntitiesToEngine();
  87. afx_msg void OnUpdateFoundryMoveEngineViewToHammer3DView( CCmdUI *pCmdUI );
  88. afx_msg void OnFoundryMoveEngineViewToHammer3DView();
  89. afx_msg void OnUpdateFoundryRemoveSelectedEntitiesFromEngine( CCmdUI *pCmdUI );
  90. afx_msg void OnFoundryRemoveSelectedEntitiesFromEngine();
  91. afx_msg void OnUpdateFoundryMoveFocusToEngine( CCmdUI *pCmdUI );
  92. afx_msg void OnFoundryMoveFocusToEngine();
  93. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  94. afx_msg void OnEditProperties();
  95. afx_msg void OnViewMessages();
  96. afx_msg void OnUpdateViewMessages(CCmdUI* pCmdUI);
  97. afx_msg void OnSize(UINT nType, int cx, int cy);
  98. afx_msg void OnClose();
  99. afx_msg void OnDestroy();
  100. afx_msg void OnPaint();
  101. afx_msg void OnTimer(UINT nIDEvent);
  102. afx_msg void OnToolsOptions();
  103. afx_msg void OnViewDotACamera();
  104. afx_msg void OnViewShowconnections();
  105. afx_msg void OnToolsPrefabfactory();
  106. afx_msg BOOL OnHelpOpenURL(UINT nID);
  107. afx_msg void OnHelpFinder();
  108. afx_msg void OnEditUndoredoactive();
  109. afx_msg void OnUpdateEditUndoredoactive(CCmdUI* pCmdUI);
  110. afx_msg BOOL OnFileNew(UINT);
  111. afx_msg void OnSavewindowstate();
  112. afx_msg void OnLoadwindowstate();
  113. afx_msg void OnFileOpen();
  114. afx_msg BOOL OnChange3dViewType(UINT nID);
  115. afx_msg BOOL OnUnits(UINT nID);
  116. afx_msg void OnUpdateUnits(CCmdUI *pCmdUI);
  117. afx_msg void OnUpdateView3d(CCmdUI *pCmdUI);
  118. afx_msg void OnUpdateView2d(CCmdUI *pCmdUI);
  119. afx_msg void OnUpdateToolUI(CCmdUI *pUI);
  120. afx_msg BOOL OnView3dChangeBrightness(UINT nID);
  121. afx_msg void OnUpdateApplicatorUI(CCmdUI *pUI);
  122. afx_msg BOOL OnHelpInfo(HELPINFO*);
  123. afx_msg void OnEnterMenuLoop( BOOL bIsTrackPopupMenu );
  124. #if _MSC_VER < 1300
  125. afx_msg void OnActivateApp(BOOL bActive, HTASK hTask);
  126. #else
  127. afx_msg void OnActivateApp(BOOL bActive, DWORD hThread);
  128. #endif
  129. afx_msg void OnUpdateEditFunction(CCmdUI *pCmdUI);
  130. afx_msg BOOL OnApplicator(UINT nID);
  131. afx_msg BOOL OnSoundBrowser(UINT nID);
  132. afx_msg void OnModelBrowser();
  133. afx_msg BOOL OnReloadSounds(UINT nID);
  134. afx_msg void OnUpdateOpaqueMaterials(CCmdUI *pCmdUI);
  135. afx_msg void OnOpaqueMaterials();
  136. afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
  137. afx_msg BOOL OnChangeTool(UINT nID);
  138. afx_msg void OnInitMenu( CMenu *pMenu );
  139. afx_msg void OnHDR( void );
  140. afx_msg LRESULT OnWTPacket(WPARAM, LPARAM);
  141. //}}AFX_MSG
  142. DECLARE_MESSAGE_MAP()
  143. private:
  144. void DockControlBarLeftOf(CControlBar *Bar, CControlBar *LeftOf);
  145. void SaveWindowStates(std::fstream *pFile = NULL);
  146. CChildFrame *GetNextMDIChildWnd(CChildFrame *pCurChild);
  147. CChildFrame *GetNextMDIChildWndRecursive(CWnd *pCurChild);
  148. void EnableFaceEditMode(bool bEnable);
  149. void Autosave( void );
  150. void LoadOldestAutosave( void );
  151. CMDIClientWnd wndMDIClient; // dvs: what in God's name is this for?
  152. CSearchReplaceDlg *m_pSearchReplaceDlg;
  153. CModelBrowser *m_pModelBrowser;
  154. BOOL m_bUndoActive;
  155. CStatusBar m_wndStatusBar;
  156. CToolBar m_wndMapToolBar;
  157. CToolBar m_wndUndoRedoToolBar;
  158. CToolBar m_wndMapEditToolBar;
  159. CSelectModeDlgBar m_SelectModeDlg;
  160. CFaceSmoothingVisualDlg m_SmoothingGroupDlg;
  161. bool m_bMinimized;
  162. bool m_bShellSessionActive; // Whether a client has initiated a remote shell editing session.
  163. CBitmap m_bmMapEditTools256;
  164. enum
  165. {
  166. AUTOSAVE_TIMER,
  167. FIRST_TIMER
  168. };
  169. };
  170. CMainFrame *GetMainWnd();
  171. #endif // MAINFRM_H