svn merge -r 15392:15551 https://svn.blender.org/svnroot/bf-blender/trunk/blender
[blender.git] / source / blender / include / BIF_resources.h
1 /**
2  * $Id$
3  *
4  * ***** BEGIN GPL 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.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
21  * All rights reserved.
22  *
23  * The Original Code is: all of this file.
24  *
25  * Contributor(s): none yet.
26  * 
27  * ***** END GPL LICENSE BLOCK *****
28  */
29
30 #ifndef BIF_RESOURCES_H
31 #define BIF_RESOURCES_H
32
33 /* elubie: TODO: move the typedef for icons to BIF_interface_icons.h */
34 /* and add/replace include of BIF_resources.h by BIF_interface_icons.h */
35 typedef enum {
36 #define BIFICONID_FIRST         (ICON_VIEW3D)
37         ICON_VIEW3D,
38         ICON_IPO,
39         ICON_OOPS,
40         ICON_BUTS,
41         ICON_FILESEL,
42         ICON_IMAGE_COL,
43         ICON_INFO,
44         ICON_SEQUENCE,
45         ICON_TEXT,
46         ICON_IMASEL,
47         ICON_SOUND,
48         ICON_ACTION,
49         ICON_NLA,
50         ICON_SCRIPTWIN,
51         ICON_TIME,
52         ICON_NODE,
53         ICON_SPACE2,
54         ICON_SPACE3,
55         ICON_SPACE4,
56         ICON_TRIA_LEFT,
57         ICON_TRIA_UP,
58         ICON_FONTPREVIEW,
59         ICON_BLANK4,
60         ICON_BLANK5,
61         ICON_BLANK6,
62         
63         ICON_ORTHO,
64         ICON_PERSP,
65         ICON_CAMERA,
66         ICON_PARTICLES,
67         ICON_BBOX,
68         ICON_WIRE,
69         ICON_SOLID,
70         ICON_SMOOTH,
71         ICON_POTATO,
72         ICON_MARKER_HLT,
73         ICON_PMARKER_ACT,
74         ICON_PMARKER_SEL,
75         ICON_PMARKER,
76         ICON_VIEWZOOM,
77         ICON_SORTALPHA,
78         ICON_SORTTIME,
79         ICON_SORTSIZE,
80         ICON_LONGDISPLAY,
81         ICON_SHORTDISPLAY,
82         ICON_TRIA_DOWN,
83         ICON_TRIA_RIGHT,
84         ICON_NDOF_TURN,
85         ICON_NDOF_FLY,
86         ICON_NDOF_TRANS,
87         ICON_NDOF_DOM,
88
89         ICON_VIEW_AXIS_ALL,
90         ICON_VIEW_AXIS_NONE,
91         ICON_VIEW_AXIS_NONE2,
92         ICON_VIEW_AXIS_TOP,
93         ICON_VIEW_AXIS_FRONT,
94         ICON_VIEW_AXIS_SIDE,
95         ICON_POSE_DEHLT,
96         ICON_POSE_HLT,
97         ICON_BORDERMOVE,
98         ICON_MAYBE_ITS_A_LASSO,
99         ICON_BLANK1,    /* ATTENTION, someone decided to use this throughout blender
100                            and didn't care to neither rename it nor update the PNG */
101         ICON_VERSE,
102         ICON_MOD_BOOLEAN,
103         ICON_ARMATURE,
104         ICON_PAUSE,
105         ICON_ALIGN,
106         ICON_REC,
107         ICON_PLAY,
108         ICON_FF,
109         ICON_REW,
110         ICON_PYTHON,
111         ICON_BLANK11,
112         ICON_BLANK12,
113         ICON_BLANK13,
114         ICON_BLANK14,
115
116         
117         ICON_DOTSUP,
118         ICON_DOTSDOWN,
119         ICON_MENU_PANEL,
120         ICON_AXIS_SIDE,
121         ICON_AXIS_FRONT,
122         ICON_AXIS_TOP,
123         ICON_STICKY_UVS_LOC,
124         ICON_STICKY_UVS_DISABLE,
125         ICON_STICKY_UVS_VERT,
126         ICON_PREV_KEYFRAME,
127         ICON_NEXT_KEYFRAME,
128         ICON_ENVMAP,
129         ICON_TRANSP_HLT,
130         ICON_TRANSP_DEHLT,
131         ICON_CIRCLE_DEHLT,
132         ICON_CIRCLE_HLT,
133         ICON_TPAINT_DEHLT,
134         ICON_TPAINT_HLT,
135         ICON_WPAINT_DEHLT,
136         ICON_WPAINT_HLT,
137         ICON_MARKER,
138         ICON_BLANK15,
139         ICON_BLANK16,
140         ICON_BLANK17,
141         ICON_BLANK18,
142         
143         ICON_X,
144         ICON_GO_LEFT,
145         ICON_NO_GO_LEFT,
146         ICON_UNLOCKED,
147         ICON_LOCKED,
148         ICON_PARLIB,
149         ICON_DATALIB,
150         ICON_AUTO,
151         ICON_MATERIAL_DEHLT2,
152         ICON_RING,
153         ICON_GRID,
154         ICON_PROPEDIT,
155         ICON_KEEPRECT,
156         ICON_DESEL_CUBE_VERTS,
157         ICON_EDITMODE_DEHLT,
158         ICON_EDITMODE_HLT,
159         ICON_VPAINT_DEHLT,
160         ICON_VPAINT_HLT,
161         ICON_FACESEL_DEHLT,
162         ICON_FACESEL_HLT,
163         ICON_EDIT_DEHLT,
164         ICON_BOOKMARKS,
165         ICON_BLANK20,
166         ICON_BLANK21,
167         ICON_BLANK22,
168         
169         ICON_HELP,
170         ICON_ERROR,
171         ICON_FOLDER_DEHLT,
172         ICON_FOLDER_HLT,
173         ICON_BLUEIMAGE_DEHLT,
174         ICON_BLUEIMAGE_HLT,
175         ICON_BPIBFOLDER_DEHLT,
176         ICON_BPIBFOLDER_HLT,
177         ICON_BPIBFOLDER_ERR,
178         ICON_UGLY_GREEN_RING,
179         ICON_GHOST,
180         ICON_SORTBYEXT,
181         ICON_SCULPTMODE_HLT,
182         ICON_VERTEXSEL,
183         ICON_EDGESEL,
184         ICON_FACESEL,
185         ICON_PLUS,
186         ICON_BPIBFOLDER_X,
187         ICON_BPIBFOLDERGREY,
188         ICON_MAGNIFY,
189         ICON_INFO2,
190         ICON_BLANK23,
191         ICON_BLANK24,
192         ICON_BLANK25,
193         ICON_BLANK26,
194         
195         ICON_RIGHTARROW,
196         ICON_DOWNARROW_HLT,
197         ICON_ROUNDBEVELTHING,
198         ICON_FULLTEXTURE,
199         ICON_HOOK,
200         ICON_DOT,
201         ICON_WORLD_DEHLT,
202         ICON_CHECKBOX_DEHLT,
203         ICON_CHECKBOX_HLT,
204         ICON_LINK,
205         ICON_INLINK,
206         ICON_ZOOMIN,
207         ICON_ZOOMOUT,
208         ICON_PASTEDOWN,
209         ICON_COPYDOWN,
210         ICON_CONSTANT,
211         ICON_LINEAR,
212         ICON_CYCLIC,
213         ICON_KEY_DEHLT,
214         ICON_KEY_HLT,
215         ICON_GRID2,
216         ICON_BLANK27,
217         ICON_BLANK28,
218         ICON_BLANK29,
219         ICON_BLANK30,
220         
221         ICON_EYE,
222         ICON_LAMP,
223         ICON_MATERIAL,
224         ICON_TEXTURE,
225         ICON_ANIM,
226         ICON_WORLD,
227         ICON_SCENE,
228         ICON_EDIT,
229         ICON_GAME,
230         ICON_PAINT,
231         ICON_RADIO,
232         ICON_SCRIPT,
233         ICON_SPEAKER,
234         ICON_PASTEUP,
235         ICON_COPYUP,
236         ICON_PASTEFLIPUP,
237         ICON_PASTEFLIPDOWN,
238         ICON_CYCLICLINEAR,
239         ICON_PIN_DEHLT,
240         ICON_PIN_HLT,
241         ICON_LITTLEGRID,
242         ICON_BLANK31,
243         ICON_BLANK32,
244         ICON_BLANK33,
245         ICON_BLANK34,
246         
247         ICON_FULLSCREEN,
248         ICON_SPLITSCREEN,
249         ICON_RIGHTARROW_THIN,
250         ICON_DISCLOSURE_TRI_RIGHT,
251         ICON_DISCLOSURE_TRI_DOWN,
252         ICON_SCENE_SEPIA,
253         ICON_SCENE_DEHLT,
254         ICON_OBJECT,
255         ICON_MESH,
256         ICON_CURVE,
257         ICON_MBALL,
258         ICON_LATTICE,
259         ICON_LAMP_DEHLT,
260         ICON_MATERIAL_DEHLT,
261         ICON_TEXTURE_DEHLT,
262         ICON_IPO_DEHLT,
263         ICON_LIBRARY_DEHLT,
264         ICON_IMAGE_DEHLT,
265         ICON_EYEDROPPER,
266         ICON_WINDOW_WINDOW,
267         ICON_PANEL_CLOSE,
268         ICON_PHYSICS,
269         ICON_BLANK36,
270         ICON_BLANK37,
271         ICON_BLANK38,
272         
273         ICON_BLENDER,
274         ICON_PACKAGE,
275         ICON_UGLYPACKAGE,
276         ICON_MATPLANE,
277         ICON_MATSPHERE,
278         ICON_MATCUBE,
279         ICON_SCENE_HLT,
280         ICON_OBJECT_HLT,
281         ICON_MESH_HLT,
282         ICON_CURVE_HLT,
283         ICON_MBALL_HLT,
284         ICON_LATTICE_HLT,
285         ICON_LAMP_HLT,
286         ICON_MATERIAL_HLT,
287         ICON_TEXTURE_HLT,
288         ICON_IPO_HLT,
289         ICON_LIBRARY_HLT,
290         ICON_IMAGE_HLT,
291         ICON_CONSTRAINT,
292         ICON_CAMERA_DEHLT,
293         ICON_ARMATURE_DEHLT,
294         ICON_SNAP_GEAR,
295         ICON_SNAP_GEO,
296         ICON_SNAP_NORMAL,
297         ICON_BLANK42,
298         
299         ICON_SMOOTHCURVE,
300         ICON_SPHERECURVE,
301         ICON_ROOTCURVE,
302         ICON_SHARPCURVE,
303         ICON_LINCURVE,
304         ICON_NOCURVE,
305         ICON_RNDCURVE,
306         ICON_PROP_OFF,
307         ICON_PROP_ON,
308         ICON_PROP_CON,
309         ICON_SYNTAX,
310         ICON_SYNTAX_OFF,
311         ICON_MONKEY,
312         ICON_HAIR,
313         ICON_VIEWMOVE,
314         ICON_HOME,
315         ICON_CLIPUV_DEHLT,
316         ICON_CLIPUV_HLT,
317         ICON_BLANK2,
318         ICON_BLANK3,
319         ICON_VPAINT_COL,
320         ICON_RESTRICT_SELECT_OFF,
321         ICON_RESTRICT_SELECT_ON,
322         ICON_MUTE_IPO_OFF,
323         ICON_MUTE_IPO_ON,
324         
325         ICON_MAN_TRANS,
326         ICON_MAN_ROT,
327         ICON_MAN_SCALE,
328         ICON_MANIPUL,
329         ICON_BLANK_47,
330         ICON_MODIFIER,
331         ICON_MOD_WAVE,
332         ICON_MOD_BUILD,
333         ICON_MOD_DECIM,
334         ICON_MOD_MIRROR,
335         ICON_MOD_SOFT,
336         ICON_MOD_SUBSURF,
337         ICON_SEQ_SEQUENCER,
338         ICON_SEQ_PREVIEW,
339         ICON_SEQ_LUMA_WAVEFORM,
340         ICON_SEQ_CHROMA_SCOPE,
341         ICON_ROTATE,
342         ICON_CURSOR,
343         ICON_ROTATECOLLECTION,
344         ICON_ROTATECENTER,
345         ICON_ROTACTIVE,
346         ICON_RESTRICT_VIEW_OFF,
347         ICON_RESTRICT_VIEW_ON,
348         ICON_RESTRICT_RENDER_OFF,
349         ICON_RESTRICT_RENDER_ON,
350
351         VICON_VIEW3D,
352         VICON_EDIT,
353         VICON_EDITMODE_DEHLT,
354         VICON_EDITMODE_HLT,
355         VICON_DISCLOSURE_TRI_RIGHT,
356         VICON_DISCLOSURE_TRI_DOWN,
357         VICON_MOVE_UP,
358         VICON_MOVE_DOWN,
359         VICON_X
360
361 #define BIFICONID_LAST          (VICON_X)
362 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
363 } BIFIconID;
364
365 typedef enum {
366 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
367         COLORSHADE_DARK,
368         COLORSHADE_GREY,
369         COLORSHADE_MEDIUM,
370         COLORSHADE_HILITE,
371         COLORSHADE_LIGHT,
372         COLORSHADE_WHITE
373 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
374 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
375 } BIFColorShade;
376
377 typedef enum {
378 #define BIFCOLORID_FIRST        (BUTGREY)
379         BUTGREY = 0,
380         BUTGREEN,
381         BUTBLUE,
382         BUTSALMON,
383         MIDGREY,
384         BUTPURPLE,
385         BUTYELLOW,
386         REDALERT,
387         BUTRUST,
388         BUTWHITE,
389         BUTDBLUE,
390         BUTPINK,
391         BUTDPINK,
392         BUTMACTIVE,
393
394         BUTIPO,
395         BUTAUDIO,
396         BUTCAMERA,
397         BUTRANDOM,
398         BUTEDITOBJECT,
399         BUTPROPERTY,
400         BUTSCENE,
401         BUTMOTION,
402         BUTMESSAGE,
403         BUTACTION,
404         BUTCD,
405         BUTGAME,
406         BUTVISIBILITY,
407         BUTYUCK,
408         BUTSEASICK,
409         BUTCHOKE,
410         BUTIMPERIAL,
411
412         BUTTEXTCOLOR,
413         BUTTEXTPRESSED,
414         BUTSBACKGROUND,
415         
416         VIEWPORTBACKCOLOR,
417         VIEWPORTGRIDCOLOR,
418         VIEWPORTACTIVECOLOR,
419         VIEWPORTSELECTEDCOLOR,
420         VIEWPORTUNSELCOLOR,
421         
422         EDITVERTSEL, 
423         EDITVERTUNSEL, 
424         EDITEDGESEL, 
425         EDITEDGEUNSEL
426         
427 #define BIFCOLORID_LAST         (EDITEDGEUNSEL)
428 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
429
430 } BIFColorID;
431
432 /* XXX WARNING: this is saved in file, so do not change order! */
433 enum {
434         TH_AUTO,        /* for buttons, to signal automatic color assignment */
435         
436 // uibutton colors
437         TH_BUT_OUTLINE,
438         TH_BUT_NEUTRAL,
439         TH_BUT_ACTION,
440         TH_BUT_SETTING,
441         TH_BUT_SETTING1,
442         TH_BUT_SETTING2,
443         TH_BUT_NUM,
444         TH_BUT_TEXTFIELD,
445         TH_BUT_POPUP,
446         TH_BUT_TEXT,
447         TH_BUT_TEXT_HI,
448         TH_MENU_BACK,
449         TH_MENU_ITEM,
450         TH_MENU_HILITE,
451         TH_MENU_TEXT,
452         TH_MENU_TEXT_HI,
453         
454         TH_BUT_DRAWTYPE,
455         
456         TH_REDALERT,
457         TH_CUSTOM,
458         
459         TH_BUT_TEXTFIELD_HI,
460         TH_ICONFILE,
461         
462         TH_THEMEUI,
463 // common colors among spaces
464         
465         TH_BACK,
466         TH_TEXT,
467         TH_TEXT_HI,
468         TH_HEADER,
469         TH_HEADERDESEL,
470         TH_PANEL,
471         TH_SHADE1,
472         TH_SHADE2,
473         TH_HILITE,
474
475         TH_GRID,
476         TH_WIRE,
477         TH_SELECT,
478         TH_ACTIVE,
479         TH_GROUP,
480         TH_GROUP_ACTIVE,
481         TH_TRANSFORM,
482         TH_VERTEX,
483         TH_VERTEX_SELECT,
484         TH_VERTEX_SIZE,
485         TH_EDGE,
486         TH_EDGE_SELECT,
487         TH_EDGE_SEAM,
488         TH_EDGE_FACESEL,
489         TH_FACE,
490         TH_FACE_SELECT,
491         TH_NORMAL,
492         TH_FACE_DOT,
493         TH_FACEDOT_SIZE,
494         TH_CFRAME,
495
496         TH_SYNTAX_B,
497         TH_SYNTAX_V,
498         TH_SYNTAX_C,
499         TH_SYNTAX_L,
500         TH_SYNTAX_N,
501         
502         TH_BONE_SOLID,
503         TH_BONE_POSE,
504         
505         TH_STRIP,
506         TH_STRIP_SELECT,
507         
508         TH_LAMP,
509         
510         TH_NODE,
511         TH_NODE_IN_OUT,
512         TH_NODE_OPERATOR,
513         TH_NODE_CONVERTOR,
514         TH_NODE_GROUP,
515         
516         TH_SEQ_MOVIE,
517         TH_SEQ_IMAGE,
518         TH_SEQ_SCENE,
519         TH_SEQ_AUDIO,
520         TH_SEQ_EFFECT,
521         TH_SEQ_PLUGIN,
522         TH_SEQ_TRANSITION,
523         TH_SEQ_META,
524         
525         TH_EDGE_SHARP,
526         TH_EDITMESH_ACTIVE,
527 };
528 /* XXX WARNING: previous is saved in file, so do not change order! */
529
530 /* theme drawtypes */
531 #define TH_MINIMAL  0
532 #define TH_SHADED   1
533 #define TH_ROUNDED  2
534 #define TH_OLDSKOOL 3
535
536 /* specific defines per space should have higher define values */
537
538 struct bTheme;
539
540 // THE CODERS API FOR THEMES:
541
542 // sets the color
543 void    BIF_ThemeColor(int colorid);
544
545 // sets the color plus alpha
546 void    BIF_ThemeColor4(int colorid);
547
548 // sets color plus offset for shade
549 void    BIF_ThemeColorShade(int colorid, int offset);
550
551 // sets color plus offset for alpha
552 void    BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
553
554 // sets color, which is blend between two theme colors
555 void    BIF_ThemeColorBlend(int colorid1, int colorid2, float fac);
556 // same, with shade offset
557 void    BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
558
559 // returns one value, not scaled
560 float   BIF_GetThemeValuef(int colorid);
561 int     BIF_GetThemeValue(int colorid);
562
563 // get three color values, scaled to 0.0-1.0 range
564 void    BIF_GetThemeColor3fv(int colorid, float *col);
565
566 // get the 3 or 4 byte values
567 void    BIF_GetThemeColor3ubv(int colorid, char *col);
568 void    BIF_GetThemeColor4ubv(int colorid, char *col);
569
570 // get a theme color from specified space type
571 void    BIF_GetThemeColorType4ubv(int colorid, int spacetype, char *col);
572
573 // blends and shades between two color pointers
574 void    BIF_ColorPtrBlendShade3ubv(char *cp1, char *cp2, float fac, int offset);
575
576 // get a 3 byte color, blended and shaded between two other char color pointers
577 void    BIF_GetColorPtrBlendShade3ubv(char *cp1, char *cp2, char *col, float fac, int offset);
578
579
580 struct ScrArea;
581
582 // internal (blender) usage only, for init and set active
583 void    BIF_InitTheme(void);
584 void    BIF_SetTheme(struct ScrArea *sa);
585 void    BIF_resources_init              (void);
586 void    BIF_resources_free              (void);
587 void    BIF_colors_init                 (void);
588 void    BIF_load_ui_colors              (void);
589
590 /* only for buttons in theme editor! */
591 char    *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
592 char    *BIF_ThemeColorsPup(int spacetype);
593
594 /* only for Bone Color sets */
595 char *BIF_ThemeColorSetsPup(short inc_custom);
596
597
598 void    BIF_def_color                   (BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b);
599
600 #endif /*  BIF_ICONS_H */