Blender V2.61 - r43446

UI_resources.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License
00007  * as published by the Free Software Foundation; either version 2
00008  * of the License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software Foundation,
00017  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  *
00019  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
00020  * All rights reserved.
00021  *
00022  * The Original Code is: all of this file.
00023  *
00024  * Contributor(s): none yet.
00025  * 
00026  * ***** END GPL/BL DUAL LICENSE BLOCK *****
00027  */
00028 
00033 #ifndef UI_RESOURCES_H
00034 #define UI_RESOURCES_H
00035 
00036 /* elubie: TODO: move the typedef for icons to UI_interface_icons.h */
00037 /* and add/replace include of UI_resources.h by UI_interface_icons.h */
00038 #define DEF_ICON(name) ICON_##name,
00039 #define DEF_VICO(name) VICO_##name,
00040 
00041 typedef enum {
00042     /* ui */
00043 #include "UI_icons.h"
00044     BIFICONID_LAST
00045 } BIFIconID;
00046 
00047 #define BIFICONID_FIRST     (ICON_NONE)
00048 #define BIFNICONIDS         (BIFICONID_LAST-BIFICONID_FIRST + 1)
00049 
00050 #undef DEF_ICON
00051 #undef DEF_VICO
00052 
00053 
00054 typedef enum {
00055 #define BIFCOLORSHADE_FIRST     (COLORSHADE_DARK)
00056         COLORSHADE_DARK,
00057         COLORSHADE_GREY,
00058         COLORSHADE_MEDIUM,
00059         COLORSHADE_HILITE,
00060         COLORSHADE_LIGHT,
00061         COLORSHADE_WHITE
00062 #define BIFCOLORSHADE_LAST      (COLORSHADE_WHITE)
00063 #define BIFNCOLORSHADES         (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
00064 } BIFColorShade;
00065 
00066 typedef enum {
00067 #define BIFCOLORID_FIRST    (BUTGREY)
00068     BUTGREY = 0,
00069     BUTGREEN,
00070     BUTBLUE,
00071     BUTSALMON,
00072     MIDGREY,
00073     BUTPURPLE,
00074     BUTYELLOW,
00075     REDALERT,
00076     BUTRUST,
00077     BUTWHITE,
00078     BUTDBLUE,
00079     BUTPINK,
00080     BUTDPINK,
00081     BUTMACTIVE,
00082 
00083     BUTIPO,
00084     BUTAUDIO,
00085     BUTCAMERA,
00086     BUTRANDOM,
00087     BUTEDITOBJECT,
00088     BUTPROPERTY,
00089     BUTSCENE,
00090     BUTMOTION,
00091     BUTMESSAGE,
00092     BUTACTION,
00093     BUTCD,
00094     BUTGAME,
00095     BUTVISIBILITY,
00096     BUTYUCK,
00097     BUTSEASICK,
00098     BUTCHOKE,
00099     BUTIMPERIAL,
00100 
00101     BUTTEXTCOLOR,
00102     BUTTEXTPRESSED,
00103     BUTSBACKGROUND,
00104     
00105     VIEWPORTBACKCOLOR,
00106     VIEWPORTGRIDCOLOR,
00107     VIEWPORTACTIVECOLOR,
00108     VIEWPORTSELECTEDCOLOR,
00109     VIEWPORTUNSELCOLOR,
00110     
00111     EDITVERTSEL, 
00112     EDITVERTUNSEL, 
00113     EDITEDGESEL, 
00114     EDITEDGEUNSEL
00115     
00116 #define BIFCOLORID_LAST     (EDITEDGEUNSEL)
00117 #define BIFNCOLORIDS        (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
00118 
00119 } BIFColorID;
00120 
00121 enum {
00122     TH_REDALERT,
00123 
00124     TH_THEMEUI,
00125 // common colors among spaces
00126     
00127     TH_BACK,
00128     TH_TEXT,
00129     TH_TEXT_HI,
00130     TH_TITLE,
00131     
00132     TH_HEADER,
00133     TH_HEADERDESEL,
00134     TH_HEADER_TEXT,
00135     TH_HEADER_TEXT_HI,
00136     
00137     /* float panels */
00138     TH_PANEL,
00139     TH_PANEL_TEXT,
00140     TH_PANEL_TEXT_HI,
00141     
00142     TH_BUTBACK,
00143     TH_BUTBACK_TEXT,
00144     TH_BUTBACK_TEXT_HI,
00145     
00146     TH_SHADE1,
00147     TH_SHADE2,
00148     TH_HILITE,
00149 
00150     TH_GRID,
00151     TH_WIRE,
00152     TH_SELECT,
00153     TH_ACTIVE,
00154     TH_GROUP,
00155     TH_GROUP_ACTIVE,
00156     TH_TRANSFORM,
00157     TH_VERTEX,
00158     TH_VERTEX_SELECT,
00159     TH_VERTEX_SIZE,
00160     TH_OUTLINE_WIDTH,
00161     TH_EDGE,
00162     TH_EDGE_SELECT,
00163     TH_EDGE_SEAM,
00164     TH_EDGE_FACESEL,
00165     TH_FACE,
00166     TH_FACE_SELECT,
00167     TH_NORMAL,
00168     TH_VNORMAL,
00169     TH_FACE_DOT,
00170     TH_FACEDOT_SIZE,
00171     TH_CFRAME,
00172     TH_NURB_ULINE,
00173     TH_NURB_VLINE,
00174     TH_NURB_SEL_ULINE,
00175     TH_NURB_SEL_VLINE,
00176 
00177     /* this eight colors should be in one block */
00178     TH_HANDLE_FREE,
00179     TH_HANDLE_AUTO,
00180     TH_HANDLE_VECT,
00181     TH_HANDLE_ALIGN,
00182     TH_HANDLE_AUTOCLAMP,
00183     TH_HANDLE_SEL_FREE,
00184     TH_HANDLE_SEL_AUTO,
00185     TH_HANDLE_SEL_VECT,
00186     TH_HANDLE_SEL_ALIGN,
00187     TH_HANDLE_SEL_AUTOCLAMP,
00188 
00189     TH_ACTIVE_SPLINE,
00190     TH_LASTSEL_POINT,
00191 
00192     TH_SYNTAX_B,
00193     TH_SYNTAX_V,
00194     TH_SYNTAX_C,
00195     TH_SYNTAX_L,
00196     TH_SYNTAX_N,
00197     
00198     TH_BONE_SOLID,
00199     TH_BONE_POSE,
00200     
00201     TH_STRIP,
00202     TH_STRIP_SELECT,
00203     
00204     TH_LAMP,
00205 
00206     TH_SPEAKER,
00207     
00208     TH_NODE,
00209     TH_NODE_IN_OUT,
00210     TH_NODE_OPERATOR,
00211     TH_NODE_CONVERTOR,
00212     TH_NODE_GROUP,
00213     
00214     TH_CONSOLE_OUTPUT,
00215     TH_CONSOLE_INPUT,
00216     TH_CONSOLE_INFO,
00217     TH_CONSOLE_ERROR,
00218     TH_CONSOLE_CURSOR,
00219     
00220     TH_SEQ_MOVIE,
00221     TH_SEQ_IMAGE,
00222     TH_SEQ_SCENE,
00223     TH_SEQ_AUDIO,
00224     TH_SEQ_EFFECT,
00225     TH_SEQ_PLUGIN,
00226     TH_SEQ_TRANSITION,
00227     TH_SEQ_META,
00228     
00229     TH_EDGE_SHARP,
00230     TH_EDITMESH_ACTIVE,
00231     
00232     TH_HANDLE_VERTEX,
00233     TH_HANDLE_VERTEX_SELECT,
00234     TH_HANDLE_VERTEX_SIZE,
00235     
00236     TH_DOPESHEET_CHANNELOB,
00237     TH_DOPESHEET_CHANNELSUBOB,
00238     
00239     TH_PREVIEW_BACK,
00240     
00241     TH_EDGE_CREASE,
00242 
00243     TH_DRAWEXTRA_EDGELEN,
00244     TH_DRAWEXTRA_FACEAREA,
00245     TH_DRAWEXTRA_FACEANG,
00246 
00247     TH_NODE_CURVING,
00248 
00249     TH_MARKER_OUTLINE,
00250     TH_MARKER,
00251     TH_ACT_MARKER,
00252     TH_SEL_MARKER,
00253     TH_BUNDLE_SOLID,
00254     TH_DIS_MARKER,
00255     TH_PATH_BEFORE,
00256     TH_PATH_AFTER,
00257     TH_CAMERA_PATH,
00258     TH_LOCK_MARKER
00259 };
00260 /* XXX WARNING: previous is saved in file, so do not change order! */
00261 
00262 /* specific defines per space should have higher define values */
00263 
00264 struct bTheme;
00265 struct PointerRNA;
00266 
00267 // THE CODERS API FOR THEMES:
00268 
00269 // sets the color
00270 void    UI_ThemeColor(int colorid);
00271 
00272 // sets the color plus alpha
00273 void    UI_ThemeColor4(int colorid);
00274 
00275 // sets color plus offset for shade
00276 void    UI_ThemeColorShade(int colorid, int offset);
00277 
00278 // sets color plus offset for alpha
00279 void    UI_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
00280 
00281 // sets color, which is blend between two theme colors
00282 void    UI_ThemeColorBlend(int colorid1, int colorid2, float fac);
00283 // same, with shade offset
00284 void    UI_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
00285 void    UI_ThemeColorBlendShadeAlpha(int colorid1, int colorid2, float fac, int offset, int alphaoffset);
00286 
00287 // returns one value, not scaled
00288 float   UI_GetThemeValuef(int colorid);
00289 int     UI_GetThemeValue(int colorid);
00290 
00291 // get three color values, scaled to 0.0-1.0 range
00292 void    UI_GetThemeColor3fv(int colorid, float *col);
00293 // get the color, range 0.0-1.0, complete with shading offset
00294 void    UI_GetThemeColorShade3fv(int colorid, int offset, float *col);
00295 
00296 // get the 3 or 4 byte values
00297 void    UI_GetThemeColor3ubv(int colorid, unsigned char col[3]);
00298 void    UI_GetThemeColor4ubv(int colorid, unsigned char col[4]);
00299 
00300 // get a theme color from specified space type
00301 void    UI_GetThemeColorType4ubv(int colorid, int spacetype, char col[4]);
00302 
00303 // blends and shades between two color pointers
00304 void    UI_ColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], float fac, int offset);
00305 
00306 // shade a 3 byte color (same as UI_GetColorPtrBlendShade3ubv with 0.0 factor)
00307 void    UI_GetColorPtrShade3ubv(const unsigned char cp1[3], unsigned char col[3], int offset);
00308 
00309 // get a 3 byte color, blended and shaded between two other char color pointers
00310 void    UI_GetColorPtrBlendShade3ubv(const unsigned char cp1[3], const unsigned char cp2[3], unsigned char col[3], float fac, int offset);
00311 
00312 // clear the openGL ClearColor using the input colorid
00313 void    UI_ThemeClearColor(int colorid);
00314 
00315 // internal (blender) usage only, for init and set active
00316 void    UI_SetTheme(int spacetype, int regionid);
00317 
00318 // get current theme
00319 struct bTheme *UI_GetTheme(void);
00320 
00321 /* only for buttons in theme editor! */
00322 const unsigned char     *UI_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
00323 
00324 void UI_make_axis_color(const unsigned char *src_col, unsigned char *dst_col, const char axis);
00325 
00326 #endif /*  UI_ICONS_H */