Orange branch: Revived hidden treasure, the Groups!
[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_SCRIPTWIN,
52         ICON_TIME,
53         ICON_SPACE1,
54         ICON_SPACE2,
55         ICON_SPACE3,
56         ICON_SPACE4,
57         ICON_TRIA_LEFT,
58         ICON_TRIA_UP,
59
60         ICON_ORTHO,
61         ICON_PERSP,
62         ICON_CAMERA,
63         ICON_EFFECTS,
64         ICON_BBOX,
65         ICON_WIRE,
66         ICON_SOLID,
67         ICON_SMOOTH,
68         ICON_POTATO,
69         ICON_MARKER_HLT,
70         ICON_NORMALVIEW,
71         ICON_LOCALVIEW,
72         ICON_UNUSEDVIEW,
73         ICON_VIEWZOOM,
74         ICON_SORTALPHA,
75         ICON_SORTTIME,
76         ICON_SORTSIZE,
77         ICON_LONGDISPLAY,
78         ICON_SHORTDISPLAY,
79         ICON_TRIA_DOWN,
80         ICON_TRIA_RIGHT,
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_BLANK1,    /* ATTENTION, someone decided to use this throughout blender
93                            and didn't care to neither rename it nor update the PNG */
94         ICON_BLANK2,
95         ICON_MOD_BOOLEAN,
96         ICON_ARMATURE,
97         ICON_PAUSE,
98         ICON_ALIGN,
99         ICON_REC,
100         ICON_PLAY,
101         ICON_FF,
102         ICON_REW,
103         ICON_PYTHON,
104
105         
106         ICON_DOTSUP,
107         ICON_DOTSDOWN,
108         ICON_MENU_PANEL,
109         ICON_AXIS_SIDE,
110         ICON_AXIS_FRONT,
111         ICON_AXIS_TOP,
112         ICON_DRAW_UVFACES,
113         ICON_STICKY_UVS,
114         ICON_STICKY2_UVS,
115         ICON_PREV_KEYFRAME,
116         ICON_NEXT_KEYFRAME,
117         ICON_ENVMAP,
118         ICON_TRANSP_HLT,
119         ICON_TRANSP_DEHLT,
120         ICON_CIRCLE_DEHLT,
121         ICON_CIRCLE_HLT,
122         ICON_TPAINT_DEHLT,
123         ICON_TPAINT_HLT,
124         ICON_WPAINT_DEHLT,
125         ICON_WPAINT_HLT,
126         ICON_MARKER,
127         
128         ICON_X,
129         ICON_GO_LEFT,
130         ICON_NO_GO_LEFT,
131         ICON_UNLOCKED,
132         ICON_LOCKED,
133         ICON_PARLIB,
134         ICON_DATALIB,
135         ICON_AUTO,
136         ICON_MATERIAL_DEHLT2,
137         ICON_RING,
138         ICON_GRID,
139         ICON_PROPEDIT,
140         ICON_KEEPRECT,
141         ICON_DESEL_CUBE_VERTS,
142         ICON_EDITMODE_DEHLT,
143         ICON_EDITMODE_HLT,
144         ICON_VPAINT_DEHLT,
145         ICON_VPAINT_HLT,
146         ICON_FACESEL_DEHLT,
147         ICON_FACESEL_HLT,
148         ICON_EDIT_DEHLT,
149         
150         ICON_HELP,
151         ICON_ERROR,
152         ICON_FOLDER_DEHLT,
153         ICON_FOLDER_HLT,
154         ICON_BLUEIMAGE_DEHLT,
155         ICON_BLUEIMAGE_HLT,
156         ICON_BPIBFOLDER_DEHLT,
157         ICON_BPIBFOLDER_HLT,
158         ICON_BPIBFOLDER_ERR,
159         ICON_UGLY_GREEN_RING,
160         ICON_GHOST,
161         ICON_BLANK32,
162         ICON_BLANK33,
163         ICON_VERTEXSEL,
164         ICON_EDGESEL,
165         ICON_FACESEL,
166         ICON_BLANK26,
167         ICON_BPIBFOLDER_X,
168         ICON_BPIBFOLDERGREY,
169         ICON_MAGNIFY,
170         ICON_INFO2,
171         
172         ICON_RIGHTARROW,
173         ICON_DOWNARROW_HLT,
174         ICON_ROUNDBEVELTHING,
175         ICON_FULLTEXTURE,
176         ICON_HOOK,
177         ICON_DOT,
178         ICON_WORLD_DEHLT,
179         ICON_CHECKBOX_DEHLT,
180         ICON_CHECKBOX_HLT,
181         ICON_LINK,
182         ICON_INLINK,
183         ICON_BEVELBUT_HLT,
184         ICON_BEVELBUT_DEHLT,
185         ICON_PASTEDOWN,
186         ICON_COPYDOWN,
187         ICON_CONSTANT,
188         ICON_LINEAR,
189         ICON_CYCLIC,
190         ICON_KEY_DEHLT,
191         ICON_KEY_HLT,
192         ICON_GRID2,
193         
194         ICON_EYE,
195         ICON_LAMP,
196         ICON_MATERIAL,
197         ICON_TEXTURE,
198         ICON_ANIM,
199         ICON_WORLD,
200         ICON_SCENE,
201         ICON_EDIT,
202         ICON_GAME,
203         ICON_PAINT,
204         ICON_RADIO,
205         ICON_SCRIPT,
206         ICON_SPEAKER,
207         ICON_PASTEUP,
208         ICON_COPYUP,
209         ICON_PASTEFLIPUP,
210         ICON_PASTEFLIPDOWN,
211         ICON_CYCLICLINEAR,
212         ICON_PIN_DEHLT,
213         ICON_PIN_HLT,
214         ICON_LITTLEGRID,
215         
216         ICON_FULLSCREEN,
217         ICON_SPLITSCREEN,
218         ICON_RIGHTARROW_THIN,
219         ICON_DISCLOSURE_TRI_RIGHT,
220         ICON_DISCLOSURE_TRI_DOWN,
221         ICON_SCENE_SEPIA,
222         ICON_SCENE_DEHLT,
223         ICON_OBJECT,
224         ICON_MESH,
225         ICON_CURVE,
226         ICON_MBALL,
227         ICON_LATTICE,
228         ICON_LAMP_DEHLT,
229         ICON_MATERIAL_DEHLT,
230         ICON_TEXTURE_DEHLT,
231         ICON_IPO_DEHLT,
232         ICON_LIBRARY_DEHLT,
233         ICON_IMAGE_DEHLT,
234         ICON_WINDOW_FULLSCREEN,
235         ICON_WINDOW_WINDOW,
236         ICON_PANEL_CLOSE,
237         
238         ICON_BLENDER,
239         ICON_PACKAGE,
240         ICON_UGLYPACKAGE,
241         ICON_MATPLANE,
242         ICON_MATSPHERE,
243         ICON_MATCUBE,
244         ICON_SCENE_HLT,
245         ICON_OBJECT_HLT,
246         ICON_MESH_HLT,
247         ICON_CURVE_HLT,
248         ICON_MBALL_HLT,
249         ICON_LATTICE_HLT,
250         ICON_LAMP_HLT,
251         ICON_MATERIAL_HLT,
252         ICON_TEXTURE_HLT,
253         ICON_IPO_HLT,
254         ICON_LIBRARY_HLT,
255         ICON_IMAGE_HLT,
256         ICON_CONSTRAINT,
257         ICON_CAMERA_DEHLT,
258         ICON_ARMATURE_DEHLT,
259         
260         ICON_SMOOTHCURVE,
261         ICON_SPHERECURVE,
262         ICON_ROOTCURVE,
263         ICON_SHARPCURVE,
264         ICON_LINCURVE,
265         ICON_NOCURVE,
266         ICON_PROP_OFF,
267         ICON_PROP_ON,
268         ICON_PROP_CON,
269         ICON_SYNTAX,
270         ICON_SYNTAX_OFF,
271         ICON_BLANK52,
272         ICON_BLANK53,
273         ICON_BLANK54,
274         ICON_VIEWMOVE,
275         ICON_HOME,
276         ICON_CLIPUV_DEHLT,
277         ICON_CLIPUV_HLT,
278         ICON_SOME_WACKY_VERTS_AND_LINES,
279         ICON_A_WACKY_VERT_AND_SOME_LINES,
280         ICON_VPAINT_COL,
281         
282         ICON_MAN_TRANS,
283         ICON_MAN_ROT,
284         ICON_MAN_SCALE,
285         ICON_MANIPUL,
286         ICON_BLANK65,
287         ICON_MODIFIER,
288         ICON_MOD_WAVE,
289         ICON_MOD_BUILD,
290         ICON_MOD_DECIM,
291         ICON_MOD_MIRROR,
292         ICON_MOD_SOFT,
293         ICON_MOD_SUBSURF,
294         ICON_BLANK73,
295         ICON_BLANK74,
296         ICON_BLANK75,
297         ICON_BLANK76,
298         ICON_ROTATE,
299         ICON_CURSOR,
300         ICON_ROTATECOLLECTION,
301         ICON_ROTATECENTER,
302         ICON_ROTACTIVE,
303
304         VICON_VIEW3D,
305         VICON_EDIT,
306         VICON_EDITMODE_DEHLT,
307         VICON_EDITMODE_HLT,
308         VICON_DISCLOSURE_TRI_RIGHT,
309         VICON_DISCLOSURE_TRI_DOWN,
310         VICON_MOVE_UP,
311         VICON_MOVE_DOWN,
312         VICON_X
313
314 #define BIFICONID_LAST          (VICON_X)
315 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
316 } BIFIconID;
317
318 typedef enum {
319 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
320         COLORSHADE_DARK,
321         COLORSHADE_GREY,
322         COLORSHADE_MEDIUM,
323         COLORSHADE_HILITE,
324         COLORSHADE_LIGHT,
325         COLORSHADE_WHITE
326 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
327 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
328 } BIFColorShade;
329
330 typedef enum {
331 #define BIFCOLORID_FIRST        (BUTGREY)
332         BUTGREY = 0,
333         BUTGREEN,
334         BUTBLUE,
335         BUTSALMON,
336         MIDGREY,
337         BUTPURPLE,
338         BUTYELLOW,
339         REDALERT,
340         BUTRUST,
341         BUTWHITE,
342         BUTDBLUE,
343         BUTPINK,
344         BUTDPINK,
345         BUTMACTIVE,
346
347         BUTIPO,
348         BUTAUDIO,
349         BUTCAMERA,
350         BUTRANDOM,
351         BUTEDITOBJECT,
352         BUTPROPERTY,
353         BUTSCENE,
354         BUTMOTION,
355         BUTMESSAGE,
356         BUTACTION,
357         BUTCD,
358         BUTGAME,
359         BUTVISIBILITY,
360         BUTYUCK,
361         BUTSEASICK,
362         BUTCHOKE,
363         BUTIMPERIAL,
364
365         BUTTEXTCOLOR,
366         BUTTEXTPRESSED,
367         BUTSBACKGROUND,
368         
369         VIEWPORTBACKCOLOR,
370         VIEWPORTGRIDCOLOR,
371         VIEWPORTACTIVECOLOR,
372         VIEWPORTSELECTEDCOLOR,
373         VIEWPORTUNSELCOLOR,
374         
375         EDITVERTSEL, 
376         EDITVERTUNSEL, 
377         EDITEDGESEL, 
378         EDITEDGEUNSEL
379         
380 #define BIFCOLORID_LAST         (EDITEDGEUNSEL)
381 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
382
383 } BIFColorID;
384
385 /* XXX WARNING: this is saved in file, so do not change order! */
386 enum {
387         TH_AUTO,        /* for buttons, to signal automatic color assignment */
388         
389 // uibutton colors
390         TH_BUT_OUTLINE,
391         TH_BUT_NEUTRAL,
392         TH_BUT_ACTION,
393         TH_BUT_SETTING,
394         TH_BUT_SETTING1,
395         TH_BUT_SETTING2,
396         TH_BUT_NUM,
397         TH_BUT_TEXTFIELD,
398         TH_BUT_POPUP,
399         TH_BUT_TEXT,
400         TH_BUT_TEXT_HI,
401         TH_MENU_BACK,
402         TH_MENU_ITEM,
403         TH_MENU_HILITE,
404         TH_MENU_TEXT,
405         TH_MENU_TEXT_HI,
406         
407         TH_BUT_DRAWTYPE,
408         
409         TH_REDALERT,
410         TH_CUSTOM,
411         
412         TH_BUT_TEXTFIELD_HI,
413         
414         TH_THEMEUI,
415 // common colors among spaces
416         
417         TH_BACK,
418         TH_TEXT,
419         TH_TEXT_HI,
420         TH_HEADER,
421         TH_HEADERDESEL,
422         TH_PANEL,
423         TH_SHADE1,
424         TH_SHADE2,
425         TH_HILITE,
426
427         TH_GRID,
428         TH_WIRE,
429         TH_SELECT,
430         TH_ACTIVE,
431         TH_TRANSFORM,
432         TH_VERTEX,
433         TH_VERTEX_SELECT,
434         TH_VERTEX_SIZE,
435         TH_EDGE,
436         TH_EDGE_SELECT,
437         TH_EDGE_SEAM,
438         TH_EDGE_FACESEL,
439         TH_FACE,
440         TH_FACE_SELECT,
441         TH_NORMAL,
442         TH_FACE_DOT,
443         TH_FACEDOT_SIZE,
444
445         TH_SYNTAX_B,
446         TH_SYNTAX_V,
447         TH_SYNTAX_C,
448         TH_SYNTAX_L,
449         TH_SYNTAX_N,
450         
451         TH_BONE_SOLID,
452         TH_BONE_POSE,
453         
454         TH_STRIP,
455         TH_STRIP_SELECT,
456         
457         TH_LAMP
458         
459 };
460 /* XXX WARNING: previous is saved in file, so do not change order! */
461
462
463 /* specific defines per space should have higher define values */
464
465 struct bTheme;
466
467 // THE CODERS API FOR THEMES:
468
469 // sets the color
470 void    BIF_ThemeColor(int colorid);
471
472 // sets the color plus alpha
473 void    BIF_ThemeColor4(int colorid);
474
475 // sets color plus offset for shade
476 void    BIF_ThemeColorShade(int colorid, int offset);
477
478 // sets color plus offset for alpha
479 void    BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
480
481 // sets color, which is blend between two theme colors
482 void    BIF_ThemeColorBlend(int colorid1, int colorid2, float fac);
483 // same, with shade offset
484 void    BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
485
486 // returns one value, not scaled
487 float   BIF_GetThemeValuef(int colorid);
488 int     BIF_GetThemeValue(int colorid);
489
490 // get three color values, scaled to 0.0-1.0 range
491 void    BIF_GetThemeColor3fv(int colorid, float *col);
492
493 // get the 3 or 4 byte values
494 void    BIF_GetThemeColor3ubv(int colorid, char *col);
495 void    BIF_GetThemeColor4ubv(int colorid, char *col);
496
497 // get a theme color from specified space type
498 void    BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col);
499
500
501 struct ScrArea;
502
503 // internal (blender) usage only, for init and set active
504 void    BIF_InitTheme(void);
505 void    BIF_SetTheme(struct ScrArea *sa);
506 void    BIF_resources_init              (void);
507 void    BIF_resources_free              (void);
508 void    BIF_colors_init                 (void);
509 void    BIF_load_ui_colors              (void);
510
511
512 // icon API
513 int             BIF_get_icon_width              (BIFIconID icon);
514 int             BIF_get_icon_height             (BIFIconID icon);
515 void    BIF_draw_icon                   (float x, float y, BIFIconID icon);
516 void    BIF_draw_icon_blended   (float x, float y, BIFIconID icon, int colorid, int shade);
517
518 /* only for buttons in theme editor! */
519 char    *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
520 char    *BIF_ThemeColorsPup(int spacetype);
521
522
523 void    BIF_def_color                   (BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b);
524
525 #endif /*  BIF_ICONS_H */