UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node.cpp File Reference

C interface to allow to access to cpp node code. More...

#include <typeinfo>
#include "ui_main.h"
#include "ui_behaviour.h"
#include "ui_nodes.h"
#include "ui_node.h"
#include "node/ui_node_abstractnode.h"
#include "node/ui_node_abstractoption.h"
#include "node/ui_node_battlescape.h"
#include "node/ui_node_panel.h"
#include "ui_parse.h"
#include "ui_components.h"
#include "ui_internal.h"
#include "../../common/hashtable.h"
Include dependency graph for ui_node.cpp:

Go to the source code of this file.

Functions

bool UI_Node_IsVirtual (uiNode_t const *node)
bool UI_Node_IsDrawable (uiNode_t const *node)
bool UI_Node_IsOptionContainer (uiNode_t const *node)
bool UI_Node_IsWindow (uiNode_t const *node)
bool UI_Node_IsBattleScape (uiNode_t const *node)
bool UI_Node_IsAbstract (uiNode_t const *node)
bool UI_Node_IsDrawItselfChild (uiNode_t const *node)
bool UI_Node_IsFunction (uiNode_t const *node)
bool UI_Node_IsScrollableContainer (uiNode_t const *node)
const char * UI_Node_GetWidgetName (uiNode_t const *node)
intptr_t UI_Node_GetMemorySize (uiNode_t const *node)
void UI_Node_Draw (uiNode_t *node)
void UI_Node_DrawTooltip (const uiNode_t *node, int x, int y)
void UI_Node_DrawOverWindow (uiNode_t *node)
void UI_Node_LeftClick (uiNode_t *node, int x, int y)
void UI_Node_RightClick (uiNode_t *node, int x, int y)
void UI_Node_MiddleClick (uiNode_t *node, int x, int y)
bool UI_Node_Scroll (uiNode_t *node, int deltaX, int deltaY)
void UI_Node_MouseMove (uiNode_t *node, int x, int y)
void UI_Node_MouseDown (uiNode_t *node, int x, int y, int button)
void UI_Node_MouseUp (uiNode_t *node, int x, int y, int button)
void UI_Node_MouseEnter (uiNode_t *node)
void UI_Node_MouseLeave (uiNode_t *node)
bool UI_Node_MouseLongPress (uiNode_t *node, int x, int y, int button)
bool UI_Node_StartDragging (uiNode_t *node, int startX, int startY, int currentX, int currentY, int button)
void UI_Node_CapturedMouseMove (uiNode_t *node, int x, int y)
void UI_Node_CapturedMouseLost (uiNode_t *node)
void UI_Node_Loading (uiNode_t *node)
void UI_Node_Loaded (uiNode_t *node)
void UI_Node_Clone (uiNode_t const *source, uiNode_t *clone)
void UI_Node_InitNodeDynamic (uiNode_t *node)
void UI_Node_InitNode (uiNode_t *node)
void UI_Node_DeleteNode (uiNode_t *node)
void UI_Node_WindowOpened (uiNode_t *node, linkedList_t *params)
void UI_Node_WindowClosed (uiNode_t *node)
void UI_Node_WindowActivate (uiNode_t *node)
void UI_Node_DoLayout (uiNode_t *node)
void UI_Node_Activate (uiNode_t *node)
void UI_Node_PropertyChanged (uiNode_t *node, const value_t *property)
void UI_Node_PosChanged (uiNode_t *node)
void UI_Node_SizeChanged (uiNode_t *node)
void UI_Node_GetClientPosition (uiNode_t const *node, vec2_t position)
bool UI_Node_DndEnter (uiNode_t *node)
bool UI_Node_DndMove (uiNode_t *node, int x, int y)
void UI_Node_DndLeave (uiNode_t *node)
bool UI_Node_DndDrop (uiNode_t *node, int x, int y)
bool UI_Node_DndFinished (uiNode_t *node, bool isDroped)
void UI_Node_FocusGained (uiNode_t *node)
void UI_Node_FocusLost (uiNode_t *node)
bool UI_Node_KeyPressed (uiNode_t *node, unsigned int key, unsigned short unicode)
bool UI_Node_KeyReleased (uiNode_t *node, unsigned int key, unsigned short unicode)
int UI_Node_GetCellWidth (uiNode_t *node)
int UI_Node_GetCellHeight (uiNode_t *node)
const char * UI_Node_GetText (uiNode_t *node)
void UI_Node_SetText (uiNode_t *node, const char *text)
void UI_Node_SetFont (uiNode_t *node, const char *name)
void UI_Node_SetImage (uiNode_t *node, const char *name)
const char * UI_Node_GetTooltip (uiNode_t *node)
void UI_Node_SetTooltip (uiNode_t *node, const char *tooltip)
bool UI_Node_IsDisabled (uiNode_t const *node)
bool UI_Node_IsInvisible (uiNode_t const *node)
bool UI_Node_IsGhost (uiNode_t const *node)
bool UI_Node_IsFlashing (uiNode_t const *node)
void UI_Node_SetDisabled (uiNode_t *node, const bool value)
bool UI_NodeInstanceOf (const uiNode_t *node, const char *behaviourName)
 Check the node inheritance.
