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.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef BIF_INTERFACE_H
|
|
|
|
|
#define BIF_INTERFACE_H
|
|
|
|
|
|
|
|
|
|
struct ID;
|
|
|
|
|
struct ListBase;
|
|
|
|
|
struct ScrArea;
|
|
|
|
|
|
2003-10-15 19:23:54 +00:00
|
|
|
/* uiBlock->dt */
|
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
|
|
|
#define UI_EMBOSS 0 /* use one of the themes for drawing */
|
|
|
|
|
#define UI_EMBOSSN 1 /* Nothing */
|
|
|
|
|
#define UI_EMBOSSM 2 /* Minimal builtin emboss, also for logic buttons */
|
|
|
|
|
#define UI_EMBOSSP 3 /* Pulldown */
|
2003-10-16 12:03:03 +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
|
|
|
#define UI_EMBOSSX 0 /* for a python file, which i can't change.... duh! */
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
/* uiBlock->direction */
|
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
|
|
|
#define UI_TOP 1
|
|
|
|
|
#define UI_DOWN 2
|
|
|
|
|
#define UI_LEFT 4
|
|
|
|
|
#define UI_RIGHT 8
|
|
|
|
|
#define UI_DIRECTION 15
|
|
|
|
|
#define UI_CENTRE 16
|
|
|
|
|
#define UI_SHIFT_FLIPPED 32
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
/* uiBlock->autofill */
|
|
|
|
|
#define UI_BLOCK_COLLUMNS 1
|
|
|
|
|
#define UI_BLOCK_ROWS 2
|
|
|
|
|
|
|
|
|
|
/* return from uiDoBlock */
|
|
|
|
|
#define UI_CONT 0
|
|
|
|
|
#define UI_NOTHING 1
|
|
|
|
|
#define UI_RETURN_CANCEL 2
|
|
|
|
|
#define UI_RETURN_OK 4
|
|
|
|
|
#define UI_RETURN_OUT 8
|
|
|
|
|
#define UI_RETURN 14
|
|
|
|
|
#define UI_EXIT_LOOP 16
|
|
|
|
|
|
|
|
|
|
/* uiBlock->flag (controls) */
|
|
|
|
|
#define UI_BLOCK_LOOP 1
|
|
|
|
|
#define UI_BLOCK_REDRAW 2
|
|
|
|
|
#define UI_BLOCK_RET_1 4
|
|
|
|
|
#define UI_BLOCK_BUSY 8
|
|
|
|
|
#define UI_BLOCK_NUMSELECT 16
|
|
|
|
|
#define UI_BLOCK_ENTER_OK 32
|
2004-07-05 08:48:17 +00:00
|
|
|
#define UI_BLOCK_NOSHADOW 64
|
|
|
|
|
|
2003-11-14 00:44:48 +00:00
|
|
|
/* block->flag bits 12-15 are identical to but->flag bits */
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
/* block->font, for now: bold = medium+1 */
|
|
|
|
|
#define UI_HELV 0
|
|
|
|
|
#define UI_HELVB 1
|
|
|
|
|
|
2003-10-16 00:17:24 +00:00
|
|
|
/* panel controls */
|
|
|
|
|
#define UI_PNL_TRANSP 1
|
|
|
|
|
#define UI_PNL_SOLID 2
|
|
|
|
|
|
|
|
|
|
#define UI_PNL_CLOSE 32
|
|
|
|
|
#define UI_PNL_STOW 64
|
|
|
|
|
#define UI_PNL_TO_MOUSE 128
|
- 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
|
|
|
#define UI_PNL_UNSTOW 256
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
/* warning the first 4 flags are internal */
|
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
|
|
|
/* but->flag */
|
2003-10-15 19:23:54 +00:00
|
|
|
#define UI_TEXT_LEFT 16
|
|
|
|
|
#define UI_ICON_LEFT 32
|
|
|
|
|
#define UI_ICON_RIGHT 64
|
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
|
|
|
/* control for button type block */
|
|
|
|
|
#define UI_MAKE_TOP 128
|
|
|
|
|
#define UI_MAKE_DOWN 256
|
|
|
|
|
#define UI_MAKE_LEFT 512
|
|
|
|
|
#define UI_MAKE_RIGHT 1024
|
2003-10-28 14:20:03 +00:00
|
|
|
/* dont draw hilite on mouse over */
|
|
|
|
|
#define UI_NO_HILITE 2048
|
2003-11-14 00:44:48 +00:00
|
|
|
/* button align flag, for drawing groups together */
|
|
|
|
|
#define UI_BUT_ALIGN (15<<12)
|
|
|
|
|
#define UI_BUT_ALIGN_TOP (1<<12)
|
|
|
|
|
#define UI_BUT_ALIGN_LEFT (1<<13)
|
|
|
|
|
#define UI_BUT_ALIGN_RIGHT (1<<14)
|
|
|
|
|
#define UI_BUT_ALIGN_DOWN (1<<15)
|
|
|
|
|
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
/* Button types */
|
|
|
|
|
#define CHA 32
|
|
|
|
|
#define SHO 64
|
|
|
|
|
#define INT 96
|
|
|
|
|
#define FLO 128
|
|
|
|
|
#define FUN 192
|
|
|
|
|
#define BIT 256
|
|
|
|
|
|
|
|
|
|
#define BUTPOIN (128+64+32)
|
|
|
|
|
|
|
|
|
|
#define BUT (1<<9)
|
|
|
|
|
#define ROW (2<<9)
|
|
|
|
|
#define TOG (3<<9)
|
|
|
|
|
#define SLI (4<<9)
|
|
|
|
|
#define NUM (5<<9)
|
|
|
|
|
#define TEX (6<<9)
|
|
|
|
|
#define TOG3 (7<<9)
|
|
|
|
|
#define TOGR (8<<9)
|
|
|
|
|
#define TOGN (9<<9)
|
|
|
|
|
#define LABEL (10<<9)
|
|
|
|
|
#define MENU (11<<9)
|
|
|
|
|
#define ICONROW (12<<9)
|
|
|
|
|
#define ICONTOG (13<<9)
|
|
|
|
|
#define NUMSLI (14<<9)
|
|
|
|
|
#define COL (15<<9)
|
|
|
|
|
#define IDPOIN (16<<9)
|
|
|
|
|
#define HSVSLI (17<<9)
|
|
|
|
|
#define SCROLL (18<<9)
|
|
|
|
|
#define BLOCK (19<<9)
|
|
|
|
|
#define BUTM (20<<9)
|
|
|
|
|
#define SEPR (21<<9)
|
|
|
|
|
#define LINK (22<<9)
|
|
|
|
|
#define INLINK (23<<9)
|
|
|
|
|
#define KEYEVT (24<<9)
|
|
|
|
|
#define ICONTEXTROW (25<<9)
|
2004-07-05 08:48:17 +00:00
|
|
|
#define HSVCUBE (26<<9)
|
2003-10-15 19:23:54 +00:00
|
|
|
|
|
|
|
|
#define BUTTYPE (31<<9)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
typedef struct uiBut uiBut;
|
|
|
|
|
typedef struct uiBlock uiBlock;
|
|
|
|
|
|
|
|
|
|
void uiEmboss(float x1, float y1, float x2, float y2, int sel);
|
2003-10-04 20:35:50 +00:00
|
|
|
void uiRoundBoxEmboss(float minx, float miny, float maxx, float maxy, float rad);
|
|
|
|
|
void uiRoundBox(float minx, float miny, float maxx, float maxy, float rad);
|
|
|
|
|
void uiSetRoundBox(int type);
|
|
|
|
|
void uiRoundRect(float minx, float miny, float maxx, float maxy, float rad);
|
|
|
|
|
|
2004-07-05 08:48:17 +00:00
|
|
|
void uiDrawMenuBox(float minx, float miny, float maxx, float maxy, short flag);
|
2003-05-07 03:00:11 +00:00
|
|
|
void uiTextBoundsBlock(uiBlock *block, int addval);
|
2002-10-12 11:37:38 +00:00
|
|
|
void uiBoundsBlock(struct uiBlock *block, int addval);
|
|
|
|
|
void uiDrawBlock(struct uiBlock *block);
|
|
|
|
|
void uiGetMouse(int win, short *adr);
|
|
|
|
|
void uiComposeLinks(uiBlock *block);
|
|
|
|
|
void uiSetButLock(int val, char *lockstr);
|
|
|
|
|
void uiClearButLock(void);
|
|
|
|
|
int uiDoBlocks(struct ListBase *lb, int event);
|
|
|
|
|
void uiSetCurFont(uiBlock *block, int index);
|
|
|
|
|
void uiDefFont(unsigned int index, void *xl, void *large, void *medium, void *small);
|
|
|
|
|
void uiFreeBlock(uiBlock *block);
|
|
|
|
|
void uiFreeBlocks(struct ListBase *lb);
|
|
|
|
|
void uiFreeBlocksWin(struct ListBase *lb, int win);
|
|
|
|
|
uiBlock *uiNewBlock(struct ListBase *lb, char *name, short dt, short font, short win);
|
|
|
|
|
uiBlock *uiGetBlock(char *name, struct ScrArea *sa);
|
2003-11-14 00:44:48 +00:00
|
|
|
|
2004-07-10 21:35:17 +00:00
|
|
|
void uiBlockPickerButtons(struct uiBlock *block, float *col, float *hsv, float *old, char mode);
|
|
|
|
|
|
|
|
|
|
|
2003-11-14 15:49:26 +00:00
|
|
|
/* automatic aligning, horiz or verical */
|
|
|
|
|
void uiBlockBeginAlign(uiBlock *block);
|
2003-11-14 00:44:48 +00:00
|
|
|
void uiBlockEndAlign(uiBlock *block);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefBut(uiBlock *block,
|
|
|
|
|
int type, int retval, char *str,
|
|
|
|
|
short x1, short y1,
|
|
|
|
|
short x2, short y2,
|
|
|
|
|
void *poin,
|
|
|
|
|
float min, float max,
|
|
|
|
|
float a1, float a2, char *tip);
|
|
|
|
|
uiBut *uiDefButF(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefButBitF(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefButI(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefButBitI(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefButS(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefButBitS(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefButC(uiBlock *block, int type, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefButBitC(uiBlock *block, int type, int bit, int retval, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiBut *uiDefIconBut(uiBlock *block,
|
|
|
|
|
int type, int retval, int icon,
|
|
|
|
|
short x1, short y1,
|
|
|
|
|
short x2, short y2,
|
|
|
|
|
void *poin,
|
|
|
|
|
float min, float max,
|
|
|
|
|
float a1, float a2, char *tip);
|
|
|
|
|
uiBut *uiDefIconButF(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconButBitF(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefIconButI(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefIconButS(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconButBitS(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
uiBut *uiDefIconButC(uiBlock *block, int type, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconButBitC(uiBlock *block, int type, int bit, int retval, int icon, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-05-09 11:24:55 +00:00
|
|
|
uiBut *uiDefIconTextBut(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, void *poin, float min, float max, float a1, float a2, char *tip);
|
|
|
|
|
|
|
|
|
|
uiBut *uiDefIconTextButF(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconTextButBitF(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, float *poin, float min, float max, float a1, float a2, char *tip);
|
2003-05-09 11:24:55 +00:00
|
|
|
uiBut *uiDefIconTextButI(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconTextButBitI(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, int *poin, float min, float max, float a1, float a2, char *tip);
|
2003-05-09 11:24:55 +00:00
|
|
|
uiBut *uiDefIconTextButS(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconTextButBitS(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, short *poin, float min, float max, float a1, float a2, char *tip);
|
2003-05-09 11:24:55 +00:00
|
|
|
uiBut *uiDefIconTextButC(uiBlock *block, int type, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
- committed new uiDef{Icon,IconText,}ButBit? functions
- change object draw flag buttons to use new functions (just an example)
While I probably wouldn't recommend patching other buttons to use the new
functions a week before release, it is a good (simple but tedious) project
to complete. Note that some code actually defined the constants for the
bit index, when such code is fixed the _BIT constant should be removed from
the headers.
Example:
DNA_constraint_types.h:
#define CONSTRAINT_DISABLE 0x00000004
#define CONSTRAINT_DISABLE_BIT 2
buttons_object.c:
uiDefIconButS(block, ICONTOG|BIT|CONSTRAINT_EXPAND_BIT, ...);
The button definition should change to:
uiDefIconButBitS(block, ICONTOG, CONSTRAINT_EXPAND, ...);
(whats that, the more correct way uses less typing, GOOD GOD!)
and the CONSTRAINT_DISABLE_BIT define should be removed.
2004-01-08 19:53:19 +00:00
|
|
|
uiBut *uiDefIconTextButBitC(uiBlock *block, int type, int bit, int retval, int icon, char *str, short x1, short y1, short x2, short y2, char *poin, float min, float max, float a1, float a2, char *tip);
|
2003-05-09 11:24:55 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
typedef void (*uiIDPoinFuncFP) (char *str, struct ID **idpp);
|
|
|
|
|
void uiDefIDPoinBut(struct uiBlock *block,
|
|
|
|
|
uiIDPoinFuncFP func, int retval, char *str,
|
|
|
|
|
short x1, short y1,
|
|
|
|
|
short x2, short y2,
|
|
|
|
|
void *idpp, char *tip);
|
|
|
|
|
|
|
|
|
|
typedef uiBlock* (*uiBlockFuncFP) (void *arg1);
|
2003-10-07 12:49:39 +00:00
|
|
|
uiBut *uiDefBlockBut(uiBlock *block, uiBlockFuncFP func, void *func_arg1, char *str, short x1, short y1, short x2, short y2, char *tip);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-07 12:49:39 +00:00
|
|
|
uiBut *uiDefIconTextBlockBut(uiBlock *block, uiBlockFuncFP func, void *arg, int icon, char *str, short x1, short y1, short x2, short y2, char *tip);
|
2003-05-09 11:24:55 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void uiDefKeyevtButS(uiBlock *block, int retval, char *str, short x1, short y1, short x2, short y2, short *spoin, char *tip);
|
|
|
|
|
|
|
|
|
|
void uiAutoBlock(struct uiBlock *block,
|
|
|
|
|
float minx, float miny,
|
|
|
|
|
float sizex, float sizey, int flag);
|
|
|
|
|
void uiSetButLink(struct uiBut *but,
|
|
|
|
|
void **poin,
|
|
|
|
|
void ***ppoin,
|
|
|
|
|
short *tot,
|
|
|
|
|
int from, int to);
|
|
|
|
|
|
|
|
|
|
int uiBlocksGetYMin (ListBase *lb);
|
|
|
|
|
int uiBlockGetCol (uiBlock *block);
|
|
|
|
|
void* uiBlockGetCurFont (uiBlock *block);
|
|
|
|
|
|
|
|
|
|
void uiBlockSetCol (uiBlock *block, int col);
|
|
|
|
|
void uiBlockSetEmboss (uiBlock *block, int emboss);
|
|
|
|
|
void uiBlockSetDirection (uiBlock *block, int direction);
|
2003-10-07 12:49:39 +00:00
|
|
|
void uiBlockFlipOrder (uiBlock *block);
|
2002-10-12 11:37:38 +00:00
|
|
|
void uiBlockSetFlag (uiBlock *block, int flag);
|
|
|
|
|
void uiBlockSetXOfs (uiBlock *block, int xofs);
|
|
|
|
|
|
|
|
|
|
int uiButGetRetVal (uiBut *but);
|
|
|
|
|
|
|
|
|
|
void uiButSetFlag (uiBut *but, int flag);
|
2003-10-07 12:49:39 +00:00
|
|
|
void uiButClearFlag (uiBut *but, int flag);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
void uiBlockSetButmFunc (uiBlock *block, void (*butmfunc)(void *arg, int but_a2), void *arg);
|
|
|
|
|
|
|
|
|
|
void uiBlockSetFunc (uiBlock *block, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2);
|
|
|
|
|
void uiButSetFunc (uiBut *but, void (*func)(void *arg1, void *arg2), void *arg1, void *arg2);
|
2003-10-11 00:21:05 +00:00
|
|
|
void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)());
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
short pupmenu(char *instr);
|
|
|
|
|
short pupmenu_col(char *instr, int maxrow);
|
|
|
|
|
|
2003-10-04 20:35:50 +00:00
|
|
|
extern void uiFreePanels(struct ListBase *lb);
|
2003-10-11 22:00:30 +00:00
|
|
|
extern void uiNewPanelTabbed(char *, char *);
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
extern int uiNewPanel(struct ScrArea *sa, struct uiBlock *block, char *panelname, char *tabname, int ofsx, int ofsy, int sizex, int sizey);
|
2003-10-12 19:46:17 +00:00
|
|
|
|
2003-10-04 20:35:50 +00:00
|
|
|
extern void uiSetPanel_view2d(struct ScrArea *sa);
|
2003-10-12 19:46:17 +00:00
|
|
|
extern void uiMatchPanel_view2d(struct ScrArea *sa);
|
|
|
|
|
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
extern void uiDrawBlocksPanels(struct ScrArea *sa, int re_align);
|
|
|
|
|
extern void uiNewPanelHeight(struct uiBlock *block, int sizey);
|
2003-10-11 22:00:30 +00:00
|
|
|
void uiPanelPush(uiBlock *block);
|
|
|
|
|
void uiPanelPop(uiBlock *block);
|
|
|
|
|
extern uiBlock *uiFindOpenPanelBlockName(ListBase *lb, char *name);
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
extern int uiAlignPanelStep(struct ScrArea *sa, float fac);
|
2003-10-16 00:17:24 +00:00
|
|
|
extern void uiPanelControl(int);
|
|
|
|
|
extern void uiSetPanelHandler(int);
|
2003-10-04 20:35:50 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#endif /* BIF_INTERFACE_H */
|
2002-10-30 02:07:20 +00:00
|
|
|
|