doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEApp.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13 
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
21 
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
23 
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
25 
26 ===========================================================================
27 */
28 
29 #ifndef GEAPP_H_
30 #define GEAPP_H_
31 
32 #include "../../sys/win32/win_local.h"
33 
34 #include "../../ui/Rectangle.h"
35 #include "../../ui/Window.h"
36 #include "../../ui/UserInterfaceLocal.h"
37 
38 #ifndef GEOPTIONS_H_
39 #include "GEOptions.h"
40 #endif // GEOPTIONS_H_
41 
42 #ifndef GEWINDOWWRAPPER_H_
43 #include "GEWindowWrapper.h"
44 #endif // GEWINDOWWRAPPER_H_
45 
46 #ifndef GEWORKSPACE_H_
47 #include "GEWorkspace.h"
48 #endif // GEWORKSPACE_H_
49 
50 #ifndef GENAVIGATOR_H_
51 #include "GENavigator.h"
52 #endif // GENAVIGATOR_H_
53 
54 #ifndef GEPROPERTIES_H_
55 #include "GEProperties.h"
56 #endif // GEPROPERTIES_H_
57 
58 #ifndef GETRANSFORMER_H_
59 #include "GETransformer.h"
60 #endif // GETRANSFORMER_H_
61 
62 #ifndef GESTATUSBAR_H_
63 #include "GEStatusBar.h"
64 #endif // GESTATUSBAR_H_
65 
66 // Utility functions
67 const char *StringFromVec4 ( idVec4& vec );
68 bool IsExpression ( const char* s );
69 
70 
71 class rvGEViewer;
72 
73 class rvGEApp
74 {
75 public:
76 
77  rvGEApp ( );
78  ~rvGEApp ( );
79 
80  bool Initialize ( void );
81  void RunFrame ( void );
82 // bool Uninitialize ( void );
83 
84  bool TranslateAccelerator ( LPMSG msg );
85 
86  rvGEWorkspace* GetActiveWorkspace ( HWND* retwnd = NULL );
87  rvGENavigator& GetNavigator ( void );
88  rvGEProperties& GetProperties ( void );
90  rvGEOptions& GetOptions ( void );
91  HINSTANCE GetInstance ( void );
92  HWND GetMDIFrame ( void );
93  HWND GetMDIClient ( void );
94  rvGEStatusBar& GetStatusBar ( void );
95 
96  bool OpenFile ( const char* filename );
97  bool SaveFile ( const char* filename );
98  bool NewFile ( void );
99 
100  bool IsActive ( void );
101 
102  void CloseViewer ( void );
103 
104  int ToolWindowActivate ( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam );
105 
106  int MessageBox ( const char* text, int flags );
107 
108 protected:
109 
110  int HandleCommand ( WPARAM wParam, LPARAM lParam );
111  int HandleInitMenu ( WPARAM wParam, LPARAM lParam );
112 
113  void HandleCommandSave ( rvGEWorkspace* workspace, const char* filename );
114 
115  bool InitRecentFiles ( void );
116  void UpdateRecentFiles ( void );
117 
118  HWND mMDIFrame;
120  HINSTANCE mInstance;
127 
130 
132 
135 
136 private:
137 
138  static LRESULT CALLBACK FrameWndProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
139  static LRESULT CALLBACK MDIChildProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
140 
141 };
142 
143 ID_INLINE bool rvGEApp::IsActive ( void )
144 {
145  return mMDIFrame ? true : false;
146 }
147 
149 {
150  return mNavigator;
151 }
152 
154 {
155  return mProperties;
156 }
157 
159 {
160  return mTransformer;
161 }
162 
163 ID_INLINE rvGEOptions& rvGEApp::GetOptions ( void )
164 {
165  return mOptions;
166 }
167 
168 ID_INLINE HINSTANCE rvGEApp::GetInstance ( void )
169 {
170  return mInstance;
171 }
172 
174 {
175  return mStatusBar;
176 }
177 
178 ID_INLINE HWND rvGEApp::GetMDIFrame ( void )
179 {
180  return mMDIFrame;
181 }
182 
183 ID_INLINE HWND rvGEApp::GetMDIClient ( void )
184 {
185  return mMDIClient;
186 }
187 
188 
189 extern rvGEApp gApp;
190 
191 #endif // GEAPP_H_
rvGEViewer * mViewer
Definition: GEApp.h:131
rvGEProperties mProperties
Definition: GEApp.h:126
Definition: GEApp.h:73
bool NewFile(void)
Definition: GEApp.cpp:1146
rvGEStatusBar mStatusBar
Definition: GEApp.h:125
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
static LRESULT CALLBACK FrameWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: GEApp.cpp:264
idList< rvGEWorkspace * > mWorkspaces
Definition: GEApp.h:133
const char * StringFromVec4(idVec4 &vec)
Definition: guied.cpp:130
rvGEApp()
Definition: GEApp.cpp:57
rvGEProperties & GetProperties(void)
Definition: GEApp.h:153
HINSTANCE mInstance
Definition: GEApp.h:120
bool IsActive(void)
Definition: GEApp.h:143
bool TranslateAccelerator(LPMSG msg)
Definition: GEApp.cpp:196
rvGEWorkspace * GetActiveWorkspace(HWND *retwnd=NULL)
Definition: GEApp.cpp:167
GLdouble s
Definition: glext.h:2935
void RunFrame(void)
Definition: GEApp.cpp:238
HWND GetMDIFrame(void)
Definition: GEApp.h:178
HINSTANCE GetInstance(void)
Definition: GEApp.h:168
HMENU mRecentFileMenu
Definition: GEApp.h:128
int mRecentFileInsertPos
Definition: GEApp.h:129
rvGEApp gApp
Definition: guied.cpp:41
bool Initialize(void)
Definition: GEApp.cpp:78
rvGETransformer & GetTransformer(void)
Definition: GEApp.h:158
HWND mMDIFrame
Definition: GEApp.h:118
void CloseViewer(void)
Definition: GEApp.cpp:1316
void UpdateRecentFiles(void)
Definition: GEApp.cpp:1268
bool IsExpression(const char *s)
Definition: guied.cpp:146
rvGEOptions & GetOptions(void)
Definition: GEApp.h:163
rvGEOptions mOptions
Definition: GEApp.h:121
rvGENavigator mNavigator
Definition: GEApp.h:123
Definition: Vector.h:808
#define NULL
Definition: Lib.h:88
int MessageBox(const char *text, int flags)
Definition: GEApp.cpp:1380
int ToolWindowActivate(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
Definition: GEApp.cpp:1335
rvGENavigator & GetNavigator(void)
Definition: GEApp.h:148
bool OpenFile(const char *filename)
Definition: GEApp.cpp:1178
HACCEL mAccelerators
Definition: GEApp.h:122
idList< HWND > mToolWindows
Definition: GEApp.h:134
rvGEStatusBar & GetStatusBar(void)
Definition: GEApp.h:173
void HandleCommandSave(rvGEWorkspace *workspace, const char *filename)
Definition: GEApp.cpp:476
HWND GetMDIClient(void)
Definition: GEApp.h:183
bool SaveFile(const char *filename)
~rvGEApp()
Definition: GEApp.cpp:66
rvGETransformer mTransformer
Definition: GEApp.h:124
HWND mMDIClient
Definition: GEApp.h:119
bool InitRecentFiles(void)
Definition: GEApp.cpp:1240
static LRESULT CALLBACK MDIChildProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: GEApp.cpp:386
int HandleCommand(WPARAM wParam, LPARAM lParam)
Definition: GEApp.cpp:541
int HandleInitMenu(WPARAM wParam, LPARAM lParam)
Definition: GEApp.cpp:891