bool 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_GetNodeScreenPos (const uiNode_t *node, vec2_t pos)
 Returns the absolute position of a node in the screen. Screen position is not used for the node rendering cause we use OpenGL translations. But this function is need for some R_functions methodes.
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_NodeSetPos (uiNode_t *node, vec2_t pos)
 Update the node size and fire the pos callback.
void UI_NodeSetPos (uiNode_t *node, float x, float y)
 Update the node size and fire the pos callback.
void UI_NodeSetSize (uiNode_t *node, vec2_t size)
 Update the node size and fire the size callback.
void UI_NodeSetSize (uiNode_t *node, float w, float h)
 Update the node size and fire the size callback.
void UI_NodeSetBox (uiNode_t *node, float x, float y, float w, float h)
 Update the node size and height and fire callbacks.
uiNode_tUI_GetNode (const uiNode_t *node, const char *name)
 Search a child node by given name.
uiNode_tUI_GetPrevNode (const uiNode_t *node)
 Returns the previous node based on the order of nodes in the parent.
uiNode_tUI_FindNode (const uiNode_t *node, const char *name)
 Recursive searches for a child node by name in the entire subtree.
void UI_InsertNode (uiNode_t *const parent, uiNode_t *prevNode, uiNode_t *newNode)
 Insert a node next another one into a node. If prevNode is nullptr add the node on the head of the window.
uiNode_tUI_RemoveNode (uiNode_t *const node, uiNode_t *child)
 Remove a node from a parent node.
void UI_MoveNode (uiNode_t *const parent, uiNode_t *prevNode, uiNode_t *node)
 Moves a node in the tree.
void UI_UpdateRoot (uiNode_t *node, uiNode_t *newRoot)
void UI_AppendNode (uiNode_t *const parent, uiNode_t *newNode)
 add a node at the end of the node child
void UI_NodeSetPropertyFromRAW (uiNode_t *node, const value_t *property, const void *rawValue, int rawType)
bool 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.
void UI_AddNodeMethod (uiNode_t *node, const char *name, LUA_METHOD fcn)
 Adds a lua based method to the list of available node methods for calling.
bool UI_GetNodeMethod (const uiNode_t *node, const char *name, LUA_METHOD &fcn)
 Finds the lua based method on this node or its super.
bool UI_HasNodeMethod (uiNode_t *node, const char *name)
 Returns true if a node method of given name is available on this node or its super.
void UI_Node_SetItem (uiNode_t *node, const char *name, LUA_METHOD fcn)
 This functions adds a lua based method to the internal uiNode behaviour.
LUA_METHOD UI_Node_GetItem (uiNode_t *node, const char *name)
 This functions queries a lua based method in the internal uiNode behaviour.

Detailed Description

C interface to allow to access to cpp node code.

Definition in file ui_node.cpp.

Function Documentation

◆ UI_AddNodeMethod()

void UI_AddNodeMethod ( uiNode_t * node,
const char * name,
LUA_METHOD fcn )

Adds a lua based method to the list of available node methods for calling.

Parameters
[in]nodeThe node to extend.
[in]nameThe name of the new method to add
[in]fcnThe lua based function reference.
Note
If the method name is already defined, the new method is not added and a warning will be issued in the log.
The method will be instance based, meaning that if a new node is created of the same behaviour, it will not contain this method unless this node was specified as super.

Definition at line 1094 of file ui_node.cpp.

References Com_Printf(), HASH_Insert(), HASH_NewTable(), name, uiNode_t::name, and uiNode_t::nodeMethods.

