Merging trunk up to r39145.
[blender-staging.git] / source / blender / editors / include / UI_resources.h
1 /*
2  * $Id$
3  *
4  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. The Blender
10  * Foundation also sells licenses for use in proprietary software under
11  * the Blender License.  See http://www.blender.org/BL/ for information
12  * about this.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software Foundation,
21  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22  *
23  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
24  * All rights reserved.
25  *
26  * The Original Code is: all of this file.
27  *
28  * Contributor(s): none yet.
29  * 
30  * ***** END GPL/BL DUAL LICENSE BLOCK *****
31  */
32
33 /** \file UI_resources.h
34  *  \ingroup editorui
35  */
36
37 #ifndef UI_RESOURCES_H
38 #define UI_RESOURCES_H
39
40 /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
41 /* and add/replace include of UI_resources.h by UI_interface_icons.h */
42 #define DEF_ICON(name) ICON_##name,
43 #define DEF_VICO(name) VICO_##name,
44
45 typedef enum {
46         /* ui */
47 #include "UI_icons.h"
48         BIFICONID_LAST
49 } BIFIconID;
50
51 #define BIFICONID_FIRST         (ICON_NONE)
52 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
53
54 #undef DEF_ICON
55 #undef DEF_VICO
56
57
58 typedef enum {
59 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
60                 COLORSHADE_DARK,
61                 COLORSHADE_GREY,
62                 COLORSHADE_MEDIUM,
63                 COLORSHADE_HILITE,
64                 COLORSHADE_LIGHT,
65                 COLORSHADE_WHITE
66 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
67 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
68 } BIFColorShade;
69
70 typedef enum {
71 #define BIFCOLORID_FIRST        (BUTGREY)
72         BUTGREY = 0,
73         BUTGREEN,
74         BUTBLUE,
75         BUTSALMON,
76         MIDGREY,
77         BUTPURPLE,
78         BUTYELLOW,
79         REDALERT,
80         BUTRUST,
81         BUTWHITE,
82         BUTDBLUE,
83         BUTPINK,
84         BUTDPINK,
85         BUTMACTIVE,
86
87         BUTIPO,
88         BUTAUDIO,
89         BUTCAMERA,
90         BUTRANDOM,
91         BUTEDITOBJECT,
92         BUTPROPERTY,
93         BUTSCENE,
94         BUTMOTION,
95         BUTMESSAGE,
96         BUTACTION,
97         BUTCD,
98         BUTGAME,
99         BUTVISIBILITY,
100         BUTYUCK,
101         BUTSEASICK,
102         BUTCHOKE,
103         BUTIMPERIAL,
104
105         BUTTEXTCOLOR,
106         BUTTEXTPRESSED,
107         BUTSBACKGROUND,
108         
109         VIEWPORTBACKCOLOR,
110         VIEWPORTGRIDCOLOR,
111         VIEWPORTACTIVECOLOR,
112         VIEWPORTSELECTEDCOLOR,
113         VIEWPORTUNSELCOLOR,
114         
115         EDITVERTSEL, 
116         EDITVERTUNSEL, 
117         EDITEDGESEL, 
118         EDITEDGEUNSEL
119         
120 #define BIFCOLORID_LAST         (EDITEDGEUNSEL)
121 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
122
123 } BIFColorID;
124
125 enum {
126         TH_REDALERT,
127
128         TH_THEMEUI,
129 // common colors among spaces
130         
131         TH_BACK,
132         TH_TEXT,
133         TH_TEXT_HI,
134         TH_TITLE,
135         
136         TH_HEADER,
137         TH_HEADERDESEL,
138         TH_HEADER_TEXT,
139         TH_HEADER_TEXT_HI,
140         
141         /* float panels */
142         TH_PANEL,
143         TH_PANEL_TEXT,
144         TH_PANEL_TEXT_HI,
145         
146         TH_BUTBACK,
147         TH_BUTBACK_TEXT,
148         TH_BUTBACK_TEXT_HI,
149         
150         TH_SHADE1,
151         TH_SHADE2,
152         TH_HILITE,
153
154         TH_GRID,
155         TH_WIRE,
156         TH_SELECT,
157         TH_ACTIVE,
158         TH_GROUP,
159         TH_GROUP_ACTIVE,
160         TH_TRANSFORM,
161         TH_VERTEX,
162         TH_VERTEX_SELECT,
163         TH_VERTEX_SIZE,
164         TH_OUTLINE_WIDTH,
165         TH_EDGE,
166         TH_EDGE_SELECT,
167         TH_EDGE_SEAM,
168         TH_EDGE_FACESEL,
169         TH_FACE,
170         TH_FACE_SELECT,
171         TH_NORMAL,
172         TH_VNORMAL,
173         TH_FACE_DOT,
174         TH_FACEDOT_SIZE,
175         TH_CFRAME,
176         TH_NURB_ULINE,
177         TH_NURB_VLINE,
178         TH_NURB_SEL_ULINE,
179         TH_NURB_SEL_VLINE,
180
181         /* this eight colors should be in one block */
182         TH_HANDLE_FREE,
183         TH_HANDLE_AUTO,
184         TH_HANDLE_VECT,
185         TH_HANDLE_ALIGN,
186         TH_HANDLE_AUTOCLAMP,
187         TH_HANDLE_SEL_FREE,
188         TH_HANDLE_SEL_AUTO,
189         TH_HANDLE_SEL_VECT,
190         TH_HANDLE_SEL_ALIGN,
191         TH_HANDLE_SEL_AUTOCLAMP,
192
193         TH_ACTIVE_SPLINE,
194         TH_LASTSEL_POINT,
195
196         TH_SYNTAX_B,
197         TH_SYNTAX_V,
198         TH_SYNTAX_C,
199         TH_SYNTAX_L,
200         TH_SYNTAX_N,
201         
202         TH_BONE_SOLID,
203         TH_BONE_POSE,
204         
205         TH_STRIP,
206         TH_STRIP_SELECT,
207         
208         TH_LAMP,
209
210         TH_SPEAKER,
211         
212         TH_NODE,
213         TH_NODE_IN_OUT,
214         TH_NODE_OPERATOR,
215         TH_NODE_CONVERTOR,
216         TH_NODE_GROUP,
217         
218         TH_CONSOLE_OUTPUT,
219         TH_CONSOLE_INPUT,
220         TH_CONSOLE_INFO,
221         TH_CONSOLE_ERROR,
222         TH_CONSOLE_CURSOR,
223         
224         TH_SEQ_MOVIE,
225         TH_SEQ_IMAGE,
226         TH_SEQ_SCENE,
227         TH_SEQ_AUDIO,
228         TH_SEQ_EFFECT,
229         TH_SEQ_PLUGIN,
230         TH_SEQ_TRANSITION,
231         TH_SEQ_META,
232         
233         TH_EDGE_SHARP,
234         TH_EDITMESH_ACTIVE,
235         
236         TH_HANDLE_VERTEX,
237         TH_HANDLE_VERTEX_SELECT,
238         TH_HANDLE_VERTEX_SIZE,
239         
240         TH_DOPESHEET_CHANNELOB,
241         TH_DOPESHEET_CHANNELSUBOB,
242         
243         TH_PREVIEW_BACK,
244         
245         TH_EDGE_CREASE,
246
247         TH_DRAWEXTRA_EDGELEN,
248         TH_DRAWEXTRA_FACEAREA,
249         TH_DRAWEXTRA_FACEANG,
250
251         TH_NODE_CURVING
252 };
253 /* XXX WARNING: previous is saved in file, so do not change order! */
254
255 /* specific defines per space should have higher define values */
256
257 struct bTheme;
258 struct PointerRNA;
259
260 // THE CODERS API FOR THEMES:
261
262 // sets the color
263 void    UI_ThemeColor(int colorid);
264
265 // sets the color plus alpha
266 void    UI_ThemeColor4(int colorid);
267
268 // sets color plus offset for shade
269 void    UI_ThemeColorShade(int colorid, int offset);
270
271 // sets color plus offset for alpha
272 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
273
274 // sets color, which is blend between two theme colors
275 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
276 // same, with shade offset
277 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
278 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
279
280 // returns one value, not scaled
281 float   UI_GetThemeValuef(int colorid);
282 int     UI_GetThemeValue(int colorid);
283
284 // get three color values, scaled to 0.0-1.0 range
285 void    UI_GetThemeColor3fv(int colorid, float *col);
286 // get the color, range 0.0-1.0, complete with shading offset
287 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
288
289 // get the 3 or 4 byte values
290 void    UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
291 void    UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
292
293 // get a theme color from specified space type
294 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
295
296 // blends and shades between two color pointers
297 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
298
299 // get a 3 byte color, blended and shaded between two other char color pointers
300 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
301
302 // clear the openGL ClearColor using the input colorid
303 void    UI_ThemeClearColor(int colorid);
304
305 // internal (blender) usage only, for init and set active
306 void    UI_SetTheme(int spacetype, int regionid);
307
308 /* only for buttons in theme editor! */
309 const unsigned char     *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
310
311 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
312
313 #endif /*  UI_ICONS_H */