doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEWindowWrapper.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 GEWINDOWWRAPPER_H_
30 #define GEWINDOWWRAPPER_H_
31 
32 class idWindow;
33 class rvGEWindowWrapper;
34 
35 typedef bool (*PFNENUMCHILDRENPROC) ( rvGEWindowWrapper* wrapper, void* data );
36 
38 {
39 public:
40 
42  {
53  };
54 
56 
58 
59  idWindow* GetWindow ( void );
60  idDict& GetStateDict ( void );
61  idDict& GetVariableDict ( void );
62  idDict& GetScriptDict ( void );
63  idRectangle& GetClientRect ( void );
64  idRectangle& GetScreenRect ( void );
65  EWindowType GetWindowType ( void );
66  int GetChildCount ( void );
67  int GetDepth ( void );
68  idWindow* GetChild ( int index );
69 
70  void SetRect ( idRectangle& rect );
71  void SetState ( const idDict& dict );
72  void SetStateKey ( const char* key, const char* value, bool update = true );
73  void DeleteStateKey ( const char* key );
74  bool VerfiyStateKey ( const char* name, const char* value, idStr* result = NULL );
75 
76  bool IsFlippedHorz ( void );
77  bool IsFlippedVert ( void );
78  bool IsHidden ( void );
79  bool IsDeleted ( void );
80  bool IsSelected ( void );
81  bool IsExpanded ( void );
82 
83  bool CanHaveChildren ( void );
84  bool CanMoveAndSize ( void );
85 
86  void SetFlippedHorz ( bool f );
87  void SetFlippedVert ( bool f );
88  void SetHidden ( bool v );
89  void SetDeleted ( bool del );
90  void SetSelected ( bool sel );
92 
93  bool Expand ( void );
94  bool Collapse ( void );
95 
96  bool EnumChildren ( PFNENUMCHILDRENPROC proc, void* data );
97 
98  idWindow* WindowFromPoint ( float x, float y, bool visibleOnly = true );
99 
100  void Finish ( void );
101 
102  static EWindowType StringToWindowType ( const char* string );
103  static const char* WindowTypeToString ( EWindowType type );
104 
105 protected:
106 
107  void CalcScreenRect ( void );
108  void UpdateRect ( void );
109  void UpdateWindowState ( void );
110 
119  bool mHidden;
120  bool mDeleted;
121  bool mSelected;
122  bool mExpanded;
124  bool mMoveable;
126 };
127 
129 {
130  return mState;
131 }
132 
134 {
135  return mVariables;
136 }
137 
139 {
140  return mScripts;
141 }
142 
143 ID_INLINE bool rvGEWindowWrapper::IsFlippedHorz ( void )
144 {
145  return mFlippedHorz;
146 }
147 
148 ID_INLINE bool rvGEWindowWrapper::IsFlippedVert ( void )
149 {
150  return mFlippedVert;
151 }
152 
153 ID_INLINE bool rvGEWindowWrapper::IsExpanded ( void )
154 {
155  return mExpanded;
156 }
157 
158 ID_INLINE void rvGEWindowWrapper::SetFlippedHorz ( bool f )
159 {
160  mFlippedHorz = f;
161 }
162 
163 ID_INLINE void rvGEWindowWrapper::SetFlippedVert ( bool f )
164 {
165  mFlippedVert = f;
166 }
167 
169 {
170  return mClientRect;
171 }
172 
174 {
175  return mScreenRect;
176 }
177 
178 ID_INLINE bool rvGEWindowWrapper::IsHidden ( void )
179 {
180  return mHidden;
181 }
182 
183 ID_INLINE bool rvGEWindowWrapper::IsDeleted ( void )
184 {
185  return mDeleted;
186 }
187 
188 ID_INLINE bool rvGEWindowWrapper::IsSelected ( void )
189 {
190  return mSelected;
191 }
192 
193 ID_INLINE void rvGEWindowWrapper::SetSelected ( bool sel )
194 {
195  mSelected = sel;
196 }
197 
199 {
200  return mType;
201 }
202 
204 {
205  mType = type;
206 }
207 
209 {
210  return mWindow->GetChild ( index );
211 }
212 
214 {
215  return mWindow;
216 }
217 
218 ID_INLINE bool rvGEWindowWrapper::CanMoveAndSize ( void )
219 {
220  return mMoveable;
221 }
222 
223 #endif // GEWINDOWWRAPPER_H_
bool(* PFNENUMCHILDRENPROC)(rvGEWindowWrapper *wrapper, void *data)
void UpdateWindowState(void)
GLsizei const GLfloat * value
Definition: glext.h:3614
idWindow * WindowFromPoint(float x, float y, bool visibleOnly=true)
const GLdouble * v
Definition: glext.h:2936
bool CanMoveAndSize(void)
GLenum GLint GLint y
Definition: glext.h:2849
EWindowType GetWindowType(void)
void SetFlippedHorz(bool f)
GLuint GLuint GLsizei GLenum type
Definition: glext.h:2845
static const char * WindowTypeToString(EWindowType type)
bool IsFlippedVert(void)
static EWindowType StringToWindowType(const char *string)
void SetFlippedVert(bool f)
void SetDeleted(bool del)
GLenum GLint x
Definition: glext.h:2849
Boolean result
idDict & GetStateDict(void)
bool CanHaveChildren(void)
void SetWindowType(EWindowType type)
void SetHidden(bool v)
idWindow * GetChild(int index)
GLuint index
Definition: glext.h:3476
idDict & GetScriptDict(void)
idRectangle & GetClientRect(void)
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:2853
idRectangle mClientRect
idRectangle & GetScreenRect(void)
idDict & GetVariableDict(void)
bool VerfiyStateKey(const char *name, const char *value, idStr *result=NULL)
rvGEWindowWrapper(idWindow *window, EWindowType type)
prefInfo window
static rvGEWindowWrapper * GetWrapper(idWindow *window)
idWindow * GetWindow(void)
tuple f
Definition: idal.py:89
const GLcharARB * name
Definition: glext.h:3629
idWindow * GetChild(int index)
Definition: Window.cpp:4036
Definition: Str.h:116
idRectangle mScreenRect
unsigned char bool
Definition: setup.h:74
void DeleteStateKey(const char *key)
bool IsFlippedHorz(void)
void SetStateKey(const char *key, const char *value, bool update=true)
bool EnumChildren(PFNENUMCHILDRENPROC proc, void *data)
void SetState(const idDict &dict)
void SetRect(idRectangle &rect)
void SetSelected(bool sel)