UFO: Alien Invasion
Loading...
Searching...
No Matches
ui_node_window.h File Reference
Include dependency graph for ui_node_window.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

class  uiWindowNode
struct  node_index_t
struct  windowExtraData_t
 extradata for the window node More...

Macros

#define INDEXEDCHILD_HASH_SIZE   32

Functions

void UI_RegisterWindowNode (uiBehaviour_t *behaviour)
bool UI_WindowIsFullScreen (uiNode_t const *window)
 Check if a window is fullscreen or not.
bool UI_WindowIsDropDown (uiNode_t const *window)
 True if the window is a drop down.
bool UI_WindowIsModal (uiNode_t const *window)
 True if the window is a modal.
void UI_WindowNodeRegisterKeyBinding (uiNode_t *window, struct uiKeyBinding_s *binding)
struct uiKeyBinding_s * UI_WindowNodeGetKeyBinding (uiNode_t const *node, unsigned int key)
 Search a a key binding from a window node. Window node store key bindings for his node child.
vec_tUI_WindowNodeGetNoticePosition (uiNode_t *node)
 Get the noticePosition from a window node.
uiNode_tUI_WindowNodeGetIndexedChild (uiNode_t *node, const char *childName)
 Get a node from child index.
bool UI_WindowNodeAddIndexedNode (uiNode_t *node, uiNode_t *child)
 Add a node to the child index.
bool UI_WindowNodeRemoveIndexedNode (uiNode_t *node, uiNode_t *child)
 Remove a node from the child index.
void UI_Window_SetBackgroundByName (uiNode_t *node, const char *name)
 set background sprite
void UI_Window_SetCloseButton (uiNode_t *node, bool value)
 Create/remove close button on window.
void UI_Window_SetDragButton (uiNode_t *node, bool value)
 Create/remove drag button.
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 properly.
void UI_WindowNode_SetFill (uiNode_t *node, bool value)

Macro Definition Documentation

◆ INDEXEDCHILD_HASH_SIZE

#define INDEXEDCHILD_HASH_SIZE   32

Definition at line 52 of file ui_node_window.h.

Referenced by UI_WindowNodeAddIndexedNode(), and UI_WindowNodeGetIndexedChild().

Function Documentation

◆ UI_RegisterWindowNode()

◆ UI_Window_FlagFullscreen()

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 properly.

Definition at line 391 of file ui_node_window.cpp.

References uiNode_t::box, EXTRADATA, uiBox_t::size, VID_NORM_HEIGHT, and VID_NORM_WIDTH.

Referenced by uiWindowNode::onLoaded(), and uiWindowNode::onSizeChanged().

◆ UI_Window_SetBackgroundByName()

void UI_Window_SetBackgroundByName ( uiNode_t * node,
const char * name )

set background sprite

Definition at line 61 of file ui_node_window.cpp.

References name, UI_EXTRADATA, and UI_GetSpriteByName().

Referenced by uiWindowNode_t_set_background().

◆ UI_Window_SetCloseButton()

void UI_Window_SetCloseButton ( uiNode_t * node,
bool value )

◆ UI_Window_SetDragButton()

◆ UI_WindowIsDropDown()

bool UI_WindowIsDropDown ( uiNode_t const *const node)

True if the window is a drop down.

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

Definition at line 420 of file ui_node_window.cpp.

References EXTRADATACONST.

Referenced by UI_GetNodeAtPosition(), and UI_LeftClick().

◆ UI_WindowIsFullScreen()

bool UI_WindowIsFullScreen ( uiNode_t const * window)

Check if a window is fullscreen or not.

Definition at line 118 of file ui_node_window.cpp.

References EXTRADATACONST, and UI_NodeInstanceOf().

Referenced by uiWindowNode::doLayout(), uiWindowNode::draw(), UI_GetLastFullScreenWindow(), UI_GetNodeAtPosition(), and UI_MoveWindowOnTop().

◆ UI_WindowIsModal()

bool UI_WindowIsModal ( uiNode_t const *const node)

True if the window is a modal.

Parameters
nodeA window node
Returns
True if the window is a modal.

Definition at line 430 of file ui_node_window.cpp.

References EXTRADATACONST.

Referenced by UI_GetNodeAtPosition(), and UI_KeyPressed().

◆ UI_WindowNode_SetFill()

void UI_WindowNode_SetFill ( uiNode_t * node,
bool value )

◆ UI_WindowNodeAddIndexedNode()

bool UI_WindowNodeAddIndexedNode ( uiNode_t * node,
uiNode_t * child )

Add a node to the child index.

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

Definition at line 84 of file ui_node_window.cpp.

References Com_HashKey(), EXTRADATA, hash, node_index_t::hash_next, INDEXEDCHILD_HASH_SIZE, Mem_PoolAllocType, uiNode_t::name, node_index_t::next, node_index_t::node, Q_streq, and ui_sysPool.

Referenced by UI_InsertNode().

◆ UI_WindowNodeGetIndexedChild()

uiNode_t * UI_WindowNodeGetIndexedChild ( uiNode_t *const node,
const char * childName )

Get a node from child index.

Returns
A child node by his name, else nullptr

Definition at line 70 of file ui_node_window.cpp.

References Com_HashKey(), EXTRADATA, hash, node_index_t::hash_next, INDEXEDCHILD_HASH_SIZE, and Q_streq.

Referenced by UI_ReadNodePath().

◆ UI_WindowNodeGetKeyBinding()

struct uiKeyBinding_s * 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.

Parameters
nodeA window node
keyA key code, either K_ value or lowercase ascii

Definition at line 457 of file ui_node_window.cpp.

References binding, EXTRADATACONST, key, and UI_NodeInstanceOf().

Referenced by UI_KeyPressedInWindow().

◆ UI_WindowNodeGetNoticePosition()

vec_t * UI_WindowNodeGetNoticePosition ( uiNode_t * node)

Get the noticePosition from a window node.

Parameters
nodeA window node
Returns
A position, else nullptr if no notice position

Definition at line 408 of file ui_node_window.cpp.

References EXTRADATA, and Vector2Empty.

Referenced by UI_DrawNotice().

◆ UI_WindowNodeRegisterKeyBinding()

void UI_WindowNodeRegisterKeyBinding ( uiNode_t * window,
struct uiKeyBinding_s * binding )

References binding, key, and name.

◆ UI_WindowNodeRemoveIndexedNode()

bool UI_WindowNodeRemoveIndexedNode ( uiNode_t * node,
uiNode_t * child )

Remove a node from the child index.

Todo
FIXME implement it

Definition at line 109 of file ui_node_window.cpp.

Referenced by UI_RemoveNode().