ui_node_abstractnode.c File Reference

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"
Include dependency graph for ui_node_abstractnode.c:

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_tUI_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_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)
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_tpropertyWidth
static const value_tpropertyHeight
static const value_tpropertySize
static const value_tpropertyInvis
static const value_t properties []
 valid properties for a node

Detailed Description

Every node extends this node.

Definition in file ui_node_abstractnode.c.


Function Documentation

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

static void UI_AbstractNodeClone ( const uiNode_t source,
uiNode_t clone 
) [static]

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]
static qboolean UI_AbstractNodeDNDDrop ( uiNode_t node,
int  x,
int  y 
) [static]

Definition at line 609 of file ui_node_abstractnode.c.

References qtrue.

Referenced by UI_RegisterAbstractNode().

static qboolean UI_AbstractNodeDNDEnter ( uiNode_t node  )  [static]

Definition at line 595 of file ui_node_abstractnode.c.

References qfalse.

Referenced by UI_RegisterAbstractNode().

static qboolean UI_AbstractNodeDNDFinished ( uiNode_t node,
qboolean  isDroped 
) [static]

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

static qboolean UI_AbstractNodeDNDMove ( uiNode_t node,
int  x,
int  y 
) [static]

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]
static void UI_AbstractNodePropertyChanged ( uiNode_t node,
const value_t property 
) [static]
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().

void UI_AppendNode ( uiNode_t *const   node,
uiNode_t 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 uiNode_t node,
const value_t property 
)

Return a float from a node property.

Parameters:
[in] node Requested node
[in] property Requested 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 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().

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

Search a child node by given name.

Note:
Only search with one depth

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

void UI_GetNodeAbsPos ( const uiNode_t node,
vec2_t  pos 
)

Returns the absolute position of a node.

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

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 ( uiNode_t node  ) 
void UI_NodeAbsoluteToRelativePos ( const uiNode_t 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 behaviour  ) 
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 ( uiNode_t node  ) 

Variable Documentation

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.


Generated by  doxygen 1.6.2