Every node extends this node. More...
#include "ui_node_abstractnode.h"
#include "ui_node_panel.h"
#include "../ui_parse.h"
#include "../ui_main.h"
#include "../ui_components.h"
#include "../ui_internal.h"
Go to the source code of this file.
Functions | |
qboolean | UI_NodeInstanceOf (const uiNode_t *node, const char *behaviourName) |
Check the node inheritance. | |
qboolean | UI_NodeInstanceOfPointer (const uiNode_t *node, const uiBehaviour_t *behaviour) |
Check the node inheritance. | |
void | UI_NodeGetPoint (const uiNode_t *node, vec2_t pos, int direction) |
return a relative position of a point into a node. | |
void | UI_GetNodeAbsPos (const uiNode_t *node, vec2_t pos) |
Returns the absolute position of a node. | |
void | UI_NodeRelativeToAbsolutePoint (const uiNode_t *node, vec2_t pos) |
Update a relative point to an absolute one. | |
void | UI_NodeAbsoluteToRelativePos (const uiNode_t *node, int *x, int *y) |
Update an absolute position to a relative one. | |
void | UI_HideNode (uiNode_t *node) |
Hides a given node. | |
void | UI_UnHideNode (uiNode_t *node) |
Unhides a given node. | |
void | UI_NodeSetSize (uiNode_t *node, vec2_t size) |
Update the node size and fire the size callback. | |
uiNode_t * | UI_GetNode (const uiNode_t *const node, const char *name) |
Search a child node by given name. | |
void | UI_InsertNode (uiNode_t *const node, uiNode_t *prevNode, uiNode_t *newNode) |
Insert a node next another one into a node. If prevNode is NULL add the node on the head of the window. | |
uiNode_t * | UI_RemoveNode (uiNode_t *const node, uiNode_t *child) |
Remove a node from a parent node. | |
void | UI_UpdateRoot (uiNode_t *node, uiNode_t *newRoot) |
void | UI_AppendNode (uiNode_t *const node, uiNode_t *newNode) |
add a node at the end of the node child | |
void | UI_NodeSetPropertyFromRAW (uiNode_t *node, const value_t *property, void *rawValue, int rawType) |
qboolean | UI_NodeSetProperty (uiNode_t *node, const value_t *property, const char *value) |
Set node property. | |
const char * | UI_GetStringFromNodeProperty (const uiNode_t *node, const value_t *property) |
Return a string from a node property. | |
float | UI_GetFloatFromNodeProperty (const uiNode_t *node, const value_t *property) |
Return a float from a node property. | |
void | UI_Invalidate (uiNode_t *node) |
Invalidate a node and all his parent to request a layout update. | |
void | UI_Validate (uiNode_t *node) |
Validate a node tree. | |
static qboolean | UI_AbstractNodeDNDEnter (uiNode_t *node) |
static qboolean | UI_AbstractNodeDNDMove (uiNode_t *node, int x, int y) |
static void | UI_AbstractNodeDNDLeave (uiNode_t *node) |
static qboolean | UI_AbstractNodeDNDDrop (uiNode_t *node, int x, int y) |
static qboolean | UI_AbstractNodeDNDFinished (uiNode_t *node, qboolean isDroped) |
static void | UI_AbstractNodeClone (const uiNode_t *source, uiNode_t *clone) |
Call to update a cloned node. | |
static void | UI_AbstractNodeActivate (uiNode_t *node) |
Activate the node. Can be used without the mouse (ie. a button will execute onClick). | |
static void | UI_AbstractNodeDoLayout (uiNode_t *node) |
Call to update the node layout. This common code revalidates the node tree. | |
static void | UI_AbstractNodeInit (uiNode_t *node) |
static void | UI_AbstractNodeClose (uiNode_t *node) |
static void | UI_AbstractNodeSizeChanged (uiNode_t *node) |
Callback stub. | |
static void | UI_AbstractNodeVisibilityChange (uiNode_t *node) |
static void | UI_AbstractNodePropertyChanged (uiNode_t *node, const value_t *property) |
static void | UI_AbstractNodeCallRemovaAllChild (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_AbstractNodeCallCreateChild (uiNode_t *node, const uiCallContext_t *context) |
static void | UI_AbstractNodeCallDelete (uiNode_t *node, const uiCallContext_t *context) |
void | UI_RegisterAbstractNode (uiBehaviour_t *behaviour) |
Variables | |
static const value_t * | propertyWidth |
static const value_t * | propertyHeight |
static const value_t * | propertySize |
static const value_t * | propertyInvis |
static const value_t | properties [] |
valid properties for a node |
Every node extends this node.
Definition in file ui_node_abstractnode.c.
static void UI_AbstractNodeActivate | ( | uiNode_t * | node | ) | [static] |
Activate the node. Can be used without the mouse (ie. a button will execute onClick).
Definition at line 629 of file ui_node_abstractnode.c.
References uiNode_s::onClick, and UI_ExecuteEventActions().
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeCallCreateChild | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 709 of file ui_node_abstractnode.c.
References Com_Printf(), name, qtrue, uiNode_s::root, type, UI_AllocNode(), UI_AppendNode(), UI_CloneNode(), UI_GetComponent(), UI_GetParam(), and UI_GetParamNumber().
static void UI_AbstractNodeCallDelete | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 739 of file ui_node_abstractnode.c.
References Com_Printf(), UI_DeleteNode(), and UI_GetParamNumber().
static void UI_AbstractNodeCallRemovaAllChild | ( | uiNode_t * | node, | |
const uiCallContext_t * | context | |||
) | [static] |
Definition at line 700 of file ui_node_abstractnode.c.
References Com_Printf(), UI_DeleteAllChild(), and UI_GetParamNumber().
Call to update a cloned node.
Definition at line 622 of file ui_node_abstractnode.c.
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeClose | ( | uiNode_t * | node | ) | [static] |
Definition at line 661 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiBehaviour_s::close, uiNode_s::firstChild, and uiNode_s::next.
Referenced by UI_RegisterAbstractNode().
Definition at line 609 of file ui_node_abstractnode.c.
References qtrue.
Referenced by UI_RegisterAbstractNode().
Definition at line 595 of file ui_node_abstractnode.c.
References qfalse.
Referenced by UI_RegisterAbstractNode().
Definition at line 614 of file ui_node_abstractnode.c.
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeDNDLeave | ( | uiNode_t * | node | ) | [static] |
Definition at line 605 of file ui_node_abstractnode.c.
Referenced by UI_RegisterAbstractNode().
Definition at line 600 of file ui_node_abstractnode.c.
References qtrue.
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeDoLayout | ( | uiNode_t * | node | ) | [static] |
Call to update the node layout. This common code revalidates the node tree.
Definition at line 638 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiBehaviour_s::doLayout, uiNode_s::firstChild, uiNode_s::invalidated, uiNode_s::next, and qfalse.
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeInit | ( | uiNode_t * | node | ) | [static] |
Definition at line 651 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiNode_s::firstChild, uiBehaviour_s::init, and uiNode_s::next.
Referenced by UI_RegisterAbstractNode().
Definition at line 691 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiBehaviour_s::sizeChanged, and UI_AbstractNodeVisibilityChange().
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeSizeChanged | ( | uiNode_t * | node | ) | [static] |
Callback stub.
Definition at line 674 of file ui_node_abstractnode.c.
References uiNode_s::firstChild, and UI_Invalidate().
Referenced by UI_RegisterAbstractNode().
static void UI_AbstractNodeVisibilityChange | ( | uiNode_t * | node | ) | [static] |
Definition at line 680 of file ui_node_abstractnode.c.
References uiNode_s::parent, and UI_Invalidate().
Referenced by UI_AbstractNodePropertyChanged().
add a node at the end of the node child
Definition at line 325 of file ui_node_abstractnode.c.
References uiNode_s::lastChild, and UI_InsertNode().
Referenced by UI_AbstractNodeCallCreateChild(), UI_CloneNode(), UI_ParseNode(), and UI_WindowNodeLoaded().
Return a float from a node property.
[in] | node | Requested node |
[in] | property | Requested property |
Definition at line 472 of file ui_node_abstractnode.c.
References byte, Com_Printf(), Cvar_Get(), value_s::ofs, value_s::string, value_s::type, UI_GetPath(), V_BOOL, V_CVAR_OR_FLOAT, V_FLOAT, V_INT, and cvar_s::value.
Referenced by UI_GetFloatFromExpression().
Search a child node by given name.
Definition at line 216 of file ui_node_abstractnode.c.
References uiNode_s::firstChild, uiNode_s::name, and uiNode_s::next.
Referenced by UI_ContainerNodeAutoPlace(), UI_GetReferenceFloat(), UI_GetReferenceString(), UI_ParseNode(), UI_PopupList(), UI_ReadNodePath(), and UI_SetOneButton().
Returns the absolute position of a node.
[in] | node | Context node |
[out] | pos | Absolute position |
Definition at line 114 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, Com_Error(), ERR_FATAL, uiBehaviour_s::isVirtual, uiNode_s::name, uiNode_s::parent, uiNode_s::pos, UI_GetPath(), and Vector2Set.
Referenced by MAP_DrawMap(), UI_BarNodeCapturedMouseMove(), UI_BarNodeDraw(), UI_BaseInventoryNodeDraw2(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeDrawTooltip(), UI_BaseInventoryNodeGetItem(), UI_BaseLayoutNodeDraw(), UI_BaseMapNodeDraw(), UI_ButtonNodeDraw(), UI_CheckBoxNodeDraw(), UI_ContainerNodeDNDMove(), UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawFreeSpace(), UI_ContainerNodeDrawGrid(), UI_ContainerNodeDrawSingle(), UI_ContainerNodeDrawTooltip(), UI_ContainerNodeGetItemAtPosition(), UI_CustomButtonNodeDraw(), UI_DrawDisabled(), UI_DrawFree(), UI_DrawModelNode(), UI_DrawNode(), UI_EditorNodeHighlightNode(), UI_EKGNodeDraw(), UI_GetActiveRenderRect(), UI_ImageNodeDraw(), UI_InitModelInfoView(), UI_InitRadar(), UI_ItemNodeDraw(), UI_KeyBindingNodeDraw(), UI_LineChartNodeDraw(), UI_MapNodeDraw(), UI_MaterialEditorNodeDraw(), UI_MaterialEditorNodeGetImageAtPosition(), UI_MessageListNodeDraw(), UI_OptionListNodeDraw(), UI_OptionListNodeGetOptionAtPosition(), UI_OptionTreeNodeDraw(), UI_PanelNodeDraw(), UI_RadarNodeDraw(), UI_RadioButtonNodeDraw(), UI_RowsNodeDraw(), UI_SelectBoxNodeClick(), UI_SelectBoxNodeDraw(), UI_SelectBoxNodeDrawOverWindow(), UI_SpinnerNodeDraw(), UI_StringNodeDraw(), UI_TabNodeDraw(), UI_TBarNodeDraw(), UI_TextEntryNodeDraw(), UI_TextLineNodeDrawText(), UI_TextNodeDrawText(), UI_TodoNodeDraw(), UI_VideoNodeDrawOverWindow(), UI_VScrollbarNodeDraw(), and UI_WindowNodeDraw().
Return a string from a node property.
[in] | node | Requested node |
[in] | property | Requested property |
Definition at line 431 of file ui_node_abstractnode.c.
References byte, Com_Printf(), Com_ValueToStr(), f, i, value_s::ofs, value_s::string, value_s::type, UI_GetPath(), UI_GetReferenceFloat(), UI_GetReferenceString(), V_CVAR_OR_FLOAT, V_CVAR_OR_LONGSTRING, V_CVAR_OR_STRING, V_NOT_UI, V_UI_CVAR, V_UI_MASK, and va().
Referenced by UI_GenInjectedString(), and UI_GetStringFromExpression().
void UI_HideNode | ( | uiNode_t * | node | ) |
Hides a given node.
Definition at line 180 of file ui_node_abstractnode.c.
References Com_Printf(), uiNode_s::invis, and qtrue.
Insert a node next another one into a node. If prevNode is NULL add the node on the head of the window.
[in] | node | Node where inserting a node |
[in] | prevNode | previous node, will became before the newNode; else NULL if newNode will become the first child of the node |
[in] | newNode | node we insert |
Definition at line 236 of file ui_node_abstractnode.c.
References uiNode_s::firstChild, uiNode_s::indexed, uiNode_s::lastChild, uiNode_s::next, uiNode_s::parent, uiNode_s::root, UI_Invalidate(), and UI_WindowNodeAddIndexedNode().
Referenced by UI_AppendNode().
void UI_Invalidate | ( | uiNode_t * | node | ) |
Invalidate a node and all his parent to request a layout update.
Definition at line 576 of file ui_node_abstractnode.c.
References uiNode_s::invalidated, uiNode_s::parent, and qtrue.
Referenced by UI_AbstractNodeSizeChanged(), UI_AbstractNodeVisibilityChange(), UI_InsertNode(), UI_InvalidateStack(), UI_OptionPropertyChanged(), UI_PanelNodeLoaded(), UI_PanelPropertyChanged(), UI_RemoveNode(), UI_WindowNodeInit(), and UI_WindowNodeLoaded().
void UI_NodeAbsoluteToRelativePos | ( | const uiNode_t * | node, | |
int * | x, | |||
int * | y | |||
) |
Update an absolute position to a relative one.
[in] | node | Context node |
[in,out] | x | an absolute x position |
[in,out] | y | an absolute y position |
Definition at line 157 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, Com_Error(), ERR_DROP, uiBehaviour_s::isVirtual, uiNode_s::name, uiNode_s::parent, uiNode_s::pos, and qfalse.
Referenced by UI_BarNodeCapturedMouseMove(), UI_BaseMapGetCellAtPos(), UI_ControlsNodeMouseDown(), UI_EditorNodeGetElementAtPosition(), UI_MaterialEditorNodeGetImageAtPosition(), UI_OptionTreeNodeClick(), UI_OptionTreeNodeGetOptionAtPosition(), UI_RadarNodeCapturedMouseMove(), UI_SelectBoxNodeCapturedMouseMove(), UI_SpinnerNodeDown(), UI_TabNodeTabAtPosition(), UI_TextListNodeGetLine(), UI_TextNodeGetLine(), and UI_VScrollbarNodeGetElement().
return a relative position of a point into a node.
[in] | node | Requested node |
[out] | pos | Result position |
[in] | direction |
Definition at line 72 of file ui_node_abstractnode.c.
References Com_Printf(), int(), LAYOUTALIGN_H_LEFT, LAYOUTALIGN_H_MIDDLE, LAYOUTALIGN_H_RIGHT, LAYOUTALIGN_V_BOTTOM, LAYOUTALIGN_V_MIDDLE, LAYOUTALIGN_V_TOP, uiNode_s::size, UI_GET_HORIZONTAL_ALIGN, and UI_GET_VERTICAL_ALIGN.
Referenced by UI_PushDropDownWindow_f(), and UI_StarLayout().
Check the node inheritance.
[in] | node | Requested node |
[in] | behaviourName | Behaviour name we check |
Definition at line 39 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiBehaviour_s::name, qfalse, qtrue, and uiBehaviour_s::super.
Referenced by UI_AbstractScrollableNodeIsSizeChange(), UI_AbstractScrollableNodeScrollY(), UI_AbstractScrollableNodeSetY(), UI_ActiveVScrollbarNode_f(), UI_ConfuncCommand_f(), UI_ConFuncIsVirtual(), UI_DrawModelNode(), UI_FireInit_f(), UI_OptionNodeSortOptions(), UI_TextNodeGetLine(), UI_TextScrollEnd(), UI_WindowIsFullScreen(), UI_WindowNodeGetKeyBinding(), UI_WindowNodeRegisterKeyBinding(), and UI_WindowNodeSetRenderNode().
qboolean UI_NodeInstanceOfPointer | ( | const uiNode_t * | node, | |
const uiBehaviour_t * | behaviour | |||
) |
Check the node inheritance.
[in] | node | Requested node |
[in] | behaviour | Behaviour we check |
Definition at line 55 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, qfalse, qtrue, and uiBehaviour_s::super.
Update a relative point to an absolute one.
[in] | node | The requested node |
[in,out] | pos | A point to transform |
Definition at line 140 of file ui_node_abstractnode.c.
References uiNode_s::parent, and uiNode_s::pos.
Referenced by UI_PushDropDownWindow_f(), and UI_StarLayout().
Set node property.
Definition at line 366 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, byte, Com_GetLastParseError(), Com_ParseValue(), Com_Printf(), f, Mem_PoolStrDup, value_s::ofs, uiBehaviour_s::propertyChanged, qfalse, qtrue, RESULT_OK, value_s::size, value_s::string, value_s::type, ui_dynStringPool, UI_FreeStringProperty(), UI_GetPath(), UI_SetCvar(), V_CVAR_OR_FLOAT, V_CVAR_OR_LONGSTRING, V_CVAR_OR_STRING, V_FLOAT, V_NOT_UI, V_UI_CVAR, and V_UI_MASK.
Referenced by UI_NodeSetPropertyFromActionValue().
void UI_NodeSetPropertyFromRAW | ( | uiNode_t * | node, | |
const value_t * | property, | |||
void * | rawValue, | |||
int | rawType | |||
) |
Definition at line 330 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, byte, Com_Error(), Com_Printf(), Com_SetValue(), ERR_FATAL, value_s::ofs, uiBehaviour_s::propertyChanged, value_s::size, value_s::string, value_s::type, UI_FreeStringProperty(), UI_GetPath(), V_BASETYPEMASK, V_FLOAT, V_INT, V_NOT_UI, V_UI_ACTION, V_UI_CVAR, V_UI_ICONREF, and V_UI_MASK.
Referenced by UI_NodeSetPropertyFromActionValue().
Update the node size and fire the size callback.
Definition at line 203 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiNode_s::size, and uiBehaviour_s::sizeChanged.
Referenced by UI_BorderLayout(), UI_EditorNodeCapturedMouseMove(), UI_PackLayout(), UI_StarLayout(), and UI_TopDownFlowLayout().
void UI_RegisterAbstractNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 859 of file ui_node_abstractnode.c.
References uiBehaviour_s::activate, ALIGN_CC, ALIGN_CL, ALIGN_CR, ALIGN_LC, ALIGN_LL, ALIGN_LR, ALIGN_UC, ALIGN_UL, ALIGN_UR, uiBehaviour_s::clone, uiBehaviour_s::close, Cmd_AddCommand(), Com_RegisterConstInt(), uiBehaviour_s::dndDrop, uiBehaviour_s::dndEnter, uiBehaviour_s::dndFinished, uiBehaviour_s::dndLeave, uiBehaviour_s::dndMove, uiBehaviour_s::doLayout, uiBehaviour_s::init, uiBehaviour_s::isAbstract, uiBehaviour_s::name, uiBehaviour_s::properties, uiBehaviour_s::propertyChanged, qtrue, uiBehaviour_s::sizeChanged, UI_AbstractNodeActivate(), UI_AbstractNodeClone(), UI_AbstractNodeClose(), UI_AbstractNodeDNDDrop(), UI_AbstractNodeDNDEnter(), UI_AbstractNodeDNDFinished(), UI_AbstractNodeDNDLeave(), UI_AbstractNodeDNDMove(), UI_AbstractNodeDoLayout(), UI_AbstractNodeInit(), UI_AbstractNodePropertyChanged(), UI_AbstractNodeSizeChanged(), and UI_GetPropertyFromBehaviour().
Remove a node from a parent node.
remove the 'child' node
find node before 'child' node
update cache
Definition at line 275 of file ui_node_abstractnode.c.
References uiNode_s::firstChild, uiNode_s::indexed, uiNode_s::lastChild, uiNode_s::next, uiNode_s::parent, uiNode_s::root, UI_Invalidate(), and UI_WindowNodeRemoveIndexedNode().
Referenced by UI_DeleteNode().
void UI_UnHideNode | ( | uiNode_t * | node | ) |
Unhides a given node.
Definition at line 192 of file ui_node_abstractnode.c.
References Com_Printf(), uiNode_s::invis, and qfalse.
Definition at line 312 of file ui_node_abstractnode.c.
References uiNode_s::firstChild, uiNode_s::next, uiNode_s::root, and UI_UpdateRoot().
Referenced by UI_ParseNode(), and UI_UpdateRoot().
void UI_Validate | ( | uiNode_t * | node | ) |
Validate a node tree.
Definition at line 589 of file ui_node_abstractnode.c.
References uiNode_s::behaviour, uiBehaviour_s::doLayout, and uiNode_s::invalidated.
Referenced by UI_AbstractOptionDoLayout(), UI_DrawNode(), UI_GetActiveRenderRect(), UI_GetNodeAtPosition(), and UI_OptionDoLayout().
const value_t properties[] [static] |
valid properties for a node
Definition at line 749 of file ui_node_abstractnode.c.
const value_t* propertyHeight [static] |
Definition at line 687 of file ui_node_abstractnode.c.
const value_t* propertyInvis [static] |
Definition at line 689 of file ui_node_abstractnode.c.
const value_t* propertySize [static] |
Definition at line 688 of file ui_node_abstractnode.c.
const value_t* propertyWidth [static] |
Definition at line 686 of file ui_node_abstractnode.c.