Sequence Editor Themes:
[blender.git] / source / blender / editors / include / UI_resources.h
1 /*
2  *
3  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License
7  * as published by the Free Software Foundation; either version 2
8  * of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  *
19  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
20  * All rights reserved.
21  *
22  * The Original Code is: all of this file.
23  *
24  * Contributor(s): none yet.
25  * 
26  * ***** END GPL/BL DUAL LICENSE BLOCK *****
27  */
28
29 /** \file UI_resources.h
30  *  \ingroup editorui
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 #define DEF_ICON(name) ICON_##name,
39 #define DEF_VICO(name) VICO_##name,
40
41 typedef enum {
42         /* ui */
43 #include "UI_icons.h"
44         BIFICONID_LAST
45 } BIFIconID;
46
47 #define BIFICONID_FIRST         (ICON_NONE)
48
49 #undef DEF_ICON
50 #undef DEF_VICO
51
52 enum {
53         TH_REDALERT,
54
55         TH_THEMEUI,
56 // common colors among spaces
57         
58         TH_BACK,
59         TH_TEXT,
60         TH_TEXT_HI,
61         TH_TITLE,
62         
63         TH_HEADER,
64         TH_HEADERDESEL,
65         TH_HEADER_TEXT,
66         TH_HEADER_TEXT_HI,
67         
68         /* float panels */
69         TH_PANEL,
70         TH_PANEL_TEXT,
71         TH_PANEL_TEXT_HI,
72         
73         TH_BUTBACK,
74         TH_BUTBACK_TEXT,
75         TH_BUTBACK_TEXT_HI,
76         
77         TH_SHADE1,
78         TH_SHADE2,
79         TH_HILITE,
80
81         TH_GRID,
82         TH_WIRE,
83         TH_SELECT,
84         TH_ACTIVE,
85         TH_GROUP,
86         TH_GROUP_ACTIVE,
87         TH_TRANSFORM,
88         TH_VERTEX,
89         TH_VERTEX_SELECT,
90         TH_VERTEX_SIZE,
91         TH_OUTLINE_WIDTH,
92         TH_EDGE,
93         TH_EDGE_SELECT,
94         TH_EDGE_SEAM,
95         TH_EDGE_FACESEL,
96         TH_FACE,
97         TH_FACE_SELECT,
98         TH_NORMAL,
99         TH_VNORMAL,
100         TH_FACE_DOT,
101         TH_FACEDOT_SIZE,
102         TH_CFRAME,
103         TH_NURB_ULINE,
104         TH_NURB_VLINE,
105         TH_NURB_SEL_ULINE,
106         TH_NURB_SEL_VLINE,
107
108         /* this eight colors should be in one block */
109         TH_HANDLE_FREE,
110         TH_HANDLE_AUTO,
111         TH_HANDLE_VECT,
112         TH_HANDLE_ALIGN,
113         TH_HANDLE_AUTOCLAMP,
114         TH_HANDLE_SEL_FREE,
115         TH_HANDLE_SEL_AUTO,
116         TH_HANDLE_SEL_VECT,
117         TH_HANDLE_SEL_ALIGN,
118         TH_HANDLE_SEL_AUTOCLAMP,
119
120         TH_ACTIVE_SPLINE,
121         TH_LASTSEL_POINT,
122
123         TH_SYNTAX_B,
124         TH_SYNTAX_V,
125         TH_SYNTAX_C,
126         TH_SYNTAX_L,
127         TH_SYNTAX_N,
128         
129         TH_BONE_SOLID,
130         TH_BONE_POSE,
131         
132         TH_STRIP,
133         TH_STRIP_SELECT,
134         
135         TH_LAMP,
136         TH_SPEAKER,
137         TH_CAMERA,
138         TH_EMPTY,
139         
140         TH_NODE,
141         TH_NODE_IN_OUT,
142         TH_NODE_OPERATOR,
143         TH_NODE_CONVERTOR,
144         TH_NODE_GROUP,
145         
146         TH_CONSOLE_OUTPUT,
147         TH_CONSOLE_INPUT,
148         TH_CONSOLE_INFO,
149         TH_CONSOLE_ERROR,
150         TH_CONSOLE_CURSOR,
151         
152         TH_SEQ_MOVIE,
153         TH_SEQ_MOVIECLIP,
154         TH_SEQ_IMAGE,
155         TH_SEQ_SCENE,
156         TH_SEQ_AUDIO,
157         TH_SEQ_EFFECT,
158         TH_SEQ_PLUGIN,
159         TH_SEQ_TRANSITION,
160         TH_SEQ_META,
161         TH_SEQ_PREVIEW,
162         
163         TH_EDGE_SHARP,
164         TH_EDITMESH_ACTIVE,
165         
166         TH_HANDLE_VERTEX,
167         TH_HANDLE_VERTEX_SELECT,
168         TH_HANDLE_VERTEX_SIZE,
169         
170         TH_DOPESHEET_CHANNELOB,
171         TH_DOPESHEET_CHANNELSUBOB,
172         
173         TH_PREVIEW_BACK,
174         
175         TH_EDGE_CREASE,
176
177         TH_DRAWEXTRA_EDGELEN,
178         TH_DRAWEXTRA_FACEAREA,
179         TH_DRAWEXTRA_FACEANG,
180
181         TH_NODE_CURVING,
182
183         TH_MARKER_OUTLINE,
184         TH_MARKER,
185         TH_ACT_MARKER,
186         TH_SEL_MARKER,
187         TH_BUNDLE_SOLID,
188         TH_DIS_MARKER,
189         TH_PATH_BEFORE,
190         TH_PATH_AFTER,
191         TH_CAMERA_PATH,
192         TH_LOCK_MARKER,
193
194         TH_STITCH_PREVIEW_FACE,
195         TH_STITCH_PREVIEW_EDGE,
196         TH_STITCH_PREVIEW_VERT,
197         TH_STITCH_PREVIEW_STITCHABLE,
198         TH_STITCH_PREVIEW_UNSTITCHABLE,
199         TH_STITCH_PREVIEW_ACTIVE,
200
201         TH_MATCH,                       /* highlight color for search matches */
202         TH_SELECT_HIGHLIGHT     /* highlight color for selected outliner item */
203 };
204 /* XXX WARNING: previous is saved in file, so do not change order! */
205
206 /* specific defines per space should have higher define values */
207
208 struct bTheme;
209 struct PointerRNA;
210
211 // THE CODERS API FOR THEMES:
212
213 // sets the color
214 void    UI_ThemeColor(int colorid);
215
216 // sets the color plus alpha
217 void    UI_ThemeColor4(int colorid);
218
219 // sets color plus offset for shade
220 void    UI_ThemeColorShade(int colorid, int offset);
221
222 // sets color plus offset for alpha
223 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
224
225 // sets color, which is blend between two theme colors
226 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
227 // same, with shade offset
228 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
229 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
230
231 // returns one value, not scaled
232 float   UI_GetThemeValuef(int colorid);
233 int     UI_GetThemeValue(int colorid);
234
235 // get three color values, scaled to 0.0-1.0 range
236 void    UI_GetThemeColor3fv(int colorid, float *col);
237 // get the color, range 0.0-1.0, complete with shading offset
238 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
239
240 // get the 3 or 4 byte values
241 void    UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
242 void    UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
243
244 // get a theme color from specified space type
245 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
246
247 // blends and shades between two color pointers
248 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
249
250 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
251 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
252
253 // get a 3 byte color, blended and shaded between two other char color pointers
254 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
255
256 // clear the openGL ClearColor using the input colorid
257 void    UI_ThemeClearColor(int colorid);
258
259 // internal (blender) usage only, for init and set active
260 void    UI_SetTheme(int spacetype, int regionid);
261
262 // get current theme
263 struct bTheme *UI_GetTheme(void);
264
265 /* only for buttons in theme editor! */
266 const unsigned char     *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
267
268 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
269
270 #endif /*  UI_ICONS_H */