Cleanup: manually remove header text not handled by automation
[blender.git] / source / blender / editors / include / UI_resources.h
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19
20 /** \file UI_resources.h
21  *  \ingroup editorui
22  */
23
24 #ifndef __UI_RESOURCES_H__
25 #define __UI_RESOURCES_H__
26
27 #include "BLI_sys_types.h"
28
29 /* Define icon enum. */
30 #define DEF_ICON(name) ICON_##name,
31 #define DEF_ICON_VECTOR(name) ICON_##name,
32 #define DEF_ICON_COLOR(name) ICON_##name,
33 #define DEF_ICON_BLANK(name) ICON_BLANK_##name,
34
35 typedef enum {
36         /* ui */
37 #include "UI_icons.h"
38         BIFICONID_LAST
39 } BIFIconID;
40
41 #define BIFICONID_FIRST  (ICON_NONE)
42
43 /* use to denote intentionally unset theme color */
44 #define TH_UNDEFINED -1
45
46 typedef enum ThemeColorID {
47         TH_REDALERT,
48
49         TH_THEMEUI,
50 // common colors among spaces
51
52         TH_BACK,
53         /** Use when 'TH_SHOW_BACK_GRAD' is set (the lower, darker color). */
54         TH_BACK_GRAD,
55         TH_TEXT,
56         TH_TEXT_HI,
57         TH_TITLE,
58         TH_TAB_ACTIVE,
59         TH_TAB_INACTIVE,
60         TH_TAB_BACK,
61         TH_TAB_OUTLINE,
62
63         TH_HEADER,
64         TH_HEADERDESEL,
65         TH_HEADER_TEXT,
66         TH_HEADER_TEXT_HI,
67
68         /* panels */
69         TH_PANEL_HEADER,
70         TH_PANEL_BACK,
71         TH_PANEL_SUB_BACK,
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_WIRE_INNER,
84         TH_WIRE_EDIT,
85         TH_SELECT,
86         TH_ACTIVE,
87         TH_GROUP,
88         TH_GROUP_ACTIVE,
89         TH_TRANSFORM,
90         TH_VERTEX,
91         TH_VERTEX_SELECT,
92         TH_VERTEX_UNREFERENCED,
93         TH_VERTEX_SIZE,
94         TH_OUTLINE_WIDTH,
95         TH_EDGE,
96         TH_EDGE_SELECT,
97         TH_EDGE_SEAM,
98         TH_EDGE_FACESEL,
99         TH_FACE,
100         TH_FACE_SELECT,
101         TH_NORMAL,
102         TH_VNORMAL,
103         TH_LNORMAL,
104         TH_FACE_DOT,
105         TH_FACEDOT_SIZE,
106         TH_CFRAME,
107         TH_TIME_KEYFRAME,
108         TH_TIME_GP_KEYFRAME,
109         TH_NURB_ULINE,
110         TH_NURB_VLINE,
111         TH_NURB_SEL_ULINE,
112         TH_NURB_SEL_VLINE,
113
114         /* this eight colors should be in one block */
115         TH_HANDLE_FREE,
116         TH_HANDLE_AUTO,
117         TH_HANDLE_VECT,
118         TH_HANDLE_ALIGN,
119         TH_HANDLE_AUTOCLAMP,
120         TH_HANDLE_SEL_FREE,
121         TH_HANDLE_SEL_AUTO,
122         TH_HANDLE_SEL_VECT,
123         TH_HANDLE_SEL_ALIGN,
124         TH_HANDLE_SEL_AUTOCLAMP,
125
126         TH_ACTIVE_SPLINE,
127         TH_ACTIVE_VERT, /* equivalent of TH_EDITMESH_ACTIVE for splines */
128
129         TH_SYNTAX_B,
130         TH_SYNTAX_V,
131         TH_SYNTAX_R,
132         TH_SYNTAX_C,
133         TH_SYNTAX_L,
134         TH_SYNTAX_D,
135         TH_SYNTAX_N,
136         TH_SYNTAX_S,
137
138         TH_BONE_SOLID,
139         TH_BONE_POSE,
140         TH_BONE_POSE_ACTIVE,
141
142         TH_STRIP,
143         TH_STRIP_SELECT,
144
145         TH_KEYTYPE_KEYFRAME, /* KEYTYPES */
146         TH_KEYTYPE_KEYFRAME_SELECT,
147         TH_KEYTYPE_EXTREME,
148         TH_KEYTYPE_EXTREME_SELECT,
149         TH_KEYTYPE_BREAKDOWN,
150         TH_KEYTYPE_BREAKDOWN_SELECT,
151         TH_KEYTYPE_JITTER,
152         TH_KEYTYPE_JITTER_SELECT,
153         TH_KEYTYPE_MOVEHOLD,
154         TH_KEYTYPE_MOVEHOLD_SELECT,
155
156         TH_KEYBORDER,
157         TH_KEYBORDER_SELECT,
158
159         TH_LAMP,
160         TH_SPEAKER,
161         TH_CAMERA,
162         TH_EMPTY,
163
164         TH_NODE,
165         TH_NODE_INPUT,
166         TH_NODE_OUTPUT,
167         TH_NODE_COLOR,
168         TH_NODE_FILTER,
169         TH_NODE_VECTOR,
170         TH_NODE_TEXTURE,
171         TH_NODE_PATTERN,
172         TH_NODE_SCRIPT,
173         TH_NODE_LAYOUT,
174         TH_NODE_SHADER,
175         TH_NODE_INTERFACE,
176         TH_NODE_CONVERTOR,
177         TH_NODE_GROUP,
178         TH_NODE_FRAME,
179         TH_NODE_MATTE,
180         TH_NODE_DISTORT,
181
182         TH_CONSOLE_OUTPUT,
183         TH_CONSOLE_INPUT,
184         TH_CONSOLE_INFO,
185         TH_CONSOLE_ERROR,
186         TH_CONSOLE_CURSOR,
187         TH_CONSOLE_SELECT,
188
189         TH_SEQ_MOVIE,
190         TH_SEQ_MOVIECLIP,
191         TH_SEQ_MASK,
192         TH_SEQ_IMAGE,
193         TH_SEQ_SCENE,
194         TH_SEQ_AUDIO,
195         TH_SEQ_EFFECT,
196         TH_SEQ_TRANSITION,
197         TH_SEQ_META,
198         TH_SEQ_TEXT,
199         TH_SEQ_PREVIEW,
200
201         TH_EDGE_SHARP,
202         TH_EDITMESH_ACTIVE,
203
204         TH_HANDLE_VERTEX,
205         TH_HANDLE_VERTEX_SELECT,
206         TH_HANDLE_VERTEX_SIZE,
207
208         TH_GP_VERTEX,
209         TH_GP_VERTEX_SELECT,
210         TH_GP_VERTEX_SIZE,
211
212         TH_DOPESHEET_CHANNELOB,
213         TH_DOPESHEET_CHANNELSUBOB,
214         TH_DOPESHEET_IPOLINE,
215
216         TH_PREVIEW_BACK,
217
218         TH_EDGE_CREASE,
219
220         TH_DRAWEXTRA_EDGELEN,
221         TH_DRAWEXTRA_EDGEANG,
222         TH_DRAWEXTRA_FACEAREA,
223         TH_DRAWEXTRA_FACEANG,
224
225         TH_NODE_CURVING,
226
227         TH_MARKER_OUTLINE,
228         TH_MARKER,
229         TH_ACT_MARKER,
230         TH_SEL_MARKER,
231         TH_BUNDLE_SOLID,
232         TH_DIS_MARKER,
233         TH_PATH_BEFORE,
234         TH_PATH_AFTER,
235         TH_CAMERA_PATH,
236         TH_LOCK_MARKER,
237
238         TH_STITCH_PREVIEW_FACE,
239         TH_STITCH_PREVIEW_EDGE,
240         TH_STITCH_PREVIEW_VERT,
241         TH_STITCH_PREVIEW_STITCHABLE,
242         TH_STITCH_PREVIEW_UNSTITCHABLE,
243         TH_STITCH_PREVIEW_ACTIVE,
244
245         TH_PAINT_CURVE_HANDLE,
246         TH_PAINT_CURVE_PIVOT,
247
248         TH_UV_SHADOW,
249         TH_UV_OTHERS,
250
251         TH_FREESTYLE_EDGE_MARK,
252         TH_FREESTYLE_FACE_MARK,
253
254         TH_MATCH,           /* highlight color for search matches */
255         TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
256
257         TH_SKIN_ROOT,
258
259         TH_ANIM_ACTIVE,   /* active action */
260         TH_ANIM_INACTIVE, /* no active action */
261         TH_ANIM_PREVIEW_RANGE,/* preview range overlay */
262
263         TH_ICON_COLLECTION,
264         TH_ICON_OBJECT,
265         TH_ICON_OBJECT_DATA,
266         TH_ICON_MODIFIER,
267         TH_ICON_SHADING,
268
269         TH_NLA_TWEAK,        /* 'tweaking' track in NLA */
270         TH_NLA_TWEAK_DUPLI,  /* error/warning flag for other strips referencing dupli strip */
271
272         TH_NLA_TRANSITION,
273         TH_NLA_TRANSITION_SEL,
274         TH_NLA_META,
275         TH_NLA_META_SEL,
276         TH_NLA_SOUND,
277         TH_NLA_SOUND_SEL,
278
279         TH_WIDGET_EMBOSS,
280
281         TH_EDITOR_OUTLINE,
282
283         TH_AXIS_X,              /* X/Y/Z Axis */
284         TH_AXIS_Y,
285         TH_AXIS_Z,
286
287         TH_GIZMO_HI,
288         TH_GIZMO_PRIMARY,
289         TH_GIZMO_SECONDARY,
290         TH_GIZMO_A,
291         TH_GIZMO_B,
292
293         TH_SHOW_BACK_GRAD,
294
295         TH_INFO_SELECTED,
296         TH_INFO_SELECTED_TEXT,
297         TH_INFO_ERROR,
298         TH_INFO_ERROR_TEXT,
299         TH_INFO_WARNING,
300         TH_INFO_WARNING_TEXT,
301         TH_INFO_INFO,
302         TH_INFO_INFO_TEXT,
303         TH_INFO_DEBUG,
304         TH_INFO_DEBUG_TEXT,
305         TH_VIEW_OVERLAY,
306
307         TH_V3D_CLIPPING_BORDER,
308
309         TH_METADATA_BG,
310         TH_METADATA_TEXT,
311
312         TH_EDGE_BEVEL,
313         TH_VERTEX_BEVEL
314 } ThemeColorID;
315
316 /* specific defines per space should have higher define values */
317
318 struct bTheme;
319
320 struct bThemeState {
321         struct bTheme *theme;
322         int spacetype, regionid;
323 };
324
325 // THE CODERS API FOR THEMES:
326
327 // returns one value, not scaled
328 float   UI_GetThemeValuef(int colorid);
329 int     UI_GetThemeValue(int colorid);
330
331 float   UI_GetThemeValueTypef(int colorid, int spacetype);
332 int     UI_GetThemeValueType(int colorid, int spacetype);
333
334 // get three color values, scaled to 0.0-1.0 range
335 void    UI_GetThemeColor3fv(int colorid, float col[3]);
336 void    UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned char col[3]);
337 void    UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[3]);
338 void    UI_GetThemeColorBlend4f(int colorid1, int colorid2, float fac, float r_col[4]);
339 // get the color, range 0.0-1.0, complete with shading offset
340 void    UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
341 void    UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
342 void    UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4]);
343
344 // get three color values, range 0-255, complete with shading offset for the RGB components and blending
345 void    UI_GetThemeColorBlendShade3ubv(int colorid1, int colorid2, float fac, int offset, unsigned char col[3]);
346
347 // get four color values, scaled to 0.0-1.0 range
348 void    UI_GetThemeColor4fv(int colorid, float col[4]);
349 // get four color values, range 0.0-1.0, complete with shading offset for the RGB components
350 void    UI_GetThemeColorShade4fv(int colorid, int offset, float col[4]);
351 void    UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4]);
352
353 // get four colour values ranged between 0 and 255; includes the alpha channel
354 void    UI_GetThemeColorShadeAlpha4ubv(int colorid, int coloffset, int alphaoffset, unsigned char col[4]);
355
356 // get four color values, range 0.0-1.0, complete with shading offset for the RGB components and blending
357 void    UI_GetThemeColorBlendShade3fv(int colorid1, int colorid2, float fac, int offset, float col[3]);
358 void    UI_GetThemeColorBlendShade4fv(int colorid1, int colorid2, float fac, int offset, float col[4]);
359
360 // get the 3 or 4 byte values
361 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
362 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
363
364 // get a theme color from specified space type
365 void UI_GetThemeColorType3ubv(int colorid, int spacetype, unsigned char col[3]);
366 void UI_GetThemeColorType4ubv(int colorid, int spacetype, unsigned char col[4]);
367
368 // get theme color for coloring monochrome icons
369 bool    UI_GetIconThemeColor4fv(int colorid, float col[4]);
370
371 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
372 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
373
374 // get a 3 byte color, blended and shaded between two other char color pointers
375 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
376
377 // sets the font color
378 // (for anything fancy use UI_GetThemeColor[Fancy] then BLF_color)
379 void UI_FontThemeColor(int fontid, int colorid);
380
381 // clear the openGL ClearColor using the input colorid
382 void    UI_ThemeClearColor(int colorid);
383
384 // clear the openGL ClearColor using the input colorid using optional transparency
385 void    UI_ThemeClearColorAlpha(int colorid, float alpha);
386
387 // internal (blender) usage only, for init and set active
388 void    UI_SetTheme(int spacetype, int regionid);
389
390 // get current theme
391 struct bTheme *UI_GetTheme(void);
392
393 void UI_Theme_Store(struct bThemeState *theme_state);
394 void UI_Theme_Restore(struct bThemeState *theme_state);
395
396 // return shadow width outside menus and popups */
397 int UI_ThemeMenuShadowWidth(void);
398
399 /* only for buttons in theme editor! */
400 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
401
402 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
403
404 #endif  /* __UI_RESOURCES_H__ */