ui_node_abstractnode.h File Reference

#include "../ui_nodes.h"
Include dependency graph for ui_node_abstractnode.h:

Go to the source code of this file.

Functions

void UI_RegisterAbstractNode (uiBehaviour_t *)
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.
qboolean UI_NodeSetProperty (uiNode_t *node, const value_t *property, const char *value)
 Set node property.
void UI_NodeSetPropertyFromRAW (uiNode_t *node, const value_t *property, void *rawValue, int rawType)
float UI_GetFloatFromNodeProperty (const struct uiNode_s *node, const value_t *property)
const char * UI_GetStringFromNodeProperty (const uiNode_t *node, const value_t *property)
 Return a string from a node property.
void UI_UnHideNode (struct uiNode_s *node)
 Unhides a given node.
void UI_HideNode (struct uiNode_s *node)
 Hides a given node.
void UI_Invalidate (struct uiNode_s *node)
 Invalidate a node and all his parent to request a layout update.
void UI_Validate (struct uiNode_s *node)
 Validate a node tree.
void UI_NodeSetSize (uiNode_t *node, vec2_t size)
 Update the node size and fire the size callback.
void UI_GetNodeAbsPos (const struct uiNode_s *node, vec2_t pos)
void UI_NodeAbsoluteToRelativePos (const struct uiNode_s *node, int *x, int *y)
void UI_NodeRelativeToAbsolutePoint (const uiNode_t *node, vec2_t pos)
 Update a relative point to an absolute one.
void UI_NodeGetPoint (const uiNode_t *node, vec2_t pos, int pointDirection)
 return a relative position of a point into a node.
struct uiNode_sUI_GetNode (const struct uiNode_s *const node, const char *name)
void UI_InsertNode (struct uiNode_s *const node, struct uiNode_s *prevNode, struct uiNode_s *newNode)
 Insert a node next another one into a node. If prevNode is NULL add the node on the head of the window.
void UI_AppendNode (struct uiNode_s *const node, struct uiNode_s *newNode)
 add a node at the end of the node child
uiNode_tUI_RemoveNode (uiNode_t *const node, uiNode_t *child)
 Remove a node from a parent node.
void UI_UpdateRoot (uiNode_t *node, uiNode_t *newRoot)

Detailed Description

Definition in file ui_node_abstractnode.h.


Function Documentation

void UI_AppendNode ( struct uiNode_s *const   node,
struct uiNode_s newNode 
)

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

float UI_GetFloatFromNodeProperty ( const struct uiNode_s node,
const value_t property 
)
struct uiNode_s* UI_GetNode ( const struct uiNode_s *const   node,
const char *  name 
) [read]
void UI_GetNodeAbsPos ( const struct uiNode_s node,
vec2_t  pos 
)
const char* UI_GetStringFromNodeProperty ( const uiNode_t node,
const value_t property 
)

Return a string from a node property.

Parameters:
[in] node Requested node
[in] property Requested property
Returns:
Return a string value of a property, else NULL, if the type is not supported

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.

Note:
Sanity check whether node is null included

Definition at line 180 of file ui_node_abstractnode.c.

References Com_Printf(), uiNode_s::invis, and qtrue.

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.

Parameters:
[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 ( struct uiNode_s node  ) 
void UI_NodeAbsoluteToRelativePos ( const struct uiNode_s node,
int *  x,
int *  y 
)
void UI_NodeGetPoint ( const uiNode_t node,
vec2_t  pos,
int  direction 
)

return a relative position of a point into a node.

Parameters:
[in] node Requested node
[out] pos Result position
[in] direction 
Note:
For example we can request the right-bottom corner with LAYOUTALIGN_BOTTOMRIGHT

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

qboolean UI_NodeInstanceOf ( const uiNode_t node,
const char *  behaviourName 
)
qboolean UI_NodeInstanceOfPointer ( const uiNode_t node,
const uiBehaviour_t behaviour 
)

Check the node inheritance.

Parameters:
[in] node Requested node
[in] behaviour Behaviour we check
Returns:
True if the node inherits from the behaviour

Definition at line 55 of file ui_node_abstractnode.c.

References uiNode_s::behaviour, qfalse, qtrue, and uiBehaviour_s::super.

void UI_NodeRelativeToAbsolutePoint ( const uiNode_t node,
vec2_t  pos 
)

Update a relative point to an absolute one.

Parameters:
[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().

qboolean UI_NodeSetProperty ( uiNode_t node,
const value_t property,
const char *  value 
)
void UI_NodeSetPropertyFromRAW ( uiNode_t node,
const value_t property,
void *  rawValue,
int  rawType 
)
void UI_NodeSetSize ( uiNode_t node,
vec2_t  size 
)

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  ) 
uiNode_t* UI_RemoveNode ( uiNode_t *const   node,
uiNode_t child 
)

Remove a node from a parent node.

Returns:
The removed node, else NULL
Parameters:
[in] node Node where is the child
[in] child Node we want to remove

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.

Note:
Sanity check whether node is null included

Definition at line 192 of file ui_node_abstractnode.c.

References Com_Printf(), uiNode_s::invis, and qfalse.

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

Generated by  doxygen 1.6.2