Referenced by UI_Node_SetItem(), and uiNode_t_add_nodemethod().

◆ UI_AppendNode()

void UI_AppendNode ( uiNode_t *const parent,
uiNode_t * newNode )

add a node at the end of the node child

Parameters
parentThe node where newNode is inserted as a child.
newNodeThe node to insert.

Definition at line 868 of file ui_node.cpp.

References uiNode_t::lastChild, and UI_InsertNode().

Referenced by UI_AbstractNodeCallCreateChild(), UI_CloneNode(), UI_CreateControl(), UI_ParseNode(), UI_Window_SetCloseButton(), UI_Window_SetDragButton(), and uiNode_t_append_node().

◆ UI_FindNode()

uiNode_t * UI_FindNode ( const uiNode_t * node,
const char * name )

Recursive searches for a child node by name in the entire subtree.

Returns
A uiNode_t* or nullptr if not found.

Definition at line 745 of file ui_node.cpp.

References uiNode_t::firstChild, name, uiNode_t::next, UI_FindNode(), and UI_GetNode().

Referenced by uiWindowNode::doLayout(), UI_FindNode(), UI_Window_SetCloseButton(), UI_Window_SetDragButton(), and uiNode_t_find().

◆ UI_GetFloatFromNodeProperty()

float UI_GetFloatFromNodeProperty ( const uiNode_t * node,
const value_t * property )

Return a float from a node property.

Parameters
[in]nodeRequested node
[in]propertyRequested property
Returns
Return the float value of a property, else 0, if the type is not supported
Note
If the type is not supported, a waring is reported to the console

Definition at line 1031 of file ui_node.cpp.

References Com_GetValue(), Com_Printf(), Cvar_Get(), Q_strstart(), value_t::string, value_t::type, UI_GetPath(), V_BOOL, V_CVAR_OR_FLOAT, V_CVAR_OR_STRING, V_FLOAT, V_INT, V_UI_CVAR, V_UI_MASK, and cvar_t::value.

Referenced by UI_GetFloatFromExpression().

◆ UI_GetNode()

uiNode_t * UI_GetNode ( const uiNode_t * node,
const char * name )

◆ UI_GetNodeAbsPos()

void UI_GetNodeAbsPos ( const uiNode_t * node,
vec2_t pos )

Returns the absolute position of a node.

Parameters
[in]nodeContext node
[out]posAbsolute position

Definition at line 526 of file ui_node.cpp.

References uiNode_t::behaviour, uiNode_t::box, Com_Error(), ERR_FATAL, uiBehaviour_t::isVirtual, uiNode_t::name, uiNode_t::parent, uiBox_t::pos, UI_GetPath(), and Vector2Set.

Referenced by uiBarNode::draw(), uiBaseLayoutNode::draw(), uiBattleScapeNode::draw(), uiButtonNode::draw(), uiCheckBoxNode::draw(), uiGeoscapeNode::draw(), uiImageNode::draw(), uiItemNode::draw(), uiLineChartNode::draw(), uiMaterialEditorNode::draw(), uiMessageListNode::draw(), uiOptionListNode::draw(), uiOptionTreeNode::draw(), uiPanelNode::draw(), uiRadarNode::draw(), uiRadioButtonNode::draw(), uiRowsNode::draw(), uiSelectBoxNode::draw(), uiSequenceNode::draw(), uiSpinnerNode::draw(), uiStringNode::draw(), uiTabNode::draw(), uiTBarNode::draw(), uiTextEntryNode::draw(), uiTextureNode::draw(), uiVScrollbarNode::draw(), uiWindowNode::draw(), uiSelectBoxNode::drawOverWindow(), uiVideoNode::drawOverWindow(), uiText2Node::drawText(), uiTextListNode::drawText(), uiTextNode::drawText(), GAME_GetImportData(), uiContainerNode::onDndMove(), uiTextEntryNode::onFocusGained(), uiSelectBoxNode::onLeftClick(), uiBattleScapeNode::onSizeChanged(), uiBattleScapeNode::onWindowOpened(), UI_BaseInventoryNodeDrawItems(), UI_BaseInventoryNodeGetItem(), UI_ContainerNodeDrawDropPreview(), UI_ContainerNodeDrawFreeSpace(), UI_ContainerNodeDrawGrid(), UI_ContainerNodeDrawSingle(), UI_ContainerNodeGetItemAtPosition(), UI_DrawDisabled(), UI_DrawFree(), UI_DrawModelNode(), UI_DrawNode(), UI_EditorNodeHighlightNode(), UI_InitModelInfoView(), UI_InitRadar(), UI_MaterialEditorNodeGetImageAtPosition(), and UI_OptionListNodeGetOptionAtPosition().

