Curves: save active point to file
[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         TH_TAB_ACTIVE,
62         TH_TAB_INACTIVE,
63         TH_TAB_BACK,
64         TH_TAB_OUTLINE,
65         
66         TH_HEADER,
67         TH_HEADERDESEL,
68         TH_HEADER_TEXT,
69         TH_HEADER_TEXT_HI,
70         
71         /* panels */
72         TH_PANEL_HEADER,
73         TH_PANEL_BACK,
74         TH_PANEL_SHOW_HEADER,
75         TH_PANEL_SHOW_BACK,
76         
77         TH_BUTBACK,
78         TH_BUTBACK_TEXT,
79         TH_BUTBACK_TEXT_HI,
80         
81         TH_SHADE1,
82         TH_SHADE2,
83         TH_HILITE,
84
85         TH_GRID,
86         TH_WIRE,
87         TH_WIRE_EDIT,
88         TH_SELECT,
89         TH_ACTIVE,
90         TH_GROUP,
91         TH_GROUP_ACTIVE,
92         TH_TRANSFORM,
93         TH_VERTEX,
94         TH_VERTEX_SELECT,
95         TH_VERTEX_UNREFERENCED,
96         TH_VERTEX_SIZE,
97         TH_OUTLINE_WIDTH,
98         TH_EDGE,
99         TH_EDGE_SELECT,
100         TH_EDGE_SEAM,
101         TH_EDGE_FACESEL,
102         TH_FACE,
103         TH_FACE_SELECT,
104         TH_NORMAL,
105         TH_VNORMAL,
106         TH_FACE_DOT,
107         TH_FACEDOT_SIZE,
108         TH_CFRAME,
109         TH_NURB_ULINE,
110         TH_NURB_VLINE,
111         TH_NURB_SEL_ULINE,
112         TH_NURB_SEL_VLINE,
113
114         /* this eight colors should be in one block */
115         TH_HANDLE_FREE,
116         TH_HANDLE_AUTO,
117         TH_HANDLE_VECT,
118         TH_HANDLE_ALIGN,
119         TH_HANDLE_AUTOCLAMP,
120         TH_HANDLE_SEL_FREE,
121         TH_HANDLE_SEL_AUTO,
122         TH_HANDLE_SEL_VECT,
123         TH_HANDLE_SEL_ALIGN,
124         TH_HANDLE_SEL_AUTOCLAMP,
125
126         TH_ACTIVE_SPLINE,
127         TH_ACTIVE_VERT, /* equivalent of TH_EDITMESH_ACTIVE for splines */
128
129         TH_SYNTAX_B,
130         TH_SYNTAX_V,
131         TH_SYNTAX_R,
132         TH_SYNTAX_C,
133         TH_SYNTAX_L,
134         TH_SYNTAX_D,
135         TH_SYNTAX_N,
136         TH_SYNTAX_S,
137         
138         TH_BONE_SOLID,
139         TH_BONE_POSE,
140         TH_BONE_POSE_ACTIVE,
141         
142         TH_STRIP,
143         TH_STRIP_SELECT,
144         
145         TH_KEYTYPE_KEYFRAME, /* KEYTYPES */
146         TH_KEYTYPE_KEYFRAME_SELECT,
147         TH_KEYTYPE_EXTREME,
148         TH_KEYTYPE_EXTREME_SELECT,
149         TH_KEYTYPE_BREAKDOWN,
150         TH_KEYTYPE_BREAKDOWN_SELECT,
151         TH_KEYTYPE_JITTER,
152         TH_KEYTYPE_JITTER_SELECT,
153         
154         TH_KEYBORDER,
155         TH_KEYBORDER_SELECT,
156         
157         TH_LAMP,
158         TH_SPEAKER,
159         TH_CAMERA,
160         TH_EMPTY,
161         
162         TH_NODE,
163         TH_NODE_INPUT,
164         TH_NODE_OUTPUT,
165         TH_NODE_COLOR,
166         TH_NODE_FILTER,
167         TH_NODE_VECTOR,
168         TH_NODE_TEXTURE,
169         TH_NODE_PATTERN,
170         TH_NODE_SCRIPT,
171         TH_NODE_LAYOUT,
172         TH_NODE_SHADER,
173         TH_NODE_INTERFACE,
174         TH_NODE_CONVERTOR,
175         TH_NODE_GROUP,
176         TH_NODE_FRAME,
177         TH_NODE_MATTE,
178         TH_NODE_DISTORT,
179         
180         TH_CONSOLE_OUTPUT,
181         TH_CONSOLE_INPUT,
182         TH_CONSOLE_INFO,
183         TH_CONSOLE_ERROR,
184         TH_CONSOLE_CURSOR,
185         TH_CONSOLE_SELECT,
186         
187         TH_SEQ_MOVIE,
188         TH_SEQ_MOVIECLIP,
189         TH_SEQ_MASK,
190         TH_SEQ_IMAGE,
191         TH_SEQ_SCENE,
192         TH_SEQ_AUDIO,
193         TH_SEQ_EFFECT,
194         TH_SEQ_TRANSITION,
195         TH_SEQ_META,
196         TH_SEQ_PREVIEW,
197         
198         TH_EDGE_SHARP,
199         TH_EDITMESH_ACTIVE,
200         
201         TH_HANDLE_VERTEX,
202         TH_HANDLE_VERTEX_SELECT,
203         TH_HANDLE_VERTEX_SIZE,
204         
205         TH_DOPESHEET_CHANNELOB,
206         TH_DOPESHEET_CHANNELSUBOB,
207         
208         TH_PREVIEW_BACK,
209         
210         TH_EDGE_CREASE,
211
212         TH_DRAWEXTRA_EDGELEN,
213         TH_DRAWEXTRA_EDGEANG,
214         TH_DRAWEXTRA_FACEAREA,
215         TH_DRAWEXTRA_FACEANG,
216
217         TH_NODE_CURVING,
218
219         TH_MARKER_OUTLINE,
220         TH_MARKER,
221         TH_ACT_MARKER,
222         TH_SEL_MARKER,
223         TH_BUNDLE_SOLID,
224         TH_DIS_MARKER,
225         TH_PATH_BEFORE,
226         TH_PATH_AFTER,
227         TH_CAMERA_PATH,
228         TH_LOCK_MARKER,
229
230         TH_STITCH_PREVIEW_FACE,
231         TH_STITCH_PREVIEW_EDGE,
232         TH_STITCH_PREVIEW_VERT,
233         TH_STITCH_PREVIEW_STITCHABLE,
234         TH_STITCH_PREVIEW_UNSTITCHABLE,
235         TH_STITCH_PREVIEW_ACTIVE,
236
237         TH_UV_SHADOW,
238         TH_UV_OTHERS,
239
240         TH_FREESTYLE_EDGE_MARK,
241         TH_FREESTYLE_FACE_MARK,
242
243         TH_MATCH,           /* highlight color for search matches */
244         TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
245
246         TH_SKIN_ROOT,
247         
248         TH_ANIM_ACTIVE,   /* active action */
249         TH_ANIM_INACTIVE, /* no active action */
250         
251         TH_NLA_TWEAK,        /* 'tweaking' track in NLA */
252         TH_NLA_TWEAK_DUPLI,  /* error/warning flag for other strips referencing dupli strip */
253         
254         TH_NLA_TRANSITION,
255         TH_NLA_TRANSITION_SEL,
256         TH_NLA_META,
257         TH_NLA_META_SEL,
258         TH_NLA_SOUND,
259         TH_NLA_SOUND_SEL,
260         
261         TH_AXIS_X,              /* X/Y/Z Axis */
262         TH_AXIS_Y,
263         TH_AXIS_Z,
264
265         TH_LOW_GRAD,
266         TH_HIGH_GRAD,
267         TH_SHOW_BACK_GRAD,
268
269         TH_INFO_SELECTED,
270         TH_INFO_SELECTED_TEXT,
271         TH_INFO_ERROR,
272         TH_INFO_ERROR_TEXT,
273         TH_INFO_WARNING,
274         TH_INFO_WARNING_TEXT,
275         TH_INFO_INFO,
276         TH_INFO_INFO_TEXT,
277         TH_INFO_DEBUG,
278         TH_INFO_DEBUG_TEXT
279 };
280 /* XXX WARNING: previous is saved in file, so do not change order! */
281
282 /* specific defines per space should have higher define values */
283
284 struct bTheme;
285 struct PointerRNA;
286
287 // THE CODERS API FOR THEMES:
288
289 // sets the color
290 void    UI_ThemeColor(int colorid);
291
292 // sets the color plus alpha
293 void    UI_ThemeColor4(int colorid);
294
295 // sets color plus offset for shade
296 void    UI_ThemeColorShade(int colorid, int offset);
297
298 // sets color plus offset for alpha
299 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
300
301 // sets color, which is blend between two theme colors
302 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
303 // same, with shade offset
304 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
305 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
306
307 // returns one value, not scaled
308 float   UI_GetThemeValuef(int colorid);
309 int     UI_GetThemeValue(int colorid);
310
311 // get three color values, scaled to 0.0-1.0 range
312 void    UI_GetThemeColor3fv(int colorid, float col[3]);
313 // get the color, range 0.0-1.0, complete with shading offset
314 void    UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
315 void    UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
316
317 // get four color values, scaled to 0.0-1.0 range
318 void    UI_GetThemeColor4fv(int colorid, float col[4]);
319
320 // get the 3 or 4 byte values
321 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
322 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
323
324 // get a theme color from specified space type
325 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
326
327 // blends and shades between two color pointers
328 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
329
330 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
331 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
332
333 // get a 3 byte color, blended and shaded between two other char color pointers
334 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
335
336 // clear the openGL ClearColor using the input colorid
337 void    UI_ThemeClearColor(int colorid);
338
339 // internal (blender) usage only, for init and set active
340 void    UI_SetTheme(int spacetype, int regionid);
341
342 // get current theme
343 struct bTheme *UI_GetTheme(void);
344
345 // return shadow width outside menus and popups */
346 int UI_ThemeMenuShadowWidth(void);
347
348 /* only for buttons in theme editor! */
349 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
350
351 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
352
353 #endif  /* __UI_RESOURCES_H__ */