Blender  V3.3
Classes | Macros | Typedefs | Enumerations | Functions
UI_interface_icons.h File Reference
#include "DNA_ID_enums.h"

Go to the source code of this file.

Classes

struct  IconFile
 

Macros

#define ICON_DEFAULT_HEIGHT   16
 
#define ICON_DEFAULT_WIDTH   16
 
#define ICON_DEFAULT_HEIGHT_TOOLBAR   32
 
#define ICON_DEFAULT_HEIGHT_SCALE   ((int)(UI_UNIT_Y * 0.8f))
 
#define ICON_DEFAULT_WIDTH_SCALE   ((int)(UI_UNIT_X * 0.8f))
 
#define PREVIEW_DEFAULT_HEIGHT   128
 

Typedefs

typedef struct IconFile IconFile
 
typedef enum eAlertIcon eAlertIcon
 

Enumerations

enum  eAlertIcon {
  ALERT_ICON_WARNING = 0 , ALERT_ICON_QUESTION = 1 , ALERT_ICON_ERROR = 2 , ALERT_ICON_INFO = 3 ,
  ALERT_ICON_BLENDER = 4 , ALERT_ICON_MAX
}
 

Functions

struct ImBufUI_icon_alert_imbuf_get (eAlertIcon icon)
 
void UI_icons_init (void)
 
void UI_icons_reload_internal_textures (void)
 
int UI_icon_get_width (int icon_id)
 
int UI_icon_get_height (int icon_id)
 
bool UI_icon_get_theme_color (int icon_id, unsigned char color[4])
 
void UI_icon_render_id (const struct bContext *C, struct Scene *scene, struct ID *id, enum eIconSizes size, bool use_job)
 
void UI_icon_render_id_ex (const struct bContext *C, struct Scene *scene, struct ID *id_to_render, const enum eIconSizes size, const bool use_job, struct PreviewImage *r_preview_image)
 
int UI_icon_preview_to_render_size (enum eIconSizes size)
 
void UI_icon_draw (float x, float y, int icon_id)
 
void UI_icon_draw_alpha (float x, float y, int icon_id, float alpha)
 
void UI_icon_draw_preview (float x, float y, int icon_id, float aspect, float alpha, int size)
 
void UI_icon_draw_ex (float x, float y, int icon_id, float aspect, float alpha, float desaturate, const uchar mono_color[4], bool mono_border)
 
void UI_icons_free (void)
 
void UI_icons_free_drawinfo (void *drawinfo)
 
void UI_icon_draw_cache_begin (void)
 
void UI_icon_draw_cache_end (void)
 
struct ListBaseUI_iconfile_list (void)
 
int UI_iconfile_get_index (const char *filename)
 
struct PreviewImageUI_icon_to_preview (int icon_id)
 
int UI_icon_from_rnaptr (const struct bContext *C, struct PointerRNA *ptr, int rnaicon, bool big)
 
int UI_icon_from_idcode (int idcode)
 
int UI_icon_from_library (const struct ID *id)
 
int UI_icon_from_object_mode (int mode)
 
int UI_icon_color_from_collection (const struct Collection *collection)
 

Macro Definition Documentation

◆ ICON_DEFAULT_HEIGHT

#define ICON_DEFAULT_HEIGHT   16

Definition at line 30 of file UI_interface_icons.h.

◆ ICON_DEFAULT_HEIGHT_SCALE

#define ICON_DEFAULT_HEIGHT_SCALE   ((int)(UI_UNIT_Y * 0.8f))

Definition at line 35 of file UI_interface_icons.h.

◆ ICON_DEFAULT_HEIGHT_TOOLBAR

#define ICON_DEFAULT_HEIGHT_TOOLBAR   32

Definition at line 33 of file UI_interface_icons.h.

◆ ICON_DEFAULT_WIDTH

#define ICON_DEFAULT_WIDTH   16

Definition at line 31 of file UI_interface_icons.h.

◆ ICON_DEFAULT_WIDTH_SCALE

#define ICON_DEFAULT_WIDTH_SCALE   ((int)(UI_UNIT_X * 0.8f))

Definition at line 36 of file UI_interface_icons.h.

◆ PREVIEW_DEFAULT_HEIGHT

#define PREVIEW_DEFAULT_HEIGHT   128

Definition at line 38 of file UI_interface_icons.h.

Typedef Documentation

◆ eAlertIcon

typedef enum eAlertIcon eAlertIcon

◆ IconFile

typedef struct IconFile IconFile

Enumeration Type Documentation

◆ eAlertIcon