◆ UI_GetNodeMethod()

bool UI_GetNodeMethod ( const uiNode_t * node,
const char * name,
LUA_METHOD & fcn )

Finds the lua based method on this node or its super.

Parameters
[in]nodeThe node to examine.
[in]nameThe name of the method to find
[out]fcnA reference to a LUA_METHOD value to the corresponding lua based function or to LUA_NOREF if the method is not found
Returns
True if the method is found, false otherwise.
Note
This method will first search for instance methods, then it will check for behaviour methods.

Definition at line 1116 of file ui_node.cpp.

References uiNode_t::behaviour, HASH_Get(), name, uiNode_t::super, and UI_GetBehaviourMethod().

Referenced by UI_ExecuteLuaMethod_ByName(), UI_GetPropertyOrLuaMethod(), UI_HasNodeMethod(), and UI_Node_GetItem().

◆ UI_GetNodeScreenPos()

void UI_GetNodeScreenPos ( const uiNode_t * node,
vec2_t pos )

Returns the absolute position of a node in the screen. Screen position is not used for the node rendering cause we use OpenGL translations. But this function is need for some R_functions methodes.

Parameters
[in]nodeContext node
[out]posAbsolute position into the screen

Definition at line 554 of file ui_node.cpp.

References uiNode_t::behaviour, uiNode_t::box, Com_Error(), ERR_FATAL, uiBehaviour_t::isVirtual, uiNode_t::name, uiNode_t::parent, uiBox_t::pos, UI_GetPath(), UI_Node_GetClientPosition(), UI_Node_IsScrollableContainer(), and Vector2Set.

Referenced by uiGeoscapeNode::draw(), uiRadarNode::draw(), uiSequenceNode::draw(), UI_BaseInventoryNodeDraw2(), and UI_DrawModelNode().

◆ UI_GetPrevNode()

uiNode_t * UI_GetPrevNode ( const uiNode_t * node)

Returns the previous node based on the order of nodes in the parent.

Returns
A uiNode_t* or nullptr if no previous node is found.
Note
A nullptr is returned if the node is either the last node in the chain or in case the node is the only node.

Definition at line 733 of file ui_node.cpp.

References uiNode_t::firstChild, uiNode_t::next, and uiNode_t::parent.

Referenced by UI_Window_SetDragButton().

◆ UI_GetStringFromNodeProperty()

const char * UI_GetStringFromNodeProperty ( const uiNode_t * node,
const value_t * property )

Return a string from a node property.

Parameters
[in]nodeRequested node
[in]propertyRequested property
Returns
Return a string value of a property, else nullptr, if the type is not supported

Definition at line 990 of file ui_node.cpp.

References Com_GetValue(), Com_Printf(), Com_ValueToStr(), f, i, value_t::ofs, value_t::string, value_t::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().

◆ UI_HasNodeMethod()

bool UI_HasNodeMethod ( uiNode_t * node,
const char * name )

Returns true if a node method of given name is available on this node or its super.

Parameters
[in]nodeThe node to examine.
[in]nameThe name of the method to find
Returns
True if the method is found, false otherwise.
Note
This method will first search for instance methods, then it will check for behaviour methods.

Definition at line 1139 of file ui_node.cpp.

References uiNode_t::behaviour, name, UI_GetBehaviourMethod(), and UI_GetNodeMethod().

◆ UI_HideNode()

void UI_HideNode ( uiNode_t * node)

Hides a given node.

Note
Sanity check whether node is null included

Definition at line 635 of file ui_node.cpp.

References Com_Printf(), and uiNode_t::invis.

◆ UI_InsertNode()

void UI_InsertNode ( uiNode_t *const parent,
uiNode_t * prevNode,
uiNode_t * newNode )

Insert a node next another one into a node. If prevNode is nullptr add the node on the head of the window.

Parameters
[in]parentNode where the newNode is inserted in
[in]prevNodeprevious node, will became before the newNode; else nullptr if newNode will become the first child of the node
[in]newNodenode we insert

