doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GuiScript.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 #ifndef __GUISCRIPT_H
29 #define __GUISCRIPT_H
30 
31 #include "Window.h"
32 #include "Winvar.h"
33 
34 struct idGSWinVar {
36  var = NULL;
37  own = false;
38  }
40  bool own;
41 };
42 
43 class idGuiScriptList;
44 
45 class idGuiScript {
46  friend class idGuiScriptList;
47  friend class idWindow;
48 
49 public:
50  idGuiScript();
51  ~idGuiScript();
52 
53  bool Parse(idParser *src);
54  void Execute(idWindow *win) {
55  if (handler) {
56  handler(win, &parms);
57  }
58  }
59  void FixupParms(idWindow *win);
60  size_t Size() {
61  int sz = sizeof(*this);
62  for (int i = 0; i < parms.Num(); i++) {
63  sz += parms[i].var->Size();
64  }
65  return sz;
66  }
67 
68  void WriteToSaveGame( idFile *savefile );
69  void ReadFromSaveGame( idFile *savefile );
70 
71 protected:
77 
78 };
79 
80 
83 public:
86  void Execute(idWindow *win);
87  void Append(idGuiScript* gs) {
88  list.Append(gs);
89  }
90  size_t Size() {
91  int sz = sizeof(*this);
92  for (int i = 0; i < list.Num(); i++) {
93  sz += list[i]->Size();
94  }
95  return sz;
96  }
97  void FixupParms(idWindow *win);
98  void ReadFromDemoFile( class idDemoFile *f ) {};
99  void WriteToDemoFile( class idDemoFile *f ) {};
100 
101  void WriteToSaveGame( idFile *savefile );
102  void ReadFromSaveGame( idFile *savefile );
103 };
104 
105 #endif // __GUISCRIPT_H
void Execute(idWindow *win)
Definition: GuiScript.h:54
idGSWinVar()
Definition: GuiScript.h:35
void FixupParms(idWindow *win)
Definition: GuiScript.cpp:587
void SetGranularity(int newgranularity)
Definition: List.h:305
size_t Size()
Definition: GuiScript.h:60
GLuint src
Definition: glext.h:5390
int i
Definition: process.py:33
Definition: File.h:50
int conditionReg
Definition: GuiScript.h:72
void WriteToSaveGame(idFile *savefile)
Definition: GuiScript.cpp:606
void WriteToDemoFile(class idDemoFile *f)
Definition: GuiScript.h:99
#define NULL
Definition: Lib.h:88
idGuiScriptList * ifList
Definition: GuiScript.h:73
void ReadFromDemoFile(class idDemoFile *f)
Definition: GuiScript.h:98
size_t Size(void) const
Definition: List.h:242
size_t Size()
Definition: GuiScript.h:90
idList< idGuiScript * > list
Definition: GuiScript.h:82
void DeleteContents(bool clear)
Definition: List.h:207
void FixupParms(idWindow *win)
Definition: GuiScript.cpp:436
idWinVar * var
Definition: GuiScript.h:39
bool own
Definition: GuiScript.h:40
void(* handler)(idWindow *window, idList< idGSWinVar > *src)
Definition: GuiScript.h:76
prefInfo window
void Execute(idWindow *win)
Definition: GuiScript.cpp:410
idGuiScriptList * elseList
Definition: GuiScript.h:74
int Append(const type &obj)
Definition: List.h:646
void ReadFromSaveGame(idFile *savefile)
Definition: GuiScript.cpp:321
tuple f
Definition: idal.py:89
int Num(void) const
Definition: List.h:265
bool Parse(idParser *src)
Definition: GuiScript.cpp:345
Window win
Definition: glimp.cpp:46
typedef void(APIENTRYP PFNGLBLENDCOLORPROC)(GLclampf red
void WriteToSaveGame(idFile *savefile)
Definition: GuiScript.cpp:297
idList< idGSWinVar > parms
Definition: GuiScript.h:75
void ReadFromSaveGame(idFile *savefile)
Definition: GuiScript.cpp:619
void Append(idGuiScript *gs)
Definition: GuiScript.h:87