|
UFO: Alien Invasion
|
#include "../../shared/ufotypes.h"#include "../../common/scripts.h"#include "../../common/scripts_lua.h"
Go to the source code of this file.
Data Structures | |
| struct | uiExcludeRect_t |
| struct | uiBox_t |
| struct | uiNode_t |
| Atomic structure used to define most of the UI. More... | |
Macros | |
| #define | UI_EXTRADATA_POINTER(NODE, TYPE) |
| Return extradata structure from a node. | |
| #define | UI_EXTRADATA(NODE, TYPE) |
| #define | UI_EXTRADATACONST_POINTER(NODE, TYPE) |
| #define | UI_EXTRADATACONST(NODE, TYPE) |
Functions | |
| void | UI_InitNodes (void) |
| uiNode_t * | UI_AllocNode (const char *name, const char *type, bool isDynamic) |
| Allocate a node into the UI memory. | |
| uiNode_t * | UI_GetNodeByPath (const char *path) __attribute__((warn_unused_result)) |
| Return a node by a path name (names with dot separation) It is a simplification facade over UI_ReadNodePath. | |
| void | UI_ReadNodePath (const char *path, const uiNode_t *relativeNode, const uiNode_t *iterationNode, uiNode_t **resultNode, const value_t **resultProperty, value_t *luaMethod=nullptr) |
| Read a path and return every we can use (node and property). | |
| uiNode_t * | UI_GetNodeAtPosition (int x, int y) __attribute__((warn_unused_result)) |
| Return the first visible node at a position. | |
| const char * | UI_GetPath (const uiNode_t *node) __attribute__((warn_unused_result)) |
| Return a path from a window to a node. | |
| uiNode_t * | UI_CloneNode (const uiNode_t *node, uiNode_t *newWindow, bool recursive, const char *newName, bool isDynamic) __attribute__((warn_unused_result)) |
| Clone a node. | |
| bool | UI_CheckVisibility (uiNode_t *node) |
| Check the if conditions for a given node. | |
| void | UI_DeleteAllChild (uiNode_t *node) |
| Remove all child from a node (only remove dynamic memory allocation nodes). | |
| void | UI_DeleteNode (uiNode_t *node) |
| uiBehaviour_t * | UI_GetNodeBehaviour (const char *name) __attribute__((warn_unused_result)) |
| Return a node behaviour by name. | |
| uiBehaviour_t * | UI_GetNodeBehaviourByIndex (int index) __attribute__((warn_unused_result)) |
| int | UI_GetNodeBehaviourCount (void) __attribute__((warn_unused_result)) |
| #define UI_EXTRADATA | ( | NODE, | |
| TYPE ) |
Definition at line 185 of file ui_nodes.h.
Referenced by uiWindowNode::setFill(), UI_AbstractOption_SetBackgroundByName(), UI_Button_SetBackgroundByName(), UI_Button_SetIconByName(), UI_CheckBox_SetBackgroundByName(), UI_CheckBox_SetIconCheckedByName(), UI_CheckBox_SetIconUncheckedByName(), UI_CheckBox_SetIconUnknownByName(), UI_Model_SetAnimationSource(), UI_Model_SetModelSource(), UI_Model_SetSkinSource(), UI_Model_SetTagSource(), UI_Panel_SetBackgroundByName(), UI_Spinner_SetBackgroundByName(), UI_Spinner_SetBottomIconByName(), UI_Spinner_SetTopIconByName(), UI_TextEntry_SetBackgroundByName(), UI_Window_SetBackgroundByName(), uiAbstractOptionNode_t_lineheight(), uiAbstractOptionNode_t_lua_onViewChange_get(), uiAbstractOptionNode_t_lua_onViewChange_set(), uiAbstractOptionNode_t_set_lineheight(), uiAbstractScrollableNode_t_fullsize(), uiAbstractScrollableNode_t_lua_onViewChange_get(), uiAbstractScrollableNode_t_lua_onViewChange_set(), uiAbstractScrollableNode_t_viewpos(), uiAbstractScrollableNode_t_viewsize(), uiAbstractScrollbarNode_t_current(), uiAbstractScrollbarNode_t_fullsize(), uiAbstractScrollbarNode_t_is_autoshowscroll(), uiAbstractScrollbarNode_t_set_autoshowscroll(), uiAbstractScrollbarNode_t_set_fullsize(), uiAbstractScrollbarNode_t_set_viewsize(), uiAbstractScrollbarNode_t_viewsize(), uiBarNode_t_direction(), uiBarNode_t_is_nohover(), uiBarNode_t_is_readonly(), uiBarNode_t_set_direction(), uiBarNode_t_set_nohover(), uiBarNode_t_set_readonly(), uiBaseInventoryNode_t_columns(), uiBaseInventoryNode_t_filtertype(), uiBaseInventoryNode_t_fullsize(), uiBaseInventoryNode_t_is_displayammo(), uiBaseInventoryNode_t_is_displayavailableontop(), uiBaseInventoryNode_t_is_displayimplant(), uiBaseInventoryNode_t_is_displayunavailable(), uiBaseInventoryNode_t_is_displayunavailableammo(), uiBaseInventoryNode_t_is_displayweapon(), uiBaseInventoryNode_t_is_displayweaponammo(), uiBaseInventoryNode_t_lua_onViewChange_get(), uiBaseInventoryNode_t_lua_onViewChange_set(), uiBaseInventoryNode_t_set_displayammo(), uiBaseInventoryNode_t_set_displayavailableontop(), uiBaseInventoryNode_t_set_displayimplant(), uiBaseInventoryNode_t_set_displayunavailable(), uiBaseInventoryNode_t_set_displayunavailableammo(), uiBaseInventoryNode_t_set_displayweapon(), uiBaseInventoryNode_t_set_displayweaponammo(), uiBaseInventoryNode_t_set_fullsize(), uiBaseInventoryNode_t_set_viewpos(), uiBaseInventoryNode_t_set_viewsize(), uiBaseInventoryNode_t_viewpos(), uiBaseInventoryNode_t_viewsize(), uiBaseLayoutNode_t_baseid(), uiBaseLayoutNode_t_set_baseid(), uiButtonNode_t_flipicon(), uiButtonNode_t_set_flipicon(), uiContainerNode_t_lua_onSelect_get(), uiContainerNode_t_lua_onSelect_set(), uiContainerNode_t_selectedid(), uiDataNode_t_as_float(), uiDataNode_t_as_integer(), uiDataNode_t_set_value__SWIG_1(), uiDataNode_t_set_valuef(), uiGeoscapeNode_t_paddingright(), uiGeoscapeNode_t_set_paddingright(), uiImageNode_t_is_keepratio(), uiImageNode_t_is_mousefx(), uiImageNode_t_set_keepratio(), uiImageNode_t_set_mousefx(), uiImageNode_t_set_texh(), uiImageNode_t_set_texl(), uiImageNode_t_texh(), uiImageNode_t_texl(), uiItemNode_t_is_containerlike(), uiItemNode_t_set_containerlike(), uiLineChartNode_t_is_showaxes(), uiLineChartNode_t_set_axescolor(), uiLineChartNode_t_set_showaxes(), uiModelNode_t_angles(), uiModelNode_t_animation(), uiModelNode_t_is_autoscale(), uiModelNode_t_is_mouserotate(), uiModelNode_t_model(), uiModelNode_t_omega(), uiModelNode_t_origin(), uiModelNode_t_scale(), uiModelNode_t_set_angles(), uiModelNode_t_set_autoscale(), uiModelNode_t_set_mouserotate(), uiModelNode_t_set_omega(), uiModelNode_t_set_origin(), uiModelNode_t_set_scale(), uiModelNode_t_skin(), uiModelNode_t_tag(), uiOptionNode_t_count(), uiOptionNode_t_is_collapsed(), uiOptionNode_t_is_flipicion(), uiOptionNode_t_is_truncated(), uiOptionNode_t_label(), uiOptionNode_t_set_collapsed(), uiOptionNode_t_set_flipicion(), uiOptionNode_t_set_truncated(), uiOptionNode_t_value(), uiPanelNode_t_is_wheelscrollable(), uiPanelNode_t_layout(), uiPanelNode_t_layoutcolumns(), uiPanelNode_t_layoutmargin(), uiPanelNode_t_set_layout(), uiPanelNode_t_set_layoutcolumns(), uiPanelNode_t_set_layoutmargin(), uiPanelNode_t_set_wheelscrollable(), uiRadioButtonNode_t_as_float(), uiRadioButtonNode_t_as_string(), uiRadioButtonNode_t_is_flipicon(), uiRadioButtonNode_t_set_flipicon(), uiRowsNode_t_current(), uiRowsNode_t_lineheight(), uiRowsNode_t_set_current(), uiRowsNode_t_set_lineheight(), uiSequenceNode_t_is_playing(), uiSequenceNode_t_lua_onEnd_get(), uiSequenceNode_t_lua_onEnd_set(), uiSpinnerNode_t_is_horizontal(), uiSpinnerNode_t_is_inverted(), uiSpinnerNode_t_mode(), uiSpinnerNode_t_set_horizontal(), uiSpinnerNode_t_set_inverted(), uiSpinnerNode_t_set_mode(), uiStringNode_t_longlines(), uiStringNode_t_set_longlines(), uiTBarNode_t_set_texh(), uiTBarNode_t_set_texl(), uiTBarNode_t_texh(), uiTBarNode_t_texl(), uiTextEntryNode_t_cursorposition(), uiTextEntryNode_t_is_clickoutabort(), uiTextEntryNode_t_is_password(), uiTextEntryNode_t_lua_onTextEntryAbort_get(), uiTextEntryNode_t_lua_onTextEntryAbort_set(), uiTextEntryNode_t_set_clickoutabort(), uiTextEntryNode_t_set_password(), uiTextNode_t_dataid(), uiTextNode_t_lineheight(), uiTextNode_t_lineselected(), uiTextNode_t_longlines(), uiTextNode_t_set_dataid(), uiTextNode_t_set_lineheight(), uiTextNode_t_set_longlines(), uiTextNode_t_set_tabwidth(), uiTextNode_t_tabwidth(), uiTextNode_t_textselected(), uiTimerNode_t_lua_onEvent_get(), uiTimerNode_t_lua_onEvent_set(), uiTimerNode_t_set_timeout(), uiTimerNode_t_timeout(), uiVideoNode_t_is_nosound(), uiVideoNode_t_lua_onEnd_get(), uiVideoNode_t_lua_onEnd_set(), uiVideoNode_t_set_nosound(), uiWindowNode_t_is_fullscreen(), uiWindowNode_t_is_modal(), uiWindowNode_t_is_starlayout(), uiWindowNode_t_lua_onWindowActivate_get(), uiWindowNode_t_lua_onWindowActivate_set(), uiWindowNode_t_lua_onWindowClosed_get(), uiWindowNode_t_lua_onWindowClosed_set(), uiWindowNode_t_lua_onWindowOpened_get(), uiWindowNode_t_lua_onWindowOpened_set(), uiWindowNode_t_set_dropdown(), uiWindowNode_t_set_fullscreen(), uiWindowNode_t_set_modal(), uiWindowNode_t_set_noticepos(), uiWindowNode_t_set_preventtypingescape(), uiWindowNode_t_set_starlayout(), uiZoneNode_t_clickdelay(), uiZoneNode_t_is_repeat(), uiZoneNode_t_set_clickdelay(), and uiZoneNode_t_set_repeat().
| #define UI_EXTRADATA_POINTER | ( | NODE, | |
| TYPE ) |
Return extradata structure from a node.
| TYPE | Extradata type |
| NODE | Pointer to the node |
Definition at line 184 of file ui_nodes.h.
| #define UI_EXTRADATACONST | ( | NODE, | |
| TYPE ) |
Definition at line 187 of file ui_nodes.h.
| #define UI_EXTRADATACONST_POINTER | ( | NODE, | |
| TYPE ) |
Definition at line 186 of file ui_nodes.h.
| uiNode_t * UI_AllocNode | ( | const char * | name, |
| const char * | type, | ||
| bool | isDynamic ) |
Allocate a node into the UI memory.
| [in] | name | Name of the new node, else nullptr if we don't want to edit it. |
| [in] | type | Name of the node behavior |
| [in] | isDynamic | Allocate a node in static or dynamic memory |
Definition at line 381 of file ui_nodes.cpp.
References uiNode_t::dynamic, name, type, UI_AllocNodeWithoutNew(), UI_Node_InitNode(), UI_Node_InitNodeDynamic(), and UI_Node_Loading().
Referenced by uiConFuncNode::onLoaded(), UI_AbstractNodeCallCreateChild(), UI_AllocOptionNode(), UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), UI_ParseWindow(), UI_Window_SetCloseButton(), and UI_Window_SetDragButton().
| bool UI_CheckVisibility | ( | uiNode_t * | node | ) |
Check the if conditions for a given node.
Definition at line 152 of file ui_nodes.cpp.
References uiNode_t::lua_onVisibleWhen, uiCallContext_t::source, UI_ExecuteLuaEventScript_ReturnBool(), UI_GetBooleanFromExpression(), uiCallContext_t::useCmdParam, and uiNode_t::visibilityCondition.
Referenced by UI_CheckMouseMove(), UI_DrawModelNode(), UI_DrawNode(), and UI_GetNodeInTreeAtPosition().
| uiNode_t * UI_CloneNode | ( | const uiNode_t * | node, |
| uiNode_t * | newWindow, | ||
| bool | recursive, | ||
| const char * | newName, | ||
| bool | isDynamic ) |
Clone a node.
| [in] | node | Node to clone |
| [in] | recursive | True if we also must clone subnodes |
| [in] | newWindow | Window where the nodes must be add (this function only link node into window, not window into the new node) |
| [in] | newName | New node name, else nullptr to use the source name |
| [in] | isDynamic | Allocate a node in static or dynamic memory |
exclude rect is not safe cloned.
actions are not cloned. It is be a problem if we use add/remove listener into a cloned node.
Definition at line 409 of file ui_nodes.cpp.
References Com_Printf(), uiNode_t::dynamic, uiNode_t::firstChild, HASH_CloneTable(), uiNode_t::lastChild, uiNode_t::name, uiNode_t::next, uiNode_t::nodeMethods, uiNode_t::parent, Q_strncpyz(), uiNode_t::root, uiNode_t::super, UI_AllocNodeWithoutNew(), UI_AppendNode(), UI_CloneNode(), UI_Node_Clone(), UI_Node_GetMemorySize(), UI_Node_GetWidgetName(), and UI_Node_InitNodeDynamic().
Referenced by UI_AbstractNodeCallCreateChild(), UI_CloneNode(), UI_CreateComponent(), UI_CreateControl(), UI_CreateWindow(), UI_ParseComponent(), UI_ParseNode(), and UI_ParseWindow().
Remove all child from a node (only remove dynamic memory allocation nodes).
| node | The node we want to clean |
Definition at line 596 of file ui_nodes.cpp.
References uiNode_t::firstChild, uiNode_t::next, and UI_DeleteNode().
Referenced by UI_AbstractNodeCallRemovaAllChild(), UI_DeleteNode(), and uiNode_t_remove_children().
Delete the node and remove it from his parent
| node | The node we want to delete |
Definition at line 618 of file ui_nodes.cpp.
References uiNode_t::behaviour, Com_GetValue(), Com_Printf(), uiNode_t::dynamic, uiNode_t::firstChild, uiNode_t::parent, uiBehaviour_t::super, UI_BeforeDeletingNode(), UI_DeleteAllChild(), UI_FreeStringProperty(), UI_GetPath(), UI_Node_DeleteNode(), UI_RemoveNode(), V_UI_CVAR, and V_UI_MASK.
Referenced by _wrap_delete_node(), UI_AbstractNodeCallDelete(), UI_AbstractNodeCallDeleteTimed(), UI_DeleteAllChild(), UI_DeleteOption(), UI_DrawNode(), and uiNode_t_delete_node().
Return the first visible node at a position.
Definition at line 527 of file ui_nodes.cpp.
References UI_GetNodeInTreeAtPosition(), ui_global, UI_Validate(), UI_WindowIsDropDown(), UI_WindowIsFullScreen(), and UI_WindowIsModal().
Referenced by uiEditorNode::drawOverWindow(), uiEditorNode::onMouseDown(), UI_DNDMouseMove(), and UI_MouseMove().
| uiBehaviour_t * UI_GetNodeBehaviour | ( | const char * | name | ) |
Return a node behaviour by name.
| [in] | name | Behaviour name requested |
Definition at line 559 of file ui_nodes.cpp.
References name, nodeBehaviourList, and NUMBER_OF_BEHAVIOURS.
Referenced by TEST_F(), UFO_AnalyseTestWindow(), UI_AllocNodeWithoutNew(), UI_CreateComponent(), UI_CreateControl(), UI_InitializeNodeBehaviour(), UI_ParseComponent(), UI_ParseNode(), and UI_Shutdown().
| uiBehaviour_t * UI_GetNodeBehaviourByIndex | ( | int | index | ) |
Definition at line 582 of file ui_nodes.cpp.
References index, and nodeBehaviourList.
Definition at line 587 of file ui_nodes.cpp.
References NUMBER_OF_BEHAVIOURS.
| uiNode_t * UI_GetNodeByPath | ( | const char * | path | ) |
Return a node by a path name (names with dot separation) It is a simplification facade over UI_ReadNodePath.
Definition at line 313 of file ui_nodes.cpp.
References Com_Printf(), and UI_ReadNodePath().
Referenced by GAME_GetImportData(), UI_AddListener_f(), UI_PushDropDownWindow_f(), UI_RemoveListener_f(), and UI_TextScrollEnd().
| const char * UI_GetPath | ( | const uiNode_t * | node | ) |
Return a path from a window to a node.
Definition at line 174 of file ui_nodes.cpp.
References i, name, uiNode_t::parent, and Q_strcat().
Referenced by _wrap_nodepath(), uiModelNode::doLayout(), uiTextNode::doLayout(), uiSelectBoxNode::drawOverWindow(), Key_WriteBindings(), uiConFuncNode::onLoaded(), uiFuncNode::onLoaded(), uiImageNode::onLoaded(), uiText2Node::onLoaded(), uiVScrollbarNode::onLoaded(), uiTabNode::onWindowOpened(), UI_AbstractOption_GetCurrentValue(), UI_AddLineChartCoord(), UI_AddLineChartLine(), UI_AddListener(), UI_ColumnLayout(), UI_CreateControl(), UI_CvarListenerNodeBind(), UI_DeleteNode(), UI_ExecuteActions(), UI_ExecuteCallAction(), UI_ExecuteLuaConFunc(), UI_ExecuteLuaEventScript(), UI_ExecuteLuaEventScript_DragDrop(), UI_ExecuteLuaEventScript_DragDrop_IsDropped(), UI_ExecuteLuaEventScript_DragDrop_XY(), UI_ExecuteLuaEventScript_DxDy(), UI_ExecuteLuaEventScript_Key(), UI_ExecuteLuaEventScript_ParamList(), UI_ExecuteLuaEventScript_ReturnBool(), UI_ExecuteLuaEventScript_XY(), UI_ExecuteLuaMethod(), UI_ExecuteSetAction(), UI_GenInjectedString(), UI_GetFloatFromNodeProperty(), UI_GetNodeAbsPos(), UI_GetNodeFromExpression(), UI_GetNodeScreenPos(), UI_GetStringFromNodeProperty(), UI_InitRawActionValue(), UI_Node_GetText(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_ParseNode(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ParseSetAction(), UI_ShowChartDots(), and UI_ShowChartLine().
Definition at line 658 of file ui_nodes.cpp.
References Com_Error(), ERR_FATAL, i, uiBehaviour_t::name, nodeBehaviourList, NUMBER_OF_BEHAVIOURS, OBJZERO, registerFunctions, uiBehaviour_t::registration, and UI_InitializeNodeBehaviour().
Referenced by UI_Init().
| void UI_ReadNodePath | ( | const char * | path, |
| const uiNode_t * | relativeNode, | ||
| const uiNode_t * | iterationNode, | ||
| uiNode_t ** | resultNode, | ||
| const value_t ** | resultProperty, | ||
| value_t * | luaMethod ) |
Read a path and return every we can use (node and property).
The path token must be a window name, and then node child. Reserved token 'root' and 'parent' can be used to navigate. If relativeNode is set, the path can start with reserved token 'this', 'root', 'parent' and 'child' (relative to this node). The function can return a node property by using a '@', the path 'foo@pos' will return the window foo and the property 'pos' from the 'window' behaviour.
| [in] | path | Path to read. Contain a node location with dot seprator and a facultative property |
| [in] | relativeNode | relative node where the path start. It allow to use facultative command to start the path (this, parent, root). |
| [in] | iterationNode | relative node referencing child in 'forchildin' iteration, mapped to '*node:child', can be nullptr |
| [out] | resultNode | Node found. Else nullptr. |
| [out] | resultProperty | Property found. Else nullptr. |
| [in,out] | luaMethod | A pointer to a value_t structure that is filled with a lua based method identification, can be nullptr |
Definition at line 219 of file ui_nodes.cpp.
References MAX_VAR, name, uiNode_t::parent, Q_streq, Q_strncpyz(), uiNode_t::root, value_t::type, UI_GetNode(), UI_GetPropertyOrLuaMethod(), UI_GetWindow(), UI_Node_IsWindow(), and UI_WindowNodeGetIndexedChild().
Referenced by UI_AddListener_f(), UI_ExecuteCallAction(), UI_ExecuteSetAction(), UI_GenInjectedString(), UI_GetBooleanFromExpression(), UI_GetNodeByPath(), UI_GetNodeFromExpression(), UI_RemoveListener_f(), and UI_SetKeyBindingEx().