Merged changes in the trunk up to revision 46787.
[blender-staging.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         /* float panels */
68         TH_PANEL,
69         TH_PANEL_TEXT,
70         TH_PANEL_TEXT_HI,
71         
72         TH_BUTBACK,
73         TH_BUTBACK_TEXT,
74         TH_BUTBACK_TEXT_HI,
75         
76         TH_SHADE1,
77         TH_SHADE2,
78         TH_HILITE,
79
80         TH_GRID,
81         TH_WIRE,
82         TH_SELECT,
83         TH_ACTIVE,
84         TH_GROUP,
85         TH_GROUP_ACTIVE,
86         TH_TRANSFORM,
87         TH_VERTEX,
88         TH_VERTEX_SELECT,
89         TH_VERTEX_SIZE,
90         TH_OUTLINE_WIDTH,
91         TH_EDGE,
92         TH_EDGE_SELECT,
93         TH_EDGE_SEAM,
94         TH_EDGE_FACESEL,
95         TH_FACE,
96         TH_FACE_SELECT,
97         TH_NORMAL,
98         TH_VNORMAL,
99         TH_FACE_DOT,
100         TH_FACEDOT_SIZE,
101         TH_CFRAME,
102         TH_NURB_ULINE,
103         TH_NURB_VLINE,
104         TH_NURB_SEL_ULINE,
105         TH_NURB_SEL_VLINE,
106
107         /* this eight colors should be in one block */
108         TH_HANDLE_FREE,
109         TH_HANDLE_AUTO,
110         TH_HANDLE_VECT,
111         TH_HANDLE_ALIGN,
112         TH_HANDLE_AUTOCLAMP,
113         TH_HANDLE_SEL_FREE,
114         TH_HANDLE_SEL_AUTO,
115         TH_HANDLE_SEL_VECT,
116         TH_HANDLE_SEL_ALIGN,
117         TH_HANDLE_SEL_AUTOCLAMP,
118
119         TH_ACTIVE_SPLINE,
120         TH_LASTSEL_POINT,
121
122         TH_SYNTAX_B,
123         TH_SYNTAX_V,
124         TH_SYNTAX_C,
125         TH_SYNTAX_L,
126         TH_SYNTAX_N,
127         
128         TH_BONE_SOLID,
129         TH_BONE_POSE,
130         
131         TH_STRIP,
132         TH_STRIP_SELECT,
133         
134         TH_LAMP,
135         TH_SPEAKER,
136         TH_CAMERA,
137         TH_EMPTY,
138         
139         TH_NODE,
140         TH_NODE_IN_OUT,
141         TH_NODE_OPERATOR,
142         TH_NODE_CONVERTOR,
143         TH_NODE_GROUP,
144         
145         TH_CONSOLE_OUTPUT,
146         TH_CONSOLE_INPUT,
147         TH_CONSOLE_INFO,
148         TH_CONSOLE_ERROR,
149         TH_CONSOLE_CURSOR,
150         
151         TH_SEQ_MOVIE,
152         TH_SEQ_MOVIECLIP,
153         TH_SEQ_IMAGE,
154         TH_SEQ_SCENE,
155         TH_SEQ_AUDIO,
156         TH_SEQ_EFFECT,
157         TH_SEQ_PLUGIN,
158         TH_SEQ_TRANSITION,
159         TH_SEQ_META,
160         TH_SEQ_PREVIEW,
161         
162         TH_EDGE_SHARP,
163         TH_EDITMESH_ACTIVE,
164         
165         TH_HANDLE_VERTEX,
166         TH_HANDLE_VERTEX_SELECT,
167         TH_HANDLE_VERTEX_SIZE,
168         
169         TH_DOPESHEET_CHANNELOB,
170         TH_DOPESHEET_CHANNELSUBOB,
171         
172         TH_PREVIEW_BACK,
173         
174         TH_EDGE_CREASE,
175
176         TH_DRAWEXTRA_EDGELEN,
177         TH_DRAWEXTRA_FACEAREA,
178         TH_DRAWEXTRA_FACEANG,
179
180         TH_NODE_CURVING,
181
182         TH_MARKER_OUTLINE,
183         TH_MARKER,
184         TH_ACT_MARKER,
185         TH_SEL_MARKER,
186         TH_BUNDLE_SOLID,
187         TH_DIS_MARKER,
188         TH_PATH_BEFORE,
189         TH_PATH_AFTER,
190         TH_CAMERA_PATH,
191         TH_LOCK_MARKER,
192
193         TH_STITCH_PREVIEW_FACE,
194         TH_STITCH_PREVIEW_EDGE,
195         TH_STITCH_PREVIEW_VERT,
196         TH_STITCH_PREVIEW_STITCHABLE,
197         TH_STITCH_PREVIEW_UNSTITCHABLE,
198         TH_STITCH_PREVIEW_ACTIVE,
199
200         TH_FREESTYLE_EDGE_MARK,
201         TH_FREESTYLE_FACE_MARK,
202
203         TH_MATCH,           /* highlight color for search matches */
204         TH_SELECT_HIGHLIGHT /* highlight color for selected outliner item */
205 };
206 /* XXX WARNING: previous is saved in file, so do not change order! */
207
208 /* specific defines per space should have higher define values */
209
210 struct bTheme;
211 struct PointerRNA;
212
213 // THE CODERS API FOR THEMES:
214
215 // sets the color
216 void    UI_ThemeColor(int colorid);
217
218 // sets the color plus alpha
219 void    UI_ThemeColor4(int colorid);
220
221 // sets color plus offset for shade
222 void    UI_ThemeColorShade(int colorid, int offset);
223
224 // sets color plus offset for alpha
225 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
226
227 // sets color, which is blend between two theme colors
228 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
229 // same, with shade offset
230 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
231 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
232
233 // returns one value, not scaled
234 float   UI_GetThemeValuef(int colorid);
235 int     UI_GetThemeValue(int colorid);
236
237 // get three color values, scaled to 0.0-1.0 range
238 void    UI_GetThemeColor3fv(int colorid, float *col);
239 // get the color, range 0.0-1.0, complete with shading offset
240 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
241
242 // get the 3 or 4 byte values
243 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
244 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
245
246 // get a theme color from specified space type
247 void UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
248
249 // blends and shades between two color pointers
250 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
251
252 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
253 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
254
255 // get a 3 byte color, blended and shaded between two other char color pointers
256 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
257
258 // clear the openGL ClearColor using the input colorid
259 void    UI_ThemeClearColor(int colorid);
260
261 // internal (blender) usage only, for init and set active
262 void    UI_SetTheme(int spacetype, int regionid);
263
264 // get current theme
265 struct bTheme *UI_GetTheme(void);
266
267 /* only for buttons in theme editor! */
268 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
269
270 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
271
272 #endif /*  UI_ICONS_H */