1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
25 // MainFrm.h : interface of the CMainFrame class
27 /////////////////////////////////////////////////////////////////////////////
28 //===========================================================================
29 //#####DESCRIPTIONBEGIN####
36 // Description: Interface of the main frame class
43 //####DESCRIPTIONEND####
45 //===========================================================================
46 #if !defined(AFX_MAINFRM_H__A4845244_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_)
47 #define AFX_MAINFRM_H__A4845244_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_
51 #endif // _MSC_VER >= 1000
53 class CPropertiesView;
62 #include "Subprocess.h"
64 class CMainFrame : public CFrameWnd
66 protected: // create from serialization only
68 DECLARE_DYNCREATE(CMainFrame)
77 // ClassWizard generated virtual function overrides
78 //{{AFX_VIRTUAL(CMainFrame)
80 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
81 virtual void ActivateFrame(int nCmdShow = -1);
82 virtual BOOL PreTranslateMessage(MSG* pMsg);
84 virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
89 enum {Horz=-3, Vert=-2, Thin=-1};
93 CSplitterWndEx *pSplit;
95 Split(int _type,int _nLevel,double _fFrac=0.5) : type(_type), nLevel(_nLevel), fFrac(_fFrac), pSplit(0) {}
98 static Split arSplit[];
103 void OnUpdateFrameTitle(BOOL bAddToTitle);
104 void SetFailRulePane(int nCount);
105 bool m_bFindInProgress;
106 void SetThermometerMax (int nMax);
107 enum PaneType { Cell, Control, ShortDesc, Output, Properties, Rules, MLT, PaneTypeMax};
108 LPCTSTR GetPaneName(PaneType p) { return arView[p].pszName; }
109 CFont &GetPaneFont(PaneType pane);
110 bool SetPaneFont (PaneType pane, const LOGFONT &lf);
112 void SetIdleMessage (LPCTSTR pszIdleMessage=NULL);
113 void UpdateThermometer (int nLines);
115 CConfigToolApp * GetApp();
116 virtual ~CMainFrame();
118 virtual void AssertValid() const;
119 virtual void Dump(CDumpContext& dc) const;
122 CProgressCtrl m_Progress;
123 enum {StatusPane, ThermometerPane, PercentagePane, FailRulePane};
124 int m_nFailRulePaneSize;
125 int m_nThermometerPaneSize;
126 int m_nPercentagePaneSize;
128 CStatusBar m_wndStatusBar;
129 afx_msg void OnHelp();
130 bool PrepareEnvironment(bool bWithBuildTools = true);
132 // public so available as a utility function for windows creating popups
133 LRESULT OnMenuChar(UINT nChar, UINT nFlags, CMenu* pMenu);
136 static bool m_arMounted[26];
137 static void CygMount(TCHAR c);
143 CSplitterWndEx *pParent;
146 CRuntimeClass *pClass;
148 ViewStruct(LPCTSTR _pszName,bool _bVisible,CRuntimeClass *_pClass) : pszName(_pszName), pParent(0), bVisible(_bVisible), pClass(_pClass), pView(0) {}
149 ViewStruct(const ViewStruct &o) : pszName(o.pszName), pParent(0), bVisible(o.bVisible), pClass(o.pClass), pView(0) {}
151 static ViewStruct arView[PaneTypeMax];
153 static DWORD WINAPI ThreadFunc( LPVOID );
155 static UINT indicators[];
156 CToolBar m_wndToolBar;
157 CToolBar m_wndMLTToolBar;
158 bool m_bMLTToolbarVisible;
159 CFindDialog * m_pFindReplaceDialog;
161 bool m_bStatusBarCreated;
163 CString m_strIdleMessage;
164 int m_nThermometerMax;
165 CString m_strBuildTarget;
166 void BumpWindow (int nInc);
170 void Build(const CString &strWhat=_T(""));
172 //{{AFX_MSG(CMainFrame)
173 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
174 afx_msg void OnViewProperties();
175 afx_msg void OnUpdateViewProperties(CCmdUI* pCmdUI);
176 afx_msg void OnViewMLT();
177 afx_msg void OnViewShortdesc();
178 afx_msg void OnUpdateViewShortdesc(CCmdUI* pCmdUI);
179 afx_msg void OnViewOutput();
180 afx_msg void OnUpdateViewOutput(CCmdUI* pCmdUI);
181 afx_msg void OnUpdateBuildConfigure(CCmdUI* pCmdUI);
182 afx_msg void OnBuildStop();
183 afx_msg void OnUpdateBuildStop(CCmdUI* pCmdUI);
184 afx_msg void OnConfigurationBuild();
185 afx_msg void OnDestroy();
186 afx_msg void OnBuildTests();
187 afx_msg void OnUpdateBuildTests(CCmdUI* pCmdUI);
188 afx_msg void OnUpdateFileSave(CCmdUI* pCmdUI);
189 afx_msg void OnUpdateFileSaveAs(CCmdUI* pCmdUI);
190 afx_msg void OnUpdateFileOpen(CCmdUI* pCmdUI);
191 afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
192 afx_msg void OnUpdateAppExit(CCmdUI* pCmdUI);
193 afx_msg void OnUpdateViewMLT(CCmdUI* pCmdUI);
194 afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
195 afx_msg void OnUpdateConfigurationRefresh(CCmdUI* pCmdUI);
196 afx_msg void OnConfigurationRefresh();
197 afx_msg void OnViewSettings();
198 afx_msg void OnToolsPaths();
199 afx_msg void OnSize(UINT nType, int cx, int cy);
200 afx_msg void OnUpdateConfigurationRepository(CCmdUI* pCmdUI);
201 afx_msg void OnWindowNext();
202 afx_msg void OnWindowPrev();
203 afx_msg void OnHelpSubmitPr();
204 afx_msg void OnHelpEcos();
205 afx_msg void OnHelpRedHatHome();
206 afx_msg void OnHelpUitron();
207 afx_msg void OnHelpEcoshome();
208 afx_msg void OnRunSim();
209 afx_msg void OnBuildClean();
210 afx_msg void OnUpdateBuildClean(CCmdUI* pCmdUI);
211 afx_msg void OnToolsShell();
212 afx_msg void OnClose();
213 afx_msg void OnBuildOptions();
214 afx_msg void OnToolsOptions();
215 afx_msg void OnUsertoolsPaths();
216 afx_msg LRESULT OnSetMessageString(WPARAM wParam, LPARAM lParam);
217 afx_msg void OnUpdateRunSim(CCmdUI* pCmdUI);
218 afx_msg void OnViewConflicts();
219 afx_msg void OnUpdateViewConflicts(CCmdUI* pCmdUI);
220 afx_msg void OnViewMltbar();
221 afx_msg void OnUpdateViewMltbar(CCmdUI* pCmdUI);
222 afx_msg void OnResolveConflicts();
223 afx_msg void OnUpdateResolveConflicts(CCmdUI* pCmdUI);
224 afx_msg void OnGoHome();
225 afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
226 afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
227 afx_msg void OnUpdateBuildOptions(CCmdUI* pCmdUI);
228 afx_msg LRESULT OnSubprocess(WPARAM wParam, LPARAM lParam);
229 afx_msg void OnUpdateToolsAdministration(CCmdUI* pCmdUI);
230 afx_msg BOOL OnHelpInfo(HELPINFO* pHelpInfo);
231 afx_msg void OnEditPlatforms();
232 afx_msg void OnTimer(UINT nIDEvent);
234 void OnNavComplete(NMHDR*, LRESULT*);
235 DECLARE_MESSAGE_MAP()
236 static void CALLBACK SubprocessOutputFunc(void *pParam,LPCTSTR psz);
239 /////////////////////////////////////////////////////////////////////////////
241 //{{AFX_INSERT_LOCATION}}
242 // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
244 #endif // !defined(AFX_MAINFRM_H__A4845244_05EE_11D2_80BE_00A0C949ADAC__INCLUDED_)