41#define EXTRADATA_TYPE windowExtraData_t
42#define EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE)
43#define EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE)
74 if (
Q_streq(childName, a->node->name)) {
143 const int width =
viddef.virtualWidth - (pos[0] + node->
box.
size[0]);
148 const int height =
viddef.virtualHeight - (pos[1] + node->
box.
size[1]);
169 EXTRADATA(node).lua_onWindowOpened = LUA_NOREF;
170 EXTRADATA(node).lua_onWindowClosed = LUA_NOREF;
171 EXTRADATA(node).lua_onWindowActivate = LUA_NOREF;
172 EXTRADATA(node).lua_onScriptLoaded = LUA_NOREF;
238 if (
EXTRADATA(node).lua_onWindowOpened != LUA_NOREF) {
256 if (
EXTRADATA(node).lua_onWindowClosed != LUA_NOREF) {
272 if (
EXTRADATA(node).lua_onWindowActivate != LUA_NOREF) {
312 static const char* closeCommand =
"ui_close <path:root>;";
314 control->
root = node;
321 control->
tooltip =
_(
"Close the window");
342 control->
root = node;
347 control->
tooltip =
_(
"Drag to move window");
353 if (close !=
nullptr) {
476 behaviour->
name =
"window";
virtual void doLayout(uiNode_t *node)
Call to update the node layout. This common code revalidates the node tree.
virtual void onWindowClosed(uiNode_t *node)
virtual void onWindowOpened(uiNode_t *node, linkedList_t *params)
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)
void onWindowClosed(uiNode_t *node) override
Called when we close the node on the screen.
void deleteNode(uiNode_t *node) override
Actions to do on deleting the node.
void setFill(uiNode_t *node, bool value)
void onLoading(uiNode_t *node) override
Called at the begin of the load from script.
void clone(uiNode_t const *source, uiNode_t *clone) override
void onWindowOpened(uiNode_t *node, linkedList_t *params) override
Called when we init the node on the screen.
void onSizeChanged(uiNode_t *node) override
Callback stub.
void onWindowActivate(uiNode_t *node) override
Called when a windows gets active again after some other window was popped from the stack.
void onLoaded(uiNode_t *node) override
Called at the end of the load from script.
void initNode(uiNode_t *node) override
void doLayout(uiNode_t *node) override
Call to update the node layout. This common code revalidates the node tree.
void draw(uiNode_t *node) override
Primary header for client.
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque
#define Mem_PoolAllocType(type, pool)
static wrapCache_t * hash[MAX_WRAP_HASH]
QGL_EXTERN GLuint GLsizei GLsizei GLint GLenum GLchar * name
Header for lua script functions.
unsigned int Com_HashKey(const char *name, int hashsize)
returns hash key for a string
struct node_index_s * next
struct node_index_s * hash_next
node behaviour, how a node work
Atomic structure used to define most of the UI.
uiBehaviour_t * behaviour
struct uiAction_s * onClick
void UI_ExecuteEventActionsEx(uiNode_t *source, const uiAction_t *firstAction, linkedList_t *params)
void UI_ExecuteEventActions(uiNode_t *source, const uiAction_t *firstAction)
uiAction_t * UI_AllocStaticCommandAction(const char *command)
Allocate and initialize a command action.
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.
#define UI_RegisterExtradataNodeProperty(BEHAVIOUR, NAME, TYPE, EXTRADATATYPE, ATTRIBUTE)
Initialize a property from extradata of node.
const char * UI_GetFontFromNode(const uiNode_t *const node)
Return the font for a specific node or default font.
Internal data use by the UI package.
bool UI_ExecuteLuaEventScript(uiNode_t *node, LUA_EVENT event)
Executes a lua event handler.
bool UI_ExecuteLuaEventScript_ParamList(uiNode_t *node, LUA_EVENT event, linkedList_t *params)
Executes a lua event handler with string parameter list.
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...
bool UI_NodeInstanceOf(const uiNode_t *node, const char *behaviourName)
Check the node inheritance.
uiNode_t * UI_GetPrevNode(const uiNode_t *node)
Returns the previous node based on the order of nodes in the parent.
void UI_InsertNode(uiNode_t *const parent, uiNode_t *prevNode, uiNode_t *newNode)
Insert a node next another one into a node. If prevNode is nullptr add the node on the head of the wi...
uiNode_t * UI_RemoveNode(uiNode_t *const node, uiNode_t *child)
Remove a node from a parent node.
void UI_Invalidate(uiNode_t *node)
Invalidate a node and all his parent to request a layout update.
uiNode_t * UI_FindNode(const uiNode_t *node, const char *name)
Recursive searches for a child node by name in the entire subtree.
void UI_AppendNode(uiNode_t *const parent, uiNode_t *newNode)
add a node at the end of the node child
void UI_GetNodeAbsPos(const uiNode_t *node, vec2_t pos)
Returns the absolute position of a node.
bool UI_NodeSetProperty(uiNode_t *node, const value_t *property, const char *value)
Set node property.
SharedPtr< uiNode > UINodePtr
void UI_StarLayout(uiNode_t *node)
Do a star layout with child according to there num.
static const char * WINDOW_CLOSE_BUTTON_NAME
void UI_RegisterWindowNode(uiBehaviour_t *behaviour)
bool UI_WindowIsModal(uiNode_t const *const node)
True if the window is a modal.
static const int CONTROLS_IMAGE_DIMENSIONS
static const char * WINDOW_FONT_BIG
void UI_Window_SetBackgroundByName(uiNode_t *node, const char *name)
set background sprite
static const int CONTROLS_PADDING
void UI_Window_FlagFullscreen(uiNode_t *node)
If the node size equals the full screen size, flag the node as isFullscreen, so it is displayed prope...
void UI_WindowNodeRegisterKeyBinding(uiNode_t *node, uiKeyBinding_t *binding)
Add a key binding to a window node. Window node store key bindings for his node child.
void UI_Window_SetCloseButton(uiNode_t *node, bool value)
Create/remove close button on window.
uiKeyBinding_t * UI_WindowNodeGetKeyBinding(uiNode_t const *const node, unsigned int key)
Search a a key binding from a window node. Window node store key bindings for his node child.
bool UI_WindowIsFullScreen(const uiNode_t *const node)
Check if a window is fullscreen or not.
bool UI_WindowIsDropDown(uiNode_t const *const node)
True if the window is a drop down.
vec_t * UI_WindowNodeGetNoticePosition(uiNode_t *node)
Get the noticePosition from a window node.
static const char * WINDOW_DRAG_BUTTON_NAME
static const vec4_t modalBackground
const uiKeyBinding_t * binding
static const vec4_t anamorphicBorder
bool UI_WindowNodeAddIndexedNode(uiNode_t *const node, uiNode_t *const child)
Add a node to the child index.
uiNode_t * UI_WindowNodeGetIndexedChild(uiNode_t *const node, const char *childName)
Get a node from child index.
#define EXTRADATACONST(node)
void UI_Window_SetDragButton(uiNode_t *node, bool value)
Create/remove drag button.
bool UI_WindowNodeRemoveIndexedNode(uiNode_t *const node, uiNode_t *const child)
Remove a node from the child index.
#define INDEXEDCHILD_HASH_SIZE
void UI_Window_FlagFullscreen(uiNode_t *node)
If the node size equals the full screen size, flag the node as isFullscreen, so it is displayed prope...
void UI_Window_SetCloseButton(uiNode_t *node, bool value)
Create/remove close button on window.
bool UI_WindowIsFullScreen(uiNode_t const *window)
Check if a window is fullscreen or not.
void UI_Window_SetDragButton(uiNode_t *node, bool value)
Create/remove drag button.
uiNode_t * UI_AllocNode(const char *name, const char *type, bool isDynamic)
Allocate a node into the UI memory.
#define UI_EXTRADATA(NODE, TYPE)
const char * UI_GetReferenceString(const uiNode_t *const node, const char *ref)
int UI_DrawStringInBox(const char *fontID, align_t align, int x, int y, int width, int height, const char *text, longlines_t method)
draw a line into a bounding box
void UI_DrawFill(int x, int y, int w, int h, const vec4_t color)
Fills a box of pixels with a single color.
void UI_DrawSpriteInBox(bool flip, const uiSprite_t *sprite, uiSpriteStatus_t status, int posX, int posY, int sizeX, int sizeY)
uiSprite_t * UI_GetSpriteByName(const char *name)
Return an sprite by is name.
void UI_RemoveWindow(uiNode_t *window)
Removes a window from the list of all windows.