Blender V5.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
8
9#pragma once
10
11#include "BLI_sys_types.hh"
12
13/* Required for #eIconSizes. */
14#include "DNA_ID_enums.h"
15
16namespace blender {
17
18struct Collection;
19struct ID;
20struct ImBuf;
21struct Object;
22struct PointerRNA;
23struct PreviewImage;
24struct Scene;
25struct bContext;
26
27namespace ui {
28
30 char text[5];
31 uchar color[4] = {0};
32};
33
34#define UI_NO_ICON_OVERLAY_TEXT NULL
35
36#define ICON_DEFAULT_HEIGHT 16
37#define ICON_DEFAULT_WIDTH 16
38
39#define ICON_DEFAULT_HEIGHT_TOOLBAR 32
40
41#define ICON_DEFAULT_HEIGHT_SCALE int(UI_UNIT_Y * 0.8f)
42#define ICON_DEFAULT_WIDTH_SCALE int(UI_UNIT_X * 0.8f)
43
44#define PREVIEW_DEFAULT_HEIGHT 128
45
46#define PREVIEW_DRAG_DRAW_SIZE 96.0f
47
48enum class AlertIcon : int8_t {
49 None = -1,
52 Error = 2,
53 Info = 3,
55};
56
57ImBuf *icon_alert_imbuf_get(AlertIcon icon, float size);
58
62void icons_init();
63
64bool icon_get_theme_color(int icon_id, unsigned char color[4]);
65
71void icon_render_id(const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job);
72
76void icon_render_id_ex(const bContext *C,
77 Scene *scene,
78 ID *id_to_render,
79 const enum eIconSizes size,
80 const bool use_job,
81 PreviewImage *r_preview_image);
82
87
91void icon_draw(float x, float y, int icon_id);
92void icon_draw_alpha(float x, float y, int icon_id, float alpha);
93void icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size);
94
95void icon_draw_ex(float x,
96 float y,
97 int icon_id,
98 float aspect,
99 float alpha,
100 float desaturate,
101 const uchar mono_color[4],
102 bool mono_border,
103 const IconTextOverlay *text_overlay,
104 const bool inverted = false,
105 float scale = 1.0f);
106
107ImBuf *svg_icon_bitmap(uint icon_id, float size, bool multicolor = false);
108
109void icons_free();
110void icons_free_drawinfo(void *drawinfo);
111
112PreviewImage *icon_to_preview(int icon_id);
113
114int icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big);
115int icon_from_idcode(int idcode);
116int icon_from_library(const ID *id);
117int icon_from_object_mode(int mode);
118int icon_from_object_type(const Object *object);
119int icon_color_from_collection(const Collection *collection);
120
121void icon_text_overlay_init_from_count(IconTextOverlay *text_overlay,
122 const int icon_indicator_number);
123
124void icon_ensure_deferred(const bContext *C, int icon_id, bool big);
125
126} // namespace ui
127} // namespace blender
Enumerations for DNA_ID.h.
#define C
Definition RandGen.cpp:29
float3x3 scale(float3x3 mat, float2 scale)
ccl_device_inline float3x3 inverted(const float3x3 m)
void icon_text_overlay_init_from_count(IconTextOverlay *text_overlay, const int icon_indicator_number)
int icon_from_object_type(const Object *object)
ImBuf * icon_alert_imbuf_get(AlertIcon icon, float size)
bool icon_get_theme_color(int icon_id, unsigned char color[4])
void icons_free_drawinfo(void *drawinfo)
int icon_from_idcode(int idcode)
void 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)
int icon_from_object_mode(int mode)
void icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
void 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 icon_from_rnaptr(const bContext *C, PointerRNA *ptr, int rnaicon, bool big)
void icon_draw(float x, float y, int icon_id)
void icon_render_id(const bContext *C, Scene *scene, ID *id, enum eIconSizes size, bool use_job)
int icon_color_from_collection(const Collection *collection)
void icon_draw_alpha(float x, float y, int icon_id, float alpha)
int icon_from_library(const ID *id)
void icon_ensure_deferred(const bContext *C, int icon_id, bool big)
int icon_preview_to_render_size(enum eIconSizes size)
ImBuf * svg_icon_bitmap(uint icon_id, float size, bool multicolor=false)
PreviewImage * icon_to_preview(int icon_id)
BMesh Iterators.
unsigned int uint
Definition BKE_text.h:55
unsigned char uchar
Definition BKE_text.h:58
signed char int8_t
Definition BKE_text.h:76
@ Question
Definition types.hh:63