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