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