Blender V4.3
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
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
49
51
55void UI_icons_init();
56
57bool UI_icon_get_theme_color(int icon_id, unsigned char color[4]);
58
65 const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job);
66
70void UI_icon_render_id_ex(const bContext *C,
71 Scene *scene,
72 ID *id_to_render,
73 const enum eIconSizes size,
74 const bool use_job,
75 PreviewImage *r_preview_image);
76
81
85void UI_icon_draw(float x, float y, int icon_id);
86void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha);
87void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size);
88
89void UI_icon_draw_ex(float x,
90 float y,
91 int icon_id,
92 float aspect,
93 float alpha,
94 float desaturate,
95 const uchar mono_color[4],
96 bool mono_border,
97 const IconTextOverlay *text_overlay,
98 const bool inverted = false);
99
100ImBuf *UI_svg_icon_bitmap(uint icon_id, float size, bool multicolor = false);
101
102void UI_icons_free();
103void UI_icons_free_drawinfo(void *drawinfo);
104
105PreviewImage *UI_icon_to_preview(int icon_id);
106
107int UI_icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big);
108int UI_icon_from_idcode(int idcode);
109int UI_icon_from_library(const ID *id);
110int UI_icon_from_object_mode(int mode);
111int UI_icon_color_from_collection(const Collection *collection);
112
114 const int icon_indicator_number);
unsigned char uchar
unsigned int uint
Enumerations for DNA_ID.h.
eIconSizes
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()
Definition DNA_ID.h:413
PointerRNA * ptr
Definition wm_files.cc:4126