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