Blender V5.0
UI_interface_icons.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "BLI_sys_types.h"
12
13/* Required for #eIconSizes. */
14#include "DNA_ID_enums.h"
15
16struct Collection;
17struct ID;
18struct ImBuf;
19struct PointerRNA;
20struct PreviewImage;
21struct Scene;
22struct bContext;
23
25 char text[5];
26 uchar color[4] = {0};
27};
28
29#define UI_NO_ICON_OVERLAY_TEXT NULL
30
31#define ICON_DEFAULT_HEIGHT 16
32#define ICON_DEFAULT_WIDTH 16
33
34#define ICON_DEFAULT_HEIGHT_TOOLBAR 32
35
36#define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
37#define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f))
38
39#define PREVIEW_DEFAULT_HEIGHT 128
40
41#define PREVIEW_DRAG_DRAW_SIZE 96.0f
42
51
53
57void UI_icons_init();
58
59bool UI_icon_get_theme_color(int icon_id, unsigned char color[4]);
60
67 const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job);
68
73 Scene *scene,
74 ID *id_to_render,
75 const enum eIconSizes size,
76 const bool use_job,
77 PreviewImage *r_preview_image);
78
83
87void UI_icon_draw(float x, float y, int icon_id);
88void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha);
89void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size);
90
91void UI_icon_draw_ex(float x,
92 float y,
93 int icon_id,
94 float aspect,
95 float alpha,
96 float desaturate,
97 const uchar mono_color[4],
98 bool mono_border,
99 const IconTextOverlay *text_overlay,
100 const bool inverted = false);
101
102ImBuf *UI_svg_icon_bitmap(uint icon_id, float size, bool multicolor = false);
103
104void UI_icons_free();
105void UI_icons_free_drawinfo(void *drawinfo);
106
107PreviewImage *UI_icon_to_preview(int icon_id);
108
109int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big);
110int UI_icon_from_idcode(int idcode);
111int UI_icon_from_library(const ID *id);
112int UI_icon_from_object_mode(int mode);
113int UI_icon_color_from_collection(const Collection *collection);
114
116 const int icon_indicator_number);
unsigned char uchar
unsigned int uint
Enumerations for DNA_ID.h.
eIconSizes
#define C
Definition RandGen.cpp:29
void UI_icons_free_drawinfo(void *drawinfo)
PreviewImage * UI_icon_to_preview(int icon_id)
void UI_icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
bool UI_icon_get_theme_color(int icon_id, unsigned char color[4])
void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha)
void UI_icon_draw(float x, float y, int icon_id)
int UI_icon_from_idcode(int idcode)
int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
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_from_library(const ID *id)
int UI_icon_from_object_mode(int mode)
ImBuf * UI_svg_icon_bitmap(uint icon_id, float size, bool multicolor=false)
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)
void UI_icons_init()
@ ALERT_ICON_MAX
@ ALERT_ICON_NONE
@ ALERT_ICON_INFO
@ ALERT_ICON_WARNING
@ ALERT_ICON_QUESTION
@ ALERT_ICON_ERROR
int UI_icon_color_from_collection(const Collection *collection)
void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
int UI_icon_preview_to_render_size(enum eIconSizes size)
ImBuf * UI_icon_alert_imbuf_get(eAlertIcon icon, float size)
void UI_icons_free()
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition btDbvt.cpp:52
Definition DNA_ID.h:414
PointerRNA * ptr
Definition wm_files.cc:4238