Blender  V2.93
Classes | Macros | Typedefs | Functions | Variables
interface_icons.c File Reference
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "GPU_batch.h"
#include "GPU_batch_presets.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "GPU_texture.h"
#include "BLI_blenlib.h"
#include "BLI_fileops_types.h"
#include "BLI_math_color_blend.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_brush_types.h"
#include "DNA_collection_types.h"
#include "DNA_curve_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_gpencil_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "RNA_access.h"
#include "BKE_appdir.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_icons.h"
#include "BKE_paint.h"
#include "BKE_studiolight.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_thumbs.h"
#include "BIF_glutil.h"
#include "ED_datafiles.h"
#include "ED_keyframes_draw.h"
#include "ED_render.h"
#include "UI_interface.h"
#include "UI_interface_icons.h"
#include "WM_api.h"
#include "WM_types.h"
#include "interface_intern.h"
#include "UI_icons.h"

Go to the source code of this file.

Classes

struct  IconImage
 
struct  DrawInfo
 
struct  IconTexture
 
struct  IconType
 
struct  IconDrawCall
 
struct  IconTextureDrawCall
 

Macros

#define ICON_GRID_COLS   26
 
#define ICON_GRID_ROWS   30
 
#define ICON_MONO_BORDER_OUTSET   2
 
#define ICON_GRID_MARGIN   10
 
#define ICON_GRID_W   32
 
#define ICON_GRID_H   32
 
#define ICON_TYPE_PREVIEW   0
 
#define ICON_TYPE_COLOR_TEXTURE   1
 
#define ICON_TYPE_MONO_TEXTURE   2
 
#define ICON_TYPE_BUFFER   3
 
#define ICON_TYPE_IMBUF   4
 
#define ICON_TYPE_VECTOR   5
 
#define ICON_TYPE_GEOM   6
 
#define ICON_TYPE_EVENT   7 /* draw keymap entries using custom renderer. */
 
#define ICON_TYPE_GPLAYER   8
 
#define ICON_TYPE_BLANK   9
 
#define DEF_ICON(name)   {ICON_TYPE_MONO_TEXTURE, 0},
 
#define DEF_ICON_SCENE(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_SCENE},
 
#define DEF_ICON_COLLECTION(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_COLLECTION},
 
#define DEF_ICON_OBJECT(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT},
 
#define DEF_ICON_OBJECT_DATA(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT_DATA},
 
#define DEF_ICON_MODIFIER(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_MODIFIER},
 
#define DEF_ICON_SHADING(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_SHADING},
 
#define DEF_ICON_FOLDER(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_FOLDER},
 
#define DEF_ICON_FUND(name)   {ICON_TYPE_MONO_TEXTURE, TH_ICON_FUND},
 
#define DEF_ICON_VECTOR(name)   {ICON_TYPE_VECTOR, 0},
 
#define DEF_ICON_COLOR(name)   {ICON_TYPE_COLOR_TEXTURE, 0},
 
#define DEF_ICON_BLANK(name)   {ICON_TYPE_BLANK, 0},
 
#define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index)
 
#define DEF_ICON_COLLECTION_COLOR_DRAW(index, color)
 
#define INIT_BRUSH_ICON(icon_id, name)
 
#define INIT_EVENT_ICON(icon_id, type, value)
 
#define ICON_DRAW_CACHE_SIZE   16
 

Typedefs

typedef struct IconImage IconImage
 
typedef void(* VectorDrawFunc) (int x, int y, int w, int h, float alpha)
 
typedef struct DrawInfo DrawInfo
 
typedef struct IconTexture IconTexture
 
typedef struct IconType IconType
 
typedef struct IconDrawCall IconDrawCall
 
typedef struct IconTextureDrawCall IconTextureDrawCall
 

Functions

static DrawInfodef_internal_icon (ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color)
 
static void def_internal_vicon (int icon_id, VectorDrawFunc drawFunc)
 
static void viconutil_set_point (int pt[2], int x, int y)
 
static void vicon_small_tri_right_draw (int x, int y, int w, int UNUSED(h), float alpha)
 
static void vicon_keytype_draw_wrapper (int x, int y, int w, int h, float alpha, short key_type, short handle_type)
 
static void vicon_keytype_keyframe_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_keytype_breakdown_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_keytype_extreme_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_keytype_jitter_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_keytype_moving_hold_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_handletype_free_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_handletype_aligned_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_handletype_vector_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_handletype_auto_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_handletype_auto_clamp_draw (int x, int y, int w, int h, float alpha)
 
static void vicon_colorset_draw (int index, int x, int y, int w, int h, float UNUSED(alpha))
 
