42static void UI_NodeGetProperty_f (
void)
56 if (node ==
nullptr) {
61 if (property ==
nullptr) {
62 Com_Printf(
"UI_NodeGetProperty_f: Property from path '%s' doesn't exist\n",
Cmd_Argv(1));
82static void UI_NodeSetProperty_f (
void)
221 if (!node->
dragdrop)
return isDropped;
277 if (node->
parent !=
nullptr)
298 Com_Printf(
"UI_AbstractNodeCallRemovaAllChild: Invalid number of parameters\n");
312 Com_Printf(
"UI_AbstractNodeCallCreateChild: Invalid number of parameters\n");
320 if (existingNode !=
nullptr) {
321 Com_Printf(
"UI_AbstractNodeCallCreateChild: Node with name '%s' already exists\n",
name);
331 if (child ==
nullptr) {
332 Com_Printf(
"UI_AbstractNodeCallCreateChild: Impossible to create the node\n");
342 Com_Printf(
"UI_AbstractNodeCallDelete: Invalid number of parameters\n");
351 Com_Printf(
"UI_AbstractNodeCallDeleteTimed: Invalid number of parameters\n");
355 const int ms = atoi(msStr);
390 if (node->
onClick !=
nullptr) {
474 behaviour->
name =
"abstractnode";
608 Cmd_AddCommand(
"debug_mnsetnodeproperty", UI_NodeSetProperty_f,
"Set a node property");
609 Cmd_AddCommand(
"debug_mngetnodeproperty", UI_NodeGetProperty_f,
"Get a node property");
int CL_Milliseconds(void)
virtual bool onKeyReleased(uiNode_t *node, unsigned int key, unsigned short unicode)
virtual void onMouseEnter(uiNode_t *node)
virtual bool onKeyPressed(uiNode_t *node, unsigned int key, unsigned short unicode)
virtual void onFocusGained(uiNode_t *node)
virtual bool onDndMove(uiNode_t *node, int x, int y)
virtual bool onDndFinished(uiNode_t *node, bool isDropped)
virtual void onDndLeave(uiNode_t *node)
virtual void drawTooltip(const uiNode_t *node, int x, int y) const
virtual void onSizeChanged(uiNode_t *node)
Callback stub.
virtual void onMiddleClick(uiNode_t *node, int x, int y)
virtual void onLeftClick(uiNode_t *node, int x, int y)
virtual void onFocusLost(uiNode_t *node)
virtual void onRightClick(uiNode_t *node, int x, int y)
virtual void onMouseLeave(uiNode_t *node)
virtual bool onScroll(uiNode_t *node, int deltaX, int deltaY)
virtual bool onDndEnter(uiNode_t *node)
virtual void doLayout(uiNode_t *node)
Call to update the node layout. This common code revalidates the node tree.
virtual bool onDndDrop(uiNode_t *node, int x, int y)
virtual void onWindowClosed(uiNode_t *node)
virtual void initNodeDynamic(uiNode_t *node)
virtual void onWindowOpened(uiNode_t *node, linkedList_t *params)
virtual void onPropertyChanged(uiNode_t *node, const value_t *property)
virtual void onLoading(uiNode_t *node)
virtual void onLoaded(uiNode_t *node)
virtual void deleteNode(uiNode_t *node)
virtual void onWindowActivate(uiNode_t *node)
virtual void clone(uiNode_t const *source, uiNode_t *clone)
virtual void initNode(uiNode_t *node)
virtual void onActivate(uiNode_t *node)
Activate the node. Can be used without the mouse (ie. a button will execute onClick).
const char * Cmd_Argv(int arg)
Returns a given argument.
int Cmd_Argc(void)
Return the number of arguments of the current command. "command parameter" will result in a argc of 2...
void Cmd_AddCommand(const char *cmdName, xcommand_t function, const char *desc)
Add a new command to the script interface.
void Com_Printf(const char *const fmt,...)
void HASH_DeleteTable(hashTable_s **t)
Deletes a hash table and sets the pointer to NULL.
Header file for hashtable.
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
void Com_RegisterConstInt(const char *name, int value)
Register mappings between script strings and enum values for values of the type V_INT.
Header for lua script functions.
node behaviour, how a node work
Contain the context of the calling of a function.
Atomic structure used to define most of the UI.
struct uiAction_s * onWheelDown
struct uiAction_s * onMouseLeave
LUA_EVENT lua_onDragDropFinished
LUA_EVENT lua_onFocusLost
LUA_EVENT lua_onDragDropMove
LUA_EVENT lua_onVisibleWhen
LUA_EVENT lua_onKeyReleased
LUA_EVENT lua_onDragDropEnter
LUA_EVENT lua_onDragDropLeave
LUA_EVENT lua_onWheelDown
LUA_EVENT lua_onDragDropDrop
uiBehaviour_t * behaviour
struct uiAction_s * onWheel
struct uiAction_s * onMiddleClick
LUA_EVENT lua_onRightClick
LUA_EVENT lua_onMouseLeave
LUA_EVENT lua_onMiddleClick
hashTable_s * nodeMethods
LUA_EVENT lua_onKeyPressed
LUA_EVENT lua_onMouseEnter
struct uiAction_s * onClick
struct uiAction_s * onRightClick
struct uiAction_s * onMouseEnter
struct uiAction_s * onWheelUp
LUA_EVENT lua_onFocusGained
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
const char * UI_GetParam(const uiCallContext_t *context, int paramID)
int UI_GetParamNumber(const uiCallContext_t *context)
const value_t * UI_GetPropertyFromBehaviour(const uiBehaviour_t *behaviour, const char *name)
Get a property from a behaviour or his inheritance It use a dichotomic search.
const struct value_s * UI_RegisterNodeMethod(uiBehaviour_t *behaviour, const char *name, uiNodeMethod_t function)
Register a node method to a behaviour.
#define UI_RegisterNodeProperty(BEHAVIOUR, NAME, TYPE, OBJECTTYPE, ATTRIBUTE)
Initialize a property.
uiNode_t * UI_GetComponent(const char *name)
Searches all components for the specified one.
bool UI_ExecuteLuaEventScript_DragDrop(uiNode_t *node, LUA_EVENT event, bool &result)
Executes a lua event handler for dragdrop interaction.
bool UI_ExecuteLuaEventScript_DragDrop_XY(uiNode_t *node, LUA_EVENT event, int x, int y, bool &result)
Executes a lua event handler for dragdrop interaction.
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
bool UI_ExecuteLuaEventScript_XY(uiNode_t *node, LUA_EVENT event, int x, int y)
Executes a lua event handler with (x,y) argument.
bool UI_ExecuteLuaEventScript_DragDrop_IsDropped(uiNode_t *node, LUA_EVENT event, bool isDropped, bool &result)
Executes a lua event handler for dragdrop interaction.
bool UI_ExecuteLuaEventScript_Key(uiNode_t *node, LUA_EVENT event, unsigned int key, unsigned short unicode)
Executes a lua event handler with (keycode,unicode) argument.
bool UI_ExecuteLuaEventScript_DxDy(uiNode_t *node, LUA_EVENT event, int dx, int dy)
Executes a lua event handler with (dx,dy) argument.
Basic lua initialization for the ui.
void * UI_SWIG_TypeQuery(const char *name)
This function queries the SWIG type table for a type information structure. It is used in combination...
void UI_Node_WindowClosed(uiNode_t *node)
const char * UI_GetStringFromNodeProperty(const uiNode_t *node, const value_t *property)
Return a string from a node property.
void UI_Node_SizeChanged(uiNode_t *node)
void UI_Node_DoLayout(uiNode_t *node)
void UI_Invalidate(uiNode_t *node)
Invalidate a node and all his parent to request a layout update.
void UI_AppendNode(uiNode_t *const parent, uiNode_t *newNode)
add a node at the end of the node child
void UI_Node_WindowActivate(uiNode_t *node)
uiNode_t * UI_GetNode(const uiNode_t *node, const char *name)
Search a child node by given name.
bool UI_NodeSetProperty(uiNode_t *node, const value_t *property, const char *value)
Set node property.
void UI_Node_WindowOpened(uiNode_t *node, linkedList_t *params)
float UI_GetFloatFromNodeProperty(const uiNode_t *node, const value_t *property)
Return a float from a node property.
static void UI_AbstractNodeCallRemovaAllChild(uiNode_t *node, const uiCallContext_t *context)
static const value_t * propertyHeight
static const value_t * propertyWidth
static void UI_AbstractNodeCallCreateChild(uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractNodeCallDeleteTimed(uiNode_t *node, const uiCallContext_t *context)
static void UI_AbstractNodeCallDelete(uiNode_t *node, const uiCallContext_t *context)
void UI_RegisterAbstractNode(uiBehaviour_t *behaviour)
static const value_t * propertySize
static void UI_AbstractNodeVisibilityChange(uiNode_t *node)
static const value_t * propertyInvis
SharedPtr< uiNode > UINodePtr
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_ReadNo...
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
void UI_DeleteAllChild(uiNode_t *node)
Remove all child from a node (only remove dynamic memory allocation nodes).
uiNode_t * UI_CloneNode(const uiNode_t *node, uiNode_t *newWindow, bool recursive, const char *newName, bool isDynamic)
Clone a 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, const uiNode_t *iterationNode, uiNode_t **resultNode, const value_t **resultProperty, value_t *luaMethod)
Read a path and return every we can use (node and property).
void UI_DeleteNode(uiNode_t *node)
#define V_CVAR_OR_LONGSTRING
void UI_PlaySound(const char *soundFile)
Plays a ui sound.