2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version. The Blender
|
|
|
|
|
* Foundation also sells licenses for use in proprietary software under
|
|
|
|
|
* the Blender License. See http://www.blender.org/BL/ for information
|
|
|
|
|
* about this.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
2004-06-26 18:18:11 +00:00
|
|
|
*
|
2002-10-12 11:37:38 +00:00
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BIF_RESOURCES_H
|
|
|
|
|
#define BIF_RESOURCES_H
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
#define BIFICONID_FIRST (ICON_VIEW3D)
|
|
|
|
|
ICON_VIEW3D,
|
|
|
|
|
ICON_IPO,
|
|
|
|
|
ICON_OOPS,
|
|
|
|
|
ICON_BUTS,
|
|
|
|
|
ICON_FILESEL,
|
|
|
|
|
ICON_IMAGE_COL,
|
|
|
|
|
ICON_INFO,
|
|
|
|
|
ICON_SEQUENCE,
|
|
|
|
|
ICON_TEXT,
|
|
|
|
|
ICON_IMASEL,
|
|
|
|
|
ICON_SOUND,
|
|
|
|
|
ICON_ACTION,
|
|
|
|
|
ICON_NLA,
|
|
|
|
|
ICON_VIEWZOOM,
|
|
|
|
|
ICON_VIEWMOVE,
|
|
|
|
|
ICON_HOME,
|
|
|
|
|
ICON_CLIPUV_DEHLT,
|
|
|
|
|
ICON_CLIPUV_HLT,
|
|
|
|
|
ICON_SOME_WACKY_VERTS_AND_LINES,
|
|
|
|
|
ICON_A_WACKY_VERT_AND_SOME_LINES,
|
|
|
|
|
ICON_VPAINT_COL,
|
|
|
|
|
|
|
|
|
|
ICON_ORTHO,
|
|
|
|
|
ICON_PERSP,
|
|
|
|
|
ICON_CAMERA,
|
2004-06-26 18:18:11 +00:00
|
|
|
ICON_EFFECTS,
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_BBOX,
|
|
|
|
|
ICON_WIRE,
|
|
|
|
|
ICON_SOLID,
|
|
|
|
|
ICON_SMOOTH,
|
|
|
|
|
ICON_POTATO,
|
|
|
|
|
ICON_BLANK2,
|
|
|
|
|
ICON_NORMALVIEW,
|
|
|
|
|
ICON_LOCALVIEW,
|
|
|
|
|
ICON_UNUSEDVIEW,
|
|
|
|
|
ICON_BLANK3,
|
|
|
|
|
ICON_SORTALPHA,
|
|
|
|
|
ICON_SORTTIME,
|
|
|
|
|
ICON_SORTSIZE,
|
|
|
|
|
ICON_LONGDISPLAY,
|
|
|
|
|
ICON_SHORTDISPLAY,
|
|
|
|
|
ICON_BLANK4,
|
|
|
|
|
ICON_BLANK5,
|
|
|
|
|
|
|
|
|
|
ICON_VIEW_AXIS_ALL,
|
|
|
|
|
ICON_VIEW_AXIS_NONE,
|
|
|
|
|
ICON_VIEW_AXIS_NONE2,
|
|
|
|
|
ICON_VIEW_AXIS_TOP,
|
|
|
|
|
ICON_VIEW_AXIS_FRONT,
|
|
|
|
|
ICON_VIEW_AXIS_SIDE,
|
|
|
|
|
ICON_POSE_DEHLT,
|
|
|
|
|
ICON_POSE_HLT,
|
|
|
|
|
ICON_BORDERMOVE,
|
|
|
|
|
ICON_MAYBE_ITS_A_LASSO,
|
Commit for the 4 aforementioned "features":
- "Global Pivot": Maintains a global Pivot and Align mode setting for
all 3d views when enabled, instead of seperate settings per 3d view
- "Auto Perspective": Switch to ortho mode automatically on 1/3/7, and
to Perspective when the view is rotated with the mouse
- "Align mode": As suggested on the list, when enabled, transformations
on several objects only transform their locations, not their sizes or
rotations.
- Grid dotted when not 1:1
***ATTENTION***! The User Interface parts of these features have not been
committed, as I work on my own modified UI here. The three features need
toggle buttons to turn them on and off.
I used the following 3 buttons (first two features are in userprefs,
third as a 3d view setting):
uiDefButBitS(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Persp",
(xpos+edgespace+(3*medprefbut)+(3*midspace)+smallprefbut+2),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Automatically switch between orthographic and perspective");
uiDefButBitS(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
(xpos+edgespace+(4*midspace)+(4*medprefbut)),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Use global pivot setting for all 3d views");
uiDefIconButS(block, TOG|BIT|10, B_AROUND, ICON_ALIGN,
xco+=XIC,0,XIC,YIC,
&G.vd->flag, 0, 0, 0, 0, "Translate only (align)");
Someone needs to add these to the interface in an appropriate manner!
Thanks.
2004-07-15 13:31:18 +00:00
|
|
|
ICON_BLANK1, /* ATTENTION, someone decided to use this throughout blender
|
|
|
|
|
and didn't care to neither rename it nor update the PNG */
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_ROTATE,
|
|
|
|
|
ICON_CURSOR,
|
|
|
|
|
ICON_ROTATECOLLECTION,
|
|
|
|
|
ICON_ROTATECENTER,
|
Commit for the 4 aforementioned "features":
- "Global Pivot": Maintains a global Pivot and Align mode setting for
all 3d views when enabled, instead of seperate settings per 3d view
- "Auto Perspective": Switch to ortho mode automatically on 1/3/7, and
to Perspective when the view is rotated with the mouse
- "Align mode": As suggested on the list, when enabled, transformations
on several objects only transform their locations, not their sizes or
rotations.
- Grid dotted when not 1:1
***ATTENTION***! The User Interface parts of these features have not been
committed, as I work on my own modified UI here. The three features need
toggle buttons to turn them on and off.
I used the following 3 buttons (first two features are in userprefs,
third as a 3d view setting):
uiDefButBitS(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Persp",
(xpos+edgespace+(3*medprefbut)+(3*midspace)+smallprefbut+2),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Automatically switch between orthographic and perspective");
uiDefButBitS(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
(xpos+edgespace+(4*midspace)+(4*medprefbut)),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Use global pivot setting for all 3d views");
uiDefIconButS(block, TOG|BIT|10, B_AROUND, ICON_ALIGN,
xco+=XIC,0,XIC,YIC,
&G.vd->flag, 0, 0, 0, 0, "Translate only (align)");
Someone needs to add these to the interface in an appropriate manner!
Thanks.
2004-07-15 13:31:18 +00:00
|
|
|
ICON_ALIGN,
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_BLANK8,
|
|
|
|
|
ICON_BLANK9,
|
|
|
|
|
ICON_BLANK10,
|
|
|
|
|
ICON_BLANK11,
|
|
|
|
|
ICON_BLANK12,
|
|
|
|
|
|
2004-06-26 18:18:11 +00:00
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_DOTSUP,
|
|
|
|
|
ICON_DOTSDOWN,
|
2003-10-15 16:28:57 +00:00
|
|
|
ICON_MENU_PANEL,
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_AXIS_SIDE,
|
|
|
|
|
ICON_AXIS_FRONT,
|
|
|
|
|
ICON_AXIS_TOP,
|
2004-04-05 12:42:23 +00:00
|
|
|
ICON_DRAW_UVFACES,
|
|
|
|
|
ICON_STICKY_UVS,
|
|
|
|
|
ICON_STICKY2_UVS,
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_BLANK17,
|
|
|
|
|
ICON_BLANK18,
|
|
|
|
|
ICON_ENVMAP,
|
|
|
|
|
ICON_TRANSP_HLT,
|
|
|
|
|
ICON_TRANSP_DEHLT,
|
|
|
|
|
ICON_RADIO_DEHLT,
|
|
|
|
|
ICON_RADIO_HLT,
|
|
|
|
|
ICON_TPAINT_DEHLT,
|
|
|
|
|
ICON_TPAINT_HLT,
|
|
|
|
|
ICON_WPAINT_DEHLT,
|
|
|
|
|
ICON_WPAINT_HLT,
|
|
|
|
|
ICON_BLANK21,
|
|
|
|
|
|
|
|
|
|
ICON_X,
|
|
|
|
|
ICON_GO_LEFT,
|
|
|
|
|
ICON_NO_GO_LEFT,
|
|
|
|
|
ICON_UNLOCKED,
|
|
|
|
|
ICON_LOCKED,
|
|
|
|
|
ICON_PARLIB,
|
|
|
|
|
ICON_DATALIB,
|
|
|
|
|
ICON_AUTO,
|
|
|
|
|
ICON_MATERIAL_DEHLT2,
|
|
|
|
|
ICON_RING,
|
|
|
|
|
ICON_GRID,
|
|
|
|
|
ICON_PROPEDIT,
|
|
|
|
|
ICON_KEEPRECT,
|
|
|
|
|
ICON_DESEL_CUBE_VERTS,
|
|
|
|
|
ICON_EDITMODE_DEHLT,
|
|
|
|
|
ICON_EDITMODE_HLT,
|
|
|
|
|
ICON_VPAINT_DEHLT,
|
|
|
|
|
ICON_VPAINT_HLT,
|
|
|
|
|
ICON_FACESEL_DEHLT,
|
|
|
|
|
ICON_FACESEL_HLT,
|
|
|
|
|
ICON_BLANK22,
|
|
|
|
|
|
|
|
|
|
ICON_HELP,
|
|
|
|
|
ICON_ERROR,
|
|
|
|
|
ICON_FOLDER_DEHLT,
|
|
|
|
|
ICON_FOLDER_HLT,
|
|
|
|
|
ICON_BLUEIMAGE_DEHLT,
|
|
|
|
|
ICON_BLUEIMAGE_HLT,
|
|
|
|
|
ICON_BPIBFOLDER_DEHLT,
|
|
|
|
|
ICON_BPIBFOLDER_HLT,
|
|
|
|
|
ICON_BPIBFOLDER_ERR,
|
|
|
|
|
ICON_UGLY_GREEN_RING,
|
|
|
|
|
ICON_GHOST,
|
|
|
|
|
ICON_SHARPCURVE,
|
|
|
|
|
ICON_SMOOTHCURVE,
|
|
|
|
|
ICON_BLANK23,
|
|
|
|
|
ICON_BLANK24,
|
|
|
|
|
ICON_BLANK25,
|
|
|
|
|
ICON_BLANK26,
|
|
|
|
|
ICON_BPIBFOLDER_X,
|
|
|
|
|
ICON_BPIBFOLDERGREY,
|
|
|
|
|
ICON_MAGNIFY,
|
|
|
|
|
ICON_INFO2,
|
|
|
|
|
|
|
|
|
|
ICON_RIGHTARROW,
|
|
|
|
|
ICON_DOWNARROW_HLT,
|
|
|
|
|
ICON_ROUNDBEVELTHING,
|
|
|
|
|
ICON_FULLTEXTURE,
|
|
|
|
|
ICON_REDPUBLISHERHALFTHINGY,
|
|
|
|
|
ICON_PUBLISHER,
|
|
|
|
|
ICON_CKEY,
|
|
|
|
|
ICON_CHECKBOX_DEHLT,
|
|
|
|
|
ICON_CHECKBOX_HLT,
|
|
|
|
|
ICON_LINK,
|
|
|
|
|
ICON_INLINK,
|
|
|
|
|
ICON_BEVELBUT_HLT,
|
|
|
|
|
ICON_BEVELBUT_DEHLT,
|
|
|
|
|
ICON_PASTEDOWN,
|
|
|
|
|
ICON_COPYDOWN,
|
|
|
|
|
ICON_CONSTANT,
|
|
|
|
|
ICON_LINEAR,
|
|
|
|
|
ICON_CYCLIC,
|
|
|
|
|
ICON_KEY_DEHLT,
|
|
|
|
|
ICON_KEY_HLT,
|
|
|
|
|
ICON_GRID2,
|
|
|
|
|
|
|
|
|
|
ICON_EYE,
|
|
|
|
|
ICON_LAMP,
|
|
|
|
|
ICON_MATERIAL,
|
|
|
|
|
ICON_TEXTURE,
|
|
|
|
|
ICON_ANIM,
|
|
|
|
|
ICON_WORLD,
|
|
|
|
|
ICON_SCENE,
|
|
|
|
|
ICON_EDIT,
|
|
|
|
|
ICON_GAME,
|
|
|
|
|
ICON_PAINT,
|
|
|
|
|
ICON_RADIO,
|
|
|
|
|
ICON_SCRIPT,
|
|
|
|
|
ICON_SPEAKER,
|
|
|
|
|
ICON_PASTEUP,
|
|
|
|
|
ICON_COPYUP,
|
|
|
|
|
ICON_PASTEFLIPUP,
|
|
|
|
|
ICON_PASTEFLIPDOWN,
|
|
|
|
|
ICON_CYCLICLINEAR,
|
|
|
|
|
ICON_PIN_DEHLT,
|
|
|
|
|
ICON_PIN_HLT,
|
|
|
|
|
ICON_LITTLEGRID,
|
|
|
|
|
|
|
|
|
|
ICON_FULLSCREEN,
|
|
|
|
|
ICON_SPLITSCREEN,
|
|
|
|
|
ICON_RIGHTARROW_THIN,
|
2003-05-09 14:03:34 +00:00
|
|
|
ICON_DISCLOSURE_TRI_RIGHT,
|
|
|
|
|
ICON_DISCLOSURE_TRI_DOWN,
|
2002-10-12 11:37:38 +00:00
|
|
|
ICON_SCENE_SEPIA,
|
|
|
|
|
ICON_SCENE_DEHLT,
|
|
|
|
|
ICON_OBJECT,
|
|
|
|
|
ICON_MESH,
|
|
|
|
|
ICON_CURVE,
|
|
|
|
|
ICON_MBALL,
|
|
|
|
|
ICON_LATTICE,
|
|
|
|
|
ICON_LAMP_DEHLT,
|
|
|
|
|
ICON_MATERIAL_DEHLT,
|
|
|
|
|
ICON_TEXTURE_DEHLT,
|
|
|
|
|
ICON_IPO_DEHLT,
|
|
|
|
|
ICON_LIBRARY_DEHLT,
|
|
|
|
|
ICON_IMAGE_DEHLT,
|
2003-05-09 14:03:34 +00:00
|
|
|
ICON_WINDOW_FULLSCREEN,
|
|
|
|
|
ICON_WINDOW_WINDOW,
|
2003-10-18 07:37:37 +00:00
|
|
|
ICON_PANEL_CLOSE,
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
ICON_BLENDER,
|
|
|
|
|
ICON_PACKAGE,
|
|
|
|
|
ICON_UGLYPACKAGE,
|
|
|
|
|
ICON_MATPLANE,
|
|
|
|
|
ICON_MATSPHERE,
|
|
|
|
|
ICON_MATCUBE,
|
|
|
|
|
ICON_SCENE_HLT,
|
|
|
|
|
ICON_OBJECT_HLT,
|
|
|
|
|
ICON_MESH_HLT,
|
|
|
|
|
ICON_CURVE_HLT,
|
|
|
|
|
ICON_MBALL_HLT,
|
|
|
|
|
ICON_LATTICE_HLT,
|
|
|
|
|
ICON_LAMP_HLT,
|
|
|
|
|
ICON_MATERIAL_HLT,
|
|
|
|
|
ICON_TEXTURE_HLT,
|
|
|
|
|
ICON_IPO_HLT,
|
|
|
|
|
ICON_LIBRARY_HLT,
|
|
|
|
|
ICON_IMAGE_HLT,
|
|
|
|
|
ICON_CONSTRAINT,
|
|
|
|
|
ICON_BLANK32,
|
|
|
|
|
ICON_BLANK33,
|
|
|
|
|
#define BIFICONID_LAST (ICON_BLANK33)
|
|
|
|
|
#define BIFNICONIDS (BIFICONID_LAST-BIFICONID_FIRST + 1)
|
|
|
|
|
} BIFIconID;
|
|
|
|
|
|
2004-03-22 22:02:18 +00:00
|
|
|
typedef enum {
|
|
|
|
|
#define BIFCOLORSHADE_FIRST (COLORSHADE_DARK)
|
|
|
|
|
COLORSHADE_DARK,
|
|
|
|
|
COLORSHADE_GREY,
|
|
|
|
|
COLORSHADE_MEDIUM,
|
|
|
|
|
COLORSHADE_HILITE,
|
|
|
|
|
COLORSHADE_LIGHT,
|
|
|
|
|
COLORSHADE_WHITE,
|
|
|
|
|
#define BIFCOLORSHADE_LAST (COLORSHADE_WHITE)
|
|
|
|
|
#define BIFNCOLORSHADES (BIFCOLORSHADE_LAST-BIFCOLORSHADE_FIRST + 1)
|
|
|
|
|
} BIFColorShade;
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
|
#define BIFCOLORID_FIRST (BUTGREY)
|
|
|
|
|
BUTGREY = 0,
|
|
|
|
|
BUTGREEN,
|
|
|
|
|
BUTBLUE,
|
|
|
|
|
BUTSALMON,
|
|
|
|
|
MIDGREY,
|
|
|
|
|
BUTPURPLE,
|
|
|
|
|
BUTYELLOW,
|
|
|
|
|
REDALERT,
|
|
|
|
|
BUTRUST,
|
|
|
|
|
BUTWHITE,
|
|
|
|
|
BUTDBLUE,
|
|
|
|
|
BUTPINK,
|
|
|
|
|
BUTDPINK,
|
|
|
|
|
BUTMACTIVE,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
2004-03-22 22:02:18 +00:00
|
|
|
BUTIPO,
|
|
|
|
|
BUTAUDIO,
|
|
|
|
|
BUTCAMERA,
|
|
|
|
|
BUTRANDOM,
|
|
|
|
|
BUTEDITOBJECT,
|
|
|
|
|
BUTPROPERTY,
|
|
|
|
|
BUTSCENE,
|
|
|
|
|
BUTMOTION,
|
|
|
|
|
BUTMESSAGE,
|
|
|
|
|
BUTACTION,
|
|
|
|
|
BUTCD,
|
|
|
|
|
BUTGAME,
|
|
|
|
|
BUTVISIBILITY,
|
|
|
|
|
BUTYUCK,
|
|
|
|
|
BUTSEASICK,
|
|
|
|
|
BUTCHOKE,
|
|
|
|
|
BUTIMPERIAL,
|
|
|
|
|
|
|
|
|
|
BUTTEXTCOLOR,
|
|
|
|
|
BUTTEXTPRESSED,
|
|
|
|
|
BUTSBACKGROUND,
|
|
|
|
|
|
|
|
|
|
VIEWPORTBACKCOLOR,
|
|
|
|
|
VIEWPORTGRIDCOLOR,
|
|
|
|
|
VIEWPORTACTIVECOLOR,
|
|
|
|
|
VIEWPORTSELECTEDCOLOR,
|
|
|
|
|
VIEWPORTUNSELCOLOR,
|
|
|
|
|
|
|
|
|
|
EDITVERTSEL,
|
|
|
|
|
EDITVERTUNSEL,
|
|
|
|
|
EDITEDGESEL,
|
|
|
|
|
EDITEDGEUNSEL,
|
|
|
|
|
|
|
|
|
|
#define BIFCOLORID_LAST (EDITEDGEUNSEL)
|
|
|
|
|
#define BIFNCOLORIDS (BIFCOLORID_LAST-BIFCOLORID_FIRST + 1)
|
|
|
|
|
|
|
|
|
|
} BIFColorID;
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
enum {
|
|
|
|
|
TH_AUTO, /* for buttons, to signal automatic color assignment */
|
|
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
// uibutton colors
|
2004-01-10 13:41:03 +00:00
|
|
|
TH_BUT_OUTLINE,
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
TH_BUT_NEUTRAL,
|
|
|
|
|
TH_BUT_ACTION,
|
|
|
|
|
TH_BUT_SETTING,
|
|
|
|
|
TH_BUT_SETTING1,
|
|
|
|
|
TH_BUT_SETTING2,
|
|
|
|
|
TH_BUT_NUM,
|
|
|
|
|
TH_BUT_TEXTFIELD,
|
|
|
|
|
TH_BUT_POPUP,
|
|
|
|
|
TH_BUT_TEXT,
|
|
|
|
|
TH_BUT_TEXT_HI,
|
|
|
|
|
TH_MENU_BACK,
|
|
|
|
|
TH_MENU_ITEM,
|
|
|
|
|
TH_MENU_HILITE,
|
|
|
|
|
TH_MENU_TEXT,
|
|
|
|
|
TH_MENU_TEXT_HI,
|
|
|
|
|
|
|
|
|
|
TH_BUT_DRAWTYPE,
|
|
|
|
|
|
|
|
|
|
TH_REDALERT,
|
2003-11-22 18:38:53 +00:00
|
|
|
TH_CUSTOM,
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
|
|
|
|
TH_THEMEUI,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
// common colors among spaces
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
|
|
|
|
TH_BACK,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
TH_TEXT,
|
|
|
|
|
TH_TEXT_HI,
|
|
|
|
|
TH_HEADER,
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
TH_HEADERDESEL,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
TH_PANEL,
|
|
|
|
|
TH_SHADE1,
|
|
|
|
|
TH_SHADE2,
|
|
|
|
|
TH_HILITE,
|
|
|
|
|
|
|
|
|
|
TH_GRID,
|
|
|
|
|
TH_WIRE,
|
|
|
|
|
TH_SELECT,
|
|
|
|
|
TH_ACTIVE,
|
|
|
|
|
TH_TRANSFORM,
|
|
|
|
|
TH_VERTEX,
|
|
|
|
|
TH_VERTEX_SELECT,
|
|
|
|
|
TH_VERTEX_SIZE,
|
|
|
|
|
TH_EDGE,
|
|
|
|
|
TH_EDGE_SELECT,
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
TH_EDGE_SEAM,
|
|
|
|
|
TH_EDGE_FACESEL,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
TH_FACE,
|
|
|
|
|
TH_FACE_SELECT
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/* specific defines per space should have higher define values */
|
|
|
|
|
|
|
|
|
|
struct bTheme;
|
|
|
|
|
|
2003-10-19 09:19:58 +00:00
|
|
|
// THE CODERS API FOR THEMES:
|
|
|
|
|
|
|
|
|
|
// sets the color
|
|
|
|
|
void BIF_ThemeColor(int colorid);
|
|
|
|
|
|
|
|
|
|
// sets the color plus alpha
|
|
|
|
|
void BIF_ThemeColor4(int colorid);
|
|
|
|
|
|
|
|
|
|
// sets color plus offset for shade
|
|
|
|
|
void BIF_ThemeColorShade(int colorid, int offset);
|
|
|
|
|
|
2003-10-21 07:02:38 +00:00
|
|
|
// sets color plus offset for alpha
|
|
|
|
|
void BIF_ThemeColorShadeAlpha(int colorid, int coloffset, int alphaoffset);
|
|
|
|
|
|
2003-10-19 09:19:58 +00:00
|
|
|
// sets color, which is blend between two theme colors
|
|
|
|
|
void BIF_ThemeColorBlend(int colorid1, int colorid2, float fac);
|
2003-11-17 14:31:25 +00:00
|
|
|
// same, with shade offset
|
|
|
|
|
void BIF_ThemeColorBlendShade(int colorid1, int colorid2, float fac, int offset);
|
2003-10-19 09:19:58 +00:00
|
|
|
|
|
|
|
|
// returns one value, not scaled
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
float BIF_GetThemeValuef(int colorid);
|
|
|
|
|
int BIF_GetThemeValue(int colorid);
|
2003-10-19 09:19:58 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
// get three color values, scaled to 0.0-1.0 range
|
2003-10-19 09:19:58 +00:00
|
|
|
void BIF_GetThemeColor3fv(int colorid, float *col);
|
|
|
|
|
|
|
|
|
|
// get the 3 or 4 byte values
|
|
|
|
|
void BIF_GetThemeColor3ubv(int colorid, char *col);
|
|
|
|
|
void BIF_GetThemeColor4ubv(int colorid, char *col);
|
|
|
|
|
|
First commit of a new toolbox system.
Aim was to find a simple & easy system, script alike, to add and configure
a toolbox system, so that others can experiment, but also of course Python.
Summary:
- spacebar calls it up. SHIFT+A still does old toolbox
- hold left or rightmouse for 0.4 second, and it pops up as well
this is experimental! Can be tweaked with Userdef var "ThresA"
- it is a little bit complete for Object mode only. Needs still work
at information desing/structure level
- the code works like an engine, interpreting structs like this:
static TBitem addmenu_curve[]= {
{ 0, "Bezier Curve", 0, NULL},
{ 0, "Bezier Circle", 1, NULL},
{ 0, "NURBS Curve", 2, NULL},
{ 0, "NURBS Circle", 3, NULL},
{ 0, "Path", 4, NULL},
{ -1, "", 0, do_info_add_curvemenu}};
- first value is ICON code,
- then name
- return value
- pointer to optional child
last row has -1 to indicate its the last...
plus a callback to event function.
I also built an old toolbox style callback for this:
static TBitem tb_object_select[]= {
{ 0, "Border Select|B", 'b', NULL},
{ 0, "(De)select All|A", 'a', NULL},
{ 0, "Linked...|Shift L", 'L', NULL},
{ 0, "Grouped...|Shift G", 'G', NULL},
{ -1, "", 0, tb_do_hotkey}};
here the return values are put back as hotkeys in mainqueue.
A mainloop can do all context switching, and build menus on the fly.
Meaning, it also allows other designs such as radials...
2003-10-25 00:08:12 +00:00
|
|
|
struct ScrArea;
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
2003-10-19 09:19:58 +00:00
|
|
|
// internal (blender) usage only, for init and set active
|
|
|
|
|
void BIF_InitTheme(void);
|
|
|
|
|
void BIF_SetTheme(struct ScrArea *sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
void BIF_resources_init (void);
|
|
|
|
|
void BIF_resources_free (void);
|
2004-03-22 22:02:18 +00:00
|
|
|
void BIF_colors_init (void);
|
|
|
|
|
void BIF_load_ui_colors (void);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
2003-10-19 09:19:58 +00:00
|
|
|
// icon API
|
2002-10-12 11:37:38 +00:00
|
|
|
int BIF_get_icon_width (BIFIconID icon);
|
|
|
|
|
int BIF_get_icon_height (BIFIconID icon);
|
|
|
|
|
void BIF_draw_icon (BIFIconID icon);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
void BIF_draw_icon_blended (BIFIconID icon, int colorid, int shade);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
/* only for buttons in theme editor! */
|
|
|
|
|
char *BIF_ThemeGetColorPtr(struct bTheme *btheme, int spacetype, int colorid);
|
|
|
|
|
char *BIF_ThemeColorsPup(int spacetype);
|
|
|
|
|
|
|
|
|
|
|
2004-03-22 22:02:18 +00:00
|
|
|
void BIF_def_color (BIFColorID colorid, unsigned char r, unsigned char g, unsigned char b);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif /* BIF_ICONS_H */
|