static void vicon_collection_color_draw (short color_tag, int x, int y, int w, int UNUSED(h), float UNUSED(alpha))
 
 DEF_ICON_COLLECTION_COLOR_DRAW (01, COLLECTION_COLOR_01)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (02, COLLECTION_COLOR_02)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (03, COLLECTION_COLOR_03)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (04, COLLECTION_COLOR_04)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (05, COLLECTION_COLOR_05)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (06, COLLECTION_COLOR_06)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (07, COLLECTION_COLOR_07)
 
 DEF_ICON_COLLECTION_COLOR_DRAW (08, COLLECTION_COLOR_08)
 
static void vicon_gplayer_color_draw (Icon *icon, int x, int y, int w, int h)
 
static void init_brush_icons (void)
 
int UI_icon_from_event_type (short event_type, short event_value)
 
int UI_icon_from_keymap_item (const wmKeyMapItem *kmi, int r_icon_mod[4])
 
static void init_event_icons (void)
 
static void icon_verify_datatoc (IconImage *iimg)
 
static ImBufcreate_mono_icon_with_border (ImBuf *buf, int resolution_divider, float border_intensity)
 
static void free_icons_textures (void)
 
void UI_icons_reload_internal_textures (void)
 
static void init_internal_icons (void)
 
static void init_iconfile_list (struct ListBase *list)
 
static void free_iconfile_list (struct ListBase *list)
 
int UI_iconfile_get_index (const char *filename)
 
ListBaseUI_iconfile_list (void)
 
void UI_icons_free (void)
 
void UI_icons_free_drawinfo (void *drawinfo)
 
static DrawInfoicon_create_drawinfo (Icon *icon)
 
static DrawInfoicon_ensure_drawinfo (Icon *icon)
 
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, uchar color[4])
 
void UI_icons_init ()
 
int UI_icon_preview_to_render_size (enum eIconSizes size)
 
static void icon_create_rect (struct PreviewImage *prv_img, enum eIconSizes size)
 
static void ui_id_preview_image_render_size (const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job)
 
static void ui_studiolight_icon_job_exec (void *customdata, short *UNUSED(stop), short *UNUSED(do_update), float *UNUSED(progress))
 
static void ui_studiolight_kill_icon_preview_job (wmWindowManager *wm, int icon_id)
 
static void ui_studiolight_free_function (StudioLight *sl, void *data)
 
static void ui_studiolight_icon_job_end (void *customdata)
 
void ui_icon_ensure_deferred (const bContext *C, const int icon_id, const bool big)
 
static void icon_set_image (const bContext *C, Scene *scene, ID *id, PreviewImage *prv_img, enum eIconSizes size, const bool use_job)
 
PreviewImageUI_icon_to_preview (int icon_id)
 
static void icon_draw_rect (float x, float y, int w, int h, float UNUSED(aspect), int rw, int rh, uint *rect, float alpha, const float desaturate)
 
void UI_icon_draw_cache_begin (void)
 
static void icon_draw_cache_texture_flush_ex (GPUTexture *texture, IconTextureDrawCall *texture_draw_calls)
 
static void icon_draw_cache_flush_ex (bool only_full_caches)
 
void UI_icon_draw_cache_end (void)
 
static void icon_draw_texture_cached (float x, float y, float w, float h, int ix, int iy, int UNUSED(iw), int ih, float alpha, const float rgb[3], bool with_border)
 
static void icon_draw_texture (float x, float y, float w, float h, int ix, int iy, int iw, int ih, float alpha, const float rgb[3], bool with_border)
 
static int get_draw_size (enum eIconSizes size)
 
static void icon_draw_size (float x, float y, int icon_id, float aspect, float alpha, enum eIconSizes size, int draw_size, const float desaturate, const uchar mono_rgba[4], const bool mono_border)
 
void UI_icon_render_id (const bContext *C, Scene *scene, ID *id, const enum eIconSizes size, const bool use_job)
 
static void ui_id_icon_render (const bContext *C, ID *id, bool use_jobs)
 
static int ui_id_brush_get_icon (const bContext *C, ID *id)
 
static int ui_id_screen_get_icon (const bContext *C, ID *id)
 
int ui_id_icon_get (const bContext *C, ID *id, const bool big)
 
int UI_icon_from_library (const ID *id)
 
int UI_icon_from_rnaptr (bContext *C, PointerRNA *ptr, int rnaicon, const bool big)
 
int UI_icon_from_idcode (const int idcode)
 
int UI_icon_from_object_mode (const int mode)
 
int UI_icon_color_from_collection (const Collection *collection)
 
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], const bool mono_border)
 
ImBufUI_icon_alert_imbuf_get (eAlertIcon icon)
 

Variables

static struct ListBase iconfilelist = {NULL, NULL}
 
static IconTexture icongltex = {{NULL, NULL}, 0, 0, 0, 0.0f, 0.0f}
 
