doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Winvar.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 __WINVAR_H__
30 #define __WINVAR_H__
31 
32 #include "Rectangle.h"
33 
34 static const char *VAR_GUIPREFIX = "gui::";
35 static const int VAR_GUIPREFIX_LEN = strlen(VAR_GUIPREFIX);
36 
37 class idWindow;
38 class idWinVar {
39 public:
40  idWinVar();
41  virtual ~idWinVar();
42 
43  void SetGuiInfo(idDict *gd, const char *_name);
44  const char *GetName() const {
45  if (name) {
46  if (guiDict && *name == '*') {
47  return guiDict->GetString(&name[1]);
48  }
49  return name;
50  }
51  return "";
52  }
53  void SetName(const char *_name) {
54  delete []name;
55  name = NULL;
56  if (_name) {
57  name = new char[strlen(_name)+1];
58  strcpy(name, _name);
59  }
60  }
61 
62  idWinVar &operator=( const idWinVar &other ) {
63  guiDict = other.guiDict;
64  SetName(other.name);
65  return *this;
66  }
67 
68  idDict *GetDict() const { return guiDict; }
69  bool NeedsUpdate() { return (guiDict != NULL); }
70 
71  virtual void Init(const char *_name, idWindow* win) = 0;
72  virtual void Set(const char *val) = 0;
73  virtual void Update() = 0;
74  virtual const char *c_str() const = 0;
75  virtual size_t Size() { size_t sz = (name) ? strlen(name) : 0; return sz + sizeof(*this); }
76 
77  virtual void WriteToSaveGame( idFile *savefile ) = 0;
78  virtual void ReadFromSaveGame( idFile *savefile ) = 0;
79 
80  virtual float x( void ) const = 0;
81 
82  void SetEval(bool b) {
83  eval = b;
84  }
85  bool GetEval() {
86  return eval;
87  }
88 
89 protected:
91  char *name;
92  bool eval;
93 };
94 
95 class idWinBool : public idWinVar {
96 public:
97  idWinBool() : idWinVar() {};
98  ~idWinBool() {};
99  virtual void Init(const char *_name, idWindow *win) { idWinVar::Init(_name, win);
100  if (guiDict) {
101  data = guiDict->GetBool(GetName());
102  }
103  }
104  int operator==( const bool &other ) { return (other == data); }
105  bool &operator=( const bool &other ) {
106  data = other;
107  if (guiDict) {
109  }
110  return data;
111  }
112  idWinBool &operator=( const idWinBool &other ) {
113  idWinVar::operator=(other);
114  data = other.data;
115  return *this;
116  }
117 
118  operator bool() const { return data; }
119 
120  virtual void Set(const char *val) {
121  data = ( atoi( val ) != 0 );
122  if (guiDict) {
124  }
125  }
126 
127  virtual void Update() {
128  const char *s = GetName();
129  if ( guiDict && s[0] != '\0' ) {
130  data = guiDict->GetBool( s );
131  }
132  }
133 
134  virtual const char *c_str() const {return va("%i", data); }
135 
136  // SaveGames
137  virtual void WriteToSaveGame( idFile *savefile ) {
138  savefile->Write( &eval, sizeof( eval ) );
139  savefile->Write( &data, sizeof( data ) );
140  }
141  virtual void ReadFromSaveGame( idFile *savefile ) {
142  savefile->Read( &eval, sizeof( eval ) );
143  savefile->Read( &data, sizeof( data ) );
144  }
145 
146  virtual float x( void ) const { return data ? 1.0f : 0.0f; };
147 
148 protected:
149  bool data;
150 };
151 
152 class idWinStr : public idWinVar {
153 public:
154  idWinStr() : idWinVar() {};
155  ~idWinStr() {};
156  virtual void Init(const char *_name, idWindow *win) {
157  idWinVar::Init(_name, win);
158  if (guiDict) {
160  }
161  }
162  int operator==( const idStr &other ) const {
163  return (other == data);
164  }
165  int operator==( const char *other ) const {
166  return (data == other);
167  }
168  idStr &operator=( const idStr &other ) {
169  data = other;
170  if (guiDict) {
171  guiDict->Set(GetName(), data);
172  }
173  return data;
174  }
175  idWinStr &operator=( const idWinStr &other ) {
176  idWinVar::operator=(other);
177  data = other.data;
178  return *this;
179  }
180  operator const char *() const {
181  return data.c_str();
182  }
183  operator const idStr &() const {
184  return data;
185  }
187  if (guiDict && name && *name) {
189  }
190  return data.LengthWithoutColors();
191  }
192  int Length() {
193  if (guiDict && name && *name) {
195  }
196  return data.Length();
197  }
198  void RemoveColors() {
199  if (guiDict && name && *name) {
201  }
202  data.RemoveColors();
203  }
204  virtual const char *c_str() const {
205  return data.c_str();
206  }
207 
208  virtual void Set(const char *val) {
209  data = val;
210  if ( guiDict ) {
211  guiDict->Set(GetName(), data);
212  }
213  }
214 
215  virtual void Update() {
216  const char *s = GetName();
217  if ( guiDict && s[0] != '\0' ) {
218  data = guiDict->GetString( s );
219  }
220  }
221 
222  virtual size_t Size() {
223  size_t sz = idWinVar::Size();
224  return sz +data.Allocated();
225  }
226 
227  // SaveGames
228  virtual void WriteToSaveGame( idFile *savefile ) {
229  savefile->Write( &eval, sizeof( eval ) );
230 
231  int len = data.Length();
232  savefile->Write( &len, sizeof( len ) );
233  if ( len > 0 ) {
234  savefile->Write( data.c_str(), len );
235  }
236  }
237  virtual void ReadFromSaveGame( idFile *savefile ) {
238  savefile->Read( &eval, sizeof( eval ) );
239 
240  int len;
241  savefile->Read( &len, sizeof( len ) );
242  if ( len > 0 ) {
243  data.Fill( ' ', len );
244  savefile->Read( &data[0], len );
245  }
246  }
247 
248  // return wether string is emtpy
249  virtual float x( void ) const { return data[0] ? 1.0f : 0.0f; };
250 
251 protected:
252  idStr data;
253 };
254 
255 class idWinInt : public idWinVar {
256 public:
257  idWinInt() : idWinVar() {};
258  ~idWinInt() {};
259  virtual void Init(const char *_name, idWindow *win) {
260  idWinVar::Init(_name, win);
261  if (guiDict) {
262  data = guiDict->GetInt(GetName());
263  }
264  }
265  int &operator=( const int &other ) {
266  data = other;
267  if (guiDict) {
268  guiDict->SetInt(GetName(), data);
269  }
270  return data;
271  }
272  idWinInt &operator=( const idWinInt &other ) {
273  idWinVar::operator=(other);
274  data = other.data;
275  return *this;
276  }
277  operator int () const {
278  return data;
279  }
280  virtual void Set(const char *val) {
281  data = atoi(val);;
282  if (guiDict) {
283  guiDict->SetInt(GetName(), data);
284  }
285  }
286 
287  virtual void Update() {
288  const char *s = GetName();
289  if ( guiDict && s[0] != '\0' ) {
290  data = guiDict->GetInt( s );
291  }
292  }
293  virtual const char *c_str() const {
294  return va("%i", data);
295  }
296 
297  // SaveGames
298  virtual void WriteToSaveGame( idFile *savefile ) {
299  savefile->Write( &eval, sizeof( eval ) );
300  savefile->Write( &data, sizeof( data ) );
301  }
302  virtual void ReadFromSaveGame( idFile *savefile ) {
303  savefile->Read( &eval, sizeof( eval ) );
304  savefile->Read( &data, sizeof( data ) );
305  }
306 
307  // no suitable conversion
308  virtual float x( void ) const { assert( false ); return 0.0f; };
309 
310 protected:
311  int data;
312 };
313 
314 class idWinFloat : public idWinVar {
315 public:
318  virtual void Init(const char *_name, idWindow *win) {
319  idWinVar::Init(_name, win);
320  if (guiDict) {
322  }
323  }
324  idWinFloat &operator=( const idWinFloat &other ) {
325  idWinVar::operator=(other);
326  data = other.data;
327  return *this;
328  }
329  float &operator=( const float &other ) {
330  data = other;
331  if (guiDict) {
333  }
334  return data;
335  }
336  operator float() const {
337  return data;
338  }
339  virtual void Set(const char *val) {
340  data = atof(val);
341  if (guiDict) {
343  }
344  }
345  virtual void Update() {
346  const char *s = GetName();
347  if ( guiDict && s[0] != '\0' ) {
348  data = guiDict->GetFloat( s );
349  }
350  }
351  virtual const char *c_str() const {
352  return va("%f", data);
353  }
354 
355  virtual void WriteToSaveGame( idFile *savefile ) {
356  savefile->Write( &eval, sizeof( eval ) );
357  savefile->Write( &data, sizeof( data ) );
358  }
359  virtual void ReadFromSaveGame( idFile *savefile ) {
360  savefile->Read( &eval, sizeof( eval ) );
361  savefile->Read( &data, sizeof( data ) );
362  }
363 
364  virtual float x( void ) const { return data; };
365 protected:
366  float data;
367 };
368 
369 class idWinRectangle : public idWinVar {
370 public:
373  virtual void Init(const char *_name, idWindow *win) {
374  idWinVar::Init(_name, win);
375  if (guiDict) {
377  data.x = v.x;
378  data.y = v.y;
379  data.w = v.z;
380  data.h = v.w;
381  }
382  }
383 
384  int operator==( const idRectangle &other ) const {
385  return (other == data);
386  }
387 
389  idWinVar::operator=(other);
390  data = other.data;
391  return *this;
392  }
393  idRectangle &operator=( const idVec4 &other ) {
394  data = other;
395  if (guiDict) {
396  guiDict->SetVec4(GetName(), other);
397  }
398  return data;
399  }
400 
401  idRectangle &operator=( const idRectangle &other ) {
402  data = other;
403  if (guiDict) {
404  idVec4 v = data.ToVec4();
405  guiDict->SetVec4(GetName(), v);
406  }
407  return data;
408  }
409 
410  operator const idRectangle&() const {
411  return data;
412  }
413 
414  float x() const {
415  return data.x;
416  }
417  float y() const {
418  return data.y;
419  }
420  float w() const {
421  return data.w;
422  }
423  float h() const {
424  return data.h;
425  }
426  float Right() const {
427  return data.Right();
428  }
429  float Bottom() const {
430  return data.Bottom();
431  }
433  static idVec4 ret;
434  ret = data.ToVec4();
435  return ret;
436  }
437  virtual void Set(const char *val) {
438  if ( strchr ( val, ',' ) ) {
439  sscanf( val, "%f,%f,%f,%f", &data.x, &data.y, &data.w, &data.h );
440  } else {
441  sscanf( val, "%f %f %f %f", &data.x, &data.y, &data.w, &data.h );
442  }
443  if (guiDict) {
444  idVec4 v = data.ToVec4();
445  guiDict->SetVec4(GetName(), v);
446  }
447  }
448  virtual void Update() {
449  const char *s = GetName();
450  if ( guiDict && s[0] != '\0' ) {
451  idVec4 v = guiDict->GetVec4( s );
452  data.x = v.x;
453  data.y = v.y;
454  data.w = v.z;
455  data.h = v.w;
456  }
457  }
458 
459  virtual const char *c_str() const {
460  return data.ToVec4().ToString();
461  }
462 
463  virtual void WriteToSaveGame( idFile *savefile ) {
464  savefile->Write( &eval, sizeof( eval ) );
465  savefile->Write( &data, sizeof( data ) );
466  }
467  virtual void ReadFromSaveGame( idFile *savefile ) {
468  savefile->Read( &eval, sizeof( eval ) );
469  savefile->Read( &data, sizeof( data ) );
470  }
471 
472 protected:
474 };
475 
476 class idWinVec2 : public idWinVar {
477 public:
478  idWinVec2() : idWinVar() {};
480  virtual void Init(const char *_name, idWindow *win) {
481  idWinVar::Init(_name, win);
482  if (guiDict) {
483  data = guiDict->GetVec2(GetName());
484  }
485  }
486  int operator==( const idVec2 &other ) const {
487  return (other == data);
488  }
489  idWinVec2 &operator=( const idWinVec2 &other ) {
490  idWinVar::operator=(other);
491  data = other.data;
492  return *this;
493  }
494 
495  idVec2 &operator=( const idVec2 &other ) {
496  data = other;
497  if (guiDict) {
499  }
500  return data;
501  }
502  float x() const {
503  return data.x;
504  }
505  float y() const {
506  return data.y;
507  }
508  virtual void Set(const char *val) {
509  if ( strchr ( val, ',' ) ) {
510  sscanf( val, "%f,%f", &data.x, &data.y );
511  } else {
512  sscanf( val, "%f %f", &data.x, &data.y);
513  }
514  if (guiDict) {
516  }
517  }
518  operator const idVec2&() const {
519  return data;
520  }
521  virtual void Update() {
522  const char *s = GetName();
523  if ( guiDict && s[0] != '\0' ) {
524  data = guiDict->GetVec2( s );
525  }
526  }
527  virtual const char *c_str() const {
528  return data.ToString();
529  }
530  void Zero() {
531  data.Zero();
532  }
533 
534  virtual void WriteToSaveGame( idFile *savefile ) {
535  savefile->Write( &eval, sizeof( eval ) );
536  savefile->Write( &data, sizeof( data ) );
537  }
538  virtual void ReadFromSaveGame( idFile *savefile ) {
539  savefile->Read( &eval, sizeof( eval ) );
540  savefile->Read( &data, sizeof( data ) );
541  }
542 
543 protected:
545 };
546 
547 class idWinVec4 : public idWinVar {
548 public:
549  idWinVec4() : idWinVar() {};
551  virtual void Init(const char *_name, idWindow *win) {
552  idWinVar::Init(_name, win);
553  if (guiDict) {
554  data = guiDict->GetVec4(GetName());
555  }
556  }
557  int operator==( const idVec4 &other ) const {
558  return (other == data);
559  }
560  idWinVec4 &operator=( const idWinVec4 &other ) {
561  idWinVar::operator=(other);
562  data = other.data;
563  return *this;
564  }
565  idVec4 &operator=( const idVec4 &other ) {
566  data = other;
567  if (guiDict) {
569  }
570  return data;
571  }
572  operator const idVec4&() const {
573  return data;
574  }
575 
576  float x() const {
577  return data.x;
578  }
579 
580  float y() const {
581  return data.y;
582  }
583 
584  float z() const {
585  return data.z;
586  }
587 
588  float w() const {
589  return data.w;
590  }
591  virtual void Set(const char *val) {
592  if ( strchr ( val, ',' ) ) {
593  sscanf( val, "%f,%f,%f,%f", &data.x, &data.y, &data.z, &data.w );
594  } else {
595  sscanf( val, "%f %f %f %f", &data.x, &data.y, &data.z, &data.w);
596  }
597  if ( guiDict ) {
598  guiDict->SetVec4( GetName(), data );
599  }
600  }
601  virtual void Update() {
602  const char *s = GetName();
603  if ( guiDict && s[0] != '\0' ) {
604  data = guiDict->GetVec4( s );
605  }
606  }
607  virtual const char *c_str() const {
608  return data.ToString();
609  }
610 
611  void Zero() {
612  data.Zero();
613  if ( guiDict ) {
615  }
616  }
617 
618  const idVec3 &ToVec3() const {
619  return data.ToVec3();
620  }
621 
622  virtual void WriteToSaveGame( idFile *savefile ) {
623  savefile->Write( &eval, sizeof( eval ) );
624  savefile->Write( &data, sizeof( data ) );
625  }
626  virtual void ReadFromSaveGame( idFile *savefile ) {
627  savefile->Read( &eval, sizeof( eval ) );
628  savefile->Read( &data, sizeof( data ) );
629  }
630 
631 protected:
633 };
634 
635 class idWinVec3 : public idWinVar {
636 public:
637  idWinVec3() : idWinVar() {};
639  virtual void Init(const char *_name, idWindow *win) {
640  idWinVar::Init(_name, win);
641  if (guiDict) {
643  }
644  }
645  int operator==( const idVec3 &other ) const {
646  return (other == data);
647  }
648  idWinVec3 &operator=( const idWinVec3 &other ) {
649  idWinVar::operator=(other);
650  data = other.data;
651  return *this;
652  }
653  idVec3 &operator=( const idVec3 &other ) {
654  data = other;
655  if (guiDict) {
657  }
658  return data;
659  }
660  operator const idVec3&() const {
661  return data;
662  }
663 
664  float x() const {
665  return data.x;
666  }
667 
668  float y() const {
669  return data.y;
670  }
671 
672  float z() const {
673  return data.z;
674  }
675 
676  virtual void Set(const char *val) {
677  sscanf( val, "%f %f %f", &data.x, &data.y, &data.z);
678  if (guiDict) {
680  }
681  }
682  virtual void Update() {
683  const char *s = GetName();
684  if ( guiDict && s[0] != '\0' ) {
685  data = guiDict->GetVector( s );
686  }
687  }
688  virtual const char *c_str() const {
689  return data.ToString();
690  }
691 
692  void Zero() {
693  data.Zero();
694  if (guiDict) {
696  }
697  }
698 
699  virtual void WriteToSaveGame( idFile *savefile ) {
700  savefile->Write( &eval, sizeof( eval ) );
701  savefile->Write( &data, sizeof( data ) );
702  }
703  virtual void ReadFromSaveGame( idFile *savefile ) {
704  savefile->Read( &eval, sizeof( eval ) );
705  savefile->Read( &data, sizeof( data ) );
706  }
707 
708 protected:
710 };
711 
712 class idWinBackground : public idWinStr {
713 public:
715  mat = NULL;
716  };
718  virtual void Init(const char *_name, idWindow *win) {
719  idWinStr::Init(_name, win);
720  if (guiDict) {
722  }
723  }
724  int operator==( const idStr &other ) const {
725  return (other == data);
726  }
727  int operator==( const char *other ) const {
728  return (data == other);
729  }
730  idStr &operator=( const idStr &other ) {
731  data = other;
732  if (guiDict) {
733  guiDict->Set(GetName(), data);
734  }
735  if (mat) {
736  if ( data == "" ) {
737  (*mat) = NULL;
738  } else {
739  (*mat) = declManager->FindMaterial(data);
740  }
741  }
742  return data;
743  }
745  idWinVar::operator=(other);
746  data = other.data;
747  mat = other.mat;
748  if (mat) {
749  if ( data == "" ) {
750  (*mat) = NULL;
751  } else {
752  (*mat) = declManager->FindMaterial(data);
753  }
754  }
755  return *this;
756  }
757  operator const char *() const {
758  return data.c_str();
759  }
760  operator const idStr &() const {
761  return data;
762  }
763  int Length() {
764  if (guiDict) {
766  }
767  return data.Length();
768  }
769  virtual const char *c_str() const {
770  return data.c_str();
771  }
772 
773  virtual void Set(const char *val) {
774  data = val;
775  if (guiDict) {
776  guiDict->Set(GetName(), data);
777  }
778  if (mat) {
779  if ( data == "" ) {
780  (*mat) = NULL;
781  } else {
782  (*mat) = declManager->FindMaterial(data);
783  }
784  }
785  }
786 
787  virtual void Update() {
788  const char *s = GetName();
789  if ( guiDict && s[0] != '\0' ) {
790  data = guiDict->GetString( s );
791  if (mat) {
792  if ( data == "" ) {
793  (*mat) = NULL;
794  } else {
795  (*mat) = declManager->FindMaterial(data);
796  }
797  }
798  }
799  }
800 
801  virtual size_t Size() {
802  size_t sz = idWinVar::Size();
803  return sz +data.Allocated();
804  }
805 
806  void SetMaterialPtr( const idMaterial **m ) {
807  mat = m;
808  }
809 
810  virtual void WriteToSaveGame( idFile *savefile ) {
811  savefile->Write( &eval, sizeof( eval ) );
812 
813  int len = data.Length();
814  savefile->Write( &len, sizeof( len ) );
815  if ( len > 0 ) {
816  savefile->Write( data.c_str(), len );
817  }
818  }
819  virtual void ReadFromSaveGame( idFile *savefile ) {
820  savefile->Read( &eval, sizeof( eval ) );
821 
822  int len;
823  savefile->Read( &len, sizeof( len ) );
824  if ( len > 0 ) {
825  data.Fill( ' ', len );
826  savefile->Read( &data[0], len );
827  }
828  if ( mat ) {
829  if ( len > 0 ) {
830  (*mat) = declManager->FindMaterial( data );
831  } else {
832  (*mat) = NULL;
833  }
834  }
835  }
836 
837 protected:
839  const idMaterial **mat;
840 };
841 
842 /*
843 ================
844 idMultiWinVar
845 multiplexes access to a list if idWinVar*
846 ================
847 */
848 class idMultiWinVar : public idList< idWinVar * > {
849 public:
850  void Set( const char *val );
851  void Update( void );
852  void SetGuiInfo( idDict *dict );
853 };
854 
855 #endif /* !__WINVAR_H__ */
856 
float data
Definition: Winvar.h:364
float x() const
Definition: Winvar.h:664
int operator==(const idVec2 &other) const
Definition: Winvar.h:486
virtual void WriteToSaveGame(idFile *savefile)=0
idWinFloat & operator=(const idWinFloat &other)
Definition: Winvar.h:324
idVec4 & operator=(const idVec4 &other)
Definition: Winvar.h:565
virtual void Update()
Definition: Winvar.h:345
float & operator=(const float &other)
Definition: Winvar.h:329
float GetFloat(const char *key, const char *defaultString="0") const
Definition: Dict.h:248
virtual void Set(const char *val)=0
int GetInt(const char *key, const char *defaultString="0") const
Definition: Dict.h:252
int operator==(const idVec3 &other) const
Definition: Winvar.h:645
idVec2 data
Definition: Winvar.h:544
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:318
assert(prefInfo.fullscreenBtn)
int Length()
Definition: Winvar.h:192
idWinVec3()
Definition: Winvar.h:637
bool data
Definition: Winvar.h:146
virtual float x(void) const =0
int LengthWithoutColors()
Definition: Winvar.h:186
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:99
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:228
virtual const char * c_str() const
Definition: Winvar.h:293
void Update(void)
Definition: Winvar.cpp:72
void Zero()
Definition: Winvar.h:692
virtual float x(void) const
Definition: Winvar.h:146
float y
Definition: Vector.h:811
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:538
idWinVec2 & operator=(const idWinVec2 &other)
Definition: Winvar.h:489
const GLdouble * v
Definition: glext.h:2936
virtual const char * c_str() const
Definition: Winvar.h:134
idWinRectangle()
Definition: Winvar.h:371
virtual void Update()
Definition: Winvar.h:287
virtual void Set(const char *val)
Definition: Winvar.h:120
float x() const
Definition: Winvar.h:576
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:373
virtual void Update()
Definition: Winvar.h:127
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:467
float y() const
Definition: Winvar.h:668
virtual const char * c_str() const
Definition: Winvar.h:527
virtual void Set(const char *val)
Definition: Winvar.h:591
float z
Definition: Vector.h:812
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:703
case const int
Definition: Callbacks.cpp:52
const idVec3 & ToVec3() const
Definition: Winvar.h:618
float y() const
Definition: Winvar.h:505
float w() const
Definition: Winvar.h:420
Definition: Vector.h:316
case const float
Definition: Callbacks.cpp:62
bool & operator=(const bool &other)
Definition: Winvar.h:105
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:622
idVec4 & ToVec4()
Definition: Winvar.h:432
idVec2 GetVec2(const char *key, const char *defaultString=NULL) const
Definition: Dict.h:266
int operator==(const char *other) const
Definition: Winvar.h:727
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:639
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:298
idVec4 data
Definition: Winvar.h:632
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
GLdouble s
Definition: glext.h:2935
GLenum GLsizei len
Definition: glext.h:3472
idStr data
Definition: Winvar.h:249
void Set(const char *key, const char *value)
Definition: Dict.cpp:275
float y() const
Definition: Winvar.h:417
virtual const char * c_str() const
Definition: Winvar.h:459
virtual float x(void) const
Definition: Winvar.h:308
idWinVec4 & operator=(const idWinVec4 &other)
Definition: Winvar.h:560
float Right() const
Definition: Winvar.h:426
idRectangle & operator=(const idRectangle &other)
Definition: Winvar.h:401
idWinRectangle & operator=(const idWinRectangle &other)
Definition: Winvar.h:388
float z() const
Definition: Winvar.h:672
const idMaterial ** mat
Definition: Winvar.h:839
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:259
void SetFloat(const char *key, float val)
Definition: Dict.h:188
virtual void Update()
Definition: Winvar.h:787
virtual void Set(const char *val)
Definition: Winvar.h:676
int & operator=(const int &other)
Definition: Winvar.h:265
void SetGuiInfo(idDict *gd, const char *_name)
Definition: Winvar.cpp:47
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:137
idWinVec4()
Definition: Winvar.h:549
float Bottom() const
Definition: Winvar.h:429
idWinVar & operator=(const idWinVar &other)
Definition: Winvar.h:62
idWinVec3 & operator=(const idWinVec3 &other)
Definition: Winvar.h:648
Definition: File.h:50
~idWinBackground()
Definition: Winvar.h:717
virtual const char * c_str() const =0
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:355
virtual size_t Size()
Definition: Winvar.h:222
virtual void Update()
Definition: Winvar.h:682
bool eval
Definition: Winvar.h:92
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:626
idDict * guiDict
Definition: Winvar.h:90
Definition: Vector.h:52
float x() const
Definition: Winvar.h:502
~idWinVec4()
Definition: Winvar.h:550
void Zero()
Definition: Winvar.h:611
const char * GetString(const char *key, const char *defaultString="") const
Definition: Dict.h:240
Definition: Vector.h:808
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:810
virtual const char * c_str() const
Definition: Winvar.h:351
int operator==(const bool &other)
Definition: Winvar.h:104
virtual const char * c_str() const
Definition: Winvar.h:607
idVec4 GetVec4(const char *key, const char *defaultString=NULL) const
Definition: Dict.h:272
virtual void Init(const char *_name, idWindow *win)=0
Definition: Winvar.cpp:53
virtual float x(void) const
Definition: Winvar.h:249
void SetVec2(const char *key, const idVec2 &val)
Definition: Dict.h:208
~idWinFloat()
Definition: Winvar.h:317
bool GetBool(const char *key, const char *defaultString="0") const
Definition: Dict.h:256
Definition: Dict.h:65
#define NULL
Definition: Lib.h:88
void Zero()
Definition: Winvar.h:530
void RemoveColors()
Definition: Winvar.h:198
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:2853
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:480
~idWinStr()
Definition: Winvar.h:155
idVec3 GetVector(const char *key, const char *defaultString=NULL) const
Definition: Dict.h:260
float w() const
Definition: Winvar.h:588
~idWinVec3()
Definition: Winvar.h:638
virtual void ReadFromSaveGame(idFile *savefile)=0
~idWinBool()
Definition: Winvar.h:98
virtual int Read(void *buffer, int len)
Definition: File.cpp:179
virtual void Set(const char *val)
Definition: Winvar.h:773
int operator==(const idVec4 &other) const
Definition: Winvar.h:557
void SetMaterialPtr(const idMaterial **m)
Definition: Winvar.h:806
float w
Definition: Vector.h:813
idStr data
Definition: Winvar.h:838
float x() const
Definition: Winvar.h:414
void SetName(const char *_name)
Definition: Winvar.h:53
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:699
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:141
idVec3 & operator=(const idVec3 &other)
Definition: Winvar.h:653
void SetBool(const char *key, bool val)
Definition: Dict.h:196
idStr & operator=(const idStr &other)
Definition: Winvar.h:168
bool GetEval()
Definition: Winvar.h:85
idVec2 & operator=(const idVec2 &other)
Definition: Winvar.h:495
idVec3 data
Definition: Winvar.h:709
float z() const
Definition: Winvar.h:584
idStr & operator=(const idStr &other)
Definition: Winvar.h:730
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:819
idWinStr()
Definition: Winvar.h:154
virtual float x(void) const
Definition: Winvar.h:364
idDeclManager * declManager
virtual size_t Size()
Definition: Winvar.h:801
GLubyte GLubyte b
Definition: glext.h:4662
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:237
idRectangle & operator=(const idVec4 &other)
Definition: Winvar.h:393
virtual ~idWinVar()
Definition: Winvar.cpp:42
idRectangle data
Definition: Winvar.h:473
virtual void Update()
Definition: Winvar.h:448
idDict * GetDict() const
Definition: Winvar.h:68
void SetInt(const char *key, int val)
Definition: Dict.h:192
virtual const char * c_str() const
Definition: Winvar.h:688
int data
Definition: Winvar.h:308
virtual void Update()=0
int Length()
Definition: Winvar.h:763
virtual void Set(const char *val)
Definition: Winvar.h:339
~idWinInt()
Definition: Winvar.h:258
~idWinVec2()
Definition: Winvar.h:479
const GLcharARB * name
Definition: glext.h:3629
~idWinRectangle()
Definition: Winvar.h:372
virtual size_t Size()
Definition: Winvar.h:75
virtual int Write(const void *buffer, int len)
Definition: File.cpp:189
Definition: Str.h:116
idWinFloat()
Definition: Winvar.h:316
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:302
Window win
Definition: glimp.cpp:46
virtual const char * c_str() const
Definition: Winvar.h:204
int operator==(const idRectangle &other) const
Definition: Winvar.h:384
const char * c_str(void) const
Definition: Str.h:487
int operator==(const idStr &other) const
Definition: Winvar.h:724
idWinVar()
Definition: Winvar.cpp:36
void SetGuiInfo(idDict *dict)
Definition: Winvar.cpp:78
virtual void Update()
Definition: Winvar.h:521
unsigned char bool
Definition: setup.h:74
idWinStr & operator=(const idWinStr &other)
Definition: Winvar.h:175
virtual void Set(const char *val)
Definition: Winvar.h:280
void SetVec4(const char *key, const idVec4 &val)
Definition: Dict.h:204
idWinBool & operator=(const idWinBool &other)
Definition: Winvar.h:112
idWinInt & operator=(const idWinInt &other)
Definition: Winvar.h:272
idWinBackground & operator=(const idWinBackground &other)
Definition: Winvar.h:744
void Set(const char *val)
Definition: Winvar.cpp:66
virtual void Update()
Definition: Winvar.h:601
char * va(const char *fmt,...)
Definition: Str.cpp:1568
int operator==(const idStr &other) const
Definition: Winvar.h:162
const char * GetName() const
Definition: Winvar.h:44
idWinVec2()
Definition: Winvar.h:478
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:534
virtual void Set(const char *val)
Definition: Winvar.h:208
idWinInt()
Definition: Winvar.h:257
Definition: List.h:84
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:156
idWinBool()
Definition: Winvar.h:97
float x
Definition: Vector.h:810
virtual void Set(const char *val)
Definition: Winvar.h:437
virtual void ReadFromSaveGame(idFile *savefile)
Definition: Winvar.h:359
int operator==(const char *other) const
Definition: Winvar.h:165
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:551
float y() const
Definition: Winvar.h:580
void SetEval(bool b)
Definition: Winvar.h:82
virtual void Set(const char *val)
Definition: Winvar.h:508
virtual const char * c_str() const
Definition: Winvar.h:769
virtual void Update()
Definition: Winvar.h:215
virtual void Init(const char *_name, idWindow *win)
Definition: Winvar.h:718
void SetVector(const char *key, const idVec3 &val)
Definition: Dict.h:200
char * name
Definition: Winvar.h:91
virtual void WriteToSaveGame(idFile *savefile)
Definition: Winvar.h:463
float h() const
Definition: Winvar.h:423
bool NeedsUpdate()
Definition: Winvar.h:69