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