2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
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.
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.
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/>.
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.
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.
26 ===========================================================================
29 #ifndef GEWINDOWWRAPPER_H_
30 #define GEWINDOWWRAPPER_H_
33 class rvGEWindowWrapper;
35 typedef bool (*PFNENUMCHILDRENPROC) ( rvGEWindowWrapper* wrapper, void* data );
37 class rvGEWindowWrapper
55 rvGEWindowWrapper ( idWindow* window, EWindowType type );
57 static rvGEWindowWrapper* GetWrapper ( idWindow* window );
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 );
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 );
76 bool IsFlippedHorz ( void );
77 bool IsFlippedVert ( void );
78 bool IsHidden ( void );
79 bool IsDeleted ( void );
80 bool IsSelected ( void );
81 bool IsExpanded ( void );
83 bool CanHaveChildren ( void );
84 bool CanMoveAndSize ( void );
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 );
91 void SetWindowType ( EWindowType type );
94 bool Collapse ( void );
96 bool EnumChildren ( PFNENUMCHILDRENPROC proc, void* data );
98 idWindow* WindowFromPoint ( float x, float y, bool visibleOnly = true );
100 void Finish ( void );
102 static EWindowType StringToWindowType ( const char* string );
103 static const char* WindowTypeToString ( EWindowType type );
107 void CalcScreenRect ( void );
108 void UpdateRect ( void );
109 void UpdateWindowState ( void );
111 idRectangle mClientRect;
112 idRectangle mScreenRect;
128 ID_INLINE idDict& rvGEWindowWrapper::GetStateDict ( void )
133 ID_INLINE idDict& rvGEWindowWrapper::GetVariableDict ( void )
138 ID_INLINE idDict& rvGEWindowWrapper::GetScriptDict ( void )
143 ID_INLINE bool rvGEWindowWrapper::IsFlippedHorz ( void )
148 ID_INLINE bool rvGEWindowWrapper::IsFlippedVert ( void )
153 ID_INLINE bool rvGEWindowWrapper::IsExpanded ( void )
158 ID_INLINE void rvGEWindowWrapper::SetFlippedHorz ( bool f )
163 ID_INLINE void rvGEWindowWrapper::SetFlippedVert ( bool f )
168 ID_INLINE idRectangle& rvGEWindowWrapper::GetClientRect ( void )
173 ID_INLINE idRectangle& rvGEWindowWrapper::GetScreenRect ( void )
178 ID_INLINE bool rvGEWindowWrapper::IsHidden ( void )
183 ID_INLINE bool rvGEWindowWrapper::IsDeleted ( void )
188 ID_INLINE bool rvGEWindowWrapper::IsSelected ( void )
193 ID_INLINE void rvGEWindowWrapper::SetSelected ( bool sel )
198 ID_INLINE rvGEWindowWrapper::EWindowType rvGEWindowWrapper::GetWindowType ( void )
203 ID_INLINE void rvGEWindowWrapper::SetWindowType ( rvGEWindowWrapper::EWindowType type )
208 ID_INLINE idWindow* rvGEWindowWrapper::GetChild ( int index )
210 return mWindow->GetChild ( index );
213 ID_INLINE idWindow* rvGEWindowWrapper::GetWindow ( void )
218 ID_INLINE bool rvGEWindowWrapper::CanMoveAndSize ( void )
223 #endif // GEWINDOWWRAPPER_H_