Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
MagicDoc.h
Go to the documentation of this file.
1 /* Project Magic 2.0
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Magic.exe
6  FILE: MagicDoc.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Interface of the MagicDoc class
13 */
14 
15 
16 #if !defined(AFX_MAGICDOC_H__8B8D63A3_30F9_4023_BFA8_DB79891487C2__INCLUDED_)
17 #define AFX_MAGICDOC_H__8B8D63A3_30F9_4023_BFA8_DB79891487C2__INCLUDED_
18 
19 #if _MSC_VER > 1000
20 #pragma once
21 #endif // _MSC_VER > 1000
22 
23 // +--------------------------------------------------------------------+
24 
25 #include "List.h"
26 
27 // +--------------------------------------------------------------------+
28 
29 class Bitmap;
30 class Command;
31 class Editor;
32 class Solid;
33 class Model;
34 class Surface;
35 class Segment;
36 class Selection;
37 class Selector;
38 
39 // +--------------------------------------------------------------------+
40 
41 class MagicDoc : public CDocument
42 {
43 protected: // create from serialization only
44  MagicDoc();
45  DECLARE_DYNCREATE(MagicDoc)
46 
47 // Attributes
48 public:
49 
50 // Operations
51 public:
52 
53 // Overrides
54  // ClassWizard generated virtual function overrides
55  //{{AFX_VIRTUAL(MagicDoc)
56  public:
57  virtual BOOL OnNewDocument();
58  virtual void Serialize(CArchive& ar);
59  virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
60  virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
61  virtual void DeleteContents();
62  //}}AFX_VIRTUAL
63 
64  void InitCommandStack();
65  void Exec(Command* command);
66  void Undo();
67  void Redo();
68  int NumUndo() const;
69  int NumRedo() const;
70  const char* GetUndoName() const;
71  const char* GetRedoName() const;
72 
73 // Implementation
74 public:
75  virtual ~MagicDoc();
76 #ifdef _DEBUG
77  virtual void AssertValid() const;
78  virtual void Dump(CDumpContext& dc) const;
79 #endif
80 
81  Solid* GetSolid() { return solid; }
83  Selector* GetSelector() { return selector; }
84  Editor* GetEditor() { return editor; }
85 
86  bool ImportFile(LPCTSTR path_name);
87  bool ExportFile(LPCTSTR path_name);
88 
89 protected:
94 
96  int nundo;
97 
98 // Generated message map functions
99 protected:
100  //{{AFX_MSG(MagicDoc)
101  afx_msg void OnSurfaceOptimize();
102  afx_msg void OnSurfaceExplode();
103  afx_msg void OnUpdateSurfaceOptimize(CCmdUI* pCmdUI);
104  afx_msg void OnUpdateSurfaceExplode(CCmdUI* pCmdUI);
105  //}}AFX_MSG
106  DECLARE_MESSAGE_MAP()
107 };
108 
109 // +--------------------------------------------------------------------+
110 
111 int LoadBuffer(const char* filename, BYTE*& buf, bool null_terminate=false);
112 int LoadTexture(const char* name, Bitmap*& bmp, int type=0);
113 int LoadAlpha(const char* name, Bitmap& bitmap, int type=0);
114 
115 // +--------------------------------------------------------------------+
116 
117 //{{AFX_INSERT_LOCATION}}
118 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
119 
120 #endif // !defined(AFX_MAGICDOC_H__8B8D63A3_30F9_4023_BFA8_DB79891487C2__INCLUDED_)