static const IconType icontypes []
 
static DrawInfog_di_event_list = NULL
 
struct {
   IconTextureDrawCall   normal
 
   IconTextureDrawCall   border
 
   bool   enabled
 
g_icon_draw_cache = {{{{{0}}}}}
 

Macro Definition Documentation

◆ DEF_ICON

#define DEF_ICON (   name)    {ICON_TYPE_MONO_TEXTURE, 0},

◆ DEF_ICON_BLANK

#define DEF_ICON_BLANK (   name)    {ICON_TYPE_BLANK, 0},

◆ DEF_ICON_COLLECTION

#define DEF_ICON_COLLECTION (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_COLLECTION},

◆ DEF_ICON_COLLECTION_COLOR_DRAW

#define DEF_ICON_COLLECTION_COLOR_DRAW (   index,
  color 
)
Value:
static void vicon_collection_color_draw_##index(int x, int y, int w, int h, float alpha) \
{ \
vicon_collection_color_draw(color, x, y, w, h, alpha); \
}
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition: btQuadWord.h:119
static CCL_NAMESPACE_BEGIN const double alpha

Definition at line 471 of file interface_icons.c.

◆ DEF_ICON_COLOR

#define DEF_ICON_COLOR (   name)    {ICON_TYPE_COLOR_TEXTURE, 0},

◆ DEF_ICON_FOLDER

#define DEF_ICON_FOLDER (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_FOLDER},

◆ DEF_ICON_FUND

#define DEF_ICON_FUND (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_FUND},

◆ DEF_ICON_MODIFIER

#define DEF_ICON_MODIFIER (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_MODIFIER},

◆ DEF_ICON_OBJECT

#define DEF_ICON_OBJECT (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT},

◆ DEF_ICON_OBJECT_DATA

#define DEF_ICON_OBJECT_DATA (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_OBJECT_DATA},

◆ DEF_ICON_SCENE

#define DEF_ICON_SCENE (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_SCENE},

◆ DEF_ICON_SHADING

#define DEF_ICON_SHADING (   name)    {ICON_TYPE_MONO_TEXTURE, TH_ICON_SHADING},

◆ DEF_ICON_VECTOR

#define DEF_ICON_VECTOR (   name)    {ICON_TYPE_VECTOR, 0},

◆ DEF_ICON_VECTOR_COLORSET_DRAW_NTH

#define DEF_ICON_VECTOR_COLORSET_DRAW_NTH (   prefix,
  index 
)
Value:
static void vicon_colorset_draw_##prefix(int x, int y, int w, int h, float alpha) \
{ \
vicon_colorset_draw(index, x, y, w, h, alpha); \
}

Definition at line 430 of file interface_icons.c.

◆ ICON_DRAW_CACHE_SIZE

#define ICON_DRAW_CACHE_SIZE   16

Definition at line 1558 of file interface_icons.c.

◆ ICON_GRID_COLS

#define ICON_GRID_COLS   26

Definition at line 80 of file interface_icons.c.

◆ ICON_GRID_H

#define ICON_GRID_H   32

Definition at line 86 of file interface_icons.c.

◆ ICON_GRID_MARGIN

#define ICON_GRID_MARGIN   10

Definition at line 84 of file interface_icons.c.

◆ ICON_GRID_ROWS

#define ICON_GRID_ROWS   30

Definition at line 81 of file interface_icons.c.

◆ ICON_GRID_W

#define ICON_GRID_W   32

Definition at line 85 of file interface_icons.c.

◆ ICON_MONO_BORDER_OUTSET

#define ICON_MONO_BORDER_OUTSET   2

Definition at line 83 of file interface_icons.c.

◆ ICON_TYPE_BLANK

#define ICON_TYPE_BLANK   9

Definition at line 108 of file interface_icons.c.

◆ ICON_TYPE_BUFFER

#define ICON_TYPE_BUFFER   3

Definition at line 102 of file interface_icons.c.

◆ ICON_TYPE_COLOR_TEXTURE

#define ICON_TYPE_COLOR_TEXTURE   1

Definition at line 100 of file interface_icons.c.

◆ ICON_TYPE_EVENT

#define ICON_TYPE_EVENT   7 /* draw keymap entries using custom renderer. */

Definition at line 106 of file interface_icons.c.

◆ ICON_TYPE_GEOM

#define ICON_TYPE_GEOM   6

Definition at line 105 of file interface_icons.c.

◆ ICON_TYPE_GPLAYER

#define ICON_TYPE_GPLAYER   8

Definition at line 107 of file interface_icons.c.

◆ ICON_TYPE_IMBUF

#define ICON_TYPE_IMBUF   4

Definition at line 103 of file interface_icons.c.

◆ ICON_TYPE_MONO_TEXTURE

