doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UserInterfaceLocal.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 class idWindow;
30 
33 public:
35  virtual ~idUserInterfaceLocal();
36 
37  virtual const char * Name() const;
38  virtual const char * Comment() const;
39  virtual bool IsInteractive() const;
40  virtual bool InitFromFile( const char *qpath, bool rebuild = true, bool cache = true );
41  virtual const char * HandleEvent( const sysEvent_t *event, int time, bool *updateVisuals );
42  virtual void HandleNamedEvent( const char* namedEvent );
43  virtual void Redraw( int time );
44  virtual void DrawCursor();
45  virtual const idDict & State() const;
46  virtual void DeleteStateVar( const char *varName );
47  virtual void SetStateString( const char *varName, const char *value );
48  virtual void SetStateBool( const char *varName, const bool value );
49  virtual void SetStateInt( const char *varName, const int value );
50  virtual void SetStateFloat( const char *varName, const float value );
51 
52  // Gets a gui state variable
53  virtual const char* GetStateString( const char *varName, const char* defaultString = "" ) const;
54  virtual bool GetStateBool( const char *varName, const char* defaultString = "0" ) const;
55  virtual int GetStateInt( const char *varName, const char* defaultString = "0" ) const;
56  virtual float GetStateFloat( const char *varName, const char* defaultString = "0" ) const;
57 
58  virtual void StateChanged( int time, bool redraw );
59  virtual const char * Activate( bool activate, int time );
60  virtual void Trigger( int time );
61  virtual void ReadFromDemoFile( class idDemoFile *f );
62  virtual void WriteToDemoFile( class idDemoFile *f );
63  virtual bool WriteToSaveGame( idFile *savefile ) const;
64  virtual bool ReadFromSaveGame( idFile *savefile );
65  virtual void SetKeyBindingNames( void );
66  virtual bool IsUniqued() const { return uniqued; };
67  virtual void SetUniqued( bool b ) { uniqued = b; };
68  virtual void SetCursor( float x, float y );
69 
70  virtual float CursorX() { return cursorX; }
71  virtual float CursorY() { return cursorY; }
72 
73  size_t Size();
74 
75  idDict * GetStateDict() { return &state; }
76 
77  const char * GetSourceFile( void ) const { return source; }
78  ID_TIME_T GetTimeStamp( void ) const { return timeStamp; }
79 
80  idWindow * GetDesktop() const { return desktop; }
82  bool Active() const { return active; }
83  int GetTime() const { return time; }
84  void SetTime( int _time ) { time = _time; }
85 
86  void ClearRefs() { refs = 0; }
87  void AddRef() { refs++; }
88  int GetRefs() { return refs; }
89 
91  idStr &GetPendingCmd() { return pendingCmd; };
92  idStr &GetReturnCmd() { return returnCmd; };
93 
94 private:
95  bool active;
96  bool loading;
98  bool uniqued;
99 
103 
108  ID_TIME_T timeStamp;
109 
110  float cursorX;
111  float cursorY;
112 
113  int time;
114 
115  int refs;
116 };
117 
119  friend class idUserInterfaceLocal;
120 
121 public:
122  virtual void Init();
123  virtual void Shutdown();
124  virtual void Touch( const char *name );
125  virtual void WritePrecacheCommands( idFile *f );
126  virtual void SetSize( float width, float height );
127  virtual void BeginLevelLoad();
128  virtual void EndLevelLoad();
129  virtual void Reload( bool all );
130  virtual void ListGuis() const;
131  virtual bool CheckGui( const char *qpath ) const;
132  virtual idUserInterface * Alloc( void ) const;
133  virtual void DeAlloc( idUserInterface *gui );
134  virtual idUserInterface * FindGui( const char *qpath, bool autoLoad = false, bool needInteractive = false, bool forceUnique = false );
135  virtual idUserInterface * FindDemoGui( const char *qpath );
136  virtual idListGUI * AllocListGUI( void ) const;
137  virtual void FreeListGUI( idListGUI *listgui );
138 
139 private:
142 
145 
146 };
virtual void SetStateString(const char *varName, const char *value)
virtual bool IsUniqued() const
virtual float GetStateFloat(const char *varName, const char *defaultString="0") const
void RecurseSetKeyBindingNames(idWindow *window)
GLsizei const GLfloat * value
Definition: glext.h:3614
virtual void SetStateInt(const char *varName, const int value)
virtual void SetSize(float width, float height)
virtual void Trigger(int time)
idList< idUserInterfaceLocal * > demoGuis
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)
virtual idUserInterface * FindDemoGui(const char *qpath)
virtual bool IsInteractive() const
virtual ~idUserInterfaceLocal()
GLenum GLint x
Definition: glext.h:2849
virtual void Touch(const char *name)
void SetBindHandler(idWindow *win)
virtual idUserInterface * Alloc(void) const
virtual void SetUniqued(bool b)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needInteractive=false, bool forceUnique=false)
Definition: File.h:50
virtual bool CheckGui(const char *qpath) const
virtual void WriteToDemoFile(class idDemoFile *f)
virtual int GetStateInt(const char *varName, const char *defaultString="0") const
virtual void DrawCursor()
Definition: Dict.h:65
virtual const char * GetStateString(const char *varName, const char *defaultString="") const
virtual void SetStateBool(const char *varName, const bool value)
virtual float CursorY()
const char * GetSourceFile(void) const
virtual void SetStateFloat(const char *varName, const float value)
virtual bool GetStateBool(const char *varName, const char *defaultString="0") const
GLenum GLsizei width
Definition: glext.h:2846
virtual const idDict & State() const
idWindow * GetDesktop() const
virtual void WritePrecacheCommands(idFile *f)
GLenum GLsizei GLsizei height
Definition: glext.h:2856
virtual void SetCursor(float x, float y)
GLubyte GLubyte b
Definition: glext.h:4662
idList< idUserInterfaceLocal * > guis
prefInfo window
virtual bool InitFromFile(const char *qpath, bool rebuild=true, bool cache=true)
virtual idListGUI * AllocListGUI(void) const
tuple f
Definition: idal.py:89
const GLcharARB * name
Definition: glext.h:3629
Definition: Str.h:116
virtual const char * Comment() const
virtual const char * HandleEvent(const sysEvent_t *event, int time, bool *updateVisuals)
ID_TIME_T GetTimeStamp(void) const
Window win
Definition: glimp.cpp:46
virtual void DeAlloc(idUserInterface *gui)
virtual const char * Name() const
virtual void Reload(bool all)
virtual void FreeListGUI(idListGUI *listgui)
virtual void DeleteStateVar(const char *varName)
virtual bool ReadFromSaveGame(idFile *savefile)
virtual void ReadFromDemoFile(class idDemoFile *f)
virtual void HandleNamedEvent(const char *namedEvent)
virtual bool WriteToSaveGame(idFile *savefile) const
virtual void ListGuis() const
virtual float CursorX()
void SetTime(int _time)
virtual void SetKeyBindingNames(void)