Definition at line 764 of file ui_node.cpp.

References uiNode_t::firstChild, uiNode_t::indexed, uiNode_t::lastChild, uiNode_t::next, uiNode_t::parent, uiNode_t::root, UI_Invalidate(), UI_UpdateRoot(), and UI_WindowNodeAddIndexedNode().

Referenced by UI_AppendNode(), UI_MoveNode(), UI_Window_SetDragButton(), and uiNode_t_insert_node().

◆ UI_Invalidate()

◆ UI_MoveNode()

void UI_MoveNode ( uiNode_t *const parent,
uiNode_t * prevNode,
uiNode_t * node )

Moves a node in the tree.

Parameters
[in]parentNode where the moved node is inserted in
[in]prevNodePrevious node to move this one after
[in]nodeNode to move

Definition at line 840 of file ui_node.cpp.

References UI_InsertNode(), UI_Invalidate(), and UI_RemoveNode().

Referenced by uiNode_t_move_node().

◆ UI_Node_Activate()

◆ UI_Node_CapturedMouseLost()

void UI_Node_CapturedMouseLost ( uiNode_t * node)

◆ UI_Node_CapturedMouseMove()

void UI_Node_CapturedMouseMove ( uiNode_t * node,
int x,
int y )

◆ UI_Node_Clone()

void UI_Node_Clone ( uiNode_t const * source,
uiNode_t * clone )

Definition at line 220 of file ui_node.cpp.

References uiNode_t::behaviour, uiNode::clone(), SharedPtr< T >::get(), and uiBehaviour_t::manager.

Referenced by UI_CloneNode().

◆ UI_Node_DeleteNode()

void UI_Node_DeleteNode ( uiNode_t * node)

◆ UI_Node_DndDrop()

bool UI_Node_DndDrop ( uiNode_t * node,
int x,
int y )

◆ UI_Node_DndEnter()

bool UI_Node_DndEnter ( uiNode_t * node)

◆ UI_Node_DndFinished()

bool UI_Node_DndFinished ( uiNode_t * node,
bool isDroped )

◆ UI_Node_DndLeave()

void UI_Node_DndLeave ( uiNode_t * node)

◆ UI_Node_DndMove()

bool UI_Node_DndMove ( uiNode_t * node,
int x,
int y )

◆ UI_Node_DoLayout()

◆ UI_Node_Draw()

void UI_Node_Draw ( uiNode_t * node)

◆ UI_Node_DrawOverWindow()

void UI_Node_DrawOverWindow ( uiNode_t * node)

◆ UI_Node_DrawTooltip()

void UI_Node_DrawTooltip ( const uiNode_t * node,
int x,
int y )

◆ UI_Node_FocusGained()

void UI_Node_FocusGained ( uiNode_t * node)

◆ UI_Node_FocusLost()

void UI_Node_FocusLost ( uiNode_t * node)

◆ UI_Node_GetCellHeight()

int UI_Node_GetCellHeight ( uiNode_t * node)

◆ UI_Node_GetCellWidth()

int UI_Node_GetCellWidth ( uiNode_t * node)

◆ UI_Node_GetClientPosition()

◆ UI_Node_GetItem()

LUA_METHOD UI_Node_GetItem ( uiNode_t * node,
const char * name )

This functions queries a lua based method in the internal uiNode behaviour.

Parameters
[in]nodeThe node with behaviour being queried.
[in]nameThe name of the behaviour entry to find.
Returns
A LUA_METHOD value pointing to a lua defined function or LUA_NOREF if no function is found.
Note
This is a placeholder for extending behaviour in lua and store it in the ui internal structure. Currently, only lua based functions are supported.

Definition at line 1171 of file ui_node.cpp.

References name, and UI_GetNodeMethod().

Referenced by uiNode_t___getitem().

◆ UI_Node_GetMemorySize()

intptr_t UI_Node_GetMemorySize ( uiNode_t const * node)

Definition at line 104 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::extraDataSize.

Referenced by UI_CloneNode().

◆ UI_Node_GetText()

const char * UI_Node_GetText ( uiNode_t * node)

Definition at line 373 of file ui_node.cpp.

References Com_Printf(), uiNode_t::text, and UI_GetPath().

Referenced by uiDataNode_t_as_string(), and uiNode_t_text().

◆ UI_Node_GetTooltip()

