UFO: Alien Invasion
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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"

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. More...
 
bool UI_NodeInstanceOfPointer (const uiNode_t *node, const uiBehaviour_t *behaviour)
 Check the node inheritance. More...
 
void UI_NodeGetPoint (const uiNode_t *node, vec2_t pos, int direction)
 return a relative position of a point into a node. More...
 
void UI_GetNodeAbsPos (const uiNode_t *node, vec2_t pos)
 Returns the absolute position of a node. More...
 
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. More...
 
void UI_NodeRelativeToAbsolutePoint (const uiNode_t *node, vec2_t pos)
 Update a relative point to an absolute one. More...
 
void UI_NodeAbsoluteToRelativePos (const uiNode_t *node, int *x, int *y)
 Update an absolute position to a relative one. More...
 
void UI_HideNode (uiNode_t *node)
 Hides a given node. More...
 
void UI_UnHideNode (uiNode_t *node)
 Unhides a given node. More...
 
void UI_NodeSetPos (uiNode_t *node, vec2_t pos)
 Update the node size and fire the pos callback. More...
 
void UI_NodeSetPos (uiNode_t *node, float x, float y)
 Update the node size and fire the pos callback. More...
 
void UI_NodeSetSize (uiNode_t *node, vec2_t size)
 Update the node size and fire the size callback. More...
 
void UI_NodeSetSize (uiNode_t *node, float w, float h)
 Update the node size and fire the size callback. More...
 
void UI_NodeSetBox (uiNode_t *node, float x, float y, float w, float h)
 Update the node size and height and fire callbacks. More...
 
uiNode_tUI_GetNode (const uiNode_t *node, const char *name)
 Search a child node by given name. More...
 
uiNode_tUI_GetPrevNode (const uiNode_t *node)
 Returns the previous node based on the order of nodes in the parent. More...
 
uiNode_tUI_FindNode (const uiNode_t *node, const char *name)
 Recursive searches for a child node by name in the entire subtree. More...
 
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. More...
 
uiNode_tUI_RemoveNode (uiNode_t *const node, uiNode_t *child)
 Remove a node from a parent node. More...
 
void UI_MoveNode (uiNode_t *const parent, uiNode_t *prevNode, uiNode_t *node)
 Moves a node in the tree. More...
 
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 More...
 
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. More...
 
const char * UI_GetStringFromNodeProperty (const uiNode_t *node, const value_t *property)
 Return a string from a node property. More...
 
float UI_GetFloatFromNodeProperty (const uiNode_t *node, const value_t *property)
 Return a float from a node property. More...
 
void UI_Invalidate (uiNode_t *node)
 Invalidate a node and all his parent to request a layout update. More...
 
void UI_Validate (uiNode_t *node)
 Validate a node tree. More...
 
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. More...
 
bool UI_GetNodeMethod (const uiNode_t *node, const char *name, LUA_METHOD &fcn)
 Finds the lua based method on this node or its super. More...
 
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. More...
 
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. More...
 
LUA_METHOD UI_Node_GetItem (uiNode_t *node, const char *name)
 This functions queries a lua based method in the internal uiNode behaviour. More...
 

Detailed Description

C interface to allow to access to cpp node code.

Definition in file ui_node.cpp.

Function Documentation

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 1082 of file ui_node.cpp.

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

Referenced by UI_Node_SetItem(), and uiNode_t_add_nodemethod().

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 856 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().

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 733 of file ui_node.cpp.

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

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

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 1019 of file ui_node.cpp.

References Com_Printf(), Cvar_Get(), Q_strstart(), value_s::string, value_s::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_s::value.

Referenced by UI_GetFloatFromExpression().

uiNode_t* UI_GetNode ( const uiNode_t node,
const char *  name 
)
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 514 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 uiBattleScapeNode::draw(), uiStringNode::draw(), uiVScrollbarNode::draw(), uiBaseLayoutNode::draw(), uiMaterialEditorNode::draw(), uiPanelNode::draw(), uiRowsNode::draw(), uiSelectBoxNode::draw(), uiItemNode::draw(), uiLineChartNode::draw(), uiTBarNode::draw(), uiBarNode::draw(), uiTextureNode::draw(), uiMessageListNode::draw(), uiOptionTreeNode::draw(), uiRadarNode::draw(), uiTabNode::draw(), uiButtonNode::draw(), uiCheckBoxNode::draw(), uiOptionListNode::draw(), uiRadioButtonNode::draw(), uiSequenceNode::draw(), uiTextEntryNode::draw(), uiImageNode::draw(), uiWindowNode::draw(), uiGeoscapeNode::draw(), uiSpinnerNode::draw(), uiSelectBoxNode::drawOverWindow(), uiVideoNode::drawOverWindow(), uiTextListNode::drawText(), uiText2Node::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().

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 1104 of file ui_node.cpp.

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

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

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 542 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 uiRadarNode::draw(), uiSequenceNode::draw(), uiGeoscapeNode::draw(), UI_BaseInventoryNodeDraw2(), and UI_DrawModelNode().

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 721 of file ui_node.cpp.

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

Referenced by UI_Window_SetDragButton().

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 978 of file ui_node.cpp.

References 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().

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 1127 of file ui_node.cpp.

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

void UI_HideNode ( uiNode_t node)

Hides a given node.

Note
Sanity check whether node is null included

Definition at line 623 of file ui_node.cpp.

References Com_Printf(), and uiNode_t::invis.

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 752 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().

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 828 of file ui_node.cpp.

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

Referenced by uiNode_t_move_node().

void UI_Node_Activate ( uiNode_t node)
void UI_Node_CapturedMouseLost ( uiNode_t node)
void UI_Node_CapturedMouseMove ( uiNode_t node,
int  x,
int  y 
)
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().

