- code cleanup: blender/src now compiles -Wall without warnings again.
authorTon Roosendaal <ton@blender.org>
Tue, 20 Apr 2004 22:00:33 +0000 (22:00 +0000)
committerTon Roosendaal <ton@blender.org>
Tue, 20 Apr 2004 22:00:33 +0000 (22:00 +0000)
- first code for panel in NLA window, tomorrow I continue with it.

13 files changed:
source/blender/include/BIF_editdeform.h
source/blender/include/BIF_space.h
source/blender/include/BIF_toolbox.h
source/blender/src/drawaction.c
source/blender/src/drawnla.c
source/blender/src/editnla.c
source/blender/src/header_action.c
source/blender/src/header_buttonswin.c
source/blender/src/header_info.c
source/blender/src/header_script.c
source/blender/src/headerbuttons.c
source/blender/src/toets.c
source/blender/src/toolbox.c

index 94c369bc0c4be7c3d4f55e6e1e5d9373c66e80cc..c45bdbccd2438a63dde32c1cc3072a8239f53d52 100644 (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
 
index f0849b6d853d41e2001bb268246ddd580c1f10ac..04cc7ad359a398aee440d75629abf1e68151f5bb 100644 (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);
index 1350592a0ee2bc06ec2898944c8b9ed675951eee..1b7e05c521749f3533d4a35ce10b98cfa096981f 100644 (file)
  * ***** 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
index 04aac1f67ec1459edc828270b946a450eed9c393..bf0c46823e51a3b0bfcdbc6b2e2670c561eea881 100644 (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;
                
index 5434505da8fc0841b5b3f06eb3be3a2866f61fd5..0c086d5b03cda090ace1d2a40502c6181b6a4ca4 100644 (file)
 
 #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"
 #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;
 }
 
index 0a69955552bfc02ddfbbb24bbcbcd281f76e0b21..6b59f3c6b8e5d72eac10bd525c5c2493c5d9578f 100644 (file)
@@ -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;
index f9c153cc3a6f030b6b4eec9c5734b0c2646212c0..0ea50317cf81cb8c8459434428f634d2c32fad61 100644 (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"
index bfad2c1b6d21d63d27ff55b7a21db975ac7f041b..db4b6572ec6a0150792e766091443da3d55777f9 100644 (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);
index 74b690320c6067cdc89168df392fb82e072b9abb..5cbaa7b6c3415aa0caa22fcb02fc86e4de99cee6 100644 (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) {
index cf029812dfddf998da246720c509e276d7afe23e..9b1d618ab7ebd26c7af901e37b644103828a6820 100644 (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();
index d62946ef4a4580d6e179223473911d93f3da164f..ed1e9f30cdb65d24707403942cc27478655d96a0 100644 (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);
index 84a54f3e98f91c34865c62f9621f5610cc3cd37a..9f615b8ec0254f50d9329217e2bef8b3d58f15c8 100644 (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;
index c6ca8d14afb5a53c0d10dccb07af606a1eeea00d..738d575066b608235fd802154f4ecdfb3dadc17a 100644 (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) {
        }