const char * UI_Node_GetTooltip ( uiNode_t * node)

Definition at line 406 of file ui_node.cpp.

References uiNode_t::tooltip.

◆ UI_Node_GetWidgetName()

const char * UI_Node_GetWidgetName ( uiNode_t const * node)

Definition at line 99 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::name.

Referenced by UI_CloneNode(), UI_DebugTree(), and UI_GetStringFromExpression().

◆ UI_Node_InitNode()

void UI_Node_InitNode ( uiNode_t * node)

◆ UI_Node_InitNodeDynamic()

void UI_Node_InitNodeDynamic ( uiNode_t * node)

◆ UI_Node_IsAbstract()

bool UI_Node_IsAbstract ( uiNode_t const * node)

Definition at line 72 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::isAbstract.

Referenced by UI_AllocNodeWithoutNew(), and uiNode_t_is_abstract().

◆ UI_Node_IsBattleScape()

bool UI_Node_IsBattleScape ( uiNode_t const * node)

Definition at line 66 of file ui_node.cpp.

References uiNode_t::behaviour, SharedPtr< T >::get(), and uiBehaviour_t::manager.

Referenced by UI_IsMouseOnWindow().

◆ UI_Node_IsDisabled()

bool UI_Node_IsDisabled ( uiNode_t const * node)

Definition at line 418 of file ui_node.cpp.

References uiNode_t::disabled.

Referenced by uiNode_t_is_disabled().

◆ UI_Node_IsDrawable()

bool UI_Node_IsDrawable ( uiNode_t const * node)

◆ UI_Node_IsDrawItselfChild()

bool UI_Node_IsDrawItselfChild ( uiNode_t const * node)

Definition at line 77 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::drawItselfChild.

Referenced by UI_DrawNode().

◆ UI_Node_IsFlashing()

bool UI_Node_IsFlashing ( uiNode_t const * node)

Definition at line 430 of file ui_node.cpp.

References uiNode_t::flash.

Referenced by uiNode_t_is_flashing().

◆ UI_Node_IsFunction()

bool UI_Node_IsFunction ( uiNode_t const * node)
Todo
Use typeid when it is possible

Definition at line 85 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::isFunction.

Referenced by UI_ParseFunction(), UI_ParseNodeBody(), and uiNode_t_is_function().

◆ UI_Node_IsGhost()

bool UI_Node_IsGhost ( uiNode_t const * node)

Definition at line 426 of file ui_node.cpp.

References uiNode_t::ghost.

Referenced by uiNode_t_is_ghost().

◆ UI_Node_IsInvisible()

bool UI_Node_IsInvisible ( uiNode_t const * node)

Definition at line 422 of file ui_node.cpp.

References uiNode_t::invis.

Referenced by uiNode_t_is_invisible().

◆ UI_Node_IsOptionContainer()

bool UI_Node_IsOptionContainer ( uiNode_t const * node)

◆ UI_Node_IsScrollableContainer()

◆ UI_Node_IsVirtual()

bool UI_Node_IsVirtual ( uiNode_t const * node)

◆ UI_Node_IsWindow()

bool UI_Node_IsWindow ( uiNode_t const * node)

◆ UI_Node_KeyPressed()

bool UI_Node_KeyPressed ( uiNode_t * node,
unsigned int key,
unsigned short unicode )

◆ UI_Node_KeyReleased()

bool UI_Node_KeyReleased ( uiNode_t * node,
unsigned int key,
unsigned short unicode )

◆ UI_Node_LeftClick()

void UI_Node_LeftClick ( uiNode_t * node,
int x,
int y )

◆ UI_Node_Loaded()

◆ UI_Node_Loading()

void UI_Node_Loading ( uiNode_t * node)

◆ UI_Node_MiddleClick()

void UI_Node_MiddleClick ( uiNode_t * node,
int x,
int y )

◆ UI_Node_MouseDown()

void UI_Node_MouseDown ( uiNode_t * node,
int x,
int y,
int button )

◆ UI_Node_MouseEnter()

void UI_Node_MouseEnter ( uiNode_t * node)

◆ UI_Node_MouseLeave()

void UI_Node_MouseLeave ( uiNode_t * node)

◆ UI_Node_MouseLongPress()

bool UI_Node_MouseLongPress ( uiNode_t * node,
int x,
int y,
int button )

◆ UI_Node_MouseMove()

