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.
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.
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.
16 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17 * All rights reserved.
24 #ifndef __UI_RESOURCES_H__
25 #define __UI_RESOURCES_H__
27 #include "BLI_sys_types.h"
33 /* Define icon enum. */
34 #define DEF_ICON(name) ICON_##name,
35 #define DEF_ICON_VECTOR(name) ICON_##name,
36 #define DEF_ICON_COLOR(name) ICON_##name,
37 #define DEF_ICON_BLANK(name) ICON_BLANK_##name,
45 #define BIFICONID_FIRST (ICON_NONE)
47 /* use to denote intentionally unset theme color */
48 #define TH_UNDEFINED -1
50 typedef enum ThemeColorID {
54 // common colors among spaces
57 /** Use when 'TH_SHOW_BACK_GRAD' is set (the lower, darker color). */
96 TH_VERTEX_UNREFERENCED,
114 TH_TIME_SCRUB_BACKGROUND,
116 TH_TIME_MARKER_LINE_SELECTED,
124 /* this eight colors should be in one block */
134 TH_HANDLE_SEL_AUTOCLAMP,
137 TH_ACTIVE_VERT, /* equivalent of TH_EDITMESH_ACTIVE for splines */
152 TH_BONE_LOCKED_WEIGHT,
157 TH_KEYTYPE_KEYFRAME, /* KEYTYPES */
158 TH_KEYTYPE_KEYFRAME_SELECT,
160 TH_KEYTYPE_EXTREME_SELECT,
161 TH_KEYTYPE_BREAKDOWN,
162 TH_KEYTYPE_BREAKDOWN_SELECT,
164 TH_KEYTYPE_JITTER_SELECT,
166 TH_KEYTYPE_MOVEHOLD_SELECT,
219 TH_HANDLE_VERTEX_SELECT,
220 TH_HANDLE_VERTEX_SIZE,
226 TH_DOPESHEET_CHANNELOB,
227 TH_DOPESHEET_CHANNELSUBOB,
228 TH_DOPESHEET_IPOLINE,
234 TH_DRAWEXTRA_EDGELEN,
235 TH_DRAWEXTRA_EDGEANG,
236 TH_DRAWEXTRA_FACEAREA,
237 TH_DRAWEXTRA_FACEANG,
250 TH_PATH_KEYFRAME_BEFORE,
251 TH_PATH_KEYFRAME_AFTER,
255 TH_STITCH_PREVIEW_FACE,
256 TH_STITCH_PREVIEW_EDGE,
257 TH_STITCH_PREVIEW_VERT,
258 TH_STITCH_PREVIEW_STITCHABLE,
259 TH_STITCH_PREVIEW_UNSTITCHABLE,
260 TH_STITCH_PREVIEW_ACTIVE,
262 TH_PAINT_CURVE_HANDLE,
263 TH_PAINT_CURVE_PIVOT,
268 TH_FREESTYLE_EDGE_MARK,
269 TH_FREESTYLE_FACE_MARK,
271 TH_MATCH, /* highlight color for search matches */
272 TH_SELECT_HIGHLIGHT, /* highlight color for selected outliner item */
273 TH_SELECT_ACTIVE, /* highlight color for active outliner item */
274 TH_SELECTED_OBJECT, /* selected object color for outliner */
275 TH_ACTIVE_OBJECT, /* active object color for outliner */
276 TH_EDITED_OBJECT, /* edited object color for outliner */
277 TH_ROW_ALTERNATE, /* overlay on every other row */
281 TH_ANIM_ACTIVE, /* active action */
282 TH_ANIM_INACTIVE, /* no active action */
283 TH_ANIM_PREVIEW_RANGE, /* preview range overlay */
296 TH_NLA_TWEAK, /* 'tweaking' track in NLA */
297 TH_NLA_TWEAK_DUPLI, /* error/warning flag for other strips referencing dupli strip */
301 TH_NLA_TRANSITION_SEL,
308 TH_WIDGET_TEXT_CURSOR,
311 TH_TRANSPARENT_CHECKER_PRIMARY,
312 TH_TRANSPARENT_CHECKER_SECONDARY,
313 TH_TRANSPARENT_CHECKER_SIZE,
315 TH_AXIS_X, /* X/Y/Z Axis */
329 TH_INFO_SELECTED_TEXT,
333 TH_INFO_WARNING_TEXT,
339 TH_INFO_PROPERTY_TEXT,
341 TH_INFO_OPERATOR_TEXT,
344 TH_V3D_CLIPPING_BORDER,
353 /* specific defines per space should have higher define values */
358 struct bTheme *theme;
359 int spacetype, regionid;
362 // THE CODERS API FOR THEMES:
364 // returns one value, not scaled
365 float UI_GetThemeValuef(int colorid);
366 int UI_GetThemeValue(int colorid);
368 float UI_GetThemeValueTypef(int colorid, int spacetype);
369 int UI_GetThemeValueType(int colorid, int spacetype);
371 // get three color values, scaled to 0.0-1.0 range
372 void UI_GetThemeColor3fv(int colorid, float col[3]);
373 void UI_GetThemeColorBlend3ubv(int colorid1, int colorid2, float fac, unsigned char col[3]);
374 void UI_GetThemeColorBlend3f(int colorid1, int colorid2, float fac, float r_col[3]);
375 void UI_GetThemeColorBlend4f(int colorid1, int colorid2, float fac, float r_col[4]);
376 // get the color, range 0.0-1.0, complete with shading offset
377 void UI_GetThemeColorShade3fv(int colorid, int offset, float col[3]);
378 void UI_GetThemeColorShade3ubv(int colorid, int offset, unsigned char col[3]);
379 void UI_GetThemeColorShade4ubv(int colorid, int offset, unsigned char col[4]);
381 // get three color values, range 0-255,
382 // complete with shading offset for the RGB components and blending.
383 void UI_GetThemeColorBlendShade3ubv(
384 int colorid1, int colorid2, float fac, int offset, unsigned char col[3]);
386 // get four color values, scaled to 0.0-1.0 range
387 void UI_GetThemeColor4fv(int colorid, float col[4]);
389 /* get four color values from specified space type, scaled to 0.0-1.0 range */
390 void UI_GetThemeColorType4fv(int colorid, int spacetype, float col[4]);
392 // get four color values, range 0.0-1.0, complete with shading offset for the RGB components
393 void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4]);
394 void UI_GetThemeColorShadeAlpha4fv(int colorid, int coloffset, int alphaoffset, float col[4]);
396 // get four color values ranged between 0 and 255; includes the alpha channel
397 void UI_GetThemeColorShadeAlpha4ubv(int colorid,
400 unsigned char col[4]);
402 // get four color values, range 0.0-1.0,
403 // complete with shading offset for the RGB components and blending.
404 void UI_GetThemeColorBlendShade3fv(
405 int colorid1, int colorid2, float fac, int offset, float col[3]);
406 void UI_GetThemeColorBlendShade4fv(
407 int colorid1, int colorid2, float fac, int offset, float col[4]);
409 // get the 3 or 4 byte values
410 void UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
411 void UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
413 // get a theme color from specified space type
414 void UI_GetThemeColorType3fv(int colorid, int spacetype, float col[3]);
415 void UI_GetThemeColorType3ubv(int colorid, int spacetype, unsigned char col[3]);
416 void UI_GetThemeColorType4ubv(int colorid, int spacetype, unsigned char col[4]);
418 // get theme color for coloring monochrome icons
419 bool UI_GetIconThemeColor4ubv(int colorid, unsigned char col[4]);
421 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
422 void UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
424 // get a 3 byte color, blended and shaded between two other char color pointers
425 void UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3],
426 const unsigned char cp2[3],
427 unsigned char col[3],
431 // sets the font color
432 // (for anything fancy use UI_GetThemeColor[Fancy] then BLF_color)
433 void UI_FontThemeColor(int fontid, int colorid);
435 // clear the openGL ClearColor using the input colorid
436 void UI_ThemeClearColor(int colorid);
438 // clear the openGL ClearColor using the input colorid using optional transparency
439 void UI_ThemeClearColorAlpha(int colorid, float alpha);
441 // internal (blender) usage only, for init and set active
442 void UI_SetTheme(int spacetype, int regionid);
445 struct bTheme *UI_GetTheme(void);
447 void UI_Theme_Store(struct bThemeState *theme_state);
448 void UI_Theme_Restore(struct bThemeState *theme_state);
450 // return shadow width outside menus and popups */
451 int UI_ThemeMenuShadowWidth(void);
453 /* only for buttons in theme editor! */
454 const unsigned char *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
456 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
462 #endif /* __UI_RESOURCES_H__ */