ui_node_window.c File Reference

#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"
Include dependency graph for ui_node_window.c:

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_tUI_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_tUI_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_tUI_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_tbinding

Detailed Description

Todo:
move it as an inheritance of panel bahaviour?

Definition in file ui_node_window.c.


Define Documentation

#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().


Function Documentation

void UI_RegisterWindowNode ( uiBehaviour_t behaviour  ) 
qboolean UI_WindowIsDropDown ( const struct uiNode_s *const   node  ) 

True if the window is a drop down.

Parameters:
node A window node
Returns:
True if the window is a drop down.

Definition at line 419 of file ui_node_window.c.

References EXTRADATACONST.

Referenced by UI_GetNodeAtPosition(), and UI_LeftClick().

qboolean UI_WindowIsFullScreen ( const uiNode_t *const   node  ) 

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().

qboolean UI_WindowIsModal ( const struct uiNode_s *const   node  ) 

True if the window is a modal.

Parameters:
node A window node
Returns:
True if the window is a modal.

Definition at line 429 of file ui_node_window.c.

References EXTRADATACONST.

Referenced by UI_GetNodeAtPosition(), and UI_KeyPressed().

qboolean UI_WindowNodeAddIndexedNode ( uiNode_t *const   node,
uiNode_t *const   child 
)

Add a node to the child index.

Todo:
display a warning, we must not override a node name here

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().

static void UI_WindowNodeClone ( const uiNode_t source,
uiNode_t clone 
) [static]

Todo:
anyway we should remove soon renderNode

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.

Todo:
we can move generic code into abstract node

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]
static void UI_WindowNodeDraw ( uiNode_t node  )  [static]
uiNode_t* UI_WindowNodeGetIndexedChild ( uiNode_t *const   node,
const char *  childName 
) [read]

Get a node from child index.

Returns:
A child node by his name, else NULL

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.

Parameters:
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().

vec_t* UI_WindowNodeGetNoticePosition ( struct uiNode_s node  ) 

Get the noticePosition from a window node.

Parameters:
node A window node
Returns:
A position, else NULL if no notice position

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.

Todo:
we can move generic code into abstract node

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.

Todo:
Once image_t is known on the client, use image->width resp. image->height here
Todo:
Once 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.

Parameters:
node A window node
binding Key binding to link with the window (structure should not be already linked somewhere)
Todo:
Rework that function to remove possible wrong use of that function

Definition at line 441 of file ui_node_window.c.

References EXTRADATA, uiKeyBinding_s::next, and UI_NodeInstanceOf().

Referenced by UI_SetKeyBinding().

qboolean UI_WindowNodeRemoveIndexedNode ( uiNode_t *const   node,
uiNode_t *const   child 
)

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().

void UI_WindowNodeSetRenderNode ( uiNode_t node,
uiNode_t renderNode 
)

Definition at line 276 of file ui_node_window.c.

References Com_Printf(), EXTRADATA, UI_GetPath(), and UI_NodeInstanceOf().

Referenced by UI_ZoneNodeLoaded().


Variable Documentation

const vec4_t anamorphicBorder = {0, 0, 0, 1} [static]

Definition at line 67 of file ui_node_window.c.

Referenced by UI_WindowNodeDraw().

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().

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]
Initial value:

Definition at line 60 of file ui_node_window.c.

Referenced by UI_WindowNodeDraw().


Generated by  doxygen 1.6.2