|
UFO: Alien Invasion
|
#include "../client.h"#include "ui_parse.h"#include "ui_main.h"#include "ui_node.h"#include "ui_data.h"#include "ui_internal.h"#include "ui_actions.h"#include "ui_sprite.h"#include "ui_components.h"#include "node/ui_node_window.h"#include "node/ui_node_selectbox.h"#include "node/ui_node_abstractnode.h"#include "node/ui_node_abstractoption.h"#include "../../shared/parse.h"#include "../cl_language.h"
Go to the source code of this file.
Functions | |
| static bool | UI_ParseProperty (void *object, const value_t *property, const char *objectName, const char **text, const char **token) |
| Parse a property value. | |
| static uiAction_t * | UI_ParseActionList (uiNode_t *node, const char **text, const char **token) |
| Parse actions and return action list. | |
| static uiNode_t * | UI_ParseNode (uiNode_t *parent, const char **text, const char **token, const char *errhead) |
| parse a node | |
| bool | UI_TokenIsReserved (const char *name) |
| static bool | UI_TokenIsValue (const char *name, bool isQuoted) |
| bool | UI_TokenIsName (const char *name, bool isQuoted) |
| const value_t * | UI_FindPropertyByName (const value_t *propertyList, const char *name) |
| Find a value_t by name into a array of value_t. | |
| float * | UI_AllocStaticFloat (int count) |
| Allocate a float into the UI static memory. | |
| vec4_t * | UI_AllocStaticColor (int count) |
| Allocate a color into the UI static memory. | |
| char * | UI_AllocStaticString (const char *string, int size) |
| Allocate a string into the UI static memory. | |
| uiAction_t * | UI_AllocStaticAction (void) |
| Allocate an action. | |
| bool | UI_InitRawActionValue (uiAction_t *action, uiNode_t *node, const value_t *property, const char *string) |
| static bool | UI_ParseSetAction (uiNode_t *node, uiAction_t *action, const char **text, const char **token, const char *errhead) |
| Parser for setter command. | |
| static bool | UI_ParseCallAction (uiNode_t *node, uiAction_t *action, const char **text, const char **token, const char *errhead) |
| Parser for call command. | |
| static bool | UI_ParseExcludeRect (uiNode_t *node, const char **text, const char **token, const char *errhead) |
| static bool | UI_ParseEventProperty (uiNode_t *node, const value_t *event, const char **text, const char **token, const char *errhead) |
| static bool | UI_ParseFunction (uiNode_t *node, const char **text, const char **token) |
| static bool | UI_ParseNodeProperties (uiNode_t *node, const char **text, const char **token) |
| parse all sequencial properties into a block | |
| static bool | UI_ParseNodeBody (uiNode_t *node, const char **text, const char **token, const char *errhead) |
| Read a node body. | |
| bool | UI_ParseUIModel (const char *name, const char **text) |
| parses the models.ufo and all files where UI models (menu_model) are defined | |
| bool | UI_ParseSprite (const char *name, const char **text) |
| bool | UI_ParseComponent (const char *type, const char *name, const char **text) |
| Parse a component. | |
| bool | UI_ParseWindow (const char *type, const char *name, const char **text) |
| Parse a window. | |
| const char * | UI_GetReferenceString (const uiNode_t *const node, const char *ref) |
| float | UI_GetReferenceFloat (const uiNode_t *const node, const void *ref) |
| Returns the value of the reference variable. | |
Variables | |
| static const value_t | uiModelProperties [] |
| valid properties for a UI model definition | |
| static char const *const | reservedTokens [] |
| reserved token preventing calling a node with it | |
remove all "token" param from function and use Com_UnParseLastToken
reduce use of uiGlobal (create global functions to add/get/... entities)
remove Com_EParseValue and use Com_ParseValue
Definition in file ui_parse.cpp.
| uiAction_t * UI_AllocStaticAction | ( | void | ) |
Allocate an action.
Definition at line 221 of file ui_parse.cpp.
References Com_Error(), ERR_FATAL, ui_global, and UI_MAX_ACTIONS.
Referenced by UI_AllocStaticCommandAction(), UI_ParseActionList(), UI_ParseExpression(), UI_ParseSetAction(), and UI_ParseValueExpression().
Allocate a color into the UI static memory.
| [in] | count | number of element need to allocate |
Definition at line 187 of file ui_parse.cpp.
References Com_Error(), count, ERR_FATAL, and UI_AllocHunkMemory().
| float * UI_AllocStaticFloat | ( | int | count | ) |
Allocate a float into the UI static memory.
| [in] | count | number of element need to allocate |
Definition at line 171 of file ui_parse.cpp.
References Com_Error(), count, ERR_FATAL, and UI_AllocHunkMemory().
Referenced by UI_CloneCvarOrFloat(), and UI_InitCvarOrFloat().
| char * UI_AllocStaticString | ( | const char * | string, |
| int | size ) |
Allocate a string into the UI static memory.
| [in] | string | Use to initialize the string |
| [in] | size | request a fixed memory size, if 0 the string size is used |
Definition at line 204 of file ui_parse.cpp.
References Com_Error(), ERR_FATAL, Q_strncpyz(), and UI_AllocHunkMemory().
Referenced by uiModelNode::clone(), uiModelNode::doLayout(), UI_AutoGenerateSprite(), UI_InitRawActionValue(), UI_ParseActionList(), UI_ParseSetAction(), and UI_ParseValueExpression().
Find a value_t by name into a array of value_t.
Definition at line 154 of file ui_parse.cpp.
References name, Q_strcasecmp, and value_t::string.
Referenced by UI_MaterialEditorChangeValue_f(), UI_ParseSprite(), and UI_ParseUIModel().
Returns the value of the reference variable.
Definition at line 1434 of file ui_parse.cpp.
References Cvar_GetValue(), and Q_strstart().
Referenced by uiAbstractValueNode::decValue(), uiAbstractValueNode::getDelta(), uiAbstractValueNode::getMax(), uiAbstractValueNode::getMin(), uiAbstractValueNode::getValue(), uiAbstractValueNode::incValue(), uiRadioButtonNode::onActivate(), uiAbstractValueNode::setDelta(), uiAbstractValueNode::setMax(), uiAbstractValueNode::setMin(), uiAbstractValueNode::setValue(), UI_GetStringFromNodeProperty(), and UI_RadioButtonNodeIsSelected().
| const char * UI_GetReferenceString | ( | const uiNode_t *const | node, |
| const char * | ref ) |
Definition at line 1406 of file ui_parse.cpp.
References CL_Translate(), Com_MacroExpandString(), and Sys_Error().
Referenced by uiButtonNode::draw(), uiImageNode::draw(), uiItemNode::draw(), uiModelNode::draw(), uiRadioButtonNode::draw(), uiSelectBoxNode::draw(), uiStringNode::draw(), uiTBarNode::draw(), uiTextEntryNode::draw(), uiTextNode::draw(), uiTextureNode::draw(), uiVScrollbarNode::draw(), uiWindowNode::draw(), uiSelectBoxNode::drawOverWindow(), uiStringNode::drawTooltip(), UI_AbstractOption_GetCurrentValue(), UI_DrawModelNode(), UI_DrawModelNodeWithUIModel(), UI_GetFontFromNode(), UI_GetStringFromNodeProperty(), UI_RadioButtonNodeIsSelected(), UI_TextNodeGenerateLineSplit(), and UI_Tooltip().
| bool UI_InitRawActionValue | ( | uiAction_t * | action, |
| uiNode_t * | node, | ||
| const value_t * | property, | ||
| const char * | string ) |
Parse a string according to a property type, and allocate a raw value to the static memory
| action | Action to initialize |
| node | Current node we are parsing, only used for error message |
| property | Type of the value to parse, if nullptr the string is not stored as string |
| string | String value to parse |
Definition at line 238 of file ui_parse.cpp.
References Com_AlignPtr(), Com_EParseValue(), Com_Printf(), uiAction_t::d, uiAction_t::d1, uiAction_t::d2, uiTerminalActionData_t::data, EA_VALUE_RAW, EA_VALUE_STRING, uiTerminalActionData_t::integer, value_t::size, value_t::string, uiAction_t::terminal, uiAction_t::type, value_t::type, UI_AllocStaticString(), UI_GetPath(), UI_GetSpriteByName(), ui_global, V_BASETYPEMASK, V_UI_CVAR, V_UI_MASK, and V_UI_SPRITEREF.
Referenced by UI_NodeSetPropertyFromActionValue(), and UI_ParseSetAction().
|
static |
Parse actions and return action list.
Definition at line 427 of file ui_parse.cpp.
References Com_EParse(), Com_Printf(), uiTerminalActionData_t::constString, uiAction_t::d, uiAction_t::d1, EA_ACTION, EA_ASSIGN, EA_CALL, EA_CMD, EA_DELETE, EA_ELIF, EA_ELSE, EA_FORCHILDIN, EA_IF, EA_NULL, EA_VALUE_CVARNAME, EA_VALUE_PATHNODE, EA_VALUE_PATHNODE_WITHINJECTION, EA_WHILE, uiAction_t::left, uiAction_t::next, uiAction_t::nonTerminal, uiAction_t::right, uiAction_t::terminal, type, uiAction_t::type, UI_AllocStaticAction(), UI_AllocStaticString(), UI_GetActionTokenType(), UI_GetPath(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseExpression(), and UI_ParseSetAction().
Referenced by UI_ParseActionList(), UI_ParseEventProperty(), UI_ParseFunction(), and UI_ParseSetAction().
|
static |
Parser for call command.
Definition at line 361 of file ui_parse.cpp.
References Com_EParse(), Com_Printf(), Com_UnParseLastToken(), uiAction_t::d, EA_VALUE_PATHNODE, EA_VALUE_PATHNODE_WITHINJECTION, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, uiAction_t::left, uiAction_t::next, uiAction_t::nonTerminal, Q_streq, uiAction_t::right, uiAction_t::type, UI_GetPath(), and UI_ParseExpression().
Referenced by UI_ParseActionList().
| bool UI_ParseComponent | ( | const char * | type, |
| const char * | name, | ||
| const char ** | text ) |
Parse a component.
Definition at line 1261 of file ui_parse.cpp.
References Com_EParse(), Com_Error(), Com_Printf(), ERR_FATAL, name, uiBehaviour_t::name, Q_streq, type, UI_AllocNode(), UI_CloneNode(), UI_GetComponent(), UI_GetNodeBehaviour(), UI_InsertComponent(), UI_Node_Loaded(), UI_ParseNodeBody(), UI_TokenIsName(), and UI_TokenIsReserved().
Referenced by CL_ParseClientData(), and UI_Restart_f().
|
static |
Definition at line 668 of file ui_parse.cpp.
References Com_EParse(), Com_GetValue(), Com_Printf(), uiNode_t::name, uiAction_t::next, value_t::string, UI_GetPath(), and UI_ParseActionList().
Referenced by UI_ParseProperty().
|
static |
Definition at line 623 of file ui_parse.cpp.
References Com_EParse(), Com_EParseValue(), Com_Printf(), uiNode_t::firstExcludeRect, uiNode_t::name, uiExcludeRect_t::next, Q_streq, STRUCT_MEMORY_ALIGN, UI_AllocHunkMemory(), UI_GetPath(), and V_POS.
Referenced by UI_ParseProperty().
|
static |
Definition at line 890 of file ui_parse.cpp.
References uiNode_t::onClick, UI_Node_IsFunction(), and UI_ParseActionList().
Referenced by UI_ParseNodeBody().
|
static |
parse a node
Definition at line 1059 of file ui_parse.cpp.
References uiNode_t::behaviour, Com_DPrintf(), Com_EParse(), Com_GetType(), Com_Printf(), DEBUG_CLIENT, uiBehaviour_t::name, uiNode_t::root, TT_QUOTED_WORD, UI_AllocNode(), UI_AppendNode(), UI_CloneNode(), UI_GetComponent(), UI_GetNode(), UI_GetNodeBehaviour(), UI_GetPath(), UI_Node_Loaded(), UI_ParseNodeBody(), UI_TokenIsName(), UI_TokenIsReserved(), and UI_UpdateRoot().
Referenced by UI_ParseNodeBody().
|
static |
Read a node body.
Definition at line 978 of file ui_parse.cpp.
References uiNode_t::behaviour, Com_EParse(), Com_Printf(), uiNode_t::name, UI_GetPath(), UI_GetPropertyFromBehaviour(), ui_global, UI_Node_IsFunction(), UI_ParseFunction(), UI_ParseNode(), and UI_ParseNodeProperties().
Referenced by UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().
|
static |
parse all sequencial properties into a block
Definition at line 920 of file ui_parse.cpp.
References uiNode_t::behaviour, Com_EParse(), Com_Printf(), uiNode_t::name, value_t::string, UI_GetPath(), UI_GetPropertyFromBehaviour(), and UI_ParseProperty().
Referenced by UI_ParseNodeBody().
|
static |
Parse a property value.
prototypes
Definition at line 698 of file ui_parse.cpp.
References Com_AlignPtr(), Com_EParse(), Com_GetLastParseError(), Com_GetType(), Com_GetValue(), Com_ParseValue(), Com_Printf(), MAX_VAR, value_t::ofs, Q_strncpyz(), RESULT_OK, value_t::size, value_t::string, TT_QUOTED_WORD, value_t::type, UI_AllocStaticStringCondition(), UI_GetDataIDByName(), UI_GetSpriteByName(), ui_global, UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_TokenIsValue(), V_BASETYPEMASK, V_NOT_UI, V_NULL, V_STRING, V_TRANSLATION_STRING, V_UI, V_UI_ACTION, V_UI_CVAR, V_UI_DATAID, V_UI_EXCLUDERECT, V_UI_IF, V_UI_MASK, V_UI_REF, and V_UI_SPRITEREF.
Referenced by UI_ParseNodeProperties(), and UI_ParseSprite().
|
static |
Parser for setter command.
Definition at line 276 of file ui_parse.cpp.
References Com_EParse(), Com_Printf(), Com_UnParseLastToken(), uiAction_t::d, uiAction_t::d1, uiAction_t::d2, uiTerminalActionData_t::data, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_RAW, EA_VALUE_STRING_WITHINJECTION, uiTerminalActionData_t::integer, uiAction_t::left, uiAction_t::nonTerminal, Q_streq, uiAction_t::right, value_t::string, uiAction_t::terminal, type, uiAction_t::type, value_t::type, UI_AllocStaticAction(), UI_AllocStaticString(), UI_GetPath(), UI_InitRawActionValue(), UI_IsInjectedString(), UI_ParseActionList(), UI_ParseExpression(), and V_UI_ACTION.
Referenced by UI_ParseActionList().
| bool UI_ParseSprite | ( | const char * | name, |
| const char ** | text ) |
Definition at line 1213 of file ui_parse.cpp.
References Com_Parse(), Com_Printf(), name, uiSprite_t::name, UI_AllocStaticSprite(), UI_FindPropertyByName(), UI_ParseProperty(), and ui_spriteProperties.
Referenced by CL_ParseClientData(), and UI_Restart_f().
| bool UI_ParseUIModel | ( | const char * | name, |
| const char ** | text ) |
parses the models.ufo and all files where UI models (menu_model) are defined
Definition at line 1134 of file ui_parse.cpp.
References uiModel_t::color, Com_DPrintf(), Com_EParse(), Com_EParseValue(), Com_GetValue(), Com_Parse(), Com_Printf(), DEBUG_CLIENT, i, uiModel_t::id, Mem_PoolStrDup, Mem_PoolStrDupTo, name, uiModel_t::next, OBJZERO, Q_streq, Sys_Error(), UI_FindPropertyByName(), UI_GetUIModel(), ui_global, UI_MAX_MODELS, ui_sysPool, uiModelProperties, v, V_HUNK_STRING, V_NULL, and Vector4Set.
Referenced by CL_ParseClientData(), and UI_Restart_f().
| bool UI_ParseWindow | ( | const char * | type, |
| const char * | name, | ||
| const char ** | text ) |
Parse a window.
Definition at line 1336 of file ui_parse.cpp.
References Com_Error(), Com_GetType(), Com_Parse(), Com_Printf(), ERR_FATAL, i, name, uiNode_t::name, Q_streq, uiNode_t::root, Sys_Error(), TT_QUOTED_WORD, type, UI_AllocNode(), UI_CloneNode(), UI_GetWindow(), ui_global, UI_InsertWindow(), UI_MAX_WINDOWS, UI_Node_Loaded(), UI_ParseNodeBody(), UI_TokenIsName(), and UI_TokenIsReserved().
Referenced by CL_ParseClientData(), and UI_Restart_f().
| bool UI_TokenIsName | ( | const char * | name, |
| bool | isQuoted ) |
Definition at line 126 of file ui_parse.cpp.
References name.
Referenced by UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().
| bool UI_TokenIsReserved | ( | const char * | name | ) |
Definition at line 82 of file ui_parse.cpp.
References name, Q_streq, and reservedTokens.
Referenced by UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().
|
static |
Definition at line 93 of file ui_parse.cpp.
Referenced by UI_ParseProperty().
|
static |
reserved token preventing calling a node with it
Definition at line 66 of file ui_parse.cpp.
Referenced by UI_TokenIsReserved().
|
static |
valid properties for a UI model definition
Definition at line 51 of file ui_parse.cpp.
Referenced by UI_ParseUIModel().