- added Theme for File Window
[blender.git] / source / blender / include / BIF_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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, 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 BIF_RESOURCES_H
34 #define BIF_RESOURCES_H
35
36 typedef enum {
37 #define BIFICONID_FIRST         (ICON_VIEW3D)
38         ICON_VIEW3D,
39         ICON_IPO,
40         ICON_OOPS,
41         ICON_BUTS,
42         ICON_FILESEL,
43         ICON_IMAGE_COL,
44         ICON_INFO,
45         ICON_SEQUENCE,
46         ICON_TEXT,
47         ICON_IMASEL,
48         ICON_SOUND,
49         ICON_ACTION,
50         ICON_NLA,
51         ICON_VIEWZOOM,
52         ICON_VIEWMOVE,
53         ICON_HOME,
54         ICON_CLIPUV_DEHLT,
55         ICON_CLIPUV_HLT,
56         ICON_SOME_WACKY_VERTS_AND_LINES,
57         ICON_A_WACKY_VERT_AND_SOME_LINES,
58         ICON_VPAINT_COL,
59
60         ICON_ORTHO,
61         ICON_PERSP,
62         ICON_CAMERA,
63         ICON_BLANK1,
64         ICON_BBOX,
65         ICON_WIRE,
66         ICON_SOLID,
67         ICON_SMOOTH,
68         ICON_POTATO,
69         ICON_BLANK2,
70         ICON_NORMALVIEW,
71         ICON_LOCALVIEW,
72         ICON_UNUSEDVIEW,
73         ICON_BLANK3,
74         ICON_SORTALPHA,
75         ICON_SORTTIME,
76         ICON_SORTSIZE,
77         ICON_LONGDISPLAY,
78         ICON_SHORTDISPLAY,
79         ICON_BLANK4,
80         ICON_BLANK5,
81
82         ICON_VIEW_AXIS_ALL,
83         ICON_VIEW_AXIS_NONE,
84         ICON_VIEW_AXIS_NONE2,
85         ICON_VIEW_AXIS_TOP,
86         ICON_VIEW_AXIS_FRONT,
87         ICON_VIEW_AXIS_SIDE,
88         ICON_POSE_DEHLT,
89         ICON_POSE_HLT,
90         ICON_BORDERMOVE,
91         ICON_MAYBE_ITS_A_LASSO,
92         ICON_BLANK6,
93         ICON_ROTATE,
94         ICON_CURSOR,
95         ICON_ROTATECOLLECTION,
96         ICON_ROTATECENTER,
97         ICON_BLANK7,
98         ICON_BLANK8,
99         ICON_BLANK9,
100         ICON_BLANK10,
101         ICON_BLANK11,
102         ICON_BLANK12,
103         
104         ICON_DOTSUP,
105         ICON_DOTSDOWN,
106         ICON_MENU_PANEL,
107         ICON_AXIS_SIDE,
108         ICON_AXIS_FRONT,
109         ICON_AXIS_TOP,
110         ICON_BLANK14,
111         ICON_BLANK15,
112         ICON_BLANK16,
113         ICON_BLANK17,
114         ICON_BLANK18,
115         ICON_ENVMAP,
116         ICON_TRANSP_HLT,
117         ICON_TRANSP_DEHLT,
118         ICON_RADIO_DEHLT,
119         ICON_RADIO_HLT,
120         ICON_TPAINT_DEHLT,
121         ICON_TPAINT_HLT,
122         ICON_WPAINT_DEHLT,
123         ICON_WPAINT_HLT,
124         ICON_BLANK21,
125         
126         ICON_X,
127         ICON_GO_LEFT,
128         ICON_NO_GO_LEFT,
129         ICON_UNLOCKED,
130         ICON_LOCKED,
131         ICON_PARLIB,
132         ICON_DATALIB,
133         ICON_AUTO,
134         ICON_MATERIAL_DEHLT2,
135         ICON_RING,
136         ICON_GRID,
137         ICON_PROPEDIT,
138         ICON_KEEPRECT,
139         ICON_DESEL_CUBE_VERTS,
140         ICON_EDITMODE_DEHLT,
141         ICON_EDITMODE_HLT,
142         ICON_VPAINT_DEHLT,
143         ICON_VPAINT_HLT,
144         ICON_FACESEL_DEHLT,
145         ICON_FACESEL_HLT,
146         ICON_BLANK22,
147         
148         ICON_HELP,
149         ICON_ERROR,
150         ICON_FOLDER_DEHLT,
151         ICON_FOLDER_HLT,
152         ICON_BLUEIMAGE_DEHLT,
153         ICON_BLUEIMAGE_HLT,
154         ICON_BPIBFOLDER_DEHLT,
155         ICON_BPIBFOLDER_HLT,
156         ICON_BPIBFOLDER_ERR,
157         ICON_UGLY_GREEN_RING,
158         ICON_GHOST,
159         ICON_SHARPCURVE,
160         ICON_SMOOTHCURVE,
161         ICON_BLANK23,
162         ICON_BLANK24,
163         ICON_BLANK25,
164         ICON_BLANK26,
165         ICON_BPIBFOLDER_X,
166         ICON_BPIBFOLDERGREY,
167         ICON_MAGNIFY,
168         ICON_INFO2,
169         
170         ICON_RIGHTARROW,
171         ICON_DOWNARROW_HLT,
172         ICON_ROUNDBEVELTHING,
173         ICON_FULLTEXTURE,
174         ICON_REDPUBLISHERHALFTHINGY,
175         ICON_PUBLISHER,
176         ICON_CKEY,
177         ICON_CHECKBOX_DEHLT,
178         ICON_CHECKBOX_HLT,
179         ICON_LINK,
180         ICON_INLINK,
181         ICON_BEVELBUT_HLT,
182         ICON_BEVELBUT_DEHLT,
183         ICON_PASTEDOWN,
184         ICON_COPYDOWN,
185         ICON_CONSTANT,
186         ICON_LINEAR,
187         ICON_CYCLIC,
188         ICON_KEY_DEHLT,
189         ICON_KEY_HLT,
190         ICON_GRID2,
191         
192         ICON_EYE,
193         ICON_LAMP,
194         ICON_MATERIAL,
195         ICON_TEXTURE,
196         ICON_ANIM,
197         ICON_WORLD,
198         ICON_SCENE,
199         ICON_EDIT,
200         ICON_GAME,
201         ICON_PAINT,
202         ICON_RADIO,
203         ICON_SCRIPT,
204         ICON_SPEAKER,
205         ICON_PASTEUP,
206         ICON_COPYUP,
207         ICON_PASTEFLIPUP,
208         ICON_PASTEFLIPDOWN,
209         ICON_CYCLICLINEAR,
210         ICON_PIN_DEHLT,
211         ICON_PIN_HLT,
212         ICON_LITTLEGRID,
213         
214         ICON_FULLSCREEN,
215         ICON_SPLITSCREEN,
216         ICON_RIGHTARROW_THIN,
217         ICON_DISCLOSURE_TRI_RIGHT,
218         ICON_DISCLOSURE_TRI_DOWN,
219         ICON_SCENE_SEPIA,
220         ICON_SCENE_DEHLT,
221         ICON_OBJECT,
222         ICON_MESH,
223         ICON_CURVE,
224         ICON_MBALL,
225         ICON_LATTICE,
226         ICON_LAMP_DEHLT,
227         ICON_MATERIAL_DEHLT,
228         ICON_TEXTURE_DEHLT,
229         ICON_IPO_DEHLT,
230         ICON_LIBRARY_DEHLT,
231         ICON_IMAGE_DEHLT,
232         ICON_WINDOW_FULLSCREEN,
233         ICON_WINDOW_WINDOW,
234         ICON_PANEL_CLOSE,
235         
236         ICON_BLENDER,
237         ICON_PACKAGE,
238         ICON_UGLYPACKAGE,
239         ICON_MATPLANE,
240         ICON_MATSPHERE,
241         ICON_MATCUBE,
242         ICON_SCENE_HLT,
243         ICON_OBJECT_HLT,
244         ICON_MESH_HLT,
245         ICON_CURVE_HLT,
246         ICON_MBALL_HLT,
247         ICON_LATTICE_HLT,
248         ICON_LAMP_HLT,
249         ICON_MATERIAL_HLT,
250         ICON_TEXTURE_HLT,
251         ICON_IPO_HLT,
252         ICON_LIBRARY_HLT,
253         ICON_IMAGE_HLT,
254         ICON_CONSTRAINT,
255         ICON_BLANK32,
256         ICON_BLANK33,
257 #define BIFICONID_LAST          (ICON_BLANK33)
258 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
259 } BIFIconID;
260
261 typedef enum {
262 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
263         COLORSHADE_DARK,
264         COLORSHADE_GREY,
265         COLORSHADE_LGREY,
266         COLORSHADE_LMEDIUM,
267         COLORSHADE_MEDIUM,
268         COLORSHADE_HILITE,
269         COLORSHADE_LIGHT,
270         COLORSHADE_WHITE,
271         
272 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
273 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
274 } BIFColorShade;
275
276 typedef enum {
277 #define BIFCOLORID_FIRST        (BUTGREY)
278         BUTGREY,
279         BUTGREEN,
280         BUTBLUE,
281         BUTSALMON,
282         MIDGREY,
283         BUTPURPLE,
284         BUTYELLOW,
285         REDALERT,
286         BUTRUST,
287         BUTWHITE,
288         BUTDBLUE,
289         BUTPINK,
290         BUTDPINK,
291         BUTMACTIVE,
292
293         ACTIONBUTCOL,
294         NUMBUTCOL,
295         TEXBUTCOL,
296         TOGBUTCOL,
297         SLIDERCOL,
298         TABCOL,
299         MENUCOL,
300         MENUACTIVECOL,
301
302         BUTIPO,
303         BUTAUDIO,
304         BUTCAMERA,
305         BUTRANDOM,
306         BUTEDITOBJECT,
307         BUTPROPERTY,
308         BUTSCENE,
309         BUTMOTION,
310         BUTMESSAGE,
311         BUTACTION,
312         BUTCD,
313         BUTGAME,
314         BUTVISIBILITY,
315         BUTYUCK,
316         BUTSEASICK,
317         BUTCHOKE,
318         
319         HEADERCOL,
320         HEADERCOLSEL,
321         
322         BUTIMPERIAL,
323 #define BIFCOLORID_LAST         (BUTIMPERIAL)
324 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
325 } BIFColorID;
326
327
328 /* ---------- theme ----------- */
329
330 // uibutton colors
331
332
333 #define TH_THEMEUI      99
334
335 // common colors among spaces
336
337 enum {
338         TH_BACK = 100,
339         TH_TEXT,
340         TH_TEXT_HI,
341         TH_HEADER,
342         TH_PANEL,
343         TH_SHADE1,
344         TH_SHADE2,
345         TH_HILITE,
346
347         TH_GRID,
348         TH_WIRE,
349         TH_SELECT,
350         TH_ACTIVE,
351         TH_TRANSFORM,
352         TH_VERTEX,
353         TH_VERTEX_SELECT,
354         TH_VERTEX_SIZE,
355         TH_EDGE,
356         TH_EDGE_SELECT,
357         TH_FACE,
358         TH_FACE_SELECT
359 };
360
361 /* specific defines per space should have higher define values */
362
363 struct bTheme;
364
365 void    BIF_InitThemeColors(void);
366 void    BIF_ThemeColor(struct ScrArea *sa, int colorid);
367 void    BIF_ThemeColor4(struct ScrArea *sa, int colorid);
368 void    BIF_ThemeColorShade(struct ScrArea *sa, int colorid, int offset);
369 void    BIF_ThemeColorBlend(struct ScrArea *sa, int colorid1, int colorid2, float fac);
370
371 // get only one value, not scaled
372 float   BIF_GetThemeColorf(struct ScrArea *sa, int colorid);
373 // get three color values, scaled to 0.0-1.0 range
374 void    BIF_GetThemeColor3fv(struct ScrArea *sa, int colorid, float *col);
375 // get the byte values
376 void    BIF_GetThemeColor3ubv(struct ScrArea *sa, int colorid, char *col);
377 void    BIF_GetThemeColor4ubv(struct ScrArea *sa, int colorid, char *col);
378
379 void    BIF_resources_init              (void);
380 void    BIF_resources_free              (void);
381
382
383 int             BIF_get_icon_width              (BIFIconID icon);
384 int             BIF_get_icon_height             (BIFIconID icon);
385 void    BIF_draw_icon                   (BIFIconID icon);
386 void    BIF_draw_icon_blended   (BIFIconID icon, BIFColorID color, BIFColorShade shade);
387
388 void    BIF_set_color                   (BIFColorID color, BIFColorShade shade);
389
390 /* only for buttons in theme editor! */
391 char    *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
392 char    *BIF_ThemeColorsPup(int spacetype);
393
394
395 #endif /*  BIF_ICONS_H */