ui_parse.h File Reference

#include "../../common/scripts.h"
Include dependency graph for ui_parse.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define V_UI_MASK   0x8F00
#define V_UI   0x8000
#define V_NOT_UI   0
#define V_UI_ACTION   (V_UI + 0)
#define V_UI_EXCLUDERECT   (V_UI + 1)
#define V_UI_ICONREF   (V_UI + 2)
#define V_UI_IF   (V_UI + 3)
#define V_UI_DATAID   (V_UI + 4)
#define V_UI_CVAR   (V_UI + 0x0100)
#define V_UI_REF   (V_UI + 0x0200)
#define V_UI_NODEMETHOD   (V_UI + 0x0400)
#define V_UI_ALIGN   V_INT
#define V_CVAR_OR_FLOAT   (V_UI_CVAR + V_FLOAT)
#define V_CVAR_OR_STRING   (V_UI_CVAR + V_STRING)
#define V_CVAR_OR_LONGSTRING   (V_UI_CVAR + V_LONGSTRING)
#define V_REF_OF_STRING   (V_UI_REF + V_STRING)

Functions

void UI_ParseWindow (const char *type, const char *name, const char **text)
 Parse a window.
void UI_ParseComponent (const char *type, const char **text)
 Parse a component.
void UI_ParseIcon (const char *name, const char **text)
void UI_ParseUIModel (const char *name, const char **text)
 parses the models.ufo and all files where UI models (menu_model) are defined
float UI_GetReferenceFloat (const struct uiNode_s *const node, const void *ref)
const char * UI_GetReferenceString (const struct uiNode_s *const node, const char *ref) __attribute__((warn_unused_result))
const value_tUI_FindPropertyByName (const value_t *propertyList, const char *name) __attribute__((warn_unused_result))
 Find a value_t by name into a array of value_t.
char * UI_AllocStaticString (const char *string, int size) __attribute__((warn_unused_result))
 Allocate a string into the UI static memory.
float * UI_AllocStaticFloat (int count) __attribute__((warn_unused_result))
 Allocate a float into the UI static memory.
vec4_tUI_AllocStaticColor (int count) __attribute__((warn_unused_result))
 Allocate a color into the UI static memory.
struct uiAction_sUI_AllocStaticAction (void) __attribute__((warn_unused_result))
 Allocate an action.
qboolean UI_InitRawActionValue (struct uiAction_s *action, struct uiNode_s *node, const struct value_s *property, const char *string)

Detailed Description

Definition in file ui_parse.h.


Define Documentation

#define V_CVAR_OR_FLOAT   (V_UI_CVAR + V_FLOAT)
#define V_CVAR_OR_LONGSTRING   (V_UI_CVAR + V_LONGSTRING)

Definition at line 67 of file ui_parse.h.

Referenced by UI_GetStringFromNodeProperty(), and UI_NodeSetProperty().

#define V_CVAR_OR_STRING   (V_UI_CVAR + V_STRING)

Definition at line 66 of file ui_parse.h.

Referenced by UI_GetStringFromNodeProperty(), and UI_NodeSetProperty().

#define V_NOT_UI   0
#define V_REF_OF_STRING   (V_UI_REF + V_STRING)

Definition at line 68 of file ui_parse.h.

#define V_UI   0x8000

bit identity an UI type

Definition at line 50 of file ui_parse.h.

Referenced by UI_ParseProperty().

#define V_UI_ACTION   (V_UI + 0)

Identify an action type into the value_t structure

Definition at line 52 of file ui_parse.h.

Referenced by UI_AddListener_f(), UI_ExecuteCallAction(), UI_FuncNodeLoaded(), UI_NodeSetPropertyFromRAW(), UI_ParseProperty(), UI_ParseSetAction(), and UI_RemoveListener_f().

#define V_UI_ALIGN   V_INT

Definition at line 62 of file ui_parse.h.

#define V_UI_CVAR   (V_UI + 0x0100)

Property is a CVAR string (mix this flag with base type, see bellow)

Definition at line 57 of file ui_parse.h.

