Fix [#34005] blender will close immediately in debug mode on deleting objects
[blender.git] / source / blender / editors / include / UI_resources.h
1 /*
2  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
19  * All rights reserved.
20  *
21  * The Original Code is: all of this file.
22  *
23  * Contributor(s): none yet.
24  * 
25  * ***** END GPL/BL DUAL LICENSE BLOCK *****
26  */
27
28 /** \file UI_resources.h
29  *  \ingroup editorui
30  */
31
32 #ifndef __UI_RESOURCES_H__
33 #define __UI_RESOURCES_H__
34
35 /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
36 /* and add/replace include of UI_resources.h by UI_interface_icons.h */
37 #define DEF_ICON(name) ICON_##name,
38 #define DEF_VICO(name) VICO_##name,
39
40 typedef enum {
41         /* ui */
42 #include "UI_icons.h"
43         BIFICONID_LAST
44 } BIFIconID;
45
46 #define BIFICONID_FIRST  (ICON_NONE)
47
48 #undef DEF_ICON
49 #undef DEF_VICO
50
51 enum {
52         TH_REDALERT,
53
54         TH_THEMEUI,
55 // common colors among spaces
56         
57         TH_BACK,
58         TH_TEXT,
59         TH_TEXT_HI,
60         TH_TITLE,
61         
62         TH_HEADER,
63         TH_HEADERDESEL,
64         TH_HEADER_TEXT,
65         TH_HEADER_TEXT_HI,
66         
67         /* panels */
68         TH_PANEL_HEADER,
69         TH_PANEL_BACK,
70         TH_PANEL_SHOW_HEADER,
71         TH_PANEL_SHOW_BACK,
72         
73         TH_BUTBACK,
74         TH_BUTBACK_TEXT,
75         TH_BUTBACK_TEXT_HI,
76         
77         TH_SHADE1,
78         TH_SHADE2,
79         TH_HILITE,
80
81         TH_GRID,
82         TH_WIRE,
83         TH_SELECT,
84         TH_ACTIVE,
85         TH_GROUP,
86         TH_GROUP_ACTIVE,
87         TH_TRANSFORM,
88         TH_VERTEX,
89         TH_VERTEX_SELECT,
90         TH_VERTEX_SIZE,
91         TH_OUTLINE_WIDTH,
92         TH_EDGE,
93         TH_EDGE_SELECT,
94         TH_EDGE_SEAM,
95         TH_EDGE_FACESEL,
96         TH_FACE,
97         TH_FACE_SELECT,
98         TH_NORMAL,
99         TH_VNORMAL,
100         TH_FACE_DOT,
101         TH_FACEDOT_SIZE,
102         TH_CFRAME,
103         TH_NURB_ULINE,
104         TH_NURB_VLINE,
105         TH_NURB_SEL_ULINE,
106         TH_NURB_SEL_VLINE,
107
108         /* this eight colors should be in one block */
109         TH_HANDLE_FREE,
110         TH_HANDLE_AUTO,
111         TH_HANDLE_VECT,
112         TH_HANDLE_ALIGN,
113         TH_HANDLE_AUTOCLAMP,
114         TH_HANDLE_SEL_FREE,
115         TH_HANDLE_SEL_AUTO,
116         TH_HANDLE_SEL_VECT,
117         TH_HANDLE_SEL_ALIGN,
118         TH_HANDLE_SEL_AUTOCLAMP,
119
120         TH_ACTIVE_SPLINE,
121         TH_LASTSEL_POINT,
122
123         TH_SYNTAX_B,
124         TH_SYNTAX_V,
125         TH_SYNTAX_R,
126         TH_SYNTAX_C,
127         TH_SYNTAX_L,
128         TH_SYNTAX_D,
129         TH_SYNTAX_N,
130         TH_SYNTAX_S,
131         
132         TH_BONE_SOLID,
133         TH_BONE_POSE,
134         TH_BONE_POSE_ACTIVE,
135         
136         TH_STRIP,
137         TH_STRIP_SELECT,
138         
139         TH_LAMP,
140         TH_SPEAKER,
141         TH_CAMERA,
142         TH_EMPTY,
143         
144         TH_NODE,
145         TH_NODE_IN_OUT,
146         TH_NODE_OPERATOR,
147         TH_NODE_CONVERTOR,
148         TH_NODE_GROUP,
149         TH_NODE_FRAME,
150         TH_NODE_MATTE,
151         TH_NODE_DISTORT,
152         
153         TH_CONSOLE_OUTPUT,
154         TH_CONSOLE_INPUT,
155         TH_CONSOLE_INFO,
156         TH_CONSOLE_ERROR,
157         TH_CONSOLE_CURSOR,
158         
159         TH_SEQ_MOVIE,
160         TH_SEQ_MOVIECLIP,
161         TH_SEQ_MASK,
162         TH_SEQ_IMAGE,
163         TH_SEQ_SCENE,
164         TH_SEQ_AUDIO,
165         TH_SEQ_EFFECT,
166         TH_SEQ_TRANSITION,
167         TH_SEQ_META,
168         TH_SEQ_PREVIEW,
169         
170         TH_EDGE_SHARP,
171         TH_EDITMESH_ACTIVE,
172         
173         TH_HANDLE_VERTEX,
174         TH_HANDLE_VERTEX_SELECT,
175         TH_HANDLE_VERTEX_SIZE,
176         
177         TH_DOPESHEET_CHANNELOB,
178         TH_DOPESHEET_CHANNELSUBOB,
179         
180         TH_PREVIEW_BACK,
181         
182         TH_EDGE_CREASE,
183
184         TH_DRAWEXTRA_EDGELEN,
185         TH_DRAWEXTRA_FACEAREA,
186         TH_DRAWEXTRA_FACEANG,
187
188         TH_NODE_CURVING,
189
190         TH_MARKER_OUTLINE,
191         TH_MARKER,
192         TH_ACT_MARKER,
193         TH_SEL_MARKER,
194         TH_BUNDLE_SOLID,
195         TH_DIS_MARKER,
196         TH_PATH_BEFORE,
197         TH_PATH_AFTER,
198         TH_CAMERA_PATH,
199         TH_LOCK_MARKER,
200
201         TH_STITCH_PREVIEW_FACE,
202         TH_STITCH_PREVIEW_EDGE,
203         TH_STITCH_PREVIEW_VERT,
204         TH_STITCH_PREVIEW_STITCHABLE,
205         TH_STITCH_PREVIEW_UNSTITCHABLE,
206         TH_STITCH_PREVIEW_ACTIVE,
207
208         TH_MATCH,           /* highlight color for search matches */
209         TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
210
211         TH_SKIN_ROOT,
212         
213         TH_ANIM_ACTIVE,   /* active action */
214         TH_ANIM_INACTIVE, /* no active action */
215         
216         TH_NLA_TWEAK,        /* 'tweaking' track in NLA */
217         TH_NLA_TWEAK_DUPLI,  /* error/warning flag for other strips referencing dupli strip */
218         
219         TH_NLA_TRANSITION,
220         TH_NLA_TRANSITION_SEL,
221         TH_NLA_META,
222         TH_NLA_META_SEL,
223         TH_NLA_SOUND,
224         TH_NLA_SOUND_SEL,
225         
226         TH_AXIS_X,              /* X/Y/Z Axis */
227         TH_AXIS_Y,
228         TH_AXIS_Z,
229
230         TH_LOW_GRAD,
231         TH_HIGH_GRAD,
232         TH_SHOW_BACK_GRAD
233 };
234 /* XXX WARNING: previous is saved in file, so do not change order! */
235
236 /* specific defines per space should have higher define values */
237
238 struct bTheme;
239 struct PointerRNA;
240
241 // THE CODERS API FOR THEMES:
242
243 // sets the color
244 void    UI_ThemeColor(int colorid);
245
246 // sets the color plus alpha
247 void    UI_ThemeColor4(int colorid);
248
249 // sets color plus offset for shade
250 void    UI_ThemeColorShade(int colorid, int offset);
251
252 // sets color plus offset for alpha
253 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
254
255 // sets color, which is blend between two theme colors
256 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
257 // same, with shade offset
258 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
259 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
260
261 // returns one value, not scaled
262 float   UI_GetThemeValuef(int colorid);
263 int     UI_GetThemeValue(int colorid);
264
265 // get three color values, scaled to 0.0-1.0 range
266 void    UI_GetThemeColor3fv(int colorid, float col[3]);
267 // get the color, range 0.0-1.0, complete with shading offset
268 void    UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
269 void    UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
270
271 // get four color values, scaled to 0.0-1.0 range
272 void    UI_GetThemeColor4fv(int colorid, float col[4]);
273
274 // get the 3 or 4 byte values
275 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
276 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
277
278 // get a theme color from specified space type
279 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
280
281 // blends and shades between two color pointers
282 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
283
284 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
285 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
286
287 // get a 3 byte color, blended and shaded between two other char color pointers
288 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
289
290 // clear the openGL ClearColor using the input colorid
291 void    UI_ThemeClearColor(int colorid);
292
293 // internal (blender) usage only, for init and set active
294 void    UI_SetTheme(int spacetype, int regionid);
295
296 // get current theme
297 struct bTheme *UI_GetTheme(void);
298
299 // return shadow width outside menus and popups */
300 int UI_ThemeMenuShadowWidth(void);
301
302 /* only for buttons in theme editor! */
303 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
304
305 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
306
307 #endif /*  UI_ICONS_H */