#include "../ui_main.h"
#include "../ui_parse.h"
#include "../ui_font.h"
#include "../ui_nodes.h"
#include "../ui_internal.h"
#include "../ui_render.h"
#include "ui_node_window.h"
#include "ui_node_panel.h"
#include "ui_node_abstractnode.h"
#include "../../client.h"
Go to the source code of this file.
Defines | |
#define | EXTRADATA_TYPE windowExtraData_t |
#define | EXTRADATA(node) UI_EXTRADATA(node, EXTRADATA_TYPE) |
#define | EXTRADATACONST(node) UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
#define | LEFT_WIDTH 20 |
#define | MID_WIDTH 1 |
#define | RIGHT_WIDTH 19 |
#define | TOP_HEIGHT 46 |
#define | MID_HEIGHT 1 |
#define | BOTTOM_HEIGHT 19 |
#define | MARGE 3 |
Functions | |
uiNode_t * | UI_WindowNodeGetIndexedChild (uiNode_t *const node, const char *childName) |
Get a node from child index. | |
qboolean | UI_WindowNodeAddIndexedNode (uiNode_t *const node, uiNode_t *const child) |
Add a node to the child index. | |
qboolean | UI_WindowNodeRemoveIndexedNode (uiNode_t *const node, uiNode_t *const child) |
Remove a node from the child index. | |
qboolean | UI_WindowIsFullScreen (const uiNode_t *const node) |
Check if a window is fullscreen or not. | |
static void | UI_WindowNodeDraw (uiNode_t *node) |
static void | UI_WindowNodeDoLayout (uiNode_t *node) |
static void | UI_WindowNodeInit (uiNode_t *node) |
Called when we init the node on the screen. | |
static void | UI_WindowNodeClose (uiNode_t *node) |
Called when we close the node on the screen. | |
static void | UI_WindowNodeLoading (uiNode_t *node) |
Called at the begin of the load from script. | |
void | UI_WindowNodeSetRenderNode (uiNode_t *node, uiNode_t *renderNode) |
static void | UI_WindowNodeLoaded (uiNode_t *node) |
Called at the end of the load from script. | |
static void | UI_WindowNodeClone (const uiNode_t *source, uiNode_t *clone) |
vec_t * | UI_WindowNodeGetNoticePosition (struct uiNode_s *node) |
Get the noticePosition from a window node. | |
qboolean | UI_WindowIsDropDown (const struct uiNode_s *const node) |
True if the window is a drop down. | |
qboolean | UI_WindowIsModal (const struct uiNode_s *const node) |
True if the window is a modal. | |
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. | |
uiKeyBinding_t * | UI_WindowNodeGetKeyBinding (const struct uiNode_s *const node, unsigned int key) |
Search a a key binding from a window node. Window node store key bindings for his node child. | |
void | UI_RegisterWindowNode (uiBehaviour_t *behaviour) |
Variables | |
const uiBehaviour_t const * | ui_windowBehaviour |
static const int | CONTROLS_IMAGE_DIMENSIONS = 17 |
static const int | CONTROLS_PADDING = 22 |
static const int | CONTROLS_SPACING = 5 |
static const int | windowTemplate [] |
static const vec4_t | modalBackground = {0, 0, 0, 0.6} |
static const vec4_t | anamorphicBorder = {0, 0, 0, 1} |
static const value_t | windowNodeProperties [] |
Valid properties for a window node. | |
const uiKeyBinding_t * | binding |
Definition in file ui_node_window.c.
#define BOTTOM_HEIGHT 19 |
Definition at line 50 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
#define EXTRADATA | ( | node | ) | UI_EXTRADATA(node, EXTRADATA_TYPE) |
Definition at line 39 of file ui_node_window.c.
#define EXTRADATA_TYPE windowExtraData_t |
Definition at line 38 of file ui_node_window.c.
#define EXTRADATACONST | ( | node | ) | UI_EXTRADATACONST(node, EXTRADATA_TYPE) |
Definition at line 40 of file ui_node_window.c.
#define LEFT_WIDTH 20 |
Definition at line 44 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
#define MARGE 3 |
Definition at line 52 of file ui_node_window.c.
#define MID_HEIGHT 1 |
Definition at line 49 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
#define MID_WIDTH 1 |
Definition at line 45 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
#define RIGHT_WIDTH 19 |
Definition at line 46 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
#define TOP_HEIGHT 46 |
Definition at line 48 of file ui_node_window.c.
Referenced by UI_WindowNodeDraw(), and UI_WindowNodeLoaded().
void UI_RegisterWindowNode | ( | uiBehaviour_t * | behaviour | ) |
Definition at line 468 of file ui_node_window.c.
References uiBehaviour_s::clone, uiBehaviour_s::close, uiBehaviour_s::doLayout, uiBehaviour_s::draw, EXTRADATA_TYPE, uiBehaviour_s::extraDataSize, uiBehaviour_s::init, uiBehaviour_s::loaded, uiBehaviour_s::loading, uiBehaviour_s::name, uiBehaviour_s::properties, UI_WindowNodeClone(), UI_WindowNodeClose(), UI_WindowNodeDoLayout(), UI_WindowNodeDraw(), UI_WindowNodeInit(), UI_WindowNodeLoaded(), and UI_WindowNodeLoading().
True if the window is a drop down.
node | A window node |
Definition at line 419 of file ui_node_window.c.
References EXTRADATACONST.
Referenced by UI_GetNodeAtPosition(), and UI_LeftClick().
Check if a window is fullscreen or not.
Definition at line 126 of file ui_node_window.c.
References EXTRADATACONST, and UI_NodeInstanceOf().
Referenced by UI_GetLastFullScreenWindow(), UI_GetNodeAtPosition(), UI_MoveWindowOnTop(), UI_WindowNodeDoLayout(), and UI_WindowNodeDraw().
True if the window is a modal.
node | A window node |
Definition at line 429 of file ui_node_window.c.
References EXTRADATACONST.
Referenced by UI_GetNodeAtPosition(), and UI_KeyPressed().
Add a node to the child index.
Definition at line 90 of file ui_node_window.c.
References Com_HashKey(), EXTRADATA, hash(), node_index_s::hash_next, INDEXEDCHILD_HASH_SIZE, Mem_PoolAlloc, uiNode_s::name, node_index_s::next, node_index_s::node, qfalse, and ui_sysPool.
Referenced by UI_InsertNode().
Definition at line 340 of file ui_node_window.c.
References Com_Printf(), EXTRADATA, EXTRADATACONST, INDEXEDCHILD_HASH_SIZE, and UI_GetPath().
Referenced by UI_RegisterWindowNode().
static void UI_WindowNodeClose | ( | uiNode_t * | node | ) | [static] |
Called when we close the node on the screen.
Definition at line 249 of file ui_node_window.c.
References uiNode_s::behaviour, uiBehaviour_s::close, EXTRADATA, uiNode_s::firstChild, uiNode_s::next, and UI_ExecuteEventActions().
Referenced by UI_RegisterWindowNode().
static void UI_WindowNodeDoLayout | ( | uiNode_t * | node | ) | [static] |
Definition at line 189 of file ui_node_window.c.
References uiBehaviour_s::doLayout, EXTRADATA, int(), uiNode_s::invalidated, uiNode_s::pos, uiNode_s::size, uiBehaviour_s::super, UI_StarLayout(), UI_WindowIsFullScreen(), viddef, viddef_t::virtualHeight, and viddef_t::virtualWidth.
Referenced by UI_RegisterWindowNode().
static void UI_WindowNodeDraw | ( | uiNode_t * | node | ) | [static] |
Definition at line 132 of file ui_node_window.c.
References ALIGN_CC, anamorphicBorder, CL_Milliseconds(), Com_DPrintf(), DEBUG_CLIENT, EXTRADATA, uiNode_s::image, LONGLINES_PRETTYCHOP, modalBackground, uiNode_s::name, uiNode_s::padding, pos, uiNode_s::size, uiNode_s::text, TOP_HEIGHT, UI_DrawFill(), UI_DrawPanel(), UI_DrawStringInBox(), UI_ExecuteEventActions(), UI_GetFontFromNode(), UI_GetNodeAbsPos(), UI_GetReferenceString(), ui_global, UI_WindowIsFullScreen(), viddef, viddef_t::virtualHeight, viddef_t::virtualWidth, uiGlobal_s::windowStack, uiGlobal_s::windowStackPos, and windowTemplate.
Referenced by UI_RegisterWindowNode().
Get a node from child index.
Definition at line 73 of file ui_node_window.c.
References Com_HashKey(), EXTRADATA, hash(), node_index_s::hash_next, INDEXEDCHILD_HASH_SIZE, uiNode_s::name, and node_index_s::node.
Referenced by UI_ReadNodePath().
uiKeyBinding_t* UI_WindowNodeGetKeyBinding | ( | const struct uiNode_s *const | node, | |
unsigned int | key | |||
) | [read] |
Search a a key binding from a window node. Window node store key bindings for his node child.
node | A window node | |
key | A key code, either K_ value or lowercase ascii |
Definition at line 456 of file ui_node_window.c.
References EXTRADATACONST, uiKeyBinding_s::key, uiKeyBinding_s::next, and UI_NodeInstanceOf().
Referenced by UI_KeyPressedInWindow().
Get the noticePosition from a window node.
node | A window node |
Definition at line 407 of file ui_node_window.c.
References EXTRADATA.
Referenced by UI_DrawNotice().
static void UI_WindowNodeInit | ( | uiNode_t * | node | ) | [static] |
Called when we init the node on the screen.
Definition at line 224 of file ui_node_window.c.
References uiNode_s::behaviour, CL_Milliseconds(), EXTRADATA, uiNode_s::firstChild, uiBehaviour_s::init, uiNode_s::next, UI_ExecuteEventActions(), and UI_Invalidate().
Referenced by UI_RegisterWindowNode().
static void UI_WindowNodeLoaded | ( | uiNode_t * | node | ) | [static] |
Called at the end of the load from script.
image_t
is known on the client, use image->width
resp. image->height
here image_t
is known on the client, use image->width
resp. image->height
here Definition at line 294 of file ui_node_window.c.
References _, BOTTOM_HEIGHT, Com_DPrintf(), CONTROLS_IMAGE_DIMENSIONS, CONTROLS_PADDING, DEBUG_CLIENT, uiNode_s::dynamic, EXTRADATA, uiNode_s::image, LEFT_WIDTH, MID_HEIGHT, MID_WIDTH, uiNode_s::name, uiNode_s::onClick, uiNode_s::pos, RIGHT_WIDTH, uiNode_s::root, uiNode_s::size, uiNode_s::tooltip, TOP_HEIGHT, UI_AllocNode(), UI_AllocStaticCommandAction(), UI_AppendNode(), UI_Invalidate(), VID_NORM_HEIGHT, and VID_NORM_WIDTH.
Referenced by UI_RegisterWindowNode().
static void UI_WindowNodeLoading | ( | uiNode_t * | node | ) | [static] |
Called at the begin of the load from script.
Definition at line 268 of file ui_node_window.c.
References uiNode_s::font, uiNode_s::padding, uiNode_s::size, VID_NORM_HEIGHT, and VID_NORM_WIDTH.
Referenced by UI_RegisterWindowNode().
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.
node | A window node | |
binding | Key binding to link with the window (structure should not be already linked somewhere) |
Definition at line 441 of file ui_node_window.c.
References EXTRADATA, uiKeyBinding_s::next, and UI_NodeInstanceOf().
Referenced by UI_SetKeyBinding().
Remove a node from the child index.
FIXME implement it
Definition at line 117 of file ui_node_window.c.
References qfalse.
Referenced by UI_RemoveNode().
Definition at line 276 of file ui_node_window.c.
References Com_Printf(), EXTRADATA, UI_GetPath(), and UI_NodeInstanceOf().
Referenced by UI_ZoneNodeLoaded().
const vec4_t anamorphicBorder = {0, 0, 0, 1} [static] |
Definition at line 67 of file ui_node_window.c.
Referenced by UI_WindowNodeDraw().
const uiKeyBinding_t* binding |
Definition at line 448 of file ui_node_window.c.
Referenced by Key_WriteBindings(), UI_KeyBindingNodeDraw(), UI_KeyBindingNodeKeyPressed(), UI_KeyPressedInWindow(), and UI_SetKeyBinding().
const int CONTROLS_IMAGE_DIMENSIONS = 17 [static] |
Definition at line 56 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
const int CONTROLS_PADDING = 22 [static] |
Definition at line 57 of file ui_node_window.c.
Referenced by UI_WindowNodeLoaded().
const int CONTROLS_SPACING = 5 [static] |
Definition at line 58 of file ui_node_window.c.
const vec4_t modalBackground = {0, 0, 0, 0.6} [static] |
Definition at line 66 of file ui_node_window.c.
Referenced by UI_WindowNodeDraw().
const uiBehaviour_t const* ui_windowBehaviour |
Definition at line 54 of file ui_node_window.c.
Referenced by UI_ReadNodePath().
const value_t windowNodeProperties[] [static] |
Valid properties for a window node.
Definition at line 356 of file ui_node_window.c.
const int windowTemplate[] [static] |
Definition at line 60 of file ui_node_window.c.
Referenced by UI_WindowNodeDraw().