diff options
author | Ton Roosendaal <ton@blender.org> | 2004-04-21 02:00:33 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2004-04-21 02:00:33 +0400 |
commit | 6d9b6ccbbfb2cceddc14bef61bfe0067d8131b48 (patch) | |
tree | ef31717c11c6df06233bffb8bd755277d41dc4b4 /source/blender/src | |
parent | 9a122193729f9f31532d092fc3ecc8a7f7cd3d3d (diff) |
- code cleanup: blender/src now compiles -Wall without warnings again.
- first code for panel in NLA window, tomorrow I continue with it.
Diffstat (limited to 'source/blender/src')
-rw-r--r-- | source/blender/src/drawaction.c | 2 | ||||
-rw-r--r-- | source/blender/src/drawnla.c | 76 | ||||
-rw-r--r-- | source/blender/src/editnla.c | 78 | ||||
-rw-r--r-- | source/blender/src/header_action.c | 3 | ||||
-rw-r--r-- | source/blender/src/header_buttonswin.c | 1 | ||||
-rw-r--r-- | source/blender/src/header_info.c | 2 | ||||
-rw-r--r-- | source/blender/src/header_script.c | 7 | ||||
-rw-r--r-- | source/blender/src/headerbuttons.c | 2 | ||||
-rw-r--r-- | source/blender/src/toets.c | 4 | ||||
-rw-r--r-- | source/blender/src/toolbox.c | 5 |
10 files changed, 126 insertions, 54 deletions
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c index 04aac1f67ec..bf0c46823e5 100644 --- a/source/blender/src/drawaction.c +++ b/source/blender/src/drawaction.c @@ -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; diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c index 5434505da8f..0c086d5b03c 100644 --- a/source/blender/src/drawnla.c +++ b/source/blender/src/drawnla.c @@ -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; } diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c index 0a69955552b..6b59f3c6b8e 100644 --- a/source/blender/src/editnla.c +++ b/source/blender/src/editnla.c @@ -125,40 +125,11 @@ 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){ add_nlablock(mval); @@ -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; diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c index f9c153cc3a6..0ea50317cf8 100644 --- a/source/blender/src/header_action.c +++ b/source/blender/src/header_action.c @@ -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" diff --git a/source/blender/src/header_buttonswin.c b/source/blender/src/header_buttonswin.c index bfad2c1b6d2..db4b6572ec6 100644 --- a/source/blender/src/header_buttonswin.c +++ b/source/blender/src/header_buttonswin.c @@ -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); diff --git a/source/blender/src/header_info.c b/source/blender/src/header_info.c index 74b690320c6..5cbaa7b6c34 100644 --- a/source/blender/src/header_info.c +++ b/source/blender/src/header_info.c @@ -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) { diff --git a/source/blender/src/header_script.c b/source/blender/src/header_script.c index cf029812dfd..9b1d618ab7e 100644 --- a/source/blender/src/header_script.c +++ b/source/blender/src/header_script.c @@ -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(); diff --git a/source/blender/src/headerbuttons.c b/source/blender/src/headerbuttons.c index d62946ef4a4..ed1e9f30cdb 100644 --- a/source/blender/src/headerbuttons.c +++ b/source/blender/src/headerbuttons.c @@ -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); diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 84a54f3e98f..9f615b8ec02 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -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; diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index c6ca8d14afb..738d575066b 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -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) { } |