ui_icon.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  uiIcon_s

Defines

#define UI_MAX_ICONS   128

Typedefs

typedef struct uiIcon_s uiIcon_t

Enumerations

enum  uiIconStatus_t {
  ICON_STATUS_NORMAL = 0, ICON_STATUS_HOVER = 1, ICON_STATUS_DISABLED = 2, ICON_STATUS_CLICKED = 3,
  ICON_STATUS_MAX
}

Functions

uiIcon_tUI_GetIconByName (const char *name)
 Return an icon by is name.
uiIcon_tUI_AllocStaticIcon (const char *name) __attribute__((warn_unused_result))
 Allocate an icon to the UI static memory.
void UI_DrawIconInBox (const uiIcon_t *icon, uiIconStatus_t status, int posX, int posY, int sizeX, int sizeY)

Variables

const value_t mn_iconProperties []

Detailed Description

Definition in file ui_icon.h.


Define Documentation

#define UI_MAX_ICONS   128

Definition at line 28 of file ui_icon.h.

Referenced by UI_AllocStaticIcon().


Typedef Documentation

typedef struct uiIcon_s uiIcon_t

Enumeration Type Documentation

Enumerator:
ICON_STATUS_NORMAL 
ICON_STATUS_HOVER 
ICON_STATUS_DISABLED 
ICON_STATUS_CLICKED 
ICON_STATUS_MAX 

Definition at line 30 of file ui_icon.h.


Function Documentation

uiIcon_t* UI_AllocStaticIcon ( const char *  name  ) 

Allocate an icon to the UI static memory.

Note:
Its not a dynamic memory allocation. Please only use it at the loading time
Parameters:
[in] name Name of the icon
Todo:
Assert out when we are not in parsing/loading stage

Todo:
understand why we must hide this assert in release build with mingw

Definition at line 133 of file ui_icon.c.

References Com_Error(), ERR_FATAL, uiGlobal_s::icons, uiIcon_s::name, uiGlobal_s::numIcons, Q_strncpyz(), ui_global, and UI_MAX_ICONS.

Referenced by UI_AutoGenerateIcon(), and UI_ParseIcon().

void UI_DrawIconInBox ( const uiIcon_t icon,
uiIconStatus_t  status,
int  posX,
int  posY,
int  sizeX,
int  sizeY 
)
Parameters:
[in] status The state of the icon node
[in] icon Context icon
[in] posX Absolute X position of the top-left corner
[in] posY Absolute Y position of the top-left corner
[in] sizeX Width of the bounded box
[in] sizeY Height of the bounded box
Todo:
use named const for status

Todo:
Add warning
Todo:
merge all this cases

Definition at line 160 of file ui_icon.c.

References uiIcon_s::blend, uiIcon_s::color, ICON_STATUS_MAX, ICON_STATUS_NORMAL, uiIcon_s::image, uiIcon_s::pack64, uiIcon_s::pos, R_Color(), uiIcon_s::single, uiIcon_s::size, TILE_HEIGHT, and UI_DrawNormImageByName().

Referenced by UI_ButtonNodeDraw(), UI_CustomButtonNodeDraw(), UI_MessageDraw(), UI_OptionListNodeDraw(), UI_OptionTreeNodeDraw(), UI_RadioButtonNodeDraw(), and UI_TabNodeDraw().

uiIcon_t* UI_GetIconByName ( const char *  name  ) 

Return an icon by is name.

Parameters:
[in] name Name of the icon
Returns:
The requested icon, else NULL
Note:
not very fast; if we use it often we should improve the search

Definition at line 116 of file ui_icon.c.

References uiGlobal_s::icons, MEMBER_SIZEOF, uiIcon_s::name, uiGlobal_s::numIcons, UI_AutoGenerateIcon(), and ui_global.

Referenced by UI_InitRawActionValue(), UI_MessageGetIcon(), UI_OptionTreeNodeDraw(), UI_ParseProperty(), and UP_GenerateSummary().


Variable Documentation

Definition at line 37 of file ui_icon.c.

Referenced by UI_ParseIcon().


Generated by  doxygen 1.6.2