unify include guard defines, __$FILENAME__
[blender-staging.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
137         TH_SPEAKER,
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_IMAGE,
153         TH_SEQ_SCENE,
154         TH_SEQ_AUDIO,
155         TH_SEQ_EFFECT,
156         TH_SEQ_PLUGIN,
157         TH_SEQ_TRANSITION,
158         TH_SEQ_META,
159         
160         TH_EDGE_SHARP,
161         TH_EDITMESH_ACTIVE,
162         
163         TH_HANDLE_VERTEX,
164         TH_HANDLE_VERTEX_SELECT,
165         TH_HANDLE_VERTEX_SIZE,
166         
167         TH_DOPESHEET_CHANNELOB,
168         TH_DOPESHEET_CHANNELSUBOB,
169         
170         TH_PREVIEW_BACK,
171         
172         TH_EDGE_CREASE,
173
174         TH_DRAWEXTRA_EDGELEN,
175         TH_DRAWEXTRA_FACEAREA,
176         TH_DRAWEXTRA_FACEANG,
177
178         TH_NODE_CURVING,
179
180         TH_MARKER_OUTLINE,
181         TH_MARKER,
182         TH_ACT_MARKER,
183         TH_SEL_MARKER,
184         TH_BUNDLE_SOLID,
185         TH_DIS_MARKER,
186         TH_PATH_BEFORE,
187         TH_PATH_AFTER,
188         TH_CAMERA_PATH,
189         TH_LOCK_MARKER,
190
191         TH_STITCH_PREVIEW_FACE,
192         TH_STITCH_PREVIEW_EDGE,
193         TH_STITCH_PREVIEW_VERT,
194         TH_STITCH_PREVIEW_STITCHABLE,
195         TH_STITCH_PREVIEW_UNSTITCHABLE,
196         TH_STITCH_PREVIEW_ACTIVE,
197
198         TH_MATCH,                       /* highlight color for search matches */
199         TH_SELECT_HIGHLIGHT     /* highlight color for selected outliner item */
200 };
201 /* XXX WARNING: previous is saved in file, so do not change order! */
202
203 /* specific defines per space should have higher define values */
204
205 struct bTheme;
206 struct PointerRNA;
207
208 // THE CODERS API FOR THEMES:
209
210 // sets the color
211 void    UI_ThemeColor(int colorid);
212
213 // sets the color plus alpha
214 void    UI_ThemeColor4(int colorid);
215
216 // sets color plus offset for shade
217 void    UI_ThemeColorShade(int colorid, int offset);
218
219 // sets color plus offset for alpha
220 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
221
222 // sets color, which is blend between two theme colors
223 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
224 // same, with shade offset
225 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
226 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
227
228 // returns one value, not scaled
229 float   UI_GetThemeValuef(int colorid);
230 int     UI_GetThemeValue(int colorid);
231
232 // get three color values, scaled to 0.0-1.0 range
233 void    UI_GetThemeColor3fv(int colorid, float *col);
234 // get the color, range 0.0-1.0, complete with shading offset
235 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
236
237 // get the 3 or 4 byte values
238 void    UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
239 void    UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
240
241 // get a theme color from specified space type
242 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
243
244 // blends and shades between two color pointers
245 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
246
247 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
248 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
249
250 // get a 3 byte color, blended and shaded between two other char color pointers
251 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
252
253 // clear the openGL ClearColor using the input colorid
254 void    UI_ThemeClearColor(int colorid);
255
256 // internal (blender) usage only, for init and set active
257 void    UI_SetTheme(int spacetype, int regionid);
258
259 // get current theme
260 struct bTheme *UI_GetTheme(void);
261
262 /* only for buttons in theme editor! */
263 const unsigned char     *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
264
265 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
266
267 #endif /*  UI_ICONS_H */