Blender V4.3
UI_interface_icons.hh File Reference
#include "BLI_sys_types.h"
#include "DNA_ID_enums.h"

Go to the source code of this file.

Classes

struct  IconTextOverlay
 

Macros

#define UI_NO_ICON_OVERLAY_TEXT   NULL
 
#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
 

Enumerations

enum  eAlertIcon {
  ALERT_ICON_NONE = -1 , ALERT_ICON_WARNING = 0 , ALERT_ICON_QUESTION = 1 , ALERT_ICON_ERROR = 2 ,
  ALERT_ICON_INFO = 3 , ALERT_ICON_MAX
}
 

Functions

ImBufUI_icon_alert_imbuf_get (eAlertIcon icon, float size)
 
void UI_icons_init ()
 
bool UI_icon_get_theme_color (int icon_id, unsigned char color[4])
 
void UI_icon_render_id (const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
 
void UI_icon_render_id_ex (const bContext *C, Scene *scene, ID *id_to_render, const enum eIconSizes size, const bool use_job, 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, const IconTextOverlay *text_overlay, const bool inverted=false)
 
ImBufUI_svg_icon_bitmap (uint icon_id, float size, bool multicolor=false)
 
void UI_icons_free ()
 
void UI_icons_free_drawinfo (void *drawinfo)
 
PreviewImageUI_icon_to_preview (int icon_id)
 
int UI_icon_from_rnaptr (const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
 
int UI_icon_from_idcode (int idcode)
 
int UI_icon_from_library (const ID *id)
 
int UI_icon_from_object_mode (int mode)
 
int UI_icon_color_from_collection (const Collection *collection)
 
void UI_icon_text_overlay_init_from_count (IconTextOverlay *text_overlay, const int icon_indicator_number)
 

Macro Definition Documentation

◆ ICON_DEFAULT_HEIGHT

◆ ICON_DEFAULT_HEIGHT_SCALE

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

Definition at line 36 of file UI_interface_icons.hh.

Referenced by file_draw_list().

◆ ICON_DEFAULT_HEIGHT_TOOLBAR

#define ICON_DEFAULT_HEIGHT_TOOLBAR   32

Definition at line 34 of file UI_interface_icons.hh.

Referenced by icon_draw_size(), and widget_draw_text_icon().

◆ ICON_DEFAULT_WIDTH

◆ ICON_DEFAULT_WIDTH_SCALE

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

Definition at line 37 of file UI_interface_icons.hh.

Referenced by file_draw_list().

◆ PREVIEW_DEFAULT_HEIGHT

#define PREVIEW_DEFAULT_HEIGHT   128

Definition at line 39 of file UI_interface_icons.hh.

Referenced by get_draw_size().

◆ UI_NO_ICON_OVERLAY_TEXT

Enumeration Type Documentation

◆ eAlertIcon

enum eAlertIcon
Enumerator
ALERT_ICON_NONE 
ALERT_ICON_WARNING 
ALERT_ICON_QUESTION 
ALERT_ICON_ERROR 
ALERT_ICON_INFO 
ALERT_ICON_MAX 

Definition at line 41 of file UI_interface_icons.hh.

Function Documentation

◆ UI_icon_alert_imbuf_get()

ImBuf * UI_icon_alert_imbuf_get ( eAlertIcon icon,
float size )

◆ UI_icon_color_from_collection()

◆ UI_icon_draw()

◆ UI_icon_draw_alpha()

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

◆ UI_icon_draw_ex()

◆ 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 1968 of file interface_icons.cc.

References icon_draw_size(), ICON_SIZE_PREVIEW, and UI_NO_ICON_OVERLAY_TEXT.

Referenced by widget_draw_preview().

◆ UI_icon_from_idcode()

◆ UI_icon_from_library()

◆ UI_icon_from_object_mode()

◆ UI_icon_from_rnaptr()

◆ UI_icon_get_theme_color()

◆ UI_icon_preview_to_render_size()

int UI_icon_preview_to_render_size ( enum eIconSizes size)

Render size for preview images and icons

Definition at line 984 of file interface_icons.cc.

References ICON_RENDER_DEFAULT_HEIGHT, ICON_SIZE_ICON, ICON_SIZE_PREVIEW, and PREVIEW_RENDER_DEFAULT_HEIGHT.

Referenced by bpy_app_preview_render_size_get(), and icon_create_rect().

◆ UI_icon_render_id()

void UI_icon_render_id ( const bContext * C,
Scene * scene,
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.

Definition at line 1672 of file interface_icons.cc.

References BKE_previewimg_id_ensure(), Object::data, ED_preview_id_is_supported(), GS, ID_OB, and UI_icon_render_id_ex().

Referenced by ED_preview_restart_queue_work(), blender::ed::asset::generate_preview(), lib_id_generate_preview_exec(), previews_id_ensure(), and ui_id_icon_get().

◆ UI_icon_render_id_ex()

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

Render the data block into the provided PreviewImage.

Definition at line 1662 of file interface_icons.cc.

References ui_id_preview_image_render_size().

Referenced by lib_id_generate_preview_from_object_exec(), and UI_icon_render_id().

◆ UI_icon_text_overlay_init_from_count()

void UI_icon_text_overlay_init_from_count ( IconTextOverlay * text_overlay,
const int icon_indicator_number )

◆ UI_icon_to_preview()

◆ UI_icons_free()

void UI_icons_free ( )

Definition at line 892 of file interface_icons.cc.

References BKE_icons_free(), and BKE_preview_images_free().

Referenced by ui_resources_free().

◆ UI_icons_free_drawinfo()

◆ UI_icons_init()

void UI_icons_init ( )

Resizable Icons for Blender

Definition at line 976 of file interface_icons.cc.

References init_event_icons(), and init_internal_icons().

Referenced by ui_resources_init().

◆ UI_svg_icon_bitmap()