doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DebuggerWindow.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 #ifndef DEBUGGERWINDOW_H_
29 #define DEBUGGERWINDOW_H_
30 
31 #ifndef DEBUGGERSCRIPT_H_
32 #include "DebuggerScript.h"
33 #endif
34 
36 {
37 public:
38 
41  bool mModified;
42 };
43 
45 
46 class rvDebuggerClient;
47 
49 {
50 public:
51 
52  rvDebuggerWindow ( );
54 
55  bool Create ( HINSTANCE hInstance );
56 
57  static bool Activate ( void );
58 
59  void ProcessNetMessage ( msg_t* msg );
60 
61  void Printf ( const char* format, ... );
62 
63  HWND GetWindow ( void );
64 
65  void AddWatch ( const char* name, bool update = true );
66 
67  HINSTANCE GetInstance ( void );
68 
69 protected:
70 
71  bool FindPrev ( const char* text = NULL );
72  bool FindNext ( const char* text = NULL );
73 
74  void UpdateWatch ( void );
75  void UpdateWindowMenu ( void );
76  void UpdateScript ( void );
77  void UpdateToolbar ( void );
78  void UpdateTitle ( void );
79  void UpdateCallstack ( void );
80  void UpdateRecentFiles ( void );
81  bool OpenScript ( const char* filename, int lineNumber = -1 );
82  void EnableWindows ( bool state );
83 
84  int GetSelectedText ( idStr& text );
85 
86  void ToggleBreakpoint ( void );
87 
88  HWND mWnd;
89  HWND mWndScript;
90  HWND mWndOutput;
91  HWND mWndMargin;
92  HWND mWndTabs;
93  HWND mWndBorder;
96  HWND mWndWatch;
100 
103 
104  WNDPROC mOldWatchProc;
105  WNDPROC mOldScriptProc;
108 
109  HINSTANCE mInstance;
110  HIMAGELIST mImageList;
111 
114 
119 
120  HMENU mWindowMenu;
122 
126 
128 
130 
132 
133 private:
134 
135  bool RegisterClass ( void );
136  void CreateToolbar ( void );
137  bool InitRecentFiles ( void );
138 
139  int HandleInitMenu ( WPARAM wParam, LPARAM lParam );
140  int HandleCommand ( WPARAM wParam, LPARAM lParam );
141  int HandleCreate ( WPARAM wparam, LPARAM lparam );
142  int HandleActivate ( WPARAM wparam, LPARAM lparam );
143  int HandleDrawItem ( WPARAM wparam, LPARAM lparam );
144  void HandleTooltipGetDispInfo ( WPARAM wparam, LPARAM lparam );
145 
146  static LRESULT CALLBACK WndProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam );
147  static LRESULT CALLBACK MarginWndProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam );
148  static LRESULT CALLBACK ScriptWndProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam );
149  static INT_PTR CALLBACK AboutDlgProc ( HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam );
150  static int CALLBACK ScriptWordBreakProc ( LPTSTR text, int current, int max, int action );
151 };
152 
153 /*
154 ================
155 rvDebuggerWindow::GetWindow
156 ================
157 */
158 ID_INLINE HWND rvDebuggerWindow::GetWindow ( void )
159 {
160  return mWnd;
161 }
162 
163 /*
164 ================
165 rvDebuggerWindow::UpdateToolbar
166 ================
167 */
168 ID_INLINE void rvDebuggerWindow::UpdateToolbar ( void )
169 {
170  HandleInitMenu ( (WPARAM)GetMenu ( mWnd ), 0 );
171 }
172 
173 /*
174 ================
175 rvDebuggerWindow::GetInstance
176 ================
177 */
178 ID_INLINE HINSTANCE rvDebuggerWindow::GetInstance ( void )
179 {
180  return mInstance;
181 }
182 
183 #endif // DEBUGGERWINDOW_H_
184 
bool FindPrev(const char *text=NULL)
int HandleCreate(WPARAM wparam, LPARAM lparam)
GLenum GLsizei GLenum format
Definition: glext.h:2846
CONST PIXELFORMATDESCRIPTOR UINT
Definition: win_qgl.cpp:47
bool OpenScript(const char *filename, int lineNumber=-1)
void Printf(const char *format,...)
void UpdateWindowMenu(void)
HWND GetWindow(void)
void EnableWindows(bool state)
static LRESULT CALLBACK MarginWndProc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
bool RegisterClass(void)
static LRESULT CALLBACK ScriptWndProc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
idList< rvDebuggerWatch * > rvDebuggerWatchList
static bool Activate(void)
void AddWatch(const char *name, bool update=true)
int HandleActivate(WPARAM wparam, LPARAM lparam)
HIMAGELIST mImageList
void CreateToolbar(void)
bool Create(HINSTANCE hInstance)
bool InitRecentFiles(void)
#define NULL
Definition: Lib.h:88
idList< rvDebuggerScript * > mScripts
void UpdateScript(void)
static INT_PTR CALLBACK AboutDlgProc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
void HandleTooltipGetDispInfo(WPARAM wparam, LPARAM lparam)
int GetSelectedText(idStr &text)
rvDebuggerClient * mClient
rvDebuggerWatchList mWatches
void UpdateToolbar(void)
int HandleCommand(WPARAM wParam, LPARAM lParam)
int HandleDrawItem(WPARAM wparam, LPARAM lparam)
const GLcharARB * name
Definition: glext.h:3629
void UpdateTitle(void)
Definition: Str.h:116
int HandleInitMenu(WPARAM wParam, LPARAM lParam)
bool FindNext(const char *text=NULL)
void UpdateCallstack(void)
static int CALLBACK ScriptWordBreakProc(LPTSTR text, int current, int max, int action)
#define max(x, y)
Definition: os.h:70
void ProcessNetMessage(msg_t *msg)
static LRESULT CALLBACK WndProc(HWND wnd, UINT msg, WPARAM wparam, LPARAM lparam)
void ToggleBreakpoint(void)
HINSTANCE GetInstance(void)
void UpdateWatch(void)
void UpdateRecentFiles(void)