void UI_Node_MouseMove ( uiNode_t * node,
int x,
int y )

◆ UI_Node_MouseUp()

void UI_Node_MouseUp ( uiNode_t * node,
int x,
int y,
int button )

◆ UI_Node_PosChanged()

void UI_Node_PosChanged ( uiNode_t * node)

◆ UI_Node_PropertyChanged()

void UI_Node_PropertyChanged ( uiNode_t * node,
const value_t * property )

◆ UI_Node_RightClick()

void UI_Node_RightClick ( uiNode_t * node,
int x,
int y )

◆ UI_Node_Scroll()

bool UI_Node_Scroll ( uiNode_t * node,
int deltaX,
int deltaY )

◆ UI_Node_SetDisabled()

void UI_Node_SetDisabled ( uiNode_t * node,
const bool value )

Definition at line 434 of file ui_node.cpp.

References uiNode_t::disabled.

Referenced by uiNode_t_set_disabled().

◆ UI_Node_SetFont()

void UI_Node_SetFont ( uiNode_t * node,
const char * name )

Definition at line 390 of file ui_node.cpp.

References uiNode_t::font, Mem_PoolStrDup, name, ui_dynStringPool, and UI_FreeStringProperty().

Referenced by uiNode_t_set_font().

◆ UI_Node_SetImage()

void UI_Node_SetImage ( uiNode_t * node,
const char * name )

◆ UI_Node_SetItem()

void UI_Node_SetItem ( uiNode_t * node,
const char * name,
LUA_METHOD fcn )

This functions adds a lua based method to the internal uiNode behaviour.

Parameters
[in]nodeThe node getting new behaviour.
[in]nameThe name of the new behaviour entry (this is the function name).
[in]fcnA reference to a lua based method.
Note
This is a placeholder for extending behaviour in lua and store it in the ui internal structure. Currently, only lua based functions are supported.

Definition at line 1159 of file ui_node.cpp.

References name, and UI_AddNodeMethod().

Referenced by uiNode_t___setitem().

◆ UI_Node_SetText()

void UI_Node_SetText ( uiNode_t * node,
const char * text )

◆ UI_Node_SetTooltip()

void UI_Node_SetTooltip ( uiNode_t * node,
const char * tooltip )

◆ UI_Node_SizeChanged()

void UI_Node_SizeChanged ( uiNode_t * node)

◆ UI_Node_StartDragging()

bool UI_Node_StartDragging ( uiNode_t * node,
int startX,
int startY,
int currentX,
int currentY,
int button )

◆ UI_Node_WindowActivate()

void UI_Node_WindowActivate ( uiNode_t * node)

◆ UI_Node_WindowClosed()

◆ UI_Node_WindowOpened()

void UI_Node_WindowOpened ( uiNode_t * node,
linkedList_t * params )

◆ UI_NodeAbsoluteToRelativePos()

◆ UI_NodeGetPoint()

void UI_NodeGetPoint ( const uiNode_t * node,
vec2_t pos,
int direction )

return a relative position of a point into a node.

Parameters
[in]nodeRequested node
[out]posResult position
[in]direction
Note
For example we can request the right-bottom corner with LAYOUTALIGN_BOTTOMRIGHT

Definition at line 484 of file ui_node.cpp.

References uiNode_t::box, Com_Printf(), int(), LAYOUTALIGN_H_LEFT, LAYOUTALIGN_H_MIDDLE, LAYOUTALIGN_H_RIGHT, LAYOUTALIGN_V_BOTTOM, LAYOUTALIGN_V_MIDDLE, LAYOUTALIGN_V_TOP, uiBox_t::size, UI_GET_HORIZONTAL_ALIGN, and UI_GET_VERTICAL_ALIGN.

Referenced by UI_PushDropDownWindow_f(), and UI_StarLayout().

◆ UI_NodeInstanceOf()

bool UI_NodeInstanceOf ( const uiNode_t * node,
const char * behaviourName )

Check the node inheritance.

Parameters
[in]nodeRequested node
[in]behaviourNameBehaviour name we check
Returns
True if the node inherits from the behaviour

Definition at line 453 of file ui_node.cpp.

References uiNode_t::behaviour, Q_streq, and uiBehaviour_t::super.