#define ICON_TYPE_MONO_TEXTURE   2

Definition at line 101 of file interface_icons.c.

◆ ICON_TYPE_PREVIEW

#define ICON_TYPE_PREVIEW   0

Definition at line 99 of file interface_icons.c.

◆ ICON_TYPE_VECTOR

#define ICON_TYPE_VECTOR   5

Definition at line 104 of file interface_icons.c.

◆ INIT_BRUSH_ICON

#define INIT_BRUSH_ICON (   icon_id,
  name 
)
Value:
{ \
uchar *rect = (uchar *)datatoc_##name##_png; \
const int size = datatoc_##name##_png_size; \
DrawInfo *di; \
\
di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_BUFFER, 0); \
di->data.buffer.image->datatoc_rect = rect; \
di->data.buffer.image->datatoc_size = size; \
} \
((void)0)
unsigned char uchar
Definition: BLI_sys_types.h:86
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
#define ICON_TYPE_BUFFER
static DrawInfo * def_internal_icon(ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color)

◆ INIT_EVENT_ICON

#define INIT_EVENT_ICON (   icon_id,
  type,
  value 
)
Value:
{ \
DrawInfo *di = def_internal_icon(NULL, icon_id, 0, 0, w, ICON_TYPE_EVENT, 0); \
di->data.input.event_type = type; \
di->data.input.event_value = value; \
di->data.input.icon = icon_id; \
di->data.input.next = di_next; \
di_next = di; \
} \
((void)0)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
#define ICON_TYPE_EVENT

Typedef Documentation

◆ DrawInfo

typedef struct DrawInfo DrawInfo

◆ IconDrawCall

typedef struct IconDrawCall IconDrawCall

◆ IconImage

typedef struct IconImage IconImage

◆ IconTexture

typedef struct IconTexture IconTexture

◆ IconTextureDrawCall

◆ IconType

typedef struct IconType IconType

◆ VectorDrawFunc

typedef void(* VectorDrawFunc) (int x, int y, int w, int h, float alpha)

Definition at line 97 of file interface_icons.c.

Function Documentation

◆ create_mono_icon_with_border()