Referenced by UI_DeleteNode(), UI_GetStringFromNodeProperty(), UI_InitRawActionValue(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().

#define V_UI_DATAID   (V_UI + 4)

Definition at line 56 of file ui_parse.h.

Referenced by UI_ParseProperty().

#define V_UI_EXCLUDERECT   (V_UI + 1)

Identify a special attribute, use special parse function

Definition at line 53 of file ui_parse.h.

Referenced by UI_ParseProperty().

#define V_UI_ICONREF   (V_UI + 2)

Identify a special attribute, use special parse function

Definition at line 54 of file ui_parse.h.

Referenced by UI_InitRawActionValue(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().

#define V_UI_IF   (V_UI + 3)

Identify a special attribute, use special parse function

Definition at line 55 of file ui_parse.h.

Referenced by UI_ParseProperty().

#define V_UI_MASK   0x8F00
Todo:
we should split/flag parse type (type need only 1 lex; and other)

Mask for all UI bits

Definition at line 49 of file ui_parse.h.

Referenced by UI_DeleteNode(), UI_GetStringFromNodeProperty(), UI_InitRawActionValue(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), and UI_ParseProperty().

#define V_UI_NODEMETHOD   (V_UI + 0x0400)

Property is a function

Definition at line 59 of file ui_parse.h.

Referenced by UI_ExecuteCallAction(), UI_InitializeNodeBehaviour(), UI_KeyPressedInWindow(), and UI_SetKeyBinding().

#define V_UI_REF   (V_UI + 0x0200)

Property is a ref into a value (mix this flag with base type, see bellow)

Definition at line 58 of file ui_parse.h.

Referenced by UI_ParseProperty().


Function Documentation

struct uiAction_s* UI_AllocStaticAction ( void   )  [read]
vec4_t* UI_AllocStaticColor ( int  count  ) 

Allocate a color into the UI static memory.

Note:
Its not a dynamic memory allocation. Please only use it at the loading time
Parameters:
[in] count number of element need to allocate
Todo:
Assert out when we are not in parsing/loading stage

Definition at line 185 of file ui_parse.c.

References uiGlobal_s::adata, uiGlobal_s::adataize, Com_Error(), uiGlobal_s::curadata, ERR_FATAL, and ui_global.

float* UI_AllocStaticFloat ( int  count  ) 

Allocate a float into the UI static memory.

Note:
Its not a dynamic memory allocation. Please only use it at the loading time
Parameters:
[in] count number of element need to allocate
Todo:
Assert out when we are not in parsing/loading stage

Definition at line 167 of file ui_parse.c.

References uiGlobal_s::adata, uiGlobal_s::adataize, Com_Error(), uiGlobal_s::curadata, ERR_FATAL, and ui_global.

Referenced by UI_CloneCvarOrFloat(), and UI_InitCvarOrFloat().

char* UI_AllocStaticString ( const char *  string,
int  size 
)

Allocate a string into the UI static memory.

Note:
Its not a dynamic memory allocation. Please only use it at the loading time
Parameters:
[in] string Use to initialize the string
[in] size request a fixed memory size, if 0 the string size is used
Todo:
Assert out when we are not in parsing/loading stage

Definition at line 204 of file ui_parse.c.

References uiGlobal_s::adata, uiGlobal_s::adataize, Com_Error(), uiGlobal_s::curadata, ERR_FATAL, and ui_global.

Referenced by UI_AutoGenerateIcon(), UI_InitRawActionValue(), UI_ModelNodeClone(), UI_ModelNodeLoaded(), UI_ParseActionList(), UI_ParseSetAction(), and UI_ParseValueExpression().

const value_t* UI_FindPropertyByName ( const value_t propertyList,
const char *  name 
)

Find a value_t by name into a array of value_t.

Parameters:
[in] propertyList Array of value_t, with null termination
[in] name Property name we search
Returns:
A value_t with the requested name, else NULL

Definition at line 150 of file ui_parse.c.

References Q_strcasecmp, and value_s::string.

Referenced by UI_GetPropertyFromBehaviour(), UI_MaterialEditorChangeValue_f(), UI_ParseIcon(), and UI_ParseUIModel().

float UI_GetReferenceFloat ( const struct uiNode_s *const   node,
const void *  ref 
)
const char* UI_GetReferenceString ( const struct uiNode_s *const   node,
const char *  ref 
)
qboolean UI_InitRawActionValue ( struct uiAction_s action,
struct uiNode_s node,
const struct value_s property,
const char *  string 
)
void UI_ParseComponent ( const char *  type,
const char **  text 
)

Parse a component.

See also:
CL_ParseClientData
 component panel componentName {
 }

Definition at line 1256 of file ui_parse.c.

References Com_Error(), Com_Parse(), Com_UnParseLastToken(), ERR_FATAL, UI_InsertComponent(), and UI_ParseNode().

Referenced by CL_ParseClientData().

void UI_ParseIcon ( const char *  name,
const char **  text 
)
void UI_ParseUIModel ( const char *  name,
const char **  text 
)
void UI_ParseWindow ( const char *  type,
const char *  name,
const char **  text 
)

Generated by  doxygen 1.6.2