void UI_Node_DeleteNode ( uiNode_t node)
bool UI_Node_DndDrop ( uiNode_t node,
int  x,
int  y 
)
bool UI_Node_DndEnter ( uiNode_t node)
bool UI_Node_DndFinished ( uiNode_t node,
bool  isDroped 
)
void UI_Node_DndLeave ( uiNode_t node)
bool UI_Node_DndMove ( uiNode_t node,
int  x,
int  y 
)
void UI_Node_Draw ( uiNode_t node)
void UI_Node_DrawOverWindow ( uiNode_t node)
void UI_Node_DrawTooltip ( const uiNode_t node,
int  x,
int  y 
)
void UI_Node_FocusGained ( uiNode_t node)
void UI_Node_FocusLost ( uiNode_t node)
int UI_Node_GetCellHeight ( uiNode_t node)
int UI_Node_GetCellWidth ( uiNode_t node)
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 1159 of file ui_node.cpp.

References UI_GetNodeMethod().

Referenced by uiNode_t___getitem().

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().

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().

const char* UI_Node_GetTooltip ( uiNode_t node)

Definition at line 397 of file ui_node.cpp.

References uiNode_t::tooltip.

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().

void UI_Node_InitNode ( uiNode_t node)
void UI_Node_InitNodeDynamic ( uiNode_t node)
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().

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().

bool UI_Node_IsDisabled ( uiNode_t const *  node)

Definition at line 406 of file ui_node.cpp.

References uiNode_t::disabled.

Referenced by uiNode_t_is_disabled().

bool UI_Node_IsDrawable ( uiNode_t const *  node)
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().

bool UI_Node_IsFlashing ( uiNode_t const *  node)

Definition at line 418 of file ui_node.cpp.

References uiNode_t::flash.

Referenced by uiNode_t_is_flashing().

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().

bool UI_Node_IsGhost ( uiNode_t const *  node)

Definition at line 414 of file ui_node.cpp.

References uiNode_t::ghost.

Referenced by uiNode_t_is_ghost().

bool UI_Node_IsInvisible ( uiNode_t const *  node)

Definition at line 410 of file ui_node.cpp.

References uiNode_t::invis.

Referenced by uiNode_t_is_invisible().

bool UI_Node_IsOptionContainer ( uiNode_t const *  node)
bool UI_Node_IsVirtual ( uiNode_t const *  node)
bool UI_Node_IsWindow ( uiNode_t const *  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 
)
void UI_Node_LeftClick ( uiNode_t node,
int  x,
int  y 
)
void UI_Node_Loading ( uiNode_t node)
void UI_Node_MiddleClick ( uiNode_t node,
int  x,
int  y 
)
void UI_Node_MouseDown ( 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 
)
void UI_Node_MouseMove ( uiNode_t node,
int  x,
int  y 
)
void UI_Node_MouseUp ( uiNode_t node,
int  x,
int  y,
int  button 
)
void UI_Node_PosChanged ( uiNode_t node)
void UI_Node_PropertyChanged ( uiNode_t node,
const value_t property 
)
void UI_Node_RightClick ( uiNode_t node,
int  x,
int  y 
)
bool UI_Node_Scroll ( uiNode_t node,
int  deltaX,
int  deltaY 
)
void UI_Node_SetDisabled ( uiNode_t node,
const bool  value 
)

Definition at line 422 of file ui_node.cpp.

References uiNode_t::disabled.

Referenced by uiNode_t_set_disabled().

void UI_Node_SetFont ( uiNode_t node,
const char *  name 
)

Definition at line 387 of file ui_node.cpp.

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

Referenced by uiNode_t_set_font().

void UI_Node_SetImage ( uiNode_t node,
const char *  name 
)
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 1147 of file ui_node.cpp.

References UI_AddNodeMethod().

Referenced by uiNode_t___setitem().

void UI_Node_SetText ( uiNode_t node,
const char *  text 
)
void UI_Node_SetTooltip ( uiNode_t node,
const char *  tooltip 
)
void UI_Node_SizeChanged ( uiNode_t node)
bool UI_Node_StartDragging ( uiNode_t node,
int  startX,
int  startY,
int  currentX,
int  currentY,
int  button 
)
void UI_Node_WindowActivate ( uiNode_t node)
void UI_Node_WindowOpened ( uiNode_t node,
linkedList_t params 
)
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 472 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().

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 441 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_TextScrollEnd(), UI_WindowIsFullScreen(), UI_WindowNodeGetKeyBinding(), and UI_WindowNodeRegisterKeyBinding().

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 456 of file ui_node.cpp.

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

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 575 of file ui_node.cpp.

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

Referenced by UI_PushDropDownWindow_f(), and UI_StarLayout().

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 687 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().

void UI_NodeSetPos ( uiNode_t node,
vec2_t  pos 
)

Update the node size and fire the pos callback.

Definition at line 646 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().

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

Update the node size and fire the pos callback.

Definition at line 657 of file ui_node.cpp.

References UI_NodeSetPos().

void UI_NodeSetSize ( uiNode_t node,
vec2_t  size 
)
void UI_NodeSetSize ( uiNode_t node,
float  w,
float  h 
)

Update the node size and fire the size callback.

Definition at line 677 of file ui_node.cpp.

References UI_NodeSetSize().

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 790 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().

void UI_UnHideNode ( uiNode_t node)

Unhides 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.

void UI_UpdateRoot ( uiNode_t node,
uiNode_t newRoot 
)
void UI_Validate ( uiNode_t node)

Validate a node tree.

Definition at line 1066 of file ui_node.cpp.

References uiNode_t::invalidated, and UI_Node_DoLayout().

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