Blender V5.3
interface_icons.cc File Reference
#include "DNA_ID_enums.h"
#include "MEM_guardedalloc.h"
#include "GPU_immediate.hh"
#include "GPU_state.hh"
#include "BLF_api.hh"
#include "BLI_math_color_c.hh"
#include "BLI_math_vector_c.hh"
#include "BLI_string.hh"
#include "BLT_translation.hh"
#include "DNA_collection_types.h"
#include "DNA_dynamicpaint_types.h"
#include "DNA_gpencil_legacy_types.h"
#include "DNA_grease_pencil_types.h"
#include "DNA_object_force_types.h"
#include "DNA_screen_types.h"
#include "DNA_sequence_types.h"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"
#include "BKE_context.hh"
#include "BKE_global.hh"
#include "BKE_icons.hh"
#include "BKE_paint.hh"
#include "BKE_preview_image.hh"
#include "BKE_studiolight.h"
#include "IMB_imbuf.hh"
#include "IMB_thumbs.hh"
#include "BIF_glutil.hh"
#include "ED_keyframes_draw.hh"
#include "ED_keyframes_keylist.hh"
#include "ED_node.hh"
#include "ED_render.hh"
#include "UI_interface_icons.hh"
#include "WM_api.hh"
#include "CLG_log.h"
#include "interface_intern.hh"
#include <fmt/format.h>
#include "UI_icons.hh"

Go to the source code of this file.

Classes

struct  blender::ui::IconImage
struct  blender::ui::DrawInfo
struct  blender::ui::IconType

Namespaces

namespace  blender
 BMesh Iterators.
namespace  blender::ui

Macros

#define ICON_TYPE_PREVIEW   0
#define ICON_TYPE_SVG_COLOR   1
#define ICON_TYPE_SVG_MONO   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
#define ICON_TYPE_GPLAYER   8
#define ICON_TYPE_BLANK   9
#define DEF_ICON(name)
#define DEF_ICON_COLOR(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_BLANK(name)
#define DEF_ICON_VECTOR_COLORSET_DRAW_NTH(prefix, index)
#define DEF_ICON_STRIP_COLOR_DRAW(index, color)
#define ICON_INDIRECT_DATA_ALPHA   0.6f
#define DEF_ICON_LAYERGROUP_COLOR_DRAW(index, color)
#define DEF_ICON_NODE_SOCKET_DRAW(name, socket_type)
#define INIT_EVENT_ICON(icon_id, type, value)

Typedefs

using blender::ui::VectorDrawFunc

Functions

