#include "ui_expression.h"
#include "ui_main.h"
#include "ui_internal.h"
#include "ui_parse.h"
#include "ui_actions.h"
#include "node/ui_node_abstractnode.h"
#include "../../shared/parse.h"
Go to the source code of this file.
Functions | |
uiNode_t * | UI_GetNodeFromExpression (uiAction_t *expression, const uiCallContext_t *context, const value_t **property) |
Get a node and a property from an expression. | |
float | UI_GetFloatFromExpression (uiAction_t *expression, const uiCallContext_t *context) |
const char * | UI_GetStringFromExpression (uiAction_t *expression, const uiCallContext_t *context) |
qboolean | UI_GetBooleanFromExpression (uiAction_t *expression, const uiCallContext_t *context) |
Check if an expression is true. | |
uiAction_t * | UI_AllocStaticStringCondition (const char *description) |
Allocate and initialize an expression according to a string. | |
static uiAction_t * | UI_ParseValueExpression (const char **text) |
Read a value from the stream and init an action with it. | |
uiAction_t * | UI_ParseExpression (const char **text) |
Definition in file ui_expression.c.
uiAction_t* UI_AllocStaticStringCondition | ( | const char * | description | ) | [read] |
Allocate and initialize an expression according to a string.
[in] | description | String describing a condition |
Definition at line 521 of file ui_expression.c.
References Com_Printf(), uiNode_s::text, UI_ParseExpression(), and va().
Referenced by UI_ParseProperty().
qboolean UI_GetBooleanFromExpression | ( | uiAction_t * | expression, | |
const uiCallContext_t * | context | |||
) |
Check if an expression is true.
Definition at line 426 of file ui_expression.c.
References Com_Error(), Cvar_FindVar(), uiAction_s::d, EA_HIGHT_MASK, EA_OPERATOR_AND, EA_OPERATOR_BOOLEAN2BOOLEAN, EA_OPERATOR_EQ, EA_OPERATOR_EXISTS, EA_OPERATOR_FLOAT2BOOLEAN, EA_OPERATOR_GE, EA_OPERATOR_GT, EA_OPERATOR_LE, EA_OPERATOR_LT, EA_OPERATOR_NE, EA_OPERATOR_NOT, EA_OPERATOR_OR, EA_OPERATOR_PATHPROPERTYFROM, EA_OPERATOR_STR_EQ, EA_OPERATOR_STR_NE, EA_OPERATOR_STRING2BOOLEAN, EA_OPERATOR_UNARY, EA_OPERATOR_XOR, EA_VALUE, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, ERR_FATAL, uiAction_s::nonTerminal, qfalse, uiAction_s::terminal, uiAction_s::type, UI_GenInjectedString(), UI_GetFloatFromExpression(), and UI_GetStringFromExpression().
Referenced by UI_CheckVisibility(), UI_ExecuteAction(), and UI_GetStringFromExpression().
float UI_GetFloatFromExpression | ( | uiAction_t * | expression, | |
const uiCallContext_t * | context | |||
) |
Definition at line 153 of file ui_expression.c.
References Com_Error(), Com_Printf(), uiValue_s::cvar, Cvar_Get(), uiAction_s::d, EA_HIGHT_MASK, EA_OPERATOR_ADD, EA_OPERATOR_DIV, EA_OPERATOR_FLOAT2FLOAT, EA_OPERATOR_MOD, EA_OPERATOR_MUL, EA_OPERATOR_PATHPROPERTYFROM, EA_OPERATOR_SUB, EA_OPERATOR_UNARY, EA_VALUE, EA_VALUE_CVAR, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, EA_VALUE_FLOAT, EA_VALUE_PARAM, EA_VALUE_PARAMCOUNT, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_STRING, EA_VALUE_STRING_WITHINJECTION, EA_VALUE_VAR, ERR_FATAL, uiAction_s::nonTerminal, uiValue_s::number, qfalse, uiValue_s::string, uiAction_s::terminal, uiValue_s::type, uiAction_s::type, UI_GenInjectedString(), UI_GetFloatFromNodeProperty(), UI_GetNodeFromExpression(), UI_GetParam(), UI_GetParamNumber(), UI_GetVariable(), cvar_s::value, and uiValue_s::value.
Referenced by UI_GetBooleanFromExpression(), and UI_GetStringFromExpression().
uiNode_t* UI_GetNodeFromExpression | ( | uiAction_t * | expression, | |
const uiCallContext_t * | context, | |||
const value_t ** | property | |||
) |
Get a node and a property from an expression.
expression | Expression tree to analyse | |
context | Call context | |
[out] | property | A node property |
Definition at line 40 of file ui_expression.c.
References Com_Printf(), uiAction_s::d, EA_HIGHT_MASK, EA_OPERATOR_PATHPROPERTYFROM, EA_OPERATOR_UNARY, EA_VALUE, EA_VALUE_NODE, EA_VALUE_PARENT, EA_VALUE_PATHNODE, EA_VALUE_PATHNODE_WITHINJECTION, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_THIS, EA_VALUE_VAR, EA_VALUE_WINDOW, uiValue_s::node, uiAction_s::nonTerminal, uiNode_s::parent, qfalse, uiNode_s::root, uiCallContext_s::source, uiAction_s::terminal, uiValue_s::type, uiAction_s::type, UI_GenInjectedString(), UI_GetPath(), UI_GetVariable(), UI_ReadNodePath(), and uiValue_s::value.
Referenced by UI_GetFloatFromExpression(), and UI_GetStringFromExpression().
const char* UI_GetStringFromExpression | ( | uiAction_t * | expression, | |
const uiCallContext_t * | context | |||
) |
Definition at line 288 of file ui_expression.c.
References uiNode_s::behaviour, Com_Error(), Com_Printf(), uiValue_s::cvar, Cvar_Get(), uiAction_s::d, EA_HIGHT_MASK, EA_OPERATOR_BOOLEAN2BOOLEAN, EA_OPERATOR_FLOAT2BOOLEAN, EA_OPERATOR_FLOAT2FLOAT, EA_OPERATOR_PATHPROPERTYFROM, EA_OPERATOR_STRING2BOOLEAN, EA_OPERATOR_UNARY, EA_VALUE, EA_VALUE_CVAR, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, EA_VALUE_FLOAT, EA_VALUE_PARAM, EA_VALUE_PARAMCOUNT, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_STRING, EA_VALUE_STRING_WITHINJECTION, EA_VALUE_VAR, ERR_FATAL, uiBehaviour_s::name, uiValue_s::number, qfalse, value_s::string, string, cvar_s::string, uiValue_s::string, uiAction_s::terminal, uiValue_s::type, uiAction_s::type, UI_GenInjectedString(), UI_GetBooleanFromExpression(), UI_GetFloatFromExpression(), UI_GetNodeFromExpression(), UI_GetParam(), UI_GetParamNumber(), UI_GetStringFromNodeProperty(), UI_GetVariable(), va(), and uiValue_s::value.
Referenced by UI_ExecuteCallAction(), UI_ExecuteSetAction(), UI_GetBooleanFromExpression(), and UI_NodeSetPropertyFromActionValue().
uiAction_t* UI_ParseExpression | ( | const char ** | text | ) | [read] |
Definition at line 654 of file ui_expression.c.
References Com_Parse(), Com_Printf(), Com_UnParseLastToken(), uiAction_s::d, EA_BINARYOPERATOR, EA_NULL, EA_OPERATOR_EXISTS, EA_UNARYOPERATOR, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, uiAction_s::nonTerminal, type, uiAction_s::type, UI_AllocStaticAction(), UI_GetActionTokenType(), UI_ParseExpression(), and UI_ParseValueExpression().
Referenced by UI_AllocStaticStringCondition(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseExpression(), and UI_ParseSetAction().
static uiAction_t* UI_ParseValueExpression | ( | const char ** | text | ) | [static] |
Read a value from the stream and init an action with it.
Definition at line 541 of file ui_expression.c.
References Com_Error(), Com_Parse(), Com_ParsedTokenIsQuoted(), Com_Printf(), uiAction_s::d, EA_VALUE_CVARNAME, EA_VALUE_CVARNAME_WITHINJECTION, EA_VALUE_FLOAT, EA_VALUE_PARAM, EA_VALUE_PARAMCOUNT, EA_VALUE_PATHNODE, EA_VALUE_PATHNODE_WITHINJECTION, EA_VALUE_PATHPROPERTY, EA_VALUE_PATHPROPERTY_WITHINJECTION, EA_VALUE_STRING, EA_VALUE_STRING_WITHINJECTION, ERR_FATAL, f, i, Q_strcasecmp, Q_strncasecmp(), uiAction_s::terminal, uiAction_s::type, UI_AllocStaticAction(), UI_AllocStaticString(), UI_IsInjectedString(), and va().
Referenced by UI_ParseExpression().