doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UserInterface.cpp
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 #include "../idlib/precompiled.h"
30 #pragma hdrstop
31 
32 #include "ListGUILocal.h"
33 #include "DeviceContext.h"
34 #include "Window.h"
35 #include "UserInterfaceLocal.h"
36 
37 extern idCVar r_skipGuiShaders; // 1 = don't render any gui elements on surfaces
38 
41 
42 /*
43 ===============================================================================
44 
45  idUserInterfaceManagerLocal
46 
47 ===============================================================================
48 */
49 
51  screenRect = idRectangle(0, 0, 640, 480);
52  dc.Init();
53 }
54 
56  guis.DeleteContents( true );
57  demoGuis.DeleteContents( true );
58  dc.Shutdown();
59 }
60 
62  idUserInterface *gui = Alloc();
63  gui->InitFromFile( name );
64 // delete gui;
65 }
66 
68 
69  int c = guis.Num();
70  for( int i = 0; i < c; i++ ) {
71  char str[1024];
72  sprintf( str, "touchGui %s\n", guis[i]->Name() );
73  common->Printf( "%s", str );
74  f->Printf( "%s", str );
75  }
76 }
77 
79  dc.SetSize( width, height );
80 }
81 
83  int c = guis.Num();
84  for ( int i = 0; i < c; i++ ) {
85  if ( (guis[ i ]->GetDesktop()->GetFlags() & WIN_MENUGUI) == 0 ) {
86  guis[ i ]->ClearRefs();
87  /*
88  delete guis[ i ];
89  guis.RemoveIndex( i );
90  i--; c--;
91  */
92  }
93  }
94 }
95 
97  int c = guis.Num();
98  for ( int i = 0; i < c; i++ ) {
99  if ( guis[i]->GetRefs() == 0 ) {
100  //common->Printf( "purging %s.\n", guis[i]->GetSourceFile() );
101 
102  // use this to make sure no materials still reference this gui
103  bool remove = true;
104  for ( int j = 0; j < declManager->GetNumDecls( DECL_MATERIAL ); j++ ) {
105  const idMaterial *material = static_cast<const idMaterial *>(declManager->DeclByIndex( DECL_MATERIAL, j, false ));
106  if ( material->GlobalGui() == guis[i] ) {
107  remove = false;
108  break;
109  }
110  }
111  if ( remove ) {
112  delete guis[ i ];
113  guis.RemoveIndex( i );
114  i--; c--;
115  }
116  }
117  }
118 }
119 
121  ID_TIME_T ts;
122 
123  int c = guis.Num();
124  for ( int i = 0; i < c; i++ ) {
125  if ( !all ) {
126  fileSystem->ReadFile( guis[i]->GetSourceFile(), NULL, &ts );
127  if ( ts <= guis[i]->GetTimeStamp() ) {
128  continue;
129  }
130  }
131 
132  guis[i]->InitFromFile( guis[i]->GetSourceFile() );
133  common->Printf( "reloading %s.\n", guis[i]->GetSourceFile() );
134  }
135 }
136 
138  int c = guis.Num();
139  common->Printf( "\n size refs name\n" );
140  size_t total = 0;
141  int copies = 0;
142  int unique = 0;
143  for ( int i = 0; i < c; i++ ) {
144  idUserInterfaceLocal *gui = guis[i];
145  size_t sz = gui->Size();
146  bool isUnique = guis[i]->interactive;
147  if ( isUnique ) {
148  unique++;
149  } else {
150  copies++;
151  }
152  common->Printf( "%6.1fk %4i (%s) %s ( %i transitions )\n", sz / 1024.0f, guis[i]->GetRefs(), isUnique ? "unique" : "copy", guis[i]->GetSourceFile(), guis[i]->desktop->NumTransitions() );
153  total += sz;
154  }
155  common->Printf( "===========\n %i total Guis ( %i copies, %i unique ), %.2f total Mbytes", c, copies, unique, total / ( 1024.0f * 1024.0f ) );
156 }
157 
158 bool idUserInterfaceManagerLocal::CheckGui( const char *qpath ) const {
159  idFile *file = fileSystem->OpenFileRead( qpath );
160  if ( file ) {
161  fileSystem->CloseFile( file );
162  return true;
163  }
164  return false;
165 }
166 
168  return new idUserInterfaceLocal();
169 }
170 
172  if ( gui ) {
173  int c = guis.Num();
174  for ( int i = 0; i < c; i++ ) {
175  if ( guis[i] == gui ) {
176  delete guis[i];
177  guis.RemoveIndex( i );
178  return;
179  }
180  }
181  }
182 }
183 
184 idUserInterface *idUserInterfaceManagerLocal::FindGui( const char *qpath, bool autoLoad, bool needUnique, bool forceNOTUnique ) {
185  int c = guis.Num();
186 
187  for ( int i = 0; i < c; i++ ) {
188  idUserInterfaceLocal *gui = guis[i];
189  if ( !idStr::Icmp( guis[i]->GetSourceFile(), qpath ) ) {
190  if ( !forceNOTUnique && ( needUnique || guis[i]->IsInteractive() ) ) {
191  break;
192  }
193  guis[i]->AddRef();
194  return guis[i];
195  }
196  }
197 
198  if ( autoLoad ) {
199  idUserInterface *gui = Alloc();
200  if ( gui->InitFromFile( qpath ) ) {
201  gui->SetUniqued( forceNOTUnique ? false : needUnique );
202  return gui;
203  } else {
204  delete gui;
205  }
206  }
207  return NULL;
208 }
209 
211  int c = demoGuis.Num();
212  for ( int i = 0; i < c; i++ ) {
213  if ( !idStr::Icmp( demoGuis[i]->GetSourceFile(), qpath ) ) {
214  return demoGuis[i];
215  }
216  }
217  return NULL;
218 }
219 
221  return new idListGUILocal();
222 }
223 
225  delete listgui;
226 }
227 
228 /*
229 ===============================================================================
230 
231  idUserInterfaceLocal
232 
233 ===============================================================================
234 */
235 
237  cursorX = cursorY = 0.0;
238  desktop = NULL;
239  loading = false;
240  active = false;
241  interactive = false;
242  uniqued = false;
243  bindHandler = NULL;
244  //so the reg eval in gui parsing doesn't get bogus values
245  time = 0;
246  refs = 1;
247 }
248 
250  delete desktop;
251  desktop = NULL;
252 }
253 
254 const char *idUserInterfaceLocal::Name() const {
255  return source;
256 }
257 
258 const char *idUserInterfaceLocal::Comment() const {
259  if ( desktop ) {
260  return desktop->GetComment();
261  }
262  return "";
263 }
264 
266  return interactive;
267 }
268 
269 bool idUserInterfaceLocal::InitFromFile( const char *qpath, bool rebuild, bool cache ) {
270 
271  if ( !( qpath && *qpath ) ) {
272  // FIXME: Memory leak!!
273  return false;
274  }
275 
276  int sz = sizeof( idWindow );
277  sz = sizeof( idSimpleWindow );
278  loading = true;
279 
280  if ( rebuild ) {
281  delete desktop;
282  desktop = new idWindow( this );
283  } else if ( desktop == NULL ) {
284  desktop = new idWindow( this );
285  }
286 
287  source = qpath;
288  state.Set( "text", "Test Text!" );
289 
291 
292  //Load the timestamp so reload guis will work correctly
293  fileSystem->ReadFile(qpath, NULL, &timeStamp);
294 
295  src.LoadFile( qpath );
296 
297  if ( src.IsLoaded() ) {
298  idToken token;
299  while( src.ReadToken( &token ) ) {
300  if ( idStr::Icmp( token, "windowDef" ) == 0 ) {
301  desktop->SetDC( &uiManagerLocal.dc );
302  if ( desktop->Parse( &src, rebuild ) ) {
304  desktop->FixupParms();
305  }
306  continue;
307  }
308  }
309 
310  state.Set( "name", qpath );
311  } else {
312  desktop->SetDC( &uiManagerLocal.dc );
314  desktop->name = "Desktop";
315  desktop->text = va( "Invalid GUI: %s", qpath );
316  desktop->rect = idRectangle( 0.0f, 0.0f, 640.0f, 480.0f );
318  desktop->foreColor = idVec4( 1.0f, 1.0f, 1.0f, 1.0f );
319  desktop->backColor = idVec4( 0.0f, 0.0f, 0.0f, 1.0f );
321  common->Warning( "Couldn't load gui: '%s'", qpath );
322  }
323 
325 
326  if ( uiManagerLocal.guis.Find( this ) == NULL ) {
327  uiManagerLocal.guis.Append( this );
328  }
329 
330  loading = false;
331 
332  return true;
333 }
334 
335 const char *idUserInterfaceLocal::HandleEvent( const sysEvent_t *event, int _time, bool *updateVisuals ) {
336 
337  time = _time;
338 
339  if ( bindHandler && event->evType == SE_KEY && event->evValue2 == 1 ) {
340  const char *ret = bindHandler->HandleEvent( event, updateVisuals );
341  bindHandler = NULL;
342  return ret;
343  }
344 
345  if ( event->evType == SE_MOUSE ) {
346  cursorX += event->evValue;
347  cursorY += event->evValue2;
348 
349  if (cursorX < 0) {
350  cursorX = 0;
351  }
352  if (cursorY < 0) {
353  cursorY = 0;
354  }
355  }
356 
357  if ( desktop ) {
358  return desktop->HandleEvent( event, updateVisuals );
359  }
360 
361  return "";
362 }
363 
364 void idUserInterfaceLocal::HandleNamedEvent ( const char* eventName ) {
365  desktop->RunNamedEvent( eventName );
366 }
367 
368 void idUserInterfaceLocal::Redraw( int _time ) {
369  if ( r_skipGuiShaders.GetInteger() > 5 ) {
370  return;
371  }
372  if ( !loading && desktop ) {
373  time = _time;
374  uiManagerLocal.dc.PushClipRect( uiManagerLocal.screenRect );
375  desktop->Redraw( 0, 0 );
376  uiManagerLocal.dc.PopClipRect();
377  }
378 }
379 
381  if ( !desktop || desktop->GetFlags() & WIN_MENUGUI ) {
382  uiManagerLocal.dc.DrawCursor(&cursorX, &cursorY, 32.0f );
383  } else {
384  uiManagerLocal.dc.DrawCursor(&cursorX, &cursorY, 64.0f );
385  }
386 }
387 
389  return state;
390 }
391 
392 void idUserInterfaceLocal::DeleteStateVar( const char *varName ) {
393  state.Delete( varName );
394 }
395 
396 void idUserInterfaceLocal::SetStateString( const char *varName, const char *value ) {
397  state.Set( varName, value );
398 }
399 
400 void idUserInterfaceLocal::SetStateBool( const char *varName, const bool value ) {
401  state.SetBool( varName, value );
402 }
403 
404 void idUserInterfaceLocal::SetStateInt( const char *varName, const int value ) {
405  state.SetInt( varName, value );
406 }
407 
408 void idUserInterfaceLocal::SetStateFloat( const char *varName, const float value ) {
409  state.SetFloat( varName, value );
410 }
411 
412 const char* idUserInterfaceLocal::GetStateString( const char *varName, const char* defaultString ) const {
413  return state.GetString(varName, defaultString);
414 }
415 
416 bool idUserInterfaceLocal::GetStateBool( const char *varName, const char* defaultString ) const {
417  return state.GetBool(varName, defaultString);
418 }
419 
420 int idUserInterfaceLocal::GetStateInt( const char *varName, const char* defaultString ) const {
421  return state.GetInt(varName, defaultString);
422 }
423 
424 float idUserInterfaceLocal::GetStateFloat( const char *varName, const char* defaultString ) const {
425  return state.GetFloat(varName, defaultString);
426 }
427 
428 void idUserInterfaceLocal::StateChanged( int _time, bool redraw ) {
429  time = _time;
430  if (desktop) {
431  desktop->StateChanged( redraw );
432  }
433  if ( state.GetBool( "noninteractive" ) ) {
434  interactive = false;
435  }
436  else {
437  if (desktop) {
439  } else {
440  interactive = false;
441  }
442  }
443 }
444 
445 const char *idUserInterfaceLocal::Activate(bool activate, int _time) {
446  time = _time;
447  active = activate;
448  if ( desktop ) {
449  activateStr = "";
450  desktop->Activate( activate, activateStr );
451  return activateStr;
452  }
453  return "";
454 }
455 
457  time = _time;
458  if ( desktop ) {
459  desktop->Trigger();
460  }
461 }
462 
464  idStr work;
465  f->ReadDict( state );
466  source = state.GetString("name");
467 
468  if (desktop == NULL) {
469  f->Log("creating new gui\n");
470  desktop = new idWindow(this);
472  desktop->SetDC( &uiManagerLocal.dc );
474  } else {
475  f->Log("re-using gui\n");
476  desktop->ReadFromDemoFile(f, false);
477  }
478 
479  f->ReadFloat( cursorX );
480  f->ReadFloat( cursorY );
481 
482  bool add = true;
483  int c = uiManagerLocal.demoGuis.Num();
484  for ( int i = 0; i < c; i++ ) {
485  if ( uiManagerLocal.demoGuis[i] == this ) {
486  add = false;
487  break;
488  }
489  }
490 
491  if (add) {
492  uiManagerLocal.demoGuis.Append(this);
493  }
494 }
495 
497  idStr work;
498  f->WriteDict( state );
499  if (desktop) {
501  }
502 
503  f->WriteFloat( cursorX );
504  f->WriteFloat( cursorY );
505 }
506 
508  int len;
509  const idKeyValue *kv;
510  const char *string;
511 
512  int num = state.GetNumKeyVals();
513  savefile->Write( &num, sizeof( num ) );
514 
515  for( int i = 0; i < num; i++ ) {
516  kv = state.GetKeyVal( i );
517  len = kv->GetKey().Length();
518  string = kv->GetKey().c_str();
519  savefile->Write( &len, sizeof( len ) );
520  savefile->Write( string, len );
521 
522  len = kv->GetValue().Length();
523  string = kv->GetValue().c_str();
524  savefile->Write( &len, sizeof( len ) );
525  savefile->Write( string, len );
526  }
527 
528  savefile->Write( &active, sizeof( active ) );
529  savefile->Write( &interactive, sizeof( interactive ) );
530  savefile->Write( &uniqued, sizeof( uniqued ) );
531  savefile->Write( &time, sizeof( time ) );
532  len = activateStr.Length();
533  savefile->Write( &len, sizeof( len ) );
534  savefile->Write( activateStr.c_str(), len );
535  len = pendingCmd.Length();
536  savefile->Write( &len, sizeof( len ) );
537  savefile->Write( pendingCmd.c_str(), len );
538  len = returnCmd.Length();
539  savefile->Write( &len, sizeof( len ) );
540  savefile->Write( returnCmd.c_str(), len );
541 
542  savefile->Write( &cursorX, sizeof( cursorX ) );
543  savefile->Write( &cursorY, sizeof( cursorY ) );
544 
545  desktop->WriteToSaveGame( savefile );
546 
547  return true;
548 }
549 
551  int num;
552  int i, len;
553  idStr key;
554  idStr value;
555 
556  savefile->Read( &num, sizeof( num ) );
557 
558  state.Clear();
559  for( i = 0; i < num; i++ ) {
560  savefile->Read( &len, sizeof( len ) );
561  key.Fill( ' ', len );
562  savefile->Read( &key[0], len );
563 
564  savefile->Read( &len, sizeof( len ) );
565  value.Fill( ' ', len );
566  savefile->Read( &value[0], len );
567 
568  state.Set( key, value );
569  }
570 
571  savefile->Read( &active, sizeof( active ) );
572  savefile->Read( &interactive, sizeof( interactive ) );
573  savefile->Read( &uniqued, sizeof( uniqued ) );
574  savefile->Read( &time, sizeof( time ) );
575 
576  savefile->Read( &len, sizeof( len ) );
577  activateStr.Fill( ' ', len );
578  savefile->Read( &activateStr[0], len );
579  savefile->Read( &len, sizeof( len ) );
580  pendingCmd.Fill( ' ', len );
581  savefile->Read( &pendingCmd[0], len );
582  savefile->Read( &len, sizeof( len ) );
583  returnCmd.Fill( ' ', len );
584  savefile->Read( &returnCmd[0], len );
585 
586  savefile->Read( &cursorX, sizeof( cursorX ) );
587  savefile->Read( &cursorY, sizeof( cursorY ) );
588 
589  desktop->ReadFromSaveGame( savefile );
590 
591  return true;
592 }
593 
595  size_t sz = sizeof(*this) + state.Size() + source.Allocated();
596  if ( desktop ) {
597  sz += desktop->Size();
598  }
599  return sz;
600 }
601 
603  int i;
604  idWinVar *v = window->GetWinVarByName( "bind" );
605  if ( v ) {
607  }
608  i = 0;
609  while ( i < window->GetChildCount() ) {
610  idWindow *next = window->GetChild( i );
611  if ( next ) {
613  }
614  i++;
615  }
616 }
617 
618 /*
619 ==============
620 idUserInterfaceLocal::SetKeyBindingNames
621 ==============
622 */
624  if ( !desktop ) {
625  return;
626  }
627  // walk the windows
629 }
630 
631 /*
632 ==============
633 idUserInterfaceLocal::SetCursor
634 ==============
635 */
636 void idUserInterfaceLocal::SetCursor( float x, float y ) {
637  cursorX = x;
638  cursorY = y;
639 }
640 
unsigned GetFlags()
Definition: Window.h:214
virtual void SetStateString(const char *varName, const char *value)
virtual idFile * OpenFileRead(const char *relativePath, bool allowCopyFiles=true, const char *gamedir=NULL)=0
float GetFloat(const char *key, const char *defaultString="0") const
Definition: Dict.h:248
virtual float GetStateFloat(const char *varName, const char *defaultString="0") const
void RecurseSetKeyBindingNames(idWindow *window)
GLsizei const GLfloat * value
Definition: glext.h:3614
idUserInterfaceManagerLocal uiManagerLocal
int GetInt(const char *key, const char *defaultString="0") const
Definition: Dict.h:252
virtual void SetStateInt(const char *varName, const int value)
void Delete(const char *key)
Definition: Dict.cpp:496
virtual void SetSize(float width, float height)
const GLdouble * v
Definition: glext.h:2936
const idStr & GetKey(void) const
Definition: Dict.h:52
virtual void SetUniqued(bool b)=0
virtual void Trigger(int time)
virtual void StateChanged(bool redraw)
Definition: Window.cpp:518
idList< idUserInterfaceLocal * > demoGuis
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
int Length(void) const
Definition: Str.h:702
virtual void Redraw(int time)
GLenum GLint GLint y
Definition: glext.h:2849
virtual void StateChanged(int time, bool redraw)
virtual const char * Activate(bool activate, int time)
idFileSystem * fileSystem
Definition: FileSystem.cpp:500
virtual idUserInterface * FindDemoGui(const char *qpath)
virtual bool IsInteractive() const
GLenum GLsizei const GLvoid * string
Definition: glext.h:3472
virtual void WriteToSaveGame(idFile *savefile)
Definition: Window.cpp:3464
const int WIN_MENUGUI
Definition: Window.h:59
Definition: Token.h:71
void PushClipRect(float x, float y, float w, float h)
void FixupParms()
Definition: Window.cpp:3838
GLuint src
Definition: glext.h:5390
GLenum GLsizei len
Definition: glext.h:3472
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
virtual ~idUserInterfaceLocal()
idUserInterfaceManager * uiManager
GLenum GLint x
Definition: glext.h:2849
size_t Size(void) const
Definition: Dict.h:91
int i
Definition: process.py:33
virtual void Trigger()
Definition: Window.cpp:504
int IsLoaded(void) const
Definition: Parser.h:94
void SetFloat(const char *key, float val)
Definition: Dict.h:188
GLuint GLuint num
Definition: glext.h:5390
virtual void Touch(const char *name)
void SetDC(idDeviceContext *d)
Definition: Window.cpp:1301
int Icmp(const char *text) const
Definition: Str.h:667
virtual idUserInterface * Alloc(void) const
virtual void WriteToDemoFile(class idDemoFile *f)
Definition: Window.cpp:3319
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needInteractive=false, bool forceUnique=false)
Definition: File.h:50
int ReadToken(idToken *token)
Definition: Parser.cpp:2338
GLsizei GLsizei GLcharARB * source
Definition: glext.h:3633
virtual bool CheckGui(const char *qpath) const
idUserInterface * GlobalGui(void) const
Definition: Material.h:435
virtual void WriteToDemoFile(class idDemoFile *f)
idRectangle drawRect
Definition: Window.h:373
virtual void Activate(bool activate, idStr &act)
Definition: Window.cpp:481
virtual int GetStateInt(const char *varName, const char *defaultString="0") const
const GLubyte * c
Definition: glext.h:4677
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
Definition: Vector.h:808
virtual void DrawCursor()
idCommon * common
Definition: Common.cpp:206
bool GetBool(const char *key, const char *defaultString="0") const
Definition: Dict.h:256
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
virtual bool InitFromFile(const char *qpath, bool rebuild=true, bool cache=true)=0
void Clear(void)
Definition: Dict.cpp:201
int evValue2
Definition: sys_public.h:218
virtual const char * GetStateString(const char *varName, const char *defaultString="") const
int GetInteger(void) const
Definition: CVarSystem.h:143
virtual void SetStateBool(const char *varName, const bool value)
idWinVec4 foreColor
Definition: Window.h:402
virtual int Read(void *buffer, int len)
Definition: File.cpp:179
virtual bool Parse(idParser *src, bool rebuild=true)
Definition: Window.cpp:2130
virtual void SetStateFloat(const char *varName, const float value)
type * Find(type const &obj) const
Definition: List.h:782
void Size(float x, float y, float w, float h)
Definition: Window.cpp:377
const idStr & GetValue(void) const
Definition: Dict.h:53
void DeleteContents(bool clear)
Definition: List.h:207
void Log(const char *p)
Definition: DemoFile.cpp:142
virtual bool GetStateBool(const char *varName, const char *defaultString="0") const
GLenum GLsizei width
Definition: glext.h:2846
void SetBool(const char *key, bool val)
Definition: Dict.h:196
virtual const idDict & State() const
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual void WritePrecacheCommands(idFile *f)
idWinStr text
Definition: Window.h:407
sysEventType_t evType
Definition: sys_public.h:216
GLenum GLsizei GLsizei height
Definition: glext.h:2856
void DrawCursor(float *x, float *y, float size)
virtual void RunNamedEvent(const char *eventName)
Definition: Window.cpp:633
idWinRectangle rect
Definition: Window.h:399
idDeclManager * declManager
static const char * KeysFromBinding(const char *bind)
Definition: KeyInput.cpp:607
const char * GetComment()
Definition: Window.h:313
virtual void SetCursor(float x, float y)
idList< idUserInterfaceLocal * > guis
virtual int GetNumDecls(declType_t type)=0
prefInfo window
bool Interactive()
Definition: Window.cpp:3939
int Append(const type &obj)
Definition: List.h:646
void SetInt(const char *key, int val)
Definition: Dict.h:192
virtual bool InitFromFile(const char *qpath, bool rebuild=true, bool cache=true)
virtual idListGUI * AllocListGUI(void) const
virtual const idDecl * DeclByIndex(declType_t type, int index, bool forceParse=true)=0
idWinVec4 backColor
Definition: Window.h:400
tuple f
Definition: idal.py:89
int Num(void) const
Definition: List.h:265
int LoadFile(const char *filename, bool OSPath=false)
Definition: Parser.cpp:3013
bool RemoveIndex(int index)
Definition: List.h:849
virtual int WriteFloat(const float value)
Definition: File.cpp:526
const GLcharARB * name
Definition: glext.h:3629
void WriteDict(const idDict &dict)
Definition: DemoFile.cpp:293
idWindow * GetChild(int index)
Definition: Window.cpp:4036
virtual int Write(const void *buffer, int len)
Definition: File.cpp:189
Definition: Str.h:116
void Fill(const char ch, int newlen)
Definition: Str.h:867
virtual const char * Comment() const
virtual void Redraw(float x, float y)
Definition: Window.cpp:1194
virtual const char * HandleEvent(const sysEvent_t *event, int time, bool *updateVisuals)
const char * c_str(void) const
Definition: Str.h:487
virtual void DeAlloc(idUserInterface *gui)
virtual const char * Name() const
virtual void Reload(bool all)
idStr name
Definition: Window.h:387
virtual void FreeListGUI(idListGUI *listgui)
const idKeyValue * GetKeyVal(int index) const
Definition: Dict.h:294
virtual void DeleteStateVar(const char *varName)
virtual void ReadFromDemoFile(class idDemoFile *f, bool rebuild=true)
Definition: Window.cpp:3160
virtual bool ReadFromSaveGame(idFile *savefile)
GLint j
Definition: qgl.h:264
virtual int ReadFloat(float &value)
Definition: File.cpp:373
char * va(const char *fmt,...)
Definition: Str.cpp:1568
virtual void ReadFromDemoFile(class idDemoFile *f)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
Definition: Window.cpp:709
const char * GetName() const
Definition: Winvar.h:44
virtual void CloseFile(idFile *f)=0
virtual void HandleNamedEvent(const char *namedEvent)
void SetSize(float width, float height)
virtual bool WriteToSaveGame(idFile *savefile) const
const int WIN_DESKTOP
Definition: Window.h:65
void SetFlag(unsigned int f)
Definition: Window.cpp:1484
idCVar r_skipGuiShaders
int GetNumKeyVals(void) const
Definition: Dict.h:290
virtual void ListGuis() const
virtual void virtual void Warning(const char *fmt,...) id_attribute((format(printf
virtual idWinVar * GetWinVarByName(const char *_name, bool winLookup=false, drawWin_t **owner=NULL)
Definition: Window.cpp:1776
int sprintf(idStr &string, const char *fmt,...)
Definition: Str.cpp:1528
virtual int Printf(const char *fmt,...) id_attribute((format(printf
Definition: File.cpp:260
void ReadDict(idDict &dict)
Definition: DemoFile.cpp:275
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Window.cpp:3607
void SetupFromState()
Definition: Window.cpp:1409
virtual void SetKeyBindingNames(void)