1 /* $Id: xpilotView.h,v 5.0 2001/04/07 20:00:59 dik Exp $
2 *
3 * XPilot, a multiplayer gravity war game. Copyright (C) 1991-2001 by
4 *
5 * Bj�rn Stabell <bjoern@xpilot.org>
6 * Ken Ronny Schouten <ken@xpilot.org>
7 * Bert Gijsbers <bert@xpilot.org>
8 * Dick Balaska <dick@xpilot.org>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 */
24
25 /***************************************************************************\
26 * xpilotView.h : interface of the CXpilotView class *
27 * *
28 * XPilotNT uses the standard MFC doc/view model in an SDI format. *
29 * $Id: xpilotView.h,v 5.0 2001/04/07 20:00:59 dik Exp $ *
30 \***************************************************************************/
31
32 #define WSA_EVENT WM_USER+300 // from WSAAsyncSelect
33 #define WSA_RESOLVEHOST WM_USER+301
34 #define WSA_CONNECT WM_USER+302
35 #define WSA_RECV WM_USER+303
36
37 extern "C" const char* GetWSockErrText(int error);
38
39 class CXpilotView : public CView
40 {
41 protected: // create from serialization only
42 CXpilotView();
43 DECLARE_DYNCREATE(CXpilotView)
44
45 // Attributes
46 public:
47 CXpilotDoc* GetDocument();
48 BOOL isVirgin;
49 BOOL shuttingdown;
50
51 // CPalette cpal;
52 // LOGPALETTE* pal;
53
54 // Operations
55 public:
56
57 // Overrides
58 // ClassWizard generated virtual function overrides
59 //{{AFX_VIRTUAL(CXpilotView)
60 public:
61 virtual void OnDraw(CDC* pDC); // overridden to draw this view
62 virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
63 virtual void OnInitialUpdate();
64 virtual BOOL DestroyWindow();
65 virtual void OnSize(UINT, int, int);
66 protected:
67 virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
68 //}}AFX_VIRTUAL
69
70 // Implementation
71 public:
72 virtual ~CXpilotView();
73 #ifdef _DEBUG
74 virtual void AssertValid() const;
75 virtual void Dump(CDumpContext& dc) const;
76 #endif
77
78 protected:
79
80 // Generated message map functions
81 protected:
82 //{{AFX_MSG(CXpilotView)
83 afx_msg void OnDestroy();
84 afx_msg void OnFileNew();
85 afx_msg void OnUpdateFileNew(CCmdUI* pCmdUI);
86 afx_msg void OnShowWindow(BOOL bShow, UINT nStatus);
87 afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
88 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
89 afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
90 //}}AFX_MSG
91
92 afx_msg LONG OnWSA_EVENT(UINT, LONG);
93 //afx_msg LONG OnWSA_RESOLVEHOST(UINT, LONG);
94 //afx_msg LONG OnWSA_CONNECT(UINT, LONG);
95 //afx_msg LONG OnWSA_EVENT(UINT, LONG);
96 DECLARE_MESSAGE_MAP()
97 };
98
99 #ifndef _DEBUG // debug version in xpilotView.cpp
GetDocument()100 inline CXpilotDoc* CXpilotView::GetDocument()
101 { return (CXpilotDoc*)m_pDocument; }
102 #endif
103
104 /////////////////////////////////////////////////////////////////////////////
105