3d04675348f555e716bb49efb425bac41dafb277
[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_UNREFERENCED,
91         TH_VERTEX_SIZE,
92         TH_OUTLINE_WIDTH,
93         TH_EDGE,
94         TH_EDGE_SELECT,
95         TH_EDGE_SEAM,
96         TH_EDGE_FACESEL,
97         TH_FACE,
98         TH_FACE_SELECT,
99         TH_NORMAL,
100         TH_VNORMAL,
101         TH_FACE_DOT,
102         TH_FACEDOT_SIZE,
103         TH_CFRAME,
104         TH_NURB_ULINE,
105         TH_NURB_VLINE,
106         TH_NURB_SEL_ULINE,
107         TH_NURB_SEL_VLINE,
108
109         /* this eight colors should be in one block */
110         TH_HANDLE_FREE,
111         TH_HANDLE_AUTO,
112         TH_HANDLE_VECT,
113         TH_HANDLE_ALIGN,
114         TH_HANDLE_AUTOCLAMP,
115         TH_HANDLE_SEL_FREE,
116         TH_HANDLE_SEL_AUTO,
117         TH_HANDLE_SEL_VECT,
118         TH_HANDLE_SEL_ALIGN,
119         TH_HANDLE_SEL_AUTOCLAMP,
120
121         TH_ACTIVE_SPLINE,
122         TH_LASTSEL_POINT,
123
124         TH_SYNTAX_B,
125         TH_SYNTAX_V,
126         TH_SYNTAX_R,
127         TH_SYNTAX_C,
128         TH_SYNTAX_L,
129         TH_SYNTAX_D,
130         TH_SYNTAX_N,
131         TH_SYNTAX_S,
132         
133         TH_BONE_SOLID,
134         TH_BONE_POSE,
135         TH_BONE_POSE_ACTIVE,
136         
137         TH_STRIP,
138         TH_STRIP_SELECT,
139         
140         TH_LAMP,
141         TH_SPEAKER,
142         TH_CAMERA,
143         TH_EMPTY,
144         
145         TH_NODE,
146         TH_NODE_IN_OUT,
147         TH_NODE_INTERFACE,
148         TH_NODE_OPERATOR,
149         TH_NODE_CONVERTOR,
150         TH_NODE_GROUP,
151         TH_NODE_FRAME,
152         TH_NODE_MATTE,
153         TH_NODE_DISTORT,
154         
155         TH_CONSOLE_OUTPUT,
156         TH_CONSOLE_INPUT,
157         TH_CONSOLE_INFO,
158         TH_CONSOLE_ERROR,
159         TH_CONSOLE_CURSOR,
160         TH_CONSOLE_SELECT,
161         
162         TH_SEQ_MOVIE,
163         TH_SEQ_MOVIECLIP,
164         TH_SEQ_MASK,
165         TH_SEQ_IMAGE,
166         TH_SEQ_SCENE,
167         TH_SEQ_AUDIO,
168         TH_SEQ_EFFECT,
169         TH_SEQ_TRANSITION,
170         TH_SEQ_META,
171         TH_SEQ_PREVIEW,
172         
173         TH_EDGE_SHARP,
174         TH_EDITMESH_ACTIVE,
175         
176         TH_HANDLE_VERTEX,
177         TH_HANDLE_VERTEX_SELECT,
178         TH_HANDLE_VERTEX_SIZE,
179         
180         TH_DOPESHEET_CHANNELOB,
181         TH_DOPESHEET_CHANNELSUBOB,
182         
183         TH_PREVIEW_BACK,
184         
185         TH_EDGE_CREASE,
186
187         TH_DRAWEXTRA_EDGELEN,
188         TH_DRAWEXTRA_EDGEANG,
189         TH_DRAWEXTRA_FACEAREA,
190         TH_DRAWEXTRA_FACEANG,
191
192         TH_NODE_CURVING,
193
194         TH_MARKER_OUTLINE,
195         TH_MARKER,
196         TH_ACT_MARKER,
197         TH_SEL_MARKER,
198         TH_BUNDLE_SOLID,
199         TH_DIS_MARKER,
200         TH_PATH_BEFORE,
201         TH_PATH_AFTER,
202         TH_CAMERA_PATH,
203         TH_LOCK_MARKER,
204
205         TH_STITCH_PREVIEW_FACE,
206         TH_STITCH_PREVIEW_EDGE,
207         TH_STITCH_PREVIEW_VERT,
208         TH_STITCH_PREVIEW_STITCHABLE,
209         TH_STITCH_PREVIEW_UNSTITCHABLE,
210         TH_STITCH_PREVIEW_ACTIVE,
211
212         TH_FREESTYLE_EDGE_MARK,
213         TH_FREESTYLE_FACE_MARK,
214
215         TH_MATCH,           /* highlight color for search matches */
216         TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
217
218         TH_SKIN_ROOT,
219         
220         TH_ANIM_ACTIVE,   /* active action */
221         TH_ANIM_INACTIVE, /* no active action */
222         
223         TH_NLA_TWEAK,        /* 'tweaking' track in NLA */
224         TH_NLA_TWEAK_DUPLI,  /* error/warning flag for other strips referencing dupli strip */
225         
226         TH_NLA_TRANSITION,
227         TH_NLA_TRANSITION_SEL,
228         TH_NLA_META,
229         TH_NLA_META_SEL,
230         TH_NLA_SOUND,
231         TH_NLA_SOUND_SEL,
232         
233         TH_AXIS_X,              /* X/Y/Z Axis */
234         TH_AXIS_Y,
235         TH_AXIS_Z,
236
237         TH_LOW_GRAD,
238         TH_HIGH_GRAD,
239         TH_SHOW_BACK_GRAD
240 };
241 /* XXX WARNING: previous is saved in file, so do not change order! */
242
243 /* specific defines per space should have higher define values */
244
245 struct bTheme;
246 struct PointerRNA;
247
248 // THE CODERS API FOR THEMES:
249
250 // sets the color
251 void    UI_ThemeColor(int colorid);
252
253 // sets the color plus alpha
254 void    UI_ThemeColor4(int colorid);
255
256 // sets color plus offset for shade
257 void    UI_ThemeColorShade(int colorid, int offset);
258
259 // sets color plus offset for alpha
260 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
261
262 // sets color, which is blend between two theme colors
263 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
264 // same, with shade offset
265 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
266 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
267
268 // returns one value, not scaled
269 float   UI_GetThemeValuef(int colorid);
270 int     UI_GetThemeValue(int colorid);
271
272 // get three color values, scaled to 0.0-1.0 range
273 void    UI_GetThemeColor3fv(int colorid, float col[3]);
274 // get the color, range 0.0-1.0, complete with shading offset
275 void    UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
276 void    UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
277
278 // get four color values, scaled to 0.0-1.0 range
279 void    UI_GetThemeColor4fv(int colorid, float col[4]);
280
281 // get the 3 or 4 byte values
282 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
283 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
284
285 // get a theme color from specified space type
286 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
287
288 // blends and shades between two color pointers
289 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
290
291 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
292 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
293
294 // get a 3 byte color, blended and shaded between two other char color pointers
295 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
296
297 // clear the openGL ClearColor using the input colorid
298 void    UI_ThemeClearColor(int colorid);
299
300 // internal (blender) usage only, for init and set active
301 void    UI_SetTheme(int spacetype, int regionid);
302
303 // get current theme
304 struct bTheme *UI_GetTheme(void);
305
306 // return shadow width outside menus and popups */
307 int UI_ThemeMenuShadowWidth(void);
308
309 /* only for buttons in theme editor! */
310 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
311
312 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
313
314 #endif  /* __UI_RESOURCES_H__ */