static ImBuf* create_mono_icon_with_border ( ImBuf buf,
int  resolution_divider,
float  border_intensity 
)
static

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [1/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 01  ,
COLLECTION_COLOR_01   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [2/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 02  ,
COLLECTION_COLOR_02   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [3/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 03  ,
COLLECTION_COLOR_03   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [4/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 04  ,
COLLECTION_COLOR_04   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [5/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 05  ,
COLLECTION_COLOR_05   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [6/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 06  ,
COLLECTION_COLOR_06   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [7/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 07  ,
COLLECTION_COLOR_07   
)

◆ DEF_ICON_COLLECTION_COLOR_DRAW() [8/8]

DEF_ICON_COLLECTION_COLOR_DRAW ( 08  ,
COLLECTION_COLOR_08   
)

◆ def_internal_icon()

static DrawInfo* def_internal_icon ( ImBuf bbuf,
int  icon_id,
int  xofs,
int  yofs,
int  size,
int  type,
int  theme_color 
)
static

◆ def_internal_vicon()

static void def_internal_vicon ( int  icon_id,
VectorDrawFunc  drawFunc 
)
static

◆ free_iconfile_list()

static void free_iconfile_list ( struct ListBase list)
static

Definition at line 1068 of file interface_icons.c.

References BLI_freelinkN(), ListBase::first, IconFile::next, and NULL.

Referenced by UI_icons_free().

◆ free_icons_textures()

static void free_icons_textures ( void  )
static

◆ get_draw_size()

static int get_draw_size ( enum eIconSizes  size)
static

◆ icon_create_drawinfo()

static DrawInfo* icon_create_drawinfo ( Icon icon)
static

◆ icon_create_rect()

static void icon_create_rect ( struct PreviewImage prv_img,
enum eIconSizes  size 
)
static

◆ icon_draw_cache_flush_ex()

static void icon_draw_cache_flush_ex ( bool  only_full_caches)
static

◆ icon_draw_cache_texture_flush_ex()

static void icon_draw_cache_texture_flush_ex ( GPUTexture texture,
IconTextureDrawCall texture_draw_calls 
)
static

◆ icon_draw_rect()

static void icon_draw_rect ( float  x,
float  y,
int  w,
int  h,
float   UNUSEDaspect,
int  rw,
int  rh,
uint rect,
float  alpha,
const float  desaturate 
)
static

◆ icon_draw_size()

static void icon_draw_size ( float  x,
float  y,
int  icon_id,
float  aspect,
float  alpha,
enum eIconSizes  size,
int  draw_size,
const float  desaturate,
const uchar  mono_rgba[4],
const bool  mono_border 
)
static

◆ icon_draw_texture()

static void icon_draw_texture ( float  x,
float  y,
float  w,
float  h,
int  ix,
int  iy,
int  iw,
int  ih,
float  alpha,
const float  rgb[3],
bool  with_border 
)
static

◆ icon_draw_texture_cached()

static void icon_draw_texture_cached ( float  x,
float  y,
float  w,
float  h,
int  ix,
int  iy,
int   UNUSEDiw,
int  ih,
float  alpha,
const float  rgb[3],
bool  with_border 
)
static

◆ icon_ensure_drawinfo()

static DrawInfo* icon_ensure_drawinfo ( Icon icon)
static

◆ icon_set_image()

static void icon_set_image ( const bContext C,
Scene scene,
ID id,
PreviewImage prv_img,
enum eIconSizes  size,
const bool  use_job 
)
static
  • Only call with valid pointer from UI_icon_draw.
  • Only called when icon has changed.

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

Definition at line 1399 of file interface_icons.c.

References BKE_previewimg_id_supports_jobs(), C, CTX_data_scene(), ED_preview_icon_job(), ED_preview_icon_render(), PreviewImage::flag, G, G_DEBUG, PreviewImage::h, icon_create_rect(), id, ID::name, NULL, PRV_USER_EDITED, PreviewImage::rect, scene, size(), and PreviewImage::w.

Referenced by ui_id_preview_image_render_size().

◆ icon_verify_datatoc()

static void icon_verify_datatoc ( IconImage iimg)
static

◆ init_brush_icons()

static void init_brush_icons ( void  )
static

Definition at line 510 of file interface_icons.c.

References INIT_BRUSH_ICON, mask(), mix, and w().

Referenced by UI_icons_init().

◆ init_event_icons()

static void init_event_icons ( void  )
static

◆ init_iconfile_list()

static void init_iconfile_list ( struct ListBase list)
static

◆ init_internal_icons()

static void init_internal_icons ( void  )
static

◆ UI_icon_alert_imbuf_get()

ImBuf* UI_icon_alert_imbuf_get ( eAlertIcon  icon)

◆ UI_icon_color_from_collection()

int UI_icon_color_from_collection ( const Collection collection)

Definition at line 2376 of file interface_icons.c.

References COLLECTION_COLOR_NONE, and Collection::color_tag.

Referenced by ui_id_icon_get().

◆ 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 2393 of file interface_icons.c.

References alpha, 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 1577 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],
const 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 2398 of file interface_icons.c.

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

Referenced by widget_draw_preview().

◆ ui_icon_ensure_deferred()

void ui_icon_ensure_deferred ( const bContext C,
const int  icon_id,
const bool  big 
)

◆ UI_icon_from_event_type()

int UI_icon_from_event_type ( short  event_type,
short  event_value 
)

◆ UI_icon_from_idcode()

int UI_icon_from_idcode ( const int  idcode)

◆ UI_icon_from_keymap_item()

int UI_icon_from_keymap_item ( const wmKeyMapItem kmi,
int  r_icon_mod[4] 
)

◆ UI_icon_from_library()

int UI_icon_from_library ( const ID id)

◆ UI_icon_from_object_mode()

int UI_icon_from_object_mode ( const int  mode)

◆ UI_icon_from_rnaptr()

int UI_icon_from_rnaptr ( bContext C,
PointerRNA ptr,
int  rnaicon,
const 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,
uchar  color[4] 
)

◆ UI_icon_get_width()

int UI_icon_get_width ( int  icon_id)

Definition at line 1184 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 bContext C,
Scene scene,
ID id,
const enum eIconSizes  size,
const bool  use_job 
)

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

Definition at line 1959 of file interface_icons.c.

References BKE_previewimg_id_ensure(), C, NULL, scene, size(), and ui_id_preview_image_render_size().

Referenced by ui_id_icon_get().

◆ UI_icon_to_preview()

PreviewImage* UI_icon_to_preview ( int  icon_id)

◆ UI_iconfile_get_index()

int UI_iconfile_get_index ( const char *  filename)

◆ UI_iconfile_list()

ListBase* UI_iconfile_list ( void  )

Definition at line 1100 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  )

◆ ui_id_brush_get_icon()

static int ui_id_brush_get_icon ( const bContext C,
ID id 
)
static

Definition at line 1984 of file interface_icons.c.

References blender::compositor::area(), BKE_icon_id_ensure(), BKE_paint_get_brush_tool_offset_from_paintmode(), BKE_paint_get_tool_enum_from_paintmode(), BRUSH_CUSTOM_ICON, C, CTX_data_active_object(), CTX_wm_area(), Brush::flag, GP_BRUSH_ICON_AIRBRUSH, GP_BRUSH_ICON_BLOCK, GP_BRUSH_ICON_CHISEL, GP_BRUSH_ICON_ERASE_HARD, GP_BRUSH_ICON_ERASE_SOFT, GP_BRUSH_ICON_ERASE_STROKE, GP_BRUSH_ICON_FILL, GP_BRUSH_ICON_GPBRUSH_CLONE, GP_BRUSH_ICON_GPBRUSH_GRAB, GP_BRUSH_ICON_GPBRUSH_PINCH, GP_BRUSH_ICON_GPBRUSH_PUSH, GP_BRUSH_ICON_GPBRUSH_RANDOMIZE, GP_BRUSH_ICON_GPBRUSH_SMOOTH, GP_BRUSH_ICON_GPBRUSH_STRENGTH, GP_BRUSH_ICON_GPBRUSH_THICKNESS, GP_BRUSH_ICON_GPBRUSH_TWIST, GP_BRUSH_ICON_GPBRUSH_WEIGHT, GP_BRUSH_ICON_INK, GP_BRUSH_ICON_INKNOISE, GP_BRUSH_ICON_MARKER, GP_BRUSH_ICON_PEN, GP_BRUSH_ICON_PENCIL, GP_BRUSH_ICON_TINT, GP_BRUSH_ICON_VERTEX_AVERAGE, GP_BRUSH_ICON_VERTEX_BLUR, GP_BRUSH_ICON_VERTEX_DRAW, GP_BRUSH_ICON_VERTEX_REPLACE, GP_BRUSH_ICON_VERTEX_SMEAR, Brush::gpencil_settings, BrushGpencilSettings::icon_id, ID::icon_id, id, Brush::id, Object::mode, SpaceImage::mode, NULL, OB_MODE_PAINT_GPENCIL, OB_MODE_SCULPT, OB_MODE_SCULPT_GPENCIL, OB_MODE_TEXTURE_PAINT, OB_MODE_VERTEX_GPENCIL, OB_MODE_VERTEX_PAINT, OB_MODE_WEIGHT_GPENCIL, OB_MODE_WEIGHT_PAINT, PAINT_MODE_INVALID, PAINT_MODE_SCULPT, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D, PAINT_MODE_VERTEX, PAINT_MODE_WEIGHT, POINTER_OFFSET, RNA_enum_icon_from_value(), SI_MODE_PAINT, SPACE_IMAGE, SPACE_PROPERTIES, SPACE_VIEW3D, and ui_id_icon_render().

Referenced by ui_id_icon_get().

◆ ui_id_icon_get()

int ui_id_icon_get ( const bContext C,
ID id,
const bool  big 
)

◆ ui_id_icon_render()

static void ui_id_icon_render ( const bContext C,
ID id,
bool  use_jobs 
)
static

◆ ui_id_preview_image_render_size()

static void ui_id_preview_image_render_size ( const bContext C,
Scene scene,
ID id,
PreviewImage pi,
int  size,
const bool  use_job 
)
static

◆ ui_id_screen_get_icon()

static int ui_id_screen_get_icon ( const bContext C,
ID id 
)
static

Definition at line 2143 of file interface_icons.c.

References BKE_icon_id_ensure(), C, and ui_id_icon_render().

Referenced by ui_id_icon_get().

◆ ui_studiolight_free_function()

static void ui_studiolight_free_function ( StudioLight sl,
void *  data 
)
static

◆ ui_studiolight_icon_job_end()

static void ui_studiolight_icon_job_end ( void *  customdata)
static

◆ ui_studiolight_icon_job_exec()

static void ui_studiolight_icon_job_exec ( void *  customdata,
short *  UNUSEDstop,
short *  UNUSEDdo_update,
float UNUSEDprogress 
)
static

◆ ui_studiolight_kill_icon_preview_job()

static void ui_studiolight_kill_icon_preview_job ( wmWindowManager wm,
int  icon_id 
)
static

◆ vicon_collection_color_draw()

static void vicon_collection_color_draw ( short  color_tag,
int  x,
int  y,
int  w,
int   UNUSEDh,
float   UNUSEDalpha 
)
static

◆ vicon_colorset_draw()

static void vicon_colorset_draw ( int  index,
int  x,
int  y,
int  w,
int  h,
float   UNUSEDalpha 
)
static

◆ vicon_gplayer_color_draw()

static void vicon_gplayer_color_draw ( Icon icon,
int  x,
int  y,
int  w,
int  h 
)
static

◆ vicon_handletype_aligned_draw()

static void vicon_handletype_aligned_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_handletype_auto_clamp_draw()

static void vicon_handletype_auto_clamp_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_handletype_auto_draw()

static void vicon_handletype_auto_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_handletype_free_draw()

static void vicon_handletype_free_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_handletype_vector_draw()

static void vicon_handletype_vector_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_keytype_breakdown_draw()

static void vicon_keytype_breakdown_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_keytype_draw_wrapper()

static void vicon_keytype_draw_wrapper ( int  x,
int  y,
int  w,
int  h,
float  alpha,
short  key_type,
short  handle_type 
)
static

◆ vicon_keytype_extreme_draw()

static void vicon_keytype_extreme_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_keytype_jitter_draw()

static void vicon_keytype_jitter_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_keytype_keyframe_draw()

static void vicon_keytype_keyframe_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_keytype_moving_hold_draw()

static void vicon_keytype_moving_hold_draw ( int  x,
int  y,
int  w,
int  h,
float  alpha 
)
static

◆ vicon_small_tri_right_draw()

static void vicon_small_tri_right_draw ( int  x,
int  y,
int  w,
int   UNUSEDh,
float  alpha 
)
static

◆ viconutil_set_point()

static void viconutil_set_point ( int  pt[2],
int  x,
int  y 
)
static

Definition at line 254 of file interface_icons.c.

References x, and y.

Referenced by vicon_small_tri_right_draw().

Variable Documentation

◆ border

◆ enabled

bool enabled

◆ g_di_event_list

DrawInfo* g_di_event_list = NULL
static

Definition at line 584 of file interface_icons.c.

Referenced by init_event_icons(), and UI_icon_from_event_type().

◆ 

struct { ... } g_icon_draw_cache

◆ iconfilelist

struct ListBase iconfilelist = {NULL, NULL}
static

◆ icongltex

IconTexture icongltex = {{NULL, NULL}, 0, 0, 0, 0.0f, 0.0f}
static

◆ icontypes

const IconType icontypes[]
static
Initial value:
= {
#define DEF_ICON(name)
#define DEF_ICON_SCENE(name)
#define DEF_ICON_COLLECTION(name)
#define DEF_ICON_OBJECT(name)
#define DEF_ICON_OBJECT_DATA(name)
#define DEF_ICON_MODIFIER(name)
#define DEF_ICON_SHADING(name)
#define DEF_ICON_FOLDER(name)
#define DEF_ICON_FUND(name)
#define DEF_ICON_VECTOR(name)
#define DEF_ICON_COLOR(name)
#define DEF_ICON_BLANK(name)
}

Definition at line 162 of file interface_icons.c.

Referenced by create_mono_icon_with_border(), and init_internal_icons().

◆ normal

Definition at line 1572 of file interface_icons.c.

Referenced by btGImpactCollisionAlgorithm::addContactPoint(), alter_co(), btSoftBody::appendDeformableAnchor(), apply_weights_vertex_normal(), area_tri_signed_v3(), attr_create_pointiness(), axis_dominant_v3_to_m3(), axis_dominant_v3_to_m3_negate(), BKE_gpencil_stroke_2d_flat(), BKE_gpencil_stroke_2d_flat_ref(), BKE_mesh_recalc_looptri(), BKE_mesh_tessface_calc_ex(), BKE_subdiv_eval_limit_patch_resolution_point_and_normal(), BKE_subdiv_eval_limit_patch_resolution_point_and_short_normal(), BM_custom_loop_normals_to_vector_layer(), bm_face_split_by_concave(), bm_log_vert_values_swap(), bm_mesh_loops_calc_normals(), bm_mesh_loops_custom_normals_set(), bmo_triangle_fill_exec(), bt_edge_plane(), btRayAabb(), buildJacobian(), Freestyle::ViewEdgeXBuilder::BuildSmoothFEdge(), btPrimitiveTriangle::buildTriPlane(), btTriangleShapeEx::buildTriPlane(), C_BVHTree_FromPolygons(), cache_key_incremental_rotation(), calc_multiplane_scrape_surface_task_cb(), calcNormal(), ClipSegmentToLine(), cloth_collision(), cloth_filter_apply_forces_task_cb(), cloth_selfcollision(), SphereTriangleDetector::collide(), compute_collision_point_edge_tri(), compute_collision_point_tri_tri(), Freestyle::ViewMapBuilder::computeCusps(), btRigidBody::computeImpulseDenominator(), computeNormalDisplacement(), Freestyle::ViewMapBuilder::ComputeRayCastingVisibility(), computeReflectionDirection(), contarget_get_mesh_mat(), continuousCollisionDetection(), VolumeMeshBuilder::convert_quads_to_tris(), blender::compositor::NormalNode::convertToOperations(), btDefaultSoftBodySolver::copySoftBodyToVertexBuffer(), blender::bke::create_attribute_providers_for_mesh(), blender::nodes::create_line_mesh(), createBoneSpace(), createCurveSpace(), createMeshSpace(), createSpaceNormal(), createSpaceNormalTangent(), createTransCurveVerts(), curve_draw_event_add_first(), dBoxBox2(), debugDrawConstraint(), deformStroke(), do_boundary_brush_inflate_task_cb_ex(), do_cloth_brush_apply_forces_task_cb_ex(), do_layer_brush_task_cb_ex(), btSoftColliders::CollideSDF_RDF::DoNode(), btSoftColliders::CollideSDF_RD::DoNode(), dot_vf3vs3(), btIDebugDraw::drawArc(), drawSnapping(), drw_volume_wireframe_cb(), dynamic_paint_apply_surface_displace_cb(), dynamic_paint_apply_surface_wave_cb(), ED_getTransformOrientationMatrix(), ED_gizmotypes_snap_3d_draw_util(), ED_gpencil_stroke_reproject(), end_node_frames(), btSparseSdf< CELLSIZE >::Evaluate(), Freestyle::firstIntersectionGridVisitor::examineOccluder(), face_to_plane(), fillContactJacobianMultiDof(), Freestyle::ViewMapBuilder::FindOccludee(), GIM_TRIANGLE::get_normal(), btPlaneShape::get_plane_equation_transformed(), btBoxBoxDetector::getClosestPoints(), SphereTriangleDetector::getClosestPoints(), btSphereBoxCollisionAlgorithm::getSphereDistance(), btSphereBoxCollisionAlgorithm::getSpherePenetration(), getTransformOrientation(), getTransformOrientation_ex(), hair_collision(), idp_poject_surface_normal(), btDeformableMultiBodyDynamicsWorld::integrateTransforms(), MyInternalTriangleIndexCallback::internalProcessTriangleIndex(), btSoftBody::interpolateRenderMesh(), isInside(), kelvinlet_twist(), kernel_write_data_passes(), len_squared_v3v3_with_normal_bias(), lineart_chain_append_point(), lineart_chain_prepend_point(), lineart_geometry_object_load(), lineIntersectsTriangle(), Freestyle::WShape::MakeFace(), mesh_calc_ngon_normal(), mesh_calc_poly_area_centroid(), mesh_calc_tri_tessface(), mesh_filter_task_cb(), neighbor_dirty_mask(), NODE_DEFINE(), blender::nodes::normal_to_euler_rotation(), object_transform_axis_target_modal(), Freestyle::GeomUtils::overlapPlaneBox(), Freestyle::GeomUtils::overlapTriangleBox(), p_add_ngon(), parallelComponent(), perpindicularComponent(), point_in_slice_as(), point_in_slice_seg(), pointOutsideOfPlane(), poly_rotate_plane(), Freestyle::Geometry::Polygon3r::Polygon3r(), Freestyle::FEdgeXDetector::ProcessSilhouetteFace(), DebugDrawcallback::processTriangle(), btSoftBodyTriangleCallback::processTriangle(), proximityTest(), btContactArray::push_contact(), gim_contact_array::push_contact(), btSdfCollisionShape::queryPoint(), raycast_all_cb(), btSoftMultiBodyDynamicsWorld::rayTestSingle(), btSoftRigidDynamicsWorld::rayTestSingle(), btDeformableMultiBodyDynamicsWorld::rayTestSingle(), RE_bake_normal_world_to_tangent(), reflect(), reflect_v3_v3v3(), reflect_v3_v3v3_db(), blender::double3::reflected(), blender::float3::reflected(), blender::float3::refract(), refract(), resolveSingleBilateral(), resolveSingleCollision(), SCULPT_active_vertex_normal_get(), sculpt_boundary_bend_data_init(), sculpt_boundary_displacement_from_grab_delta_get(), SCULPT_cloth_simulation_limits_draw(), sculpt_gesture_line_calculate_plane_points(), sculpt_gesture_line_plane_from_tri(), sculpt_kelvinet_integrate(), Freestyle::Geometry::Polygon3r::setNormal(), btConvexHullInternal::shrink(), similar_face_select_exec(), similar_vert_select_exec(), smart_uv_project_calculate_project_normals(), solveConstraintObsolete(), sphere_normal_from_uv(), split_loop_nor_fan_do(), stitch_calculate_edge_normal(), stitch_init(), stitch_island_calculate_vert_rotation(), stroke_elem_project(), studiolight_calculate_cubemap_vector_weight(), studiolight_evaluate_specular_radiance_buffer(), studiolight_irradiance_preview(), studiolight_lights_eval(), studiolight_radiance_preview(), studiolight_spherical_harmonics_eval(), studiolight_spherical_harmonics_geomerics_eval(), svm_node_displacement(), svm_node_normal(), svm_node_normal_map(), svm_node_set_normal(), svm_node_vector_displacement(), uvprojectModifier_do(), walkStacklessQuantizedTreeAgainstRay(), and walkStacklessTreeAgainstRay().