- code cleanup: blender/src now compiles -Wall without warnings again.

- first code for panel in NLA window, tomorrow I continue with it.
This commit is contained in:
2004-04-20 22:00:33 +00:00
parent 9a12219372
commit 6d9b6ccbbf
13 changed files with 137 additions and 56 deletions

View File

@@ -38,6 +38,7 @@
#define WEIGHT_SUBTRACT 3
struct Object;
struct Mesh;
struct MDeformVert;
struct MDeformWeight;
struct bDeformGroup;
@@ -58,6 +59,7 @@ void add_vert_to_defgroup (struct Object *ob, struct bDeformGroup *dg,
int assignmode);
void remove_vert_defgroup (struct Object *ob, struct bDeformGroup *dg,
int vertnum);
void create_dverts(Mesh *me);
#endif

View File

@@ -60,9 +60,11 @@ struct BWinEvent;
/* image handler codes */
#define IMAGE_HANDLER_PROPERTIES 30
/* image handler codes */
#define ACTION_HANDLER_PROPERTIES 30
/* action handler codes */
#define ACTION_HANDLER_PROPERTIES 40
/* nla handler codes */
#define NLA_HANDLER_PROPERTIES 50
void scrarea_do_windraw (struct ScrArea *sa);

View File

@@ -30,6 +30,10 @@
* ***** END GPL/BL DUAL LICENSE BLOCK *****
*/
#ifndef BIF_TOOLBOX_H
#define BIF_TOOLBOX_H
/* TBOXX: width in pixels */
#define TBOXXL 80
#define TBOXXR 200
@@ -126,3 +130,4 @@ void replace_names_but (void);
void BIF_screendump(void);
void write_screendump(char *name);
#endif

View File

@@ -565,7 +565,7 @@ static void action_blockhandlers(ScrArea *sa)
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
switch(sact->blockhandler[a]) {
case IMAGE_HANDLER_PROPERTIES:
case ACTION_HANDLER_PROPERTIES:
action_panel_properties(sact->blockhandler[a+1]);
break;

View File

@@ -43,15 +43,6 @@
#include <stdlib.h>
#include <stdio.h>
#include "BSE_drawnla.h"
#include "BSE_drawipo.h"
#include "BSE_editnla_types.h"
#include "BIF_gl.h"
#include "BIF_resources.h"
#include "BIF_screen.h"
#include "BIF_mywindow.h"
#include "BIF_glutil.h"
#include "DNA_view3d_types.h"
#include "DNA_screen_types.h"
@@ -68,10 +59,23 @@
#include "MEM_guardedalloc.h"
#include "BKE_global.h"
#include "BSE_drawnla.h"
#include "BSE_drawipo.h"
#include "BSE_editnla_types.h"
#include "BIF_gl.h"
#include "BIF_resources.h"
#include "BIF_screen.h"
#include "BIF_mywindow.h"
#include "BIF_space.h"
#include "BIF_interface.h"
#include "BIF_glutil.h"
#include "BDR_drawaction.h"
#include "BDR_editcurve.h"
#include "blendef.h"
#include "mydevice.h"
/* Local function prototypes */
static void draw_nlastrips(SpaceNla *snla);
@@ -407,6 +411,54 @@ static void draw_nlastrips(SpaceNla *snla)
}
/* ******* panel *********** */
void do_nlabuts(unsigned short event)
{
switch(event) {
case REDRAWVIEW3D:
allqueue(REDRAWVIEW3D, 0);
break;
case B_REDR:
allqueue(REDRAWNLA, 0);
break;
}
}
static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES
{
uiBlock *block;
block= uiNewBlock(&curarea->uiblocks, "nla_panel_properties", UI_EMBOSS, UI_HELV, curarea->win);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl);
uiSetPanelHandler(NLA_HANDLER_PROPERTIES); // for close and esc
if(uiNewPanel(curarea, block, "Transform Properties", "NLA", 10, 230, 318, 204)==0) return;
uiDefBut(block, LABEL, 0, "test text", 10,180,300,19, 0, 0, 0, 0, 0, "");
}
static void nla_blockhandlers(ScrArea *sa)
{
SpaceNla *snla= sa->spacedata.first;
short a;
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
switch(snla->blockhandler[a]) {
case NLA_HANDLER_PROPERTIES:
nla_panel_properties(snla->blockhandler[a+1]);
break;
}
/* clear action value for event */
snla->blockhandler[a+1]= 0;
}
uiDrawBlocksPanels(sa, 0);
}
void drawnlaspace(ScrArea *sa, void *spacedata)
{
float col[3];
@@ -430,6 +482,8 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
glClear(GL_COLOR_BUFFER_BIT);
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
bwin_clear_viewmat(sa->win); /* clear buttons view */
glLoadIdentity();
/* Draw backdrop */
calc_ipogrid();
@@ -458,6 +512,10 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
myortho2(-0.375, sa->winx-0.375, -0.375, sa->winy-0.375);
draw_area_emboss(sa);
/* it is important to end a view in a transform compatible with buttons */
bwin_scalematrix(sa->win, G.snla->blockscale, G.snla->blockscale, G.snla->blockscale);
nla_blockhandlers(sa);
curarea->win_swap= WIN_BACK_OK;
}

View File