enum eAlertIcon
Enumerator
ALERT_ICON_WARNING 
ALERT_ICON_QUESTION 
ALERT_ICON_ERROR 
ALERT_ICON_INFO 
ALERT_ICON_BLENDER 
ALERT_ICON_MAX 

Definition at line 40 of file UI_interface_icons.h.

Function Documentation

◆ UI_icon_alert_imbuf_get()

struct ImBuf* UI_icon_alert_imbuf_get ( eAlertIcon  icon)

◆ UI_icon_color_from_collection()

int UI_icon_color_from_collection ( const struct Collection collection)

◆ UI_icon_draw()

void UI_icon_draw ( float  x,
float  y,
int  icon_id 
)

◆ UI_icon_draw_alpha()

void UI_icon_draw_alpha ( float  x,
float  y,
int  icon_id,
float  alpha 
)

Definition at line 2431 of file interface_icons.c.

References NULL, UI_icon_draw_ex(), x, and y.

Referenced by button2d_draw_intern(), and outliner_draw_tree_element().

◆ UI_icon_draw_cache_begin()

void UI_icon_draw_cache_begin ( void  )

Definition at line 1585 of file interface_icons.c.

References BLI_assert, and g_icon_draw_cache.

Referenced by UI_block_draw().

◆ UI_icon_draw_cache_end()

void UI_icon_draw_cache_end ( void  )

◆ UI_icon_draw_ex()

void UI_icon_draw_ex ( float  x,
float  y,
int  icon_id,
float  aspect,
float  alpha,
float  desaturate,
const uchar  mono_color[4],
bool  mono_border 
)

◆ UI_icon_draw_preview()

void UI_icon_draw_preview ( float  x,
float  y,
int  icon_id,
float  aspect,
float  alpha,
int  size 
)

Definition at line 2436 of file interface_icons.c.

References icon_draw_size(), ICON_SIZE_PREVIEW, NULL, size(), x, and y.

Referenced by widget_draw_preview().

◆ UI_icon_from_idcode()

int UI_icon_from_idcode ( int  idcode)

◆ UI_icon_from_library()

int UI_icon_from_library ( const struct ID id)

◆ UI_icon_from_object_mode()

int UI_icon_from_object_mode ( int  mode)

◆ UI_icon_from_rnaptr()

int UI_icon_from_rnaptr ( const struct bContext C,
struct PointerRNA ptr,
int  rnaicon,
bool  big 
)

◆ UI_icon_get_height()

int UI_icon_get_height ( int  icon_id)

◆ UI_icon_get_theme_color()

bool UI_icon_get_theme_color ( int  icon_id,
unsigned char  color[4] 
)

◆ UI_icon_get_width()

int UI_icon_get_width ( int  icon_id)

NOTE: returns unscaled by DPI.

Definition at line 1201 of file interface_icons.c.

References BKE_icon_get(), G, G_DEBUG, ICON_DEFAULT_WIDTH, icon_ensure_drawinfo(), and NULL.

◆ UI_icon_preview_to_render_size()

int UI_icon_preview_to_render_size ( enum eIconSizes  size)

◆ UI_icon_render_id()

void UI_icon_render_id ( const struct bContext C,
struct Scene scene,
struct ID id,
enum eIconSizes  size,
bool  use_job 
)

Render a PreviewImage for the data block.

Note that if an ID doesn't support jobs for preview creation, use_job will be ignored.

Referenced by ED_asset_generate_preview(), ED_preview_restart_queue_work(), lib_id_generate_preview_exec(), and previews_id_ensure().

◆ UI_icon_render_id_ex()

void UI_icon_render_id_ex ( const struct bContext C,
struct Scene scene,
struct ID id_to_render,
const enum eIconSizes  size,
const bool  use_job,
struct PreviewImage r_preview_image 
)

Render the data block into the provided PreviewImage.

Referenced by lib_id_generate_preview_from_object_exec().

◆ UI_icon_to_preview()

struct PreviewImage* UI_icon_to_preview ( int  icon_id)

◆ UI_iconfile_get_index()

int UI_iconfile_get_index ( const char *  filename)

◆ UI_iconfile_list()

struct ListBase* UI_iconfile_list ( void  )

Definition at line 1118 of file interface_icons.c.

References iconfilelist.

◆ UI_icons_free()

void UI_icons_free ( void  )

◆ UI_icons_free_drawinfo()

void UI_icons_free_drawinfo ( void drawinfo)

◆ UI_icons_init()

void UI_icons_init ( void  )

◆ UI_icons_reload_internal_textures()

void UI_icons_reload_internal_textures ( void  )