29 #include "../idlib/precompiled.h"
70 for(
int i = 0;
i <
c;
i++ ) {
84 for (
int i = 0;
i <
c;
i++ ) {
86 guis[
i ]->ClearRefs();
98 for (
int i = 0;
i <
c;
i++ ) {
99 if (
guis[
i]->GetRefs() == 0 ) {
124 for (
int i = 0;
i <
c;
i++ ) {
127 if ( ts <=
guis[
i]->GetTimeStamp() ) {
132 guis[
i]->InitFromFile(
guis[
i]->GetSourceFile() );
143 for (
int i = 0;
i <
c;
i++ ) {
145 size_t sz = gui->
Size();
146 bool isUnique =
guis[
i]->interactive;
152 common->
Printf(
"%6.1fk %4i (%s) %s ( %i transitions )\n", sz / 1024.0
f,
guis[
i]->GetRefs(), isUnique ?
"unique" :
"copy",
guis[
i]->GetSourceFile(),
guis[
i]->desktop->NumTransitions() );
155 common->
Printf(
"===========\n %i total Guis ( %i copies, %i unique ), %.2f total Mbytes", c, copies, unique, total / ( 1024.0
f * 1024.0
f ) );
174 for (
int i = 0;
i <
c;
i++ ) {
175 if (
guis[
i] == gui ) {
187 for (
int i = 0;
i <
c;
i++ ) {
190 if ( !forceNOTUnique && ( needUnique ||
guis[
i]->IsInteractive() ) ) {
201 gui->
SetUniqued( forceNOTUnique ?
false : needUnique );
212 for (
int i = 0;
i <
c;
i++ ) {
271 if ( !( qpath && *qpath ) ) {
469 f->
Log(
"creating new gui\n");
475 f->
Log(
"re-using gui\n");
484 for (
int i = 0;
i <
c;
i++ ) {
485 if ( uiManagerLocal.
demoGuis[
i] ==
this ) {
513 savefile->
Write( &num,
sizeof( num ) );
515 for(
int i = 0;
i <
num;
i++ ) {
519 savefile->
Write( &len,
sizeof( len ) );
520 savefile->
Write(
string, len );
524 savefile->
Write( &len,
sizeof( len ) );
525 savefile->
Write(
string, len );
533 savefile->
Write( &len,
sizeof( len ) );
536 savefile->
Write( &len,
sizeof( len ) );
539 savefile->
Write( &len,
sizeof( len ) );
556 savefile->
Read( &num,
sizeof( num ) );
559 for( i = 0; i <
num; i++ ) {
560 savefile->
Read( &len,
sizeof( len ) );
561 key.
Fill(
' ', len );
562 savefile->
Read( &key[0], len );
564 savefile->
Read( &len,
sizeof( len ) );
565 value.
Fill(
' ', len );
566 savefile->
Read( &value[0], len );
576 savefile->
Read( &len,
sizeof( len ) );
579 savefile->
Read( &len,
sizeof( len ) );
582 savefile->
Read( &len,
sizeof( len ) );
609 while ( i < window->GetChildCount() ) {
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
virtual float GetStateFloat(const char *varName, const char *defaultString="0") const
void RecurseSetKeyBindingNames(idWindow *window)
GLsizei const GLfloat * value
idUserInterfaceManagerLocal uiManagerLocal
int GetInt(const char *key, const char *defaultString="0") const
virtual void SetStateInt(const char *varName, const int value)
void Delete(const char *key)
virtual void SetSize(float width, float height)
const idStr & GetKey(void) const
virtual void SetUniqued(bool b)=0
virtual void Trigger(int time)
virtual void StateChanged(bool redraw)
idList< idUserInterfaceLocal * > demoGuis
virtual int ReadFile(const char *relativePath, void **buffer, ID_TIME_T *timestamp=NULL)=0
virtual void Redraw(int time)
virtual void StateChanged(int time, bool redraw)
virtual const char * Activate(bool activate, int time)
idFileSystem * fileSystem
virtual idUserInterface * FindDemoGui(const char *qpath)
virtual void EndLevelLoad()
virtual bool IsInteractive() const
GLenum GLsizei const GLvoid * string
virtual void WriteToSaveGame(idFile *savefile)
virtual void BeginLevelLoad()
void PushClipRect(float x, float y, float w, float h)
void Set(const char *key, const char *value)
virtual ~idUserInterfaceLocal()
idUserInterfaceManager * uiManager
void SetFloat(const char *key, float val)
virtual void Touch(const char *name)
void SetDC(idDeviceContext *d)
int Icmp(const char *text) const
virtual idUserInterface * Alloc(void) const
virtual void WriteToDemoFile(class idDemoFile *f)
virtual idUserInterface * FindGui(const char *qpath, bool autoLoad=false, bool needInteractive=false, bool forceUnique=false)
int ReadToken(idToken *token)
GLsizei GLsizei GLcharARB * source
virtual bool CheckGui(const char *qpath) const
idUserInterface * GlobalGui(void) const
virtual void WriteToDemoFile(class idDemoFile *f)
virtual void Activate(bool activate, idStr &act)
virtual int GetStateInt(const char *varName, const char *defaultString="0") const
const char * GetString(const char *key, const char *defaultString="") const
virtual void DrawCursor()
bool GetBool(const char *key, const char *defaultString="0") const
virtual bool InitFromFile(const char *qpath, bool rebuild=true, bool cache=true)=0
friend class idUserInterfaceLocal
virtual const char * GetStateString(const char *varName, const char *defaultString="") const
int GetInteger(void) const
virtual void SetStateBool(const char *varName, const bool value)
virtual int Read(void *buffer, int len)
virtual bool Parse(idParser *src, bool rebuild=true)
virtual void SetStateFloat(const char *varName, const float value)
type * Find(type const &obj) const
void Size(float x, float y, float w, float h)
const idStr & GetValue(void) const
void DeleteContents(bool clear)
virtual bool GetStateBool(const char *varName, const char *defaultString="0") const
void SetBool(const char *key, bool val)
virtual const idDict & State() const
virtual void Printf(const char *fmt,...) id_attribute((format(printf
virtual void WritePrecacheCommands(idFile *f)
GLenum GLsizei GLsizei height
void DrawCursor(float *x, float *y, float size)
virtual void RunNamedEvent(const char *eventName)
idDeclManager * declManager
const char * GetComment()
virtual void SetCursor(float x, float y)
idList< idUserInterfaceLocal * > guis
virtual int GetNumDecls(declType_t type)=0
int Append(const type &obj)
void SetInt(const char *key, int val)
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
int LoadFile(const char *filename, bool OSPath=false)
bool RemoveIndex(int index)
virtual int WriteFloat(const float value)
void WriteDict(const idDict &dict)
idWindow * GetChild(int index)
virtual int Write(const void *buffer, int len)
void Fill(const char ch, int newlen)
virtual const char * Comment() const
virtual void Redraw(float x, float y)
virtual const char * HandleEvent(const sysEvent_t *event, int time, bool *updateVisuals)
const char * c_str(void) const
virtual void DeAlloc(idUserInterface *gui)
virtual const char * Name() const
virtual void Reload(bool all)
virtual void FreeListGUI(idListGUI *listgui)
const idKeyValue * GetKeyVal(int index) const
virtual void DeleteStateVar(const char *varName)
virtual void ReadFromDemoFile(class idDemoFile *f, bool rebuild=true)
virtual bool ReadFromSaveGame(idFile *savefile)
virtual int ReadFloat(float &value)
char * va(const char *fmt,...)
virtual void ReadFromDemoFile(class idDemoFile *f)
virtual const char * HandleEvent(const sysEvent_t *event, bool *updateVisuals)
const char * GetName() const
virtual void CloseFile(idFile *f)=0
virtual void HandleNamedEvent(const char *namedEvent)
void SetSize(float width, float height)
virtual bool WriteToSaveGame(idFile *savefile) const
void SetFlag(unsigned int f)
int GetNumKeyVals(void) const
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)
int sprintf(idStr &string, const char *fmt,...)
virtual int Printf(const char *fmt,...) id_attribute((format(printf
void ReadDict(idDict &dict)
virtual void ReadFromSaveGame(idFile *savefile)
virtual void SetKeyBindingNames(void)