Blender  V2.93
UI_interface_icons.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 /* Required for #eIconSizes which can't be forward declared if this file is included in C++. */
27 #include "DNA_ID_enums.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 struct Collection;
34 struct ID;
35 struct PointerRNA;
36 struct PreviewImage;
37 struct Scene;
38 struct bContext;
39 
40 typedef struct IconFile {
41  struct IconFile *next, *prev;
42  char filename[256]; /* FILE_MAXFILE size */
43  int index;
45 
46 #define ICON_DEFAULT_HEIGHT 16
47 #define ICON_DEFAULT_WIDTH 16
48 
49 #define ICON_DEFAULT_HEIGHT_TOOLBAR 32
50 
51 #define ICON_DEFAULT_HEIGHT_SCALE ((int)(UI_UNIT_Y * 0.8f))
52 #define ICON_DEFAULT_WIDTH_SCALE ((int)(UI_UNIT_X * 0.8f))
53 
54 #define PREVIEW_DEFAULT_HEIGHT 128
55 
56 typedef enum eAlertIcon {
64 
66 
67 /*
68  * Resizable Icons for Blender
69  */
70 void UI_icons_init(void);
72 
73 int UI_icon_get_width(int icon_id);
74 int UI_icon_get_height(int icon_id);
75 bool UI_icon_get_theme_color(int icon_id, unsigned char color[4]);
76 
77 void UI_icon_render_id(const struct bContext *C,
78  struct Scene *scene,
79  struct ID *id,
80  const enum eIconSizes size,
81  const bool use_job);
83 
84 void UI_icon_draw(float x, float y, int icon_id);
85 void UI_icon_draw_alpha(float x, float y, int icon_id, float alpha);
86 void UI_icon_draw_preview(float x, float y, int icon_id, float aspect, float alpha, int size);
87 
88 void UI_icon_draw_ex(float x,
89  float y,
90  int icon_id,
91  float aspect,
92  float alpha,
93  float desaturate,
94  const uchar mono_color[4],
95  const bool mono_border);
96 
97 void UI_icons_free(void);
98 void UI_icons_free_drawinfo(void *drawinfo);
99 
100 void UI_icon_draw_cache_begin(void);
101 void UI_icon_draw_cache_end(void);
102 
103 struct ListBase *UI_iconfile_list(void);
104 int UI_iconfile_get_index(const char *filename);
105 
107 
108 int UI_icon_from_rnaptr(struct bContext *C, struct PointerRNA *ptr, int rnaicon, const bool big);
109 int UI_icon_from_idcode(const int idcode);
110 int UI_icon_from_library(const struct ID *id);
111 int UI_icon_from_object_mode(const int mode);
112 int UI_icon_color_from_collection(const struct Collection *collection);
113 
114 #ifdef __cplusplus
115 }
116 #endif
unsigned char uchar
Definition: BLI_sys_types.h:86
Enumerations for DNA_ID.h.
eIconSizes
Definition: DNA_ID_enums.h:28
_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
#define C
Definition: RandGen.cpp:39
void UI_icons_free_drawinfo(void *drawinfo)
int UI_icon_from_object_mode(const int mode)
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)
int UI_icon_from_idcode(const int idcode)
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)
struct ListBase * UI_iconfile_list(void)
int UI_icon_color_from_collection(const struct Collection *collection)
void UI_icon_draw_cache_begin(void)
int UI_icon_from_library(const struct ID *id)
int UI_icon_get_height(int icon_id)
struct PreviewImage * UI_icon_to_preview(int icon_id)
int UI_iconfile_get_index(const char *filename)
int UI_icon_from_rnaptr(struct bContext *C, struct PointerRNA *ptr, int rnaicon, const bool big)
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)
void UI_icon_render_id(const struct bContext *C, struct Scene *scene, struct ID *id, const enum eIconSizes size, const bool use_job)
int UI_icon_get_width(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], const bool mono_border)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
Definition: btDbvt.cpp:52
Scene scene
static CCL_NAMESPACE_BEGIN const double alpha
Definition: DNA_ID.h:273
char filename[256]
struct IconFile * next
struct IconFile * prev
int icon_id
Definition: DNA_ID.h:400
PointerRNA * ptr
Definition: wm_files.c:3157