static DrawInfo * blender::ui::def_internal_icon (ImBuf *bbuf, int icon_id, int xofs, int yofs, int size, int type, int theme_color)
static void blender::ui::def_internal_vicon (int icon_id, VectorDrawFunc drawFunc)
static void blender::ui::vicon_rgb_color_draw (float x, float y, float w, float h, const float color[4], float bg_alpha)
static void blender::ui::vicon_rgb_text_draw (float x, float y, float w, float h, const char *str, const uchar mono_rgba[4])
static void blender::ui::vicon_rgb_red_draw (float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void blender::ui::vicon_rgb_green_draw (float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void blender::ui::vicon_rgb_blue_draw (float x, float y, float w, float h, float alpha, const uchar mono_rgba[4])
static void blender::ui::vicon_keytype_draw_wrapper (const float x, const float y, const float w, const float h, const float alpha, const eBezTriple_KeyframeType key_type, const short handle_type)
static void blender::ui::vicon_keytype_keyframe_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_keytype_breakdown_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_keytype_extreme_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_keytype_jitter_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_keytype_moving_hold_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_keytype_generated_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_handletype_free_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_handletype_aligned_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_handletype_vector_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_handletype_auto_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::vicon_handletype_auto_clamp_draw (float x, float y, float w, float h, float alpha, const uchar *)
static void blender::ui::icon_node_socket_draw (int socket_type, float x, float y, float w, float h, float)
static void blender::ui::vicon_colorset_draw (int index, int x, int y, int w, int h, float)
static void blender::ui::vicon_strip_color_draw (short color_tag, float x, float y, float w, float, float)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (01, STRIP_COLOR_01)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (02, STRIP_COLOR_02)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (03, STRIP_COLOR_03)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (04, STRIP_COLOR_04)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (05, STRIP_COLOR_05)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (06, STRIP_COLOR_06)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (07, STRIP_COLOR_07)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (08, STRIP_COLOR_08)
 blender::ui::DEF_ICON_STRIP_COLOR_DRAW (09, STRIP_COLOR_09)
static void blender::ui::vicon_strip_color_draw_library_data_indirect (float x, float y, float w, float, float alpha, const uchar *)
static void blender::ui::vicon_strip_color_draw_package_indirect (float x, float y, float w, float, float alpha, const uchar *)
static void blender::ui::vicon_strip_color_draw_library_data_override_noneditable (float x, float y, float w, float, float alpha, const uchar *)
static void blender::ui::vicon_layergroup_color_draw (short color_tag, float x, float y, float w, float, float)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (01, LAYERGROUP_COLOR_01)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (02, LAYERGROUP_COLOR_02)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (03, LAYERGROUP_COLOR_03)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (04, LAYERGROUP_COLOR_04)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (05, LAYERGROUP_COLOR_05)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (06, LAYERGROUP_COLOR_06)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (07, LAYERGROUP_COLOR_07)
 blender::ui::DEF_ICON_LAYERGROUP_COLOR_DRAW (08, LAYERGROUP_COLOR_08)
static void blender::ui::vicon_gplayer_color_draw (Icon *icon, int x, int y, int w, int h)
int blender::ui::icon_from_event_type (short event_type, short event_value)
int blender::ui::icon_from_keymap_item (const wmKeyMapItem *kmi, int r_icon_mod[KM_MOD_NUM])
static void blender::ui::init_event_icons ()
static void blender::ui::icon_verify_datatoc (IconImage *iimg)
static void blender::ui::init_internal_icons ()
void blender::ui::icons_free ()
void blender::ui::icons_free_drawinfo (void *drawinfo)
static DrawInfo * blender::ui::icon_create_drawinfo (Icon *icon)
static DrawInfo * blender::ui::icon_ensure_drawinfo (Icon *icon)
bool blender::ui::icon_get_theme_color (int icon_id, unsigned char color[4])
void blender::ui::icons_init ()
int blender::ui::icon_preview_to_render_size (enum eIconSizes size)
static void blender::ui::icon_create_rect (PreviewImage *prv_img, enum eIconSizes size)
static void blender::ui::id_preview_image_render_size (const bContext *C, Scene *scene, ID *id, PreviewImage *pi, int size, const bool use_job)
static void blender::ui::studiolight_icon_job_exec (void *customdata, wmJobWorkerStatus *)
static void blender::ui::studiolight_kill_icon_preview_job (wmWindowManager *wm, int icon_id)
static void blender::ui::studiolight_free_function (StudioLight *sl, void *data)
static void blender::ui::studiolight_icon_job_end (void *customdata)
void blender::ui::icon_ensure_deferred (const bContext *C, int icon_id, bool big)
bool blender::ui::icon_is_preview_deferred_loading (const int icon_id, const bool big)
static void blender::ui::icon_set_image (const bContext *C, Scene *scene, ID *id, PreviewImage *prv_img, enum eIconSizes size, const bool use_job)
PreviewImage * blender::ui::icon_to_preview (int icon_id)
static void blender::ui::icon_draw_rect (float x, float y, int w, int h, int rw, int rh, const uint8_t *rect, float alpha, const float desaturate)
static int blender::ui::get_draw_size (enum eIconSizes size)
static void blender::ui::svg_replace_color_attributes (std::string &svg, const std::string &name, const size_t start, const size_t end)
static void blender::ui::icon_source_edit_cb (std::string &svg)
static void blender::ui::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, const IconTextOverlay *text_overlay, const bool inverted=false)
void blender::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)
void blender::ui::icon_render_id (const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
static void blender::ui::id_icon_render (const bContext *C, ID *id, bool use_jobs)
static int blender::ui::id_screen_get_icon (const bContext *C, ID *id)
int blender::ui::id_icon_get (const bContext *C, ID *id, const bool big)
int blender::ui::icon_from_library (const ID *id)
int blender::ui::icon_from_rnaptr (const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
int blender::ui::icon_from_idcode (int idcode)
int blender::ui::icon_from_object_mode (int mode)
int blender::ui::icon_from_object_type (const Object *object)
int blender::ui::icon_color_from_collection (const Collection *collection)
void blender::ui::icon_draw (float x, float y, int icon_id)
void blender::ui::icon_draw_alpha (float x, float y, int icon_id, float alpha)
void blender::ui::icon_draw_preview (float x, float y, int icon_id, float aspect, float alpha, int size)
void blender::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, float scale=1.0f)
ImBuf * blender::ui::svg_icon_bitmap (uint icon_id, float size, bool multicolor=false)
void blender::ui::icon_text_overlay_init_from_count (IconTextOverlay *text_overlay, const int icon_indicator_number)
ImBuf * blender::ui::icon_alert_imbuf_get (AlertIcon icon, float size)

Variables

static CLG_LogRef blender::ui::LOG = {"ui.icon"}
static const IconType blender::ui::icontypes []
static DrawInfo * blender::ui::g_di_event_list = nullptr

Macro Definition Documentation

◆ DEF_ICON

#define DEF_ICON ( name)
Value:
#define ICON_TYPE_SVG_MONO

◆ DEF_ICON_BLANK

#define DEF_ICON_BLANK ( name)
Value:
#define ICON_TYPE_BLANK

◆ DEF_ICON_COLLECTION

#define DEF_ICON_COLLECTION ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_COLLECTION},

◆ DEF_ICON_COLOR

#define DEF_ICON_COLOR ( name)
Value:
#define ICON_TYPE_SVG_COLOR

◆ DEF_ICON_FOLDER

#define DEF_ICON_FOLDER ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_FOLDER},

◆ DEF_ICON_FUND

#define DEF_ICON_FUND ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_FUND},

◆ DEF_ICON_LAYERGROUP_COLOR_DRAW

#define DEF_ICON_LAYERGROUP_COLOR_DRAW ( index,
color )
Value:
static void vicon_layergroup_color_draw_##index( \
float x, float y, float w, float h, float alpha, const uchar * ) \
{ \
vicon_layergroup_color_draw(color, x, y, w, h, alpha); \
}
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
#define index(i)
unsigned int uchar