Referenced by UI_ConfuncCommand_f(), UI_ConFuncIsVirtual(), UI_DrawModelNode(), UI_TextNodeGetLine(), UI_TextNodeGetLine(), UI_TextScrollEnd(), UI_WindowIsFullScreen(), UI_WindowNodeGetKeyBinding(), and UI_WindowNodeRegisterKeyBinding().

◆ UI_NodeInstanceOfPointer()

bool UI_NodeInstanceOfPointer ( const uiNode_t * node,
const uiBehaviour_t * behaviour )

Check the node inheritance.

Parameters
[in]nodeRequested node
[in]behaviourBehaviour we check
Returns
True if the node inherits from the behaviour

Definition at line 468 of file ui_node.cpp.

References uiNode_t::behaviour, and uiBehaviour_t::super.

◆ UI_NodeRelativeToAbsolutePoint()

void UI_NodeRelativeToAbsolutePoint ( const uiNode_t * node,
vec2_t pos )

Update a relative point to an absolute one.

Parameters
[in]nodeThe requested node
[in,out]posA point to transform

Definition at line 587 of file ui_node.cpp.

References uiNode_t::box, uiNode_t::parent, and uiBox_t::pos.

Referenced by UI_PushDropDownWindow_f(), and UI_StarLayout().

◆ UI_NodeSetBox()

void UI_NodeSetBox ( uiNode_t * node,
float x,
float y,
float w,
float h )

Update the node size and height and fire callbacks.

Note
Use value -1 for x, y, w, h to specify no change in value.

Definition at line 699 of file ui_node.cpp.

References uiNode_t::box, uiBox_t::pos, uiBox_t::size, UI_NodeSetPos(), and UI_NodeSetSize().

Referenced by uiNode_t_set_box(), uiNode_t_set_height(), uiNode_t_set_left(), uiNode_t_set_top(), and uiNode_t_set_width().

◆ UI_NodeSetPos() [1/2]

void UI_NodeSetPos ( uiNode_t * node,
float x,
float y )

Update the node size and fire the pos callback.

Definition at line 669 of file ui_node.cpp.

References UI_NodeSetPos().

◆ UI_NodeSetPos() [2/2]

void UI_NodeSetPos ( uiNode_t * node,
vec2_t pos )

Update the node size and fire the pos callback.

Definition at line 658 of file ui_node.cpp.

References uiNode_t::box, uiBox_t::pos, UI_Node_PosChanged(), and Vector2Equal.

Referenced by UI_NodeSetBox(), UI_NodeSetPos(), and uiNode_t_set_pos().

◆ UI_NodeSetProperty()

◆ UI_NodeSetPropertyFromRAW()

◆ UI_NodeSetSize() [1/2]

void UI_NodeSetSize ( uiNode_t * node,
float w,
float h )

Update the node size and fire the size callback.

Definition at line 689 of file ui_node.cpp.

References UI_NodeSetSize().

◆ UI_NodeSetSize() [2/2]

◆ UI_RemoveNode()

uiNode_t * UI_RemoveNode ( uiNode_t *const node,
uiNode_t * child )

Remove a node from a parent node.

Returns
The removed node, else nullptr
Parameters
[in]nodeNode where is the child
[in]childNode we want to remove

remove the 'child' node

update cache

Definition at line 802 of file ui_node.cpp.

References uiNode_t::firstChild, uiNode_t::indexed, uiNode_t::lastChild, uiNode_t::next, uiNode_t::parent, uiNode_t::root, UI_Invalidate(), and UI_WindowNodeRemoveIndexedNode().

Referenced by UI_DeleteNode(), UI_MoveNode(), UI_Window_SetCloseButton(), and UI_Window_SetDragButton().

◆ UI_UnHideNode()

void UI_UnHideNode ( uiNode_t * node)

Unhides a given node.

Note
Sanity check whether node is null included

Definition at line 647 of file ui_node.cpp.

References Com_Printf(), and uiNode_t::invis.

◆ UI_UpdateRoot()

void UI_UpdateRoot ( uiNode_t * node,
uiNode_t * newRoot )

◆ UI_Validate()

void UI_Validate ( uiNode_t * node)

Validate a node tree.

Definition at line 1078 of file ui_node.cpp.

References uiNode_t::invalidated, and UI_Node_DoLayout().

Referenced by uiAbstractOptionNode::doLayout(), uiOptionNode::doLayout(), UI_DrawNode(), and UI_GetNodeAtPosition().