@@ -125,39 +125,10 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
case UI_BUT_EVENT:
do_butspace(val); // abuse!
break;
case HOMEKEY:
do_nla_buttons(B_NLAHOME);
break;
case DKEY:
if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){
duplicate_nlachannel_keys();
update_for_newframe_muted();
}
break;
case DELKEY:
case XKEY:
if (mval[0]>=NLAWIDTH)
delete_nlachannel_keys ();
else
delete_nlachannels();
update_for_newframe_muted();
break;
case GKEY:
if (mval[0]>=NLAWIDTH)
transform_nlachannel_keys ('g');
update_for_newframe_muted();
break;
case SKEY:
if (mval[0]>=NLAWIDTH)
transform_nlachannel_keys ('s');
update_for_newframe_muted();
break;
case BKEY:
borderselect_nla();
break;
case CKEY:
convert_nla(mval);
break;
case AKEY:
if (G.qual & LR_SHIFTKEY){
@@ -176,6 +147,50 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
allqueue (REDRAWIPO, 0);
}
break;
case BKEY:
borderselect_nla();
break;
case CKEY:
convert_nla(mval);
break;
case DKEY:
if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){
duplicate_nlachannel_keys();
update_for_newframe_muted();
}
break;
case GKEY:
if (mval[0]>=NLAWIDTH)
transform_nlachannel_keys ('g');
update_for_newframe_muted();
break;
case NKEY:
if(G.qual==0) {
add_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
scrarea_queue_winredraw(curarea);
}
break;
case SKEY:
if (mval[0]>=NLAWIDTH)
transform_nlachannel_keys ('s');
update_for_newframe_muted();
break;
case DELKEY:
case XKEY:
if (mval[0]>=NLAWIDTH)
delete_nlachannel_keys ();
else
delete_nlachannels();
update_for_newframe_muted();
break;
case LEFTMOUSE:
if (mval[0]>NLAWIDTH){
do {
@@ -575,6 +590,7 @@ void init_nlaspace(ScrArea *sa)
BLI_addhead(&sa->spacedata, snla);
snla->spacetype= SPACE_NLA;
snla->blockscale= 0.7;
snla->v2d.tot.xmin= 1.0;
snla->v2d.tot.ymin= 0.0;

View File

@@ -72,6 +72,9 @@
#include "BKE_action.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_constraint.h"
#include "BKE_armature.h"
#include "BSE_drawipo.h"
#include "BSE_editaction.h"
#include "BSE_headerbuttons.h"

View File

@@ -451,7 +451,6 @@ void buts_buttons(void)
ID *id, *idfrom;
short xco, xmax, t_base= 0;
char naam[20];
int colorid;
sprintf(naam, "header %d", curarea->headwin);
block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->headwin);

View File

@@ -672,6 +672,7 @@ static uiBlock *info_runtime_optionsmenu(void *arg_unused)
static void do_info_file_importmenu(void *arg, int event)
{
extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c
ScrArea *sa;
if(curarea->spacetype==SPACE_INFO) {
@@ -710,6 +711,7 @@ static uiBlock *info_file_importmenu(void *arg_unused)
static void do_info_file_exportmenu(void *arg, int event)
{
extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c
ScrArea *sa;
if(curarea->spacetype==SPACE_INFO) {

View File

@@ -80,9 +80,7 @@
/* action executed after clicking in Scripts menu */
static void do_scripts_submenus(void *int_arg, int event)
{
SpaceScript *sc= curarea->spacedata.first;
Script *script= sc->script;
ScrArea *sa;
extern int BPY_menu_do_python(short menutype, int event); // BPY_interface.c
int menutype = (int)int_arg;
BPY_menu_do_python (menutype, event);
@@ -97,7 +95,7 @@ static uiBlock *script_scripts_submenus(void *int_menutype)
BPyMenu *pym;
int i = 0, menutype = (int)int_menutype;
if ((menutype < 0) || (menutype > PYMENU_TOTAL)) return;
if ((menutype < 0) || (menutype > PYMENU_TOTAL)) return NULL;
block= uiNewBlock(&curarea->uiblocks, "importmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
uiBlockSetButmFunc(block, do_scripts_submenus, int_menutype);
@@ -118,7 +116,6 @@ static uiBlock *script_scripts_submenus(void *int_menutype)
static void do_script_scriptsmenu(void *arg, int event)
{
ScrArea *sa;
char dir[FILE_MAXDIR];
if(curarea->spacetype==SPACE_INFO) {
sa= closest_bigger_area();

View File

@@ -494,8 +494,6 @@ int std_libbuttons(uiBlock *block, short xco, short yco,
void do_update_for_newframe(int mute)
{
Base *base;
extern void audiostream_scrub(unsigned int frame); /* seqaudio.c */
allqueue(REDRAWVIEW3D, 0);

View File

@@ -68,6 +68,7 @@
#include "BKE_action.h"
#include "BKE_ika.h"
#include "BKE_key.h"
#include "BKE_displist.h"
#include "BIF_interface.h"
#include "BIF_screen.h"
@@ -811,7 +812,8 @@ int blenderqread(unsigned short event, short val)
if(curarea->spacetype==SPACE_VIEW3D); // is new panel, in view3d queue
else if(curarea->spacetype==SPACE_IPO); // is new panel, in ipo queue
else if(curarea->spacetype==SPACE_IMAGE); // is new panel, in ipo queue
else if(curarea->spacetype==SPACE_ACTION); // is new panel
else if(curarea->spacetype==SPACE_ACTION); // is own queue
else if(curarea->spacetype==SPACE_NLA); // is new panel
else {
clever_numbuts();
return 0;

View File

@@ -1407,14 +1407,11 @@ void add_numbut(int nr, int type, char *str, float min, float max, void *poin, c
void clever_numbuts(void)
{
Object *ob;
float lim;
char str[128];
if(curarea->spacetype==SPACE_VIEW3D) {
}
else if(curarea->spacetype==SPACE_NLA){
clever_numbuts_nla();
//clever_numbuts_nla();
}
else if(curarea->spacetype==SPACE_IPO) {
}