#include "ui_main.h"
#include "ui_internal.h"
#include "ui_nodes.h"
#include "ui_parse.h"
#include "ui_input.h"
#include "node/ui_node_abstractnode.h"
#include "node/ui_node_abstractscrollbar.h"
#include "node/ui_node_abstractoption.h"
#include "node/ui_node_abstractvalue.h"
#include "node/ui_node_bar.h"
#include "node/ui_node_base.h"
#include "node/ui_node_baseinventory.h"
#include "node/ui_node_button.h"
#include "node/ui_node_checkbox.h"
#include "node/ui_node_controls.h"
#include "node/ui_node_video.h"
#include "node/ui_node_container.h"
#include "node/ui_node_custombutton.h"
#include "node/ui_node_editor.h"
#include "node/ui_node_ekg.h"
#include "node/ui_node_image.h"
#include "node/ui_node_item.h"
#include "node/ui_node_linechart.h"
#include "node/ui_node_map.h"
#include "node/ui_node_material_editor.h"
#include "node/ui_node_messagelist.h"
#include "node/ui_node_model.h"
#include "node/ui_node_option.h"
#include "node/ui_node_optionlist.h"
#include "node/ui_node_optiontree.h"
#include "node/ui_node_panel.h"
#include "node/ui_node_radar.h"
#include "node/ui_node_radiobutton.h"
#include "node/ui_node_rows.h"
#include "node/ui_node_selectbox.h"
#include "node/ui_node_sequence.h"
#include "node/ui_node_string.h"
#include "node/ui_node_special.h"
#include "node/ui_node_spinner.h"
#include "node/ui_node_tab.h"
#include "node/ui_node_tbar.h"
#include "node/ui_node_text.h"
#include "node/ui_node_text2.h"
#include "node/ui_node_textlist.h"
#include "node/ui_node_textentry.h"
#include "node/ui_node_keybinding.h"
#include "node/ui_node_todo.h"
#include "node/ui_node_vscrollbar.h"
#include "node/ui_node_zone.h"
Go to the source code of this file.
Defines | |
#define | NUMBER_OF_BEHAVIOURS lengthof(registerFunctions) |
Typedefs | |
typedef void(* | registerFunction_t )(uiBehaviour_t *node) |
Functions | |
const value_t * | UI_GetPropertyFromBehaviour (const uiBehaviour_t *behaviour, const char *name) |
Get a property from a behaviour or his inheritance. | |
qboolean | UI_CheckVisibility (uiNode_t *node) |
Check the if conditions for a given node. | |
const char * | UI_GetPath (const uiNode_t *node) |
Return a path from a window to a node. | |
void | UI_ReadNodePath (const char *path, const uiNode_t *relativeNode, uiNode_t **resultNode, const value_t **resultProperty) |
Read a path and return every we can use (node and property). | |
uiNode_t * | UI_GetNodeByPath (const char *path) |
Return a node by a path name (names with dot separation) It is a simplification facade over UI_ReadNodePath. | |
static uiNode_t * | UI_AllocNodeWithoutNew (const char *name, const char *type, qboolean isDynamic) |
Allocate a node into the UI memory (do notr call behaviour->new). | |
uiNode_t * | UI_AllocNode (const char *name, const char *type, qboolean isDynamic) |
Allocate a node into the UI memory. | |
static uiNode_t * | UI_GetNodeInTreeAtPosition (uiNode_t *node, int rx, int ry) |
Return the first visible node at a position. | |
uiNode_t * | UI_GetNodeAtPosition (int x, int y) |
Return the first visible node at a position. | |
uiBehaviour_t * | UI_GetNodeBehaviour (const char *name) |
Return a node behaviour by name. | |
uiBehaviour_t * | UI_GetNodeBehaviourByIndex (int index) |
int | UI_GetNodeBehaviourCount (void) |
void | UI_DeleteAllChild (uiNode_t *node) |
Remove all child from a node (only remove dynamic memory allocation nodes). | |
void | UI_DeleteNode (uiNode_t *node) |
uiNode_t * | UI_CloneNode (const uiNode_t *node, uiNode_t *newWindow, qboolean recursive, const char *newName, qboolean isDynamic) |
Clone a node. | |
static void | UI_InitializeNodeBehaviour (uiBehaviour_t *behaviour) |
void | UI_InitNodes (void) |
Variables | |
static const registerFunction_t | registerFunctions [] |
List of functions to register nodes. | |
static uiBehaviour_t | nodeBehaviourList [NUMBER_OF_BEHAVIOURS] |
List of all node behaviours, indexes by nodetype num. | |
static const int | virtualFunctions [] |
position of virtual function into node behaviour |
Definition in file ui_nodes.c.
#define NUMBER_OF_BEHAVIOURS lengthof(registerFunctions) |
Definition at line 136 of file ui_nodes.c.
Referenced by UI_GetNodeBehaviour(), UI_GetNodeBehaviourCount(), and UI_InitNodes().
typedef void(* registerFunction_t)(uiBehaviour_t *node) |
Definition at line 76 of file ui_nodes.c.
Allocate a node into the UI memory.
[in] | name | Name of the new node, else NULL if we dont want to edit it. |
[in] | type | Name of the node behavior |
[in] | isDynamic | Allocate a node in static or dynamic memory |
Definition at line 376 of file ui_nodes.c.
References uiNode_s::behaviour, uiNode_s::dynamic, uiBehaviour_s::new, and UI_AllocNodeWithoutNew().
Referenced by UI_AbstractNodeCallCreateChild(), UI_AddOption(), UI_ConFuncNodeLoaded(), UI_ParseNode(), UI_ParseWindow(), and UI_WindowNodeLoaded().
static uiNode_t* UI_AllocNodeWithoutNew | ( | const char * | name, | |
const char * | type, | |||
qboolean | isDynamic | |||
) | [static] |
Allocate a node into the UI memory (do notr call behaviour->new).
[in] | name | Name of the new node, else NULL if we dont want to edit it. |
[in] | type | Name of the node behavior |
[in] | isDynamic | Allocate a node in static or dynamic memory |
Definition at line 321 of file ui_nodes.c.
References uiGlobal_s::adata, uiGlobal_s::adataize, uiNode_s::behaviour, Com_Error(), Com_Printf(), uiGlobal_s::curadata, uiNode_s::dynamic, ERR_FATAL, uiBehaviour_s::extraDataSize, uiBehaviour_s::isAbstract, uiBehaviour_s::loading, Mem_PoolAlloc, uiNode_s::name, uiGlobal_s::numNodes, Q_strncpyz(), qtrue, ui_dynPool, UI_GetNodeBehaviour(), and ui_global.
Referenced by UI_AllocNode(), and UI_CloneNode().
Check the if conditions for a given node.
Definition at line 167 of file ui_nodes.c.
References qfalse, qtrue, uiCallContext_s::source, UI_GetBooleanFromExpression(), uiCallContext_s::useCmdParam, and uiNode_s::visibilityCondition.
Referenced by UI_CheckMouseMove(), UI_DrawModelNode(), UI_DrawNode(), and UI_GetNodeInTreeAtPosition().
uiNode_t* UI_CloneNode | ( | const uiNode_t * | node, | |
uiNode_t * | newWindow, | |||
qboolean | recursive, | |||
const char * | newName, | |||
qboolean | isDynamic | |||
) |
Clone a node.
[in] | node | Node to clone |
[in] | recursive | True if we also must clone subnodes |
[in] | newWindow | Window where the nodes must be add (this function only link node into window, not window into the new node) |
[in] | newName | New node name, else NULL to use the source name |
[in] | isDynamic | Allocate a node in static or dynamic memory |
exclude rect is not safe cloned.
actions are not cloned. It is be a problem if we use add/remove listener into a cloned node.
Definition at line 594 of file ui_nodes.c.
References uiNode_s::behaviour, uiBehaviour_s::clone, Com_Printf(), uiNode_s::dynamic, uiBehaviour_s::extraDataSize, uiNode_s::firstChild, uiNode_s::lastChild, uiNode_s::name, uiBehaviour_s::name, uiBehaviour_s::new, uiNode_s::next, uiNode_s::parent, Q_strncpyz(), uiNode_s::root, uiNode_s::super, UI_AllocNodeWithoutNew(), and UI_AppendNode().
Referenced by UI_AbstractNodeCallCreateChild(), UI_ParseNode(), and UI_ParseWindow().
void UI_DeleteAllChild | ( | uiNode_t * | node | ) |
Remove all child from a node (only remove dynamic memory allocation nodes).
node | The node we want to clean |
Definition at line 529 of file ui_nodes.c.
References uiNode_s::firstChild, uiNode_s::next, next, and UI_DeleteNode().
Referenced by UI_AbstractNodeCallRemovaAllChild(), and UI_DeleteNode().
void UI_DeleteNode | ( | uiNode_t * | node | ) |
Delete the node and remove it from his parent
node | The node we want to delete |
Definition at line 544 of file ui_nodes.c.
References uiNode_s::behaviour, byte, Com_Printf(), uiBehaviour_s::delete, uiNode_s::dynamic, uiNode_s::firstChild, uiNode_s::parent, uiBehaviour_s::properties, uiBehaviour_s::super, UI_DeleteAllChild(), UI_FreeStringProperty(), UI_GetPath(), UI_RemoveNode(), V_UI_CVAR, and V_UI_MASK.
Referenced by UI_AbstractNodeCallDelete(), UI_DeleteAllChild(), and UI_DeleteOption().
uiNode_t* UI_GetNodeAtPosition | ( | int | x, | |
int | y | |||
) | [read] |
Return the first visible node at a position.
Definition at line 458 of file ui_nodes.c.
References pos, UI_GetNodeInTreeAtPosition(), ui_global, UI_Validate(), UI_WindowIsDropDown(), UI_WindowIsFullScreen(), UI_WindowIsModal(), uiGlobal_s::windowStack, and uiGlobal_s::windowStackPos.
Referenced by UI_DNDMouseMove(), UI_EditorNodeDrawOverWindow(), UI_EditorNodeMouseDown(), and UI_MouseMove().
uiBehaviour_t* UI_GetNodeBehaviour | ( | const char * | name | ) |
Return a node behaviour by name.
[in] | name | Behaviour name requested |
Definition at line 492 of file ui_nodes.c.
References NUMBER_OF_BEHAVIOURS.
Referenced by UI_AllocNodeWithoutNew(), UI_InitializeNodeBehaviour(), UI_ParseNode(), and UI_Shutdown().
uiBehaviour_t* UI_GetNodeBehaviourByIndex | ( | int | index | ) |
Definition at line 515 of file ui_nodes.c.
int UI_GetNodeBehaviourCount | ( | void | ) |
Definition at line 520 of file ui_nodes.c.
References NUMBER_OF_BEHAVIOURS.
uiNode_t* UI_GetNodeByPath | ( | const char * | path | ) |
Return a node by a path name (names with dot separation) It is a simplification facade over UI_ReadNodePath.
// get keylist node from options_keys node from options window node = UI_GetNodeByPath("options.options_keys.keylist"); @sa UI_ReadNodePath
FIXME warning if it return a peroperty
Definition at line 304 of file ui_nodes.c.
References UI_ReadNodePath().
Referenced by CL_NationStatsUpdate_f(), GAME_CP_CampaignListClick_f(), UI_ActiveVScrollbarNode_f(), UI_AddListener_f(), UI_FireInit_f(), UI_PushDropDownWindow_f(), UI_RemoveListener_f(), and UI_TextScrollEnd().
Return the first visible node at a position.
[in] | node | Node where we must search |
[in] | rx | Relative x position to the parent of the node |
[in] | ry | Relative y position to the parent of the node |
Definition at line 394 of file ui_nodes.c.
References uiNode_s::behaviour, uiNode_s::excludeRect, uiNode_s::excludeRectNum, uiNode_s::firstChild, uiBehaviour_s::getClientPosition, uiNode_s::ghost, i, uiNode_s::invis, uiBehaviour_s::isVirtual, uiNode_s::next, uiExcludeRect_s::pos, uiNode_s::pos, uiExcludeRect_s::size, uiNode_s::size, UI_CheckVisibility(), and UI_DebugMode().
Referenced by UI_GetNodeAtPosition().
const char* UI_GetPath | ( | const uiNode_t * | node | ) |
Return a path from a window to a node.
Definition at line 182 of file ui_nodes.c.
References i, MAX_VAR, name, uiNode_s::parent, and Q_strcat().
Referenced by Key_WriteBindings(), UI_AbstractOptionGetCurrentValue(), UI_AddListener(), UI_ButtonNodeLoaded(), UI_ColumnLayout(), UI_ConFuncNodeLoaded(), UI_DeleteNode(), UI_ExecuteCallAction(), UI_ExecuteSetAction(), UI_FuncNodeLoaded(), UI_GenInjectedString(), UI_GetFloatFromNodeProperty(), UI_GetNodeAbsPos(), UI_GetNodeFromExpression(), UI_GetStringFromNodeProperty(), UI_ImageNodeLoaded(), UI_InitRawActionValue(), UI_LineChartNodeDraw(), UI_ModelNodeLoaded(), UI_NodeSetProperty(), UI_NodeSetPropertyFromRAW(), UI_PanelNodeLoaded(), UI_ParseActionList(), UI_ParseCallAction(), UI_ParseEventProperty(), UI_ParseExcludeRect(), UI_ParseNode(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ParseSetAction(), UI_RadioButtonNodeActivate(), UI_TabNodeInit(), UI_TextNodeLoaded(), UI_VScrollbarNodeLoaded(), UI_WindowNodeClone(), and UI_WindowNodeSetRenderNode().
const value_t* UI_GetPropertyFromBehaviour | ( | const uiBehaviour_t * | behaviour, | |
const char * | name | |||
) | [read] |
Get a property from a behaviour or his inheritance.
[in] | behaviour | Context behaviour |
[in] | name | Property name we search |
Definition at line 149 of file ui_nodes.c.
References uiBehaviour_s::properties, uiBehaviour_s::super, and UI_FindPropertyByName().
Referenced by UI_ConFuncNodeClose(), UI_ConFuncNodeInit(), UI_FuncNodeLoaded(), UI_GenInjectedString(), UI_GetReferenceFloat(), UI_GetReferenceString(), UI_InitializeNodeBehaviour(), UI_PanelPropertyChanged(), UI_ParseNodeBody(), UI_ParseNodeProperties(), UI_ReadNodePath(), UI_RegisterAbstractNode(), UI_RegisterOptionNode(), and UI_RegisterPanelNode().
static void UI_InitializeNodeBehaviour | ( | uiBehaviour_t * | behaviour | ) | [static] |
Initializes the inheritance (every node extends the abstract node)
behaviour | The behaviour to initialize |
<
<
Definition at line 676 of file ui_nodes.c.
References byte, Com_Error(), ERR_FATAL, uiBehaviour_s::extends, uiBehaviour_s::extraDataSize, i, uiBehaviour_s::isInitialized, uiBehaviour_s::name, pos, uiBehaviour_s::properties, uiBehaviour_s::propertyCount, qtrue, value_s::string, uiBehaviour_s::super, UI_GetNodeBehaviour(), UI_GetPropertyFromBehaviour(), V_UI_NODEMETHOD, and virtualFunctions.
Referenced by UI_InitNodes().
void UI_InitNodes | ( | void | ) |
Definition at line 752 of file ui_nodes.c.
References Com_Error(), ERR_FATAL, i, uiBehaviour_s::name, NUMBER_OF_BEHAVIOURS, registerFunctions, and UI_InitializeNodeBehaviour().
Referenced by UI_Init().
void UI_ReadNodePath | ( | const char * | path, | |
const uiNode_t * | relativeNode, | |||
uiNode_t ** | resultNode, | |||
const value_t ** | resultProperty | |||
) |
Read a path and return every we can use (node and property).
The path token must be a window name, and then node child. Reserved token 'root' and 'parent' can be used to navigate. If relativeNode is set, the path can start with reserved token 'this', 'root' and 'parent' (relative to this node). The function can return a node property by using a '@', the path 'foo@pos' will return the window foo and the property 'pos' from the 'window' behaviour.
[in] | path | Path to read. Contain a node location with dot seprator and a facultative property |
[in] | relativeNode | relative node where the path start. It allow to use facultative command to start the path (this, parent, root). |
[out] | resultNode | Node found. Else NULL. |
[out] | resultProperty | Property found. Else NULL. TODO Speed up, evilly used function, use strncmp instead of using buffer copy (name[MAX_VAR]) |
FIXME use a warning instead of an assert
Definition at line 222 of file ui_nodes.c.
References uiNode_s::behaviour, MAX_VAR, name, uiNode_s::parent, Q_strncpyz(), uiNode_s::root, UI_GetNode(), UI_GetPropertyFromBehaviour(), UI_GetWindow(), ui_windowBehaviour, and UI_WindowNodeGetIndexedChild().
Referenced by UI_AddListener_f(), UI_ExecuteCallAction(), UI_ExecuteSetAction(), UI_GenInjectedString(), UI_GetNodeByPath(), UI_GetNodeFromExpression(), UI_RemoveListener_f(), and UI_SetKeyBinding().
uiBehaviour_t nodeBehaviourList[NUMBER_OF_BEHAVIOURS] [static] |
List of all node behaviours, indexes by nodetype num.
Definition at line 141 of file ui_nodes.c.
const registerFunction_t registerFunctions[] [static] |
List of functions to register nodes.
Definition at line 82 of file ui_nodes.c.
Referenced by UI_InitNodes().
const int virtualFunctions[] [static] |
position of virtual function into node behaviour
Definition at line 638 of file ui_nodes.c.
Referenced by UI_InitializeNodeBehaviour().