121 Com_Printf(
"UI_ExecuteLuaEventScript_ReturnBool\n");
126 Com_Printf(
"UI_ExecuteLuaEventScript_ReturnBool\n");
173 Com_Printf(
"UI_ExecuteLuaEventScript_DxDy\n");
216 Com_Printf(
"UI_ExecuteLuaEventScript_DragDrop\n");
245 Com_Printf(
"UI_ExecuteLuaEventScript_DragDrop_XY\n");
272 Com_Printf(
"UI_ExecuteLuaEventScript_DragDrop_IsDropped\n");
301 for (
int i = 0;
i < nparams;
i++) {
302 const char* value =
const_cast<const char*
>((
char*)
LIST_GetByIdx(params,
i));
356 Com_Printf(
"UI_ExecuteNodeMethod_ByName: calling undefined method %s on node %s\n",
name, node->
name);
389 int ntext = strlen(*text);
432 uiNode_t* inherited_control =
nullptr;
440 if (!inherited_control) {
444 behaviour = inherited_control->
behaviour;
451 if (node_super->
behaviour != behaviour) {
452 Com_Printf(
"UI_CreateControl: behaviour [%s] of super does not match requested type [%s]\n", behaviour->
name, node_super->
behaviour->
name);
460 Com_Printf(
"UI_CreateControl: \"%s\" is not a well formed node name ([a-zA-Z_][a-zA-Z0-9_]*)\n",
name);
464 Com_Printf(
"UI_CreateControl: \"%s\" is a reserved token, we can't call a node with it\n",
name);
479 const uiBehaviour_t* test = (behaviour !=
nullptr) ? behaviour : (inherited_control !=
nullptr) ? inherited_control->
behaviour :
nullptr;
491 else if (inherited_control) {
502 if (node_super || inherited_control)
516 char* indent =
new char[
level + 1];
553 Com_Printf(
"UI_CreateComponent: \"%s\" is not a well formed node name ([a-zA-Z_][a-zA-Z0-9_]*)\n",
name);
557 Com_Printf(
"UI_CreateComponent: \"%s\" is a reserved token, we can't call a node with it\n",
name);
567 Com_Printf(
"UI_CreateComponent: node behaviour/control '%s' doesn't exist\n",
type);
576 if (node_super->
behaviour != behaviour) {
577 Com_Printf(
"UI_CreateComponent: behaviour [%s] of super does not match requested type [%s]\n", behaviour->
name, node_super->
behaviour->
name);
628 Com_Printf(
"UI_CreateWindow: \"%s\" is not a well formed node name ([a-zA-Z_][a-zA-Z0-9_]*)\n",
name);
633 Com_Printf(
"UI_CreateWindow: \"%s\" is a reserved token, we can't call a node with it (node \"%s\")\n",
name,
name);
644 Com_Printf(
"UI_CreateWindow: %s \"%s\" with same name found, second ignored\n",
type,
name);
656 if (super !=
nullptr) {
659 if (superWindow ==
nullptr) {
660 Sys_Error(
"Could not get the super window \"%s\"", super);
665 window->
root = window;
lua_State * CL_GetLuaState(void)
Returns the lua state for the client side.
void CL_RegisterCallback(const char *key, LUA_FUNCTION fnc)
Registers a lua callback function with a key.
void CL_ExecuteCallback(lua_State *L, const char *key)
Calls the registered lua onload callback function.
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 Com_DPrintf(int level, const char *fmt,...)
A Com_Printf that only shows up if the "developer" cvar is set.
void Com_Error(int code, const char *fmt,...)
void Com_Printf(const char *const fmt,...)
Cvar (console variable) header file.
Defined CONSTANTS (Macros are elsewhere).
void Sys_Error(const char *error,...)
Header file for hashtable.
void * LIST_GetByIdx(linkedList_t *list, int index)
Get an entry of a linked list by its index in the list.
#define LIST_Foreach(list, type, var)
Iterates over a linked list, it's safe to delete the returned entry from the list while looping over ...
QGL_EXTERN GLint GLenum type
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Header for lua script functions.
int LUA_FUNCTION
callback signatures for functions defined in Lua
int LUA_EVENT
holds a reference to a lua event handler
void Q_strncpyz(char *dest, const char *src, size_t destsize)
Safe strncpy that ensures a trailing zero.
node behaviour, how a node work
Atomic structure used to define most of the UI.
uiBehaviour_t * behaviour
uiNode_t * UI_GetComponent(const char *name)
Searches all components for the specified one.
void UI_InsertComponent(uiNode_t *component)
Add a new component to the list of all components.
Internal data use by the UI package.
const char * UI_Node_TypeOf(uiNode_t *node)
void UI_PrintNodeTree(uiNode_t *node, int level)
uiNode_t * UI_CreateControl(uiNode_t *parent, const char *type, const char *name, const char *super)
Create a new control inherited from a given node class or other node.
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.
uiNode_t * UI_CreateWindow(const char *type, const char *name, const char *super)
Create a window node with specified type and inheritance.
bool UI_ExecuteLuaMethod(uiNode_t *node, LUA_FUNCTION fcn, linkedList_t *params, int nparams)
Executes a lua based method defined on the behaviour class of a node.
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_ParseAndLoadLuaScript(const char *name, const char **text)
Parses and loads a .ufo file holding a lua script.
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.
void UI_ShutdownLua(void)
Performs UI specific lua shutdown. Call this before CL_ShutdownLua.
bool UI_ExecuteLuaMethod_ByName(uiNode_t *node, const char *name, linkedList_t *params, int nparams)
Executes a lua based method defined on the behaviour class of a node.
uiNode_t * UI_CreateComponent(const char *type, const char *name, const char *super)
Create a new component inherited from a given node class or other node.
void UI_InitLua(void)
Performs UI specific initialization. Call this after CL_InitLua.
void UI_CallHandler_OnLoad(lua_State *L, const char *key)
Call the registered callback handler. This stub primarily exists should the signature of the call cha...
bool UI_ExecuteLuaConFunc(uiNode_t *node, LUA_FUNCTION fcn)
Executes a lua based confunc node.
void UI_RegisterHandler_OnLoad(LUA_FUNCTION fcn)
Register global lua callback function called after loading the module.
bool UI_ExecuteLuaEventScript_ParamList(uiNode_t *node, LUA_EVENT event, linkedList_t *params)
Executes a lua event handler with string parameter list.
bool UI_ExecuteLuaEventScript_DxDy(uiNode_t *node, LUA_EVENT event, int dx, int dy)
Executes a lua event handler with (dx,dy) argument.
bool UI_ExecuteLuaEventScript_ReturnBool(uiNode_t *node, LUA_EVENT event, bool &result)
Executes a lua event handler and returns the result as a boolean.
Basic lua initialization for the ui.
#define SWIG_NewPointerObj(L, ptr, type, owner)
void UI_UpdateRoot(uiNode_t *node, uiNode_t *newRoot)
void UI_Node_Loaded(uiNode_t *node)
bool UI_GetNodeMethod(const uiNode_t *node, const char *name, LUA_METHOD &fcn)
Finds the lua based method on this node or its super.
void UI_AppendNode(uiNode_t *const parent, uiNode_t *newNode)
add a node at the end of the node child
uiNode_t * UI_GetNode(const uiNode_t *node, const char *name)
Search a child node by given name.
C interface to allow to access to cpp node code.
uiBehaviour_t * UI_GetNodeBehaviour(const char *name)
Return a node behaviour by name.
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
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.
bool UI_TokenIsName(const char *name, bool isQuoted)
bool UI_TokenIsReserved(const char *name)
void UI_InsertWindow(uiNode_t *window)
Add a new window to the list of all windows.
uiNode_t * UI_GetWindow(const char *name)
Searches all windows for the specified one.