doxygen: editor entry
[blender.git] / source / blender / editors / include / UI_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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 /** \file UI_resources.h
34  *  \ingroup editorui
35  */
36
37 #ifndef UI_RESOURCES_H
38 #define UI_RESOURCES_H
39
40 /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
41 /* and add/replace include of UI_resources.h by UI_interface_icons.h */
42 #define DEF_ICON(name) ICON_##name,
43 #define DEF_VICO(name) VICO_##name,
44
45 typedef enum {
46 #define BIFICONID_FIRST         (ICON_BLENDER)
47         /* ui */
48 #include "UI_icons.h"
49         BIFICONID_LAST
50 #define BIFNICONIDS                     (BIFICONID_LAST-BIFICONID_FIRST + 1)
51 } BIFIconID;
52 #undef DEF_ICON
53 #undef DEF_VICO
54
55
56 typedef enum {
57 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
58                 COLORSHADE_DARK,
59                 COLORSHADE_GREY,
60                 COLORSHADE_MEDIUM,
61                 COLORSHADE_HILITE,
62                 COLORSHADE_LIGHT,
63                 COLORSHADE_WHITE
64 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
65 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
66 } BIFColorShade;
67
68 typedef enum {
69 #define BIFCOLORID_FIRST        (BUTGREY)
70         BUTGREY = 0,
71         BUTGREEN,
72         BUTBLUE,
73         BUTSALMON,
74         MIDGREY,
75         BUTPURPLE,
76         BUTYELLOW,
77         REDALERT,
78         BUTRUST,
79         BUTWHITE,
80         BUTDBLUE,
81         BUTPINK,
82         BUTDPINK,
83         BUTMACTIVE,
84
85         BUTIPO,
86         BUTAUDIO,
87         BUTCAMERA,
88         BUTRANDOM,
89         BUTEDITOBJECT,
90         BUTPROPERTY,
91         BUTSCENE,
92         BUTMOTION,
93         BUTMESSAGE,
94         BUTACTION,
95         BUTCD,
96         BUTGAME,
97         BUTVISIBILITY,
98         BUTYUCK,
99         BUTSEASICK,
100         BUTCHOKE,
101         BUTIMPERIAL,
102
103         BUTTEXTCOLOR,
104         BUTTEXTPRESSED,
105         BUTSBACKGROUND,
106         
107         VIEWPORTBACKCOLOR,
108         VIEWPORTGRIDCOLOR,
109         VIEWPORTACTIVECOLOR,
110         VIEWPORTSELECTEDCOLOR,
111         VIEWPORTUNSELCOLOR,
112         
113         EDITVERTSEL, 
114         EDITVERTUNSEL, 
115         EDITEDGESEL, 
116         EDITEDGEUNSEL
117         
118 #define BIFCOLORID_LAST         (EDITEDGEUNSEL)
119 #define BIFNCOLORIDS            (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
120
121 } BIFColorID;
122
123 enum {
124         TH_REDALERT,
125
126         TH_THEMEUI,
127 // common colors among spaces
128         
129         TH_BACK,
130         TH_TEXT,
131         TH_TEXT_HI,
132         TH_TITLE,
133         
134         TH_HEADER,
135         TH_HEADERDESEL,
136         TH_HEADER_TEXT,
137         TH_HEADER_TEXT_HI,
138         
139         /* float panels */
140         TH_PANEL,
141         TH_PANEL_TEXT,
142         TH_PANEL_TEXT_HI,
143         
144         TH_BUTBACK,
145         TH_BUTBACK_TEXT,
146         TH_BUTBACK_TEXT_HI,
147         
148         TH_SHADE1,
149         TH_SHADE2,
150         TH_HILITE,
151
152         TH_GRID,
153         TH_WIRE,
154         TH_SELECT,
155         TH_ACTIVE,
156         TH_GROUP,
157         TH_GROUP_ACTIVE,
158         TH_TRANSFORM,
159         TH_VERTEX,
160         TH_VERTEX_SELECT,
161         TH_VERTEX_SIZE,
162         TH_EDGE,
163         TH_EDGE_SELECT,
164         TH_EDGE_SEAM,
165         TH_EDGE_FACESEL,
166         TH_FACE,
167         TH_FACE_SELECT,
168         TH_NORMAL,
169         TH_VNORMAL,
170         TH_FACE_DOT,
171         TH_FACEDOT_SIZE,
172         TH_CFRAME,
173         TH_NURB_ULINE,
174         TH_NURB_VLINE,
175         TH_NURB_SEL_ULINE,
176         TH_NURB_SEL_VLINE,
177
178         /* this eight colors should be in one block */
179         TH_HANDLE_FREE,
180         TH_HANDLE_AUTO,
181         TH_HANDLE_VECT,
182         TH_HANDLE_ALIGN,
183         TH_HANDLE_SEL_FREE,
184         TH_HANDLE_SEL_AUTO,
185         TH_HANDLE_SEL_VECT,
186         TH_HANDLE_SEL_ALIGN,
187
188         TH_ACTIVE_SPLINE,
189         TH_LASTSEL_POINT,
190
191         TH_SYNTAX_B,
192         TH_SYNTAX_V,
193         TH_SYNTAX_C,
194         TH_SYNTAX_L,
195         TH_SYNTAX_N,
196         
197         TH_BONE_SOLID,
198         TH_BONE_POSE,
199         
200         TH_STRIP,
201         TH_STRIP_SELECT,
202         
203         TH_LAMP,
204         
205         TH_NODE,
206         TH_NODE_IN_OUT,
207         TH_NODE_OPERATOR,
208         TH_NODE_CONVERTOR,
209         TH_NODE_GROUP,
210         
211         TH_CONSOLE_OUTPUT,
212         TH_CONSOLE_INPUT,
213         TH_CONSOLE_INFO,
214         TH_CONSOLE_ERROR,
215         TH_CONSOLE_CURSOR,
216         
217         TH_SEQ_MOVIE,
218         TH_SEQ_IMAGE,
219         TH_SEQ_SCENE,
220         TH_SEQ_AUDIO,
221         TH_SEQ_EFFECT,
222         TH_SEQ_PLUGIN,
223         TH_SEQ_TRANSITION,
224         TH_SEQ_META,
225         
226         TH_EDGE_SHARP,
227         TH_EDITMESH_ACTIVE,
228         
229         TH_HANDLE_VERTEX,
230         TH_HANDLE_VERTEX_SELECT,
231         TH_HANDLE_VERTEX_SIZE,
232         
233         TH_DOPESHEET_CHANNELOB,
234         TH_DOPESHEET_CHANNELSUBOB,
235         
236         TH_PREVIEW_BACK,
237         
238         TH_EDGE_CREASE,
239
240         TH_DRAWEXTRA_EDGELEN,
241         TH_DRAWEXTRA_FACEAREA,
242         TH_DRAWEXTRA_FACEANG
243 };
244 /* XXX WARNING: previous is saved in file, so do not change order! */
245
246 /* specific defines per space should have higher define values */
247
248 struct bTheme;
249 struct PointerRNA;
250
251 // THE CODERS API FOR THEMES:
252
253 // sets the color
254 void    UI_ThemeColor(int colorid);
255
256 // sets the color plus alpha
257 void    UI_ThemeColor4(int colorid);
258
259 // sets color plus offset for shade
260 void    UI_ThemeColorShade(int colorid, int offset);
261
262 // sets color plus offset for alpha
263 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
264
265 // sets color, which is blend between two theme colors
266 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
267 // same, with shade offset
268 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
269 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
270
271 // returns one value, not scaled
272 float   UI_GetThemeValuef(int colorid);
273 int     UI_GetThemeValue(int colorid);
274
275 // get three color values, scaled to 0.0-1.0 range
276 void    UI_GetThemeColor3fv(int colorid, float *col);
277 // get the color, range 0.0-1.0, complete with shading offset
278 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
279
280 // get the 3 or 4 byte values
281 void    UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
282 void    UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
283
284 // get a theme color from specified space type
285 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
286
287 // blends and shades between two color pointers
288 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
289
290 // get a 3 byte color, blended and shaded between two other char color pointers
291 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
292
293 // clear the openGL ClearColor using the input colorid
294 void    UI_ThemeClearColor(int colorid);
295
296 // internal (blender) usage only, for init and set active
297 void    UI_SetTheme(int spacetype, int regionid);
298
299 /* only for buttons in theme editor! */
300 const unsigned char     *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
301
302 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
303
304 #endif /*  UI_ICONS_H */