Definition at line 588 of file interface_icons.cc.

◆ DEF_ICON_MODIFIER

#define DEF_ICON_MODIFIER ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_MODIFIER},

◆ DEF_ICON_NODE_SOCKET_DRAW

#define DEF_ICON_NODE_SOCKET_DRAW ( name,
socket_type )
Value:
static void icon_node_socket_draw_##name( \
float x, float y, float w, float h, float alpha, const uchar * ) \
{ \
icon_node_socket_draw(socket_type, x, y, w, h, alpha); \
}

Definition at line 606 of file interface_icons.cc.

◆ DEF_ICON_OBJECT

#define DEF_ICON_OBJECT ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_OBJECT},

◆ DEF_ICON_OBJECT_DATA

#define DEF_ICON_OBJECT_DATA ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_OBJECT_DATA},

◆ DEF_ICON_SCENE

#define DEF_ICON_SCENE ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_SCENE},

◆ DEF_ICON_SHADING

#define DEF_ICON_SHADING ( name)
Value:
{ICON_TYPE_SVG_MONO, TH_ICON_SHADING},

◆ DEF_ICON_STRIP_COLOR_DRAW

#define DEF_ICON_STRIP_COLOR_DRAW ( index,
color )
Value:
static void vicon_strip_color_draw_##index( \
float x, float y, float w, float h, float alpha, const uchar * ) \
{ \
vicon_strip_color_draw(color, x, y, w, h, alpha); \
}

Definition at line 500 of file interface_icons.cc.

◆ DEF_ICON_VECTOR

#define DEF_ICON_VECTOR ( name)
Value:
#define ICON_TYPE_VECTOR

◆ DEF_ICON_VECTOR_COLORSET_DRAW_NTH

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

Definition at line 451 of file interface_icons.cc.

◆ ICON_INDIRECT_DATA_ALPHA

◆ ICON_TYPE_BLANK

#define ICON_TYPE_BLANK   9

Definition at line 85 of file interface_icons.cc.

◆ ICON_TYPE_BUFFER

◆ ICON_TYPE_EVENT

#define ICON_TYPE_EVENT   7

Definition at line 83 of file interface_icons.cc.

Referenced by blender::ui::icon_draw_size().

◆ ICON_TYPE_GEOM

#define ICON_TYPE_GEOM   6

◆ ICON_TYPE_GPLAYER

#define ICON_TYPE_GPLAYER   8

◆ ICON_TYPE_IMBUF

#define ICON_TYPE_IMBUF   4

◆ ICON_TYPE_PREVIEW

◆ ICON_TYPE_SVG_COLOR

#define ICON_TYPE_SVG_COLOR   1

◆ ICON_TYPE_SVG_MONO

#define ICON_TYPE_SVG_MONO   2

◆ ICON_TYPE_VECTOR

#define ICON_TYPE_VECTOR   5

◆ INIT_EVENT_ICON

#define INIT_EVENT_ICON ( icon_id,
type,
value )
Value:
{ \
DrawInfo *di = def_internal_icon(nullptr, 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)
#define ICON_TYPE_EVENT

Referenced by blender::ui::init_event_icons().