Team Fortress 2 Source Code as on 22/4/2020
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.

201 lines
5.2 KiB

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