fix for compiling with the c90 standard, support for non-static variable initializers...
[blender.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 #ifndef UI_RESOURCES_H
34 #define UI_RESOURCES_H
35
36 /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
37 /* and add/replace include of UI_resources.h by UI_interface_icons.h */
38 #define DEF_ICON(name) ICON_##name,
39 #define DEF_VICO(name) VICO_##name,
40
41 typedef enum {
42 #define BIFICONID_FIRST         (ICON_BLENDER)
43         /* ui */
44 #include "UI_icons.h"
45         BIFICONID_LAST
46 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
47 } BIFIconID;
48 #undef DEF_ICON
49 #undef DEF_VICO
50
51
52 typedef enum {
53 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
54                 COLORSHADE_DARK,
55                 COLORSHADE_GREY,
56                 COLORSHADE_MEDIUM,
57                 COLORSHADE_HILITE,
58                 COLORSHADE_LIGHT,
59                 COLORSHADE_WHITE
60 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
61 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
62 } BIFColorShade;
63
64 typedef enum {
65 #define BIFCOLORID_FIRST        (BUTGREY)
66         BUTGREY = 0,
67         BUTGREEN,
68         BUTBLUE,
69         BUTSALMON,
70         MIDGREY,
71         BUTPURPLE,
72         BUTYELLOW,
73         REDALERT,
74         BUTRUST,
75         BUTWHITE,
76         BUTDBLUE,
77         BUTPINK,
78         BUTDPINK,
79         BUTMACTIVE,
80
81         BUTIPO,
82         BUTAUDIO,
83         BUTCAMERA,
84         BUTRANDOM,
85         BUTEDITOBJECT,
86         BUTPROPERTY,
87         BUTSCENE,
88         BUTMOTION,
89         BUTMESSAGE,
90         BUTACTION,
91         BUTCD,
92         BUTGAME,
93         BUTVISIBILITY,
94         BUTYUCK,
95         BUTSEASICK,
96         BUTCHOKE,
97         BUTIMPERIAL,
98
99         BUTTEXTCOLOR,
100         BUTTEXTPRESSED,
101         BUTSBACKGROUND,
102         
103         VIEWPORTBACKCOLOR,
104         VIEWPORTGRIDCOLOR,
105         VIEWPORTACTIVECOLOR,
106         VIEWPORTSELECTEDCOLOR,
107         VIEWPORTUNSELCOLOR,
108         
109         EDITVERTSEL, 
110         EDITVERTUNSEL, 
111         EDITEDGESEL, 
112         EDITEDGEUNSEL
113         
114 #define BIFCOLORID_LAST         (EDITEDGEUNSEL)
115 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
116
117 } BIFColorID;
118
119 enum {
120         TH_REDALERT,
121
122         TH_THEMEUI,
123 // common colors among spaces
124         
125         TH_BACK,
126         TH_TEXT,
127         TH_TEXT_HI,
128         TH_TITLE,
129         
130         TH_HEADER,
131         TH_HEADERDESEL,
132         TH_HEADER_TEXT,
133         TH_HEADER_TEXT_HI,
134         
135         /* float panels */
136         TH_PANEL,
137         TH_PANEL_TEXT,
138         TH_PANEL_TEXT_HI,
139         
140         TH_BUTBACK,
141         TH_BUTBACK_TEXT,
142         TH_BUTBACK_TEXT_HI,
143         
144         TH_SHADE1,
145         TH_SHADE2,
146         TH_HILITE,
147
148         TH_GRID,
149         TH_WIRE,
150         TH_SELECT,
151         TH_ACTIVE,
152         TH_GROUP,
153         TH_GROUP_ACTIVE,
154         TH_TRANSFORM,
155         TH_VERTEX,
156         TH_VERTEX_SELECT,
157         TH_VERTEX_SIZE,
158         TH_EDGE,
159         TH_EDGE_SELECT,
160         TH_EDGE_SEAM,
161         TH_EDGE_FACESEL,
162         TH_FACE,
163         TH_FACE_SELECT,
164         TH_NORMAL,
165         TH_VNORMAL,
166         TH_FACE_DOT,
167         TH_FACEDOT_SIZE,
168         TH_CFRAME,
169         TH_NURB_ULINE,
170         TH_NURB_VLINE,
171         TH_NURB_SEL_ULINE,
172         TH_NURB_SEL_VLINE,
173
174         /* this eight colors should be in one block */
175         TH_HANDLE_FREE,
176         TH_HANDLE_AUTO,
177         TH_HANDLE_VECT,
178         TH_HANDLE_ALIGN,
179         TH_HANDLE_SEL_FREE,
180         TH_HANDLE_SEL_AUTO,
181         TH_HANDLE_SEL_VECT,
182         TH_HANDLE_SEL_ALIGN,
183
184         TH_ACTIVE_SPLINE,
185         TH_LASTSEL_POINT,
186
187         TH_SYNTAX_B,
188         TH_SYNTAX_V,
189         TH_SYNTAX_C,
190         TH_SYNTAX_L,
191         TH_SYNTAX_N,
192         
193         TH_BONE_SOLID,
194         TH_BONE_POSE,
195         
196         TH_STRIP,
197         TH_STRIP_SELECT,
198         
199         TH_LAMP,
200         
201         TH_NODE,
202         TH_NODE_IN_OUT,
203         TH_NODE_OPERATOR,
204         TH_NODE_CONVERTOR,
205         TH_NODE_GROUP,
206         
207         TH_CONSOLE_OUTPUT,
208         TH_CONSOLE_INPUT,
209         TH_CONSOLE_INFO,
210         TH_CONSOLE_ERROR,
211         TH_CONSOLE_CURSOR,
212         
213         TH_SEQ_MOVIE,
214         TH_SEQ_IMAGE,
215         TH_SEQ_SCENE,
216         TH_SEQ_AUDIO,
217         TH_SEQ_EFFECT,
218         TH_SEQ_PLUGIN,
219         TH_SEQ_TRANSITION,
220         TH_SEQ_META,
221         
222         TH_EDGE_SHARP,
223         TH_EDITMESH_ACTIVE,
224         
225         TH_HANDLE_VERTEX,
226         TH_HANDLE_VERTEX_SELECT,
227         TH_HANDLE_VERTEX_SIZE,
228         
229         TH_DOPESHEET_CHANNELOB,
230         TH_DOPESHEET_CHANNELSUBOB,
231         
232         TH_PREVIEW_BACK,
233         
234         TH_EDGE_CREASE,
235 };
236 /* XXX WARNING: previous is saved in file, so do not change order! */
237
238 /* specific defines per space should have higher define values */
239
240 struct bTheme;
241 struct PointerRNA;
242
243 // THE CODERS API FOR THEMES:
244
245 // sets the color
246 void    UI_ThemeColor(int colorid);
247
248 // sets the color plus alpha
249 void    UI_ThemeColor4(int colorid);
250
251 // sets color plus offset for shade
252 void    UI_ThemeColorShade(int colorid, int offset);
253
254 // sets color plus offset for alpha
255 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
256
257 // sets color, which is blend between two theme colors
258 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
259 // same, with shade offset
260 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
261 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
262
263 // returns one value, not scaled
264 float   UI_GetThemeValuef(int colorid);
265 int     UI_GetThemeValue(int colorid);
266
267 // get three color values, scaled to 0.0-1.0 range
268 void    UI_GetThemeColor3fv(int colorid, float *col);
269 // get the color, range 0.0-1.0, complete with shading offset
270 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
271
272 // get the 3 or 4 byte values
273 void    UI_GetThemeColor3ubv(int colorid, char *col);
274 void    UI_GetThemeColor4ubv(int colorid, char *col);
275
276 // get a theme color from specified space type
277 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char *col);
278
279 // blends and shades between two color pointers
280 void    UI_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset);
281
282 // get a 3 byte color, blended and shaded between two other char color pointers
283 void    UI_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset);
284
285 // clear the openGL ClearColor using the input colorid
286 void    UI_ThemeClearColor(int colorid);
287
288 // internal (blender) usage only, for init and set active
289 void    UI_SetTheme(int spacetype, int regionid);
290
291 /* only for buttons in theme editor! */
292 char    *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
293 char    *UI_ThemeColorsPup(int spacetype);
294
295 void UI_make_axis_color(char *src_col, char *dst_col, char axis);
296
297 #endif /*  UI_ICONS_H */