Blender  V3.3
UI_interface_icons.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #pragma once
9 
10 /* Required for #eIconSizes which can't be forward declared if this file is included in C++. */
11 #include "DNA_ID_enums.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 struct Collection;
18 struct ID;
19 struct PointerRNA;
20 struct PreviewImage;
21 struct Scene;
22 struct bContext;
23 
24 typedef struct IconFile {
25  struct IconFile *next, *prev;
26  char filename[256]; /* FILE_MAXFILE size */
27  int index;
29 
30 #define ICON_DEFAULT_HEIGHT 16
31 #define ICON_DEFAULT_WIDTH 16
32 
33 #define ICON_DEFAULT_HEIGHT_TOOLBAR 32
34 
35 #define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
36 #define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f))
37 
38 #define PREVIEW_DEFAULT_HEIGHT 128
39 
40 typedef enum eAlertIcon {
48 
50 
54 void UI_icons_init(void);
60 
64 int UI_icon_get_width(int icon_id);
65 int UI_icon_get_height(int icon_id);
66 bool UI_icon_get_theme_color(int icon_id, unsigned char color[4]);
67 
73 void UI_icon_render_id(const struct bContext *C,
74  struct Scene *scene,
75  struct ID *id,
76  enum eIconSizes size,
77  bool use_job);
78 
82 void UI_icon_render_id_ex(const struct bContext *C,
83  struct Scene *scene,
84  struct ID *id_to_render,
85  const enum eIconSizes size,
86  const bool use_job,
87  struct PreviewImage *r_preview_image);
88 
93 
97 void UI_icon_draw(float x, float y, int icon_id);
98 void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha);
99 void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size);
100 
101 void UI_icon_draw_ex(float x,
102  float y,
103  int icon_id,
104  float aspect,
105  float alpha,
106  float desaturate,
107  const uchar mono_color[4],
108  bool mono_border);
109 
110 void UI_icons_free(void);
111 void UI_icons_free_drawinfo(void *drawinfo);
112 
113 void UI_icon_draw_cache_begin(void);
114 void UI_icon_draw_cache_end(void);
115 
116 struct ListBase *UI_iconfile_list(void);
117 int UI_iconfile_get_index(const char *filename);
118 
120 
121 int UI_icon_from_rnaptr(const struct bContext *C, struct PointerRNA *ptr, int rnaicon, bool big);
122 int UI_icon_from_idcode(int idcode);
123 int UI_icon_from_library(const struct ID *id);
124 int UI_icon_from_object_mode(int mode);
125 int UI_icon_color_from_collection(const struct Collection *collection);
126 
127 #ifdef __cplusplus
128 }
129 #endif
unsigned char uchar
Definition: BLI_sys_types.h:70
Enumerations for DNA_ID.h.
eIconSizes
Definition: DNA_ID_enums.h:14
_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
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position Clamp a value between a minimum and a maximum Vector Perform vector math operation Invert a color
#define C
Definition: RandGen.cpp:25
void UI_icons_free_drawinfo(void *drawinfo)
void UI_icon_draw_cache_end(void)
struct IconFile IconFile
void UI_icons_free(void)
bool UI_icon_get_theme_color(int icon_id, unsigned char color[4])
void UI_icons_reload_internal_textures(void)
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)
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)
struct ListBase * UI_iconfile_list(void)
void UI_icon_render_id_ex(const struct bContext *C, struct Scene *scene, struct ID *id_to_render, const enum eIconSizes size, const bool use_job, struct PreviewImage *r_preview_image)
int UI_icon_color_from_collection(const struct Collection *collection)
int UI_icon_from_idcode(int idcode)
void UI_icon_draw_cache_begin(void)
int UI_icon_from_library(const struct ID *id)
int UI_icon_from_rnaptr(const struct bContext *C, struct PointerRNA *ptr, int rnaicon, bool big)
int UI_icon_get_height(int icon_id)
struct PreviewImage * UI_icon_to_preview(int icon_id)
int UI_icon_from_object_mode(int mode)
void UI_icon_render_id(const struct bContext *C, struct Scene *scene, struct ID *id, enum eIconSizes size, bool use_job)
int UI_iconfile_get_index(const char *filename)
eAlertIcon
@ ALERT_ICON_MAX
@ ALERT_ICON_BLENDER
@ ALERT_ICON_INFO
@ ALERT_ICON_WARNING
@ ALERT_ICON_QUESTION
@ ALERT_ICON_ERROR
void UI_icons_init(void)
void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size)
struct ImBuf * UI_icon_alert_imbuf_get(eAlertIcon icon)
int UI_icon_preview_to_render_size(enum eIconSizes size)
int UI_icon_get_width(int icon_id)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
Definition: DNA_ID.h:368
char filename[256]
struct IconFile * next
struct IconFile * prev
int icon_id
Definition: DNA_ID.h:540
PointerRNA * ptr
Definition: wm_files.c:3480