Update space dispatch:
authorDaniel Dunbar <daniel@zuster.org>
Mon, 24 Mar 2003 01:46:05 +0000 (01:46 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 24 Mar 2003 01:46:05 +0000 (01:46 +0000)
 - drawXXXspace, changeXXXspace, and winqreadXXXspace now receive the area
     and spacedata as explicit arguments, allowing them to access private
     data w/o going through globals.
 - pass the new BWinEvent through to the winqreadXXXspace, allowing future
     access to extended event data.

Removed direct calls to winqreadXXXspace to simulate user actions, replaced
by calls to action functions in edit.c or the appropriate handler.

39 files changed:
source/blender/include/BIF_drawimage.h
source/blender/include/BIF_drawseq.h
source/blender/include/BIF_space.h
source/blender/include/BIF_spacetypes.h
source/blender/include/BSE_drawimasel.h
source/blender/include/BSE_drawipo.h
source/blender/include/BSE_drawnla.h
source/blender/include/BSE_drawoops.h
source/blender/include/BSE_drawview.h
source/blender/include/BSE_edit.h
source/blender/include/BSE_editaction.h
source/blender/include/BSE_editipo.h
source/blender/include/BSE_filesel.h
source/blender/src/buttons.c
source/blender/src/drawaction.c
source/blender/src/drawimage.c
source/blender/src/drawimasel.c
source/blender/src/drawipo.c
source/blender/src/drawnla.c
source/blender/src/drawoops.c
source/blender/src/drawseq.c
source/blender/src/drawsound.c
source/blender/src/drawtext.c
source/blender/src/drawview.c
source/blender/src/edit.c
source/blender/src/editaction.c
source/blender/src/editimasel.c
source/blender/src/editipo.c
source/blender/src/editnla.c
source/blender/src/editscreen.c
source/blender/src/editseq.c
source/blender/src/editsound.c
source/blender/src/filesel.c
source/blender/src/headerbuttons.c
source/blender/src/renderwin.c
source/blender/src/space.c
source/blender/src/spacetypes.c
source/blender/src/usiblender.c
source/blender/src/writeavicodec.c

index 5c862dc0e31f46ecd15b592b83458058dbf69fd5..fdf4afd029a544ab828ab67897ec33ceeaffb893 100644 (file)
 #ifndef BIF_DRAWIMAGE_H
 #define BIF_DRAWIMAGE_H
 
+struct ScrArea;
 struct SpaceImage;
 
 void calc_image_view(struct SpaceImage *sima, char mode);
-void drawimagespace(void);
+void drawimagespace(struct ScrArea *sa, void *spacedata);
 void draw_tfaces(void);
 void image_changed(struct SpaceImage *sima, int dotile);
 void image_home(void);
index d122aeb071ea4e9449a5d20b423f4b789fba204c..336fd54bd1e2e02faea23f6075440ce02b32469f 100644 (file)
 #ifndef BIF_DRAWSEQ_H
 #define BIF_DRAWSEQ_H
 
+struct ScrArea;
 struct Sequence;
-void drawseqspace(void);
+
+void drawseqspace(struct ScrArea *sa, void *spacedata);
 void drawseq(struct Sequence *seq);
 void set_special_seq_update(int val);
 
index 33add3085a6f82ee45bf749ee24aa55e4aeaea3e..2c6f6f1ecee2ca07f48819d3d4b03599b4176693 100644 (file)
@@ -53,12 +53,9 @@ void scrarea_do_headchange   (struct ScrArea *sa);
 extern          void space_set_commmandline_options(void);
 extern       void allqueue(unsigned short event, short val);
 extern       void allspace(unsigned short event, short val);
-extern       void changebutspace(void);
-extern       void changeview2d(void);
-extern       void changeview3d(void);
 extern       void copy_view3d_lock(short val);
-extern       void drawemptyspace(void);
-extern       void drawinfospace(void);
+extern       void drawemptyspace(struct ScrArea *sa, void *spacedata);
+extern       void drawinfospace(struct ScrArea *sa, void *spacedata);
 extern       void duplicatespacelist(struct ScrArea *area, struct ListBase *lb1, struct ListBase *lb2);
 extern       void extern_set_butspace(int fkey);
 extern       void force_draw(void);
@@ -77,14 +74,14 @@ extern       void initipo(struct ScrArea *sa);
 extern       void initview3d(struct ScrArea *sa);
 extern       void newspace(struct ScrArea *sa, int type);
 extern       void set_rects_butspace(struct SpaceButs *buts);
-extern       void winqreadview3dspace(unsigned short event, short val, char ascii);
-extern       void winqreadbutspace(unsigned short event, short val, char ascii);
-extern       void winqreadimagespace(unsigned short event, short val, char ascii);
-extern       void winqreadinfospace(unsigned short event, short val, char ascii);
-extern       void winqreadipospace(unsigned short event, short val, char ascii);
-extern       void winqreadoopsspace(unsigned short event, short val, char ascii);
-extern       void winqreadnlaspace(unsigned short event, short val, char ascii);
-extern       void winqreadseqspace(unsigned short event, short val, char ascii);
+extern       void winqreadview3dspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadbutspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadimagespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadinfospace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadipospace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadoopsspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadnlaspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
+extern       void winqreadseqspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 extern       void test_butspace(void);
 extern       void start_game(void);
 
index 9ce075fd917a47f7cf684fd74eae2e4a5cbd889a..469ddf24354b42cb7ea1a7619ed09a5e5580b98f 100644 (file)
  */
 
 struct ScrArea;
+struct BWinEvent;
 
 typedef struct _SpaceType      SpaceType;
 
-typedef        void    (*SpaceDrawFP)          (void);
-typedef        void    (*SpaceChangeFP)        (void);
-typedef        void    (*SpaceHandleFP)        (unsigned short evt, short val, char ascii);
+typedef        void    (*SpaceDrawFP)          (struct ScrArea *sa, void *spacedata);
+typedef        void    (*SpaceChangeFP)        (struct ScrArea *sa, void *spacedata);
+typedef        void    (*SpaceHandleFP)        (struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
        /***/
 
index 3eef9faec46bd5c9b7a2fac5580e5bdb241af08b..f412ca0858489f58caea1cd72c7ca88f3ce096b6 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef BSE_DRAWIMASEL_H
 #define BSE_DRAWIMASEL_H
 
+struct ScrArea;
 struct SpaceImaSel;
 
 void viewgate(short sx, short sy, short ex, short ey);
@@ -45,7 +46,7 @@ void move_imadir_sli(struct SpaceImaSel *simasel);
 void move_imafile_sli(struct SpaceImaSel *simasel);
 void ima_select_all(struct SpaceImaSel *simasel);
 void pibplay(struct SpaceImaSel *simasel);
-void drawimaselspace(void);   
+void drawimaselspace(struct ScrArea *sa, void *spacedata);   
 
 /*  void calc_hilite(SpaceImaSel *simasel); */
 /*  void ima_select_all(SpaceImaSel *simasel); */
index b1f92668be5feb3711b2153dd128139f35953efb..298d15c19ba79a917e6b7f170e84a8547739a17d 100644 (file)
@@ -41,6 +41,7 @@
 #define SELECT_SUBTRACT  4
 #define SELECT_INVERT   16
 
+struct ScrArea;
 struct EditIpo;
 struct View2D;
 struct rctf;
@@ -52,12 +53,13 @@ void areamouseco_to_ipoco   (struct View2D *v2d, short *mval, float *x, float *y);
 void ipoco_to_areaco           (struct View2D *v2d, float *vec, short *mval);
 void ipoco_to_areaco_noclip    (struct View2D *v2d, float *vec, short *mval);
 
+void view2d_zoom                       (struct View2D *v2d, float factor, int winx, int winy);
 void test_view2d                       (struct View2D *v2d, int winx, int winy);
 void calc_scrollrcts           (struct View2D *v2d, int winx, int winy);
 
 int in_ipo_buttons(void);
 void drawscroll(int disptype);
-void drawipospace(void);
+void drawipospace(struct ScrArea *sa, void *spacedata);
 
 void center_currframe(void);
 void scroll_ipobuts(void);
index b71c604acfe2150086de3a71c2e80db063e43e90..d9d27204e28221045c42a919876054041dbd03ee 100644 (file)
@@ -33,7 +33,9 @@
 #ifndef BSE_DRAWNLA_H
 #define BSE_DRAWNLA_H
 
-void drawnlaspace(void);
+struct ScrArea;
+
+void drawnlaspace(struct ScrArea *sa, void *spacedata);
 
 #endif /* BSE_DRAWNLA */
 
index ef52d9e2c92196859d88097321a7de698907f599..b042fc097fae72f3a56302da09e409443189621a 100644 (file)
@@ -33,6 +33,7 @@
 #ifndef BSE_DRAWOOPS_H
 #define BSE_DRAWOOPS_H
 
+struct ScrArea;
 struct Oops;
 struct uiBlock;
 
@@ -44,7 +45,7 @@ void mysbox(float x1, float y1, float x2, float y2);
 unsigned int give_oops_color(short type, short sel, unsigned int *border);
 void calc_oopstext(char *str, float *v1);
 void draw_oops(struct Oops *oops, struct uiBlock *block);
-void drawoopsspace(void);
+void drawoopsspace(struct ScrArea *sa, void *spacedata);
 
 #endif /* BSE_DRAWOOPS */
 
index f0cba1eeb64d891c640afbf980acedc2e9575f4d..299c697a30ffc38b894e2607d0ec26c8707ef60c 100644 (file)
@@ -36,6 +36,7 @@
 struct Object;
 struct BGpic;
 struct rcti;
+struct ScrArea;
 
 void setalpha_bgpic(struct BGpic *bgpic);
 void default_gl_light(void);
@@ -44,7 +45,7 @@ void two_sided(int val);
 void circf(float x, float y, float rad);
 void circ(float x, float y, float rad);
 void backdrawview3d(int test);
-void drawview3dspace(void);
+void drawview3dspace(struct ScrArea *sa, void *spacedata);
 void drawview3d_render(struct View3D *v3d);
 int update_time(void);
 void calc_viewborder(struct View3D *v3d, struct rcti *viewborder_r);
index cb76517fe5645903ec306ded5abf9f16a9c0fece..e776f99ad28cdd7fdf1eb31a5b60891c8b891d91 100644 (file)
@@ -40,6 +40,10 @@ int get_border(struct rcti *rect, short col);
 void count_object(struct Object *ob, int sel);
 void countall(void);
 void snapmenu(void); 
+void mergemenu(void);
+void delete_context_selected(void);
+void duplicate_context_selected(void);
+void toggle_shading(void);
 
 #endif /*  BSE_EDIT_H */
 
index 841549de2602d166d1ea6744060b2d410d78a14d..2a9878adb11efbbb0eae7371a5cd524370cf2be5 100644 (file)
@@ -48,7 +48,7 @@ void set_action_key (struct bAction *act, struct bPoseChannel *chan, int adrcode
 struct bAction *add_empty_action(void);
 void deselect_actionchannel_keys (struct bAction *act, int test);
 void deselect_actionchannels (struct bAction *act, int test);
-void winqreadactionspace(unsigned short event, short val, char ascii);
+void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 void remake_action_ipos(struct bAction *act);
 void select_actionchannel_by_name (struct bAction *act, char *name, int select);
 struct bAction *bake_action_with_client (struct bAction *act, struct Object *arm, float tolerance);
index 40650b6f27f44de3becdbfd9ae581f84f9316ba3..3522056f21eee8c35fe0b4cbb0704bd7bcdd214b 100644 (file)
@@ -81,6 +81,7 @@ void test_editipo(void);
 void get_status_editipo(void);
 void update_editipo_flags(void);
 void set_editflag_editipo(void);
+void ipo_toggle_showkey(void);
 void swap_selectall_editipo(void);
 void swap_visible_editipo(void);
 void deselectall_editipo(void);
index 87daea87bf24f8625e3c0b1a1ea942310d2ce1b7..960708d401048118034d65ce0a2b45d3e50414c5 100644 (file)
@@ -37,6 +37,7 @@
 struct SpaceFile;
 struct direntry;
 struct ID;
+struct ScrArea;
 
 void clear_global_filesel_vars(void);
 void filesel_statistics(struct SpaceFile *sfile, int *totfile, int *selfile, float *totlen, float *sellen);
@@ -47,13 +48,13 @@ void read_dir(struct SpaceFile *sfile);
 void freefilelist(struct SpaceFile *sfile);
 void parent(struct SpaceFile *sfile);
 void swapselect_file(struct SpaceFile *sfile);
-void drawfilespace(void);
+void drawfilespace(struct ScrArea *sa, void *spacedata);
 void activate_fileselect(int type, char *title, char *file, void (*func)(char *));
 void activate_imageselect(int type, char *title, char *file, void (*func)(char *));
 void activate_databrowse(struct ID *id, int idcode, int fromcode, int retval, short *menup, void (*func)(unsigned short));
 void filesel_prevspace(void);
 void free_filesel_spec(char *dir);
-void winqreadfilespace(unsigned short event, short val, char ascii);
+void winqreadfilespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 void main_to_filelist(struct SpaceFile *sfile);   
 
 #endif
index c4256b9cc4f227ef10fa422bac3fa243321eae24..5d782eb4c59f528641b660e92e3c2d37139a73f2 100644 (file)
@@ -6981,7 +6981,7 @@ static void do_constraintbuts(unsigned short event)
 
 /* ***************************<>******************************** */
 
-void drawbutspace(void)
+void drawbutspace(ScrArea *sa, void *spacedata)
 {
        SpaceButs *sbuts= curarea->spacedata.first;
        View2D *v2d= &sbuts->v2d;
index ed57a5950766350a8baa0ca5998f79611ce9d0f2..80af4d27676d2b6f859b520d0971661ff92c8312 100644 (file)
@@ -84,7 +84,7 @@
 #include "blendef.h"
 
 /* local functions ----------------------------------------------------- */
-void drawactionspace(void);
+void drawactionspace(ScrArea *sa, void *spacedata);
 static void draw_channel_names(void);
 static void draw_channel_strips(SpaceAction *saction);
 int count_action_levels(bAction *act);
@@ -345,7 +345,7 @@ static void draw_channel_strips(SpaceAction *saction)
        glaEnd2DDraw(di);
 }
 
-void drawactionspace(void)
+void drawactionspace(ScrArea *sa, void *spacedata)
 {
 
        short ofsx = 0, ofsy = 0;
index efe75fc4586432629a6345bc70fd3fa9441e4ed1..281eec09cdac0fd9668c39c62106279195632862 100644 (file)
@@ -410,7 +410,7 @@ static unsigned int *get_part_from_ibuf(ImBuf *ibuf, short startx, short starty,
        return rectmain;
 }
 
-void drawimagespace(void)
+void drawimagespace(ScrArea *sa, void *spacedata)
 {
        ImBuf *ibuf= NULL;
        unsigned int *rect;
index 451eff81437da8c737bb001cf9904d9b6233f7aa..a4e439fc246f24031f1820d11172ab24a9997dda 100644 (file)
@@ -853,7 +853,7 @@ void pibplay(SpaceImaSel *simasel)
 
 /* ************** hoofdtekenfunktie ************** */
 
-void drawimaselspace() /* hoofdtekenfunktie */
+void drawimaselspace(ScrArea *sa, void *spacedata)     /* hoofdtekenfunktie */
 {
        SpaceImaSel *simasel;
        simasel= curarea->spacedata.first;
index a8fdabe5069ab10da49b5ced0a52315576e8fe02..ce7ed5507c51185e80436c14f68096636ec86d01 100644 (file)
@@ -358,6 +358,16 @@ int in_ipo_buttons(void)
 }
 
 
+void view2d_zoom(View2D *v2d, float factor, int winx, int winy) {
+       float dx= factor*(v2d->cur.xmax-v2d->cur.xmin);
+       float dy= factor*(v2d->cur.ymax-v2d->cur.ymin);
+       v2d->cur.xmin+= dx;
+       v2d->cur.xmax-= dx;
+       v2d->cur.ymin+= dy;
+       v2d->cur.ymax-= dy;
+       test_view2d(v2d, winx, winy);
+}
+
 void test_view2d(View2D *v2d, int winx, int winy)
 {
        /* cur mag niet groter dan max, kleiner dan min of buiten tot vallen */
@@ -1316,7 +1326,7 @@ static void draw_key(SpaceIpo *sipo, int visible)
        setlinestyle(0);
 }
 
-void drawipospace(void)
+void drawipospace(ScrArea *sa, void *spacedata)
 {
        SpaceIpo *sipo= curarea->spacedata.first;
        View2D *v2d= &sipo->v2d;
index 62d897b0d93c26b9243d7cdfdcaa8d09a6a8dbcc..b43f8c8d713cb5b4f07946a3d022188fa253e2e9 100644 (file)
@@ -427,7 +427,7 @@ static void draw_nlastrips(SpaceNla *snla)
        
 }
 
-void drawnlaspace(void)
+void drawnlaspace(ScrArea *sa, void *spacedata)
 {
        short ofsx = 0, ofsy = 0;
        
index bee15ccc7e57970efcbe8770c5b5c7f00e9da559..6c8fb4d7edb0f6c9aee803412dc5ebb25851db13 100644 (file)
@@ -367,7 +367,7 @@ void draw_oops(Oops *oops, uiBlock *block)
        }
 }
 
-void drawoopsspace()
+void drawoopsspace(ScrArea *sa, void *spacedata)
 {
        uiBlock *block;
        Oops *oops;
index 7598eaa863773a5da7677c2124741295e10c3842..63907ec2c9e61f6afaf51a0c068c0d84f03d6e29 100644 (file)
@@ -538,7 +538,7 @@ static void draw_extra_seqinfo(void)
        }
 }
 
-void drawseqspace(void)
+void drawseqspace(ScrArea *sa, void *spacedata)
 {
        SpaceSeq *sseq;
        Editing *ed;
index d4ec8b705ebd1c912000d667bd85ed01ca892a51..12f29d1054ae7534521d95b742a5a0c1a2c35c17 100644 (file)
@@ -60,7 +60,7 @@
 #include "BSE_drawipo.h"
 
 /* local */
-void drawsoundspace(void);
+void drawsoundspace(ScrArea *sa, void *spacedata);
 
 /*implementation */
 static void draw_wave(int startsamp, int endsamp, short sampdx, short offset, short *sp, float sampfac, float y)
@@ -163,7 +163,7 @@ static void draw_cfra_sound(void)
 }
 
 
-void drawsoundspace(void)
+void drawsoundspace(ScrArea *sa, void *spacedata)
 {
        short ofsx, ofsy;
        
index 42caba1c3f6da3be5ef8eeeadd4f64c86c78319d..c41b9d8abaa76afadaa28b4850391b9b1523fc97 100644 (file)
@@ -84,8 +84,8 @@
 #define TEXTXLOC       38
 
 /* locals */
-void drawtextspace(void);
-void winqreadtextspace(unsigned short event, short val, char ascii);
+void drawtextspace(ScrArea *sa, void *spacedata);
+void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
 static void *last_txt_find_string= NULL;
 
@@ -532,7 +532,7 @@ static void do_selection(SpaceText *st, int selecting)
                txt_undo_add_toop(st->text, UNDO_STO, sell, selc, linep2, charp2);
 }
 
-void drawtextspace(void)
+void drawtextspace(ScrArea *sa, void *spacedata)
 {
        SpaceText *st= curarea->spacedata.first;
        Text *text;
@@ -742,8 +742,11 @@ static int jumptoline_interactive(SpaceText *st) {
        }
 }
 
-void winqreadtextspace(unsigned short event, short val, char ascii)
+void winqreadtextspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceText *st= curarea->spacedata.first;
        Text *text= st->text;
        char *py_filename;
index 0199f3865c92a2c85db3e3d1f20c2d68df85aa9e..79ce91643004e6ca733d03ef41352c3edeec4d68 100644 (file)
@@ -784,7 +784,7 @@ static void draw_view_icon(void)
        glDisable(GL_BLEND);
 }
 
-void drawview3dspace(void)
+void drawview3dspace(ScrArea *sa, void *spacedata)
 {
        Base *base;
        Object *ob;
@@ -996,6 +996,7 @@ void drawview3dspace(void)
         */
 void drawview3d_render(struct View3D *v3d)
 {
+       extern void mywindow_build_and_set_renderwin(void);
        extern short v3d_windowmode;
        Base *base;
        Object *ob;
index 58956ed9b37d54413bc2a3c778173f5ad4b7d161..eaeba18879d76dea35d38878be8b346f9215f99c 100644 (file)
@@ -86,6 +86,8 @@
 #include "BSE_drawview.h"
 
 #include "BDR_editobject.h"
+#include "BDR_editmball.h"
+#include "BDR_editcurve.h"
 
 /* old stuff */
 #include "blendertimer.h"
@@ -1171,7 +1173,7 @@ void snapmenu()
 }
 
 
-void mergemenu()
+void mergemenu(void)
 {
        extern float doublimit;
        short event;
@@ -1193,3 +1195,45 @@ void mergemenu()
        }
 
 }
+
+void delete_context_selected(void) {
+       if(G.obedit) {
+               if(G.obedit->type==OB_MESH) delete_mesh();
+               else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) delNurb();
+               else if(G.obedit->type==OB_MBALL) delete_mball();
+               else if (G.obedit->type==OB_ARMATURE) delete_armature();
+       }
+       else delete_obj(0);
+}
+
+void duplicate_context_selected(void) {
+       if(G.obedit) {
+               if(G.obedit->type==OB_MESH) adduplicate_mesh();
+               else if(G.obedit->type==OB_ARMATURE) adduplicate_armature();
+               else if(G.obedit->type==OB_MBALL) adduplicate_mball();
+               else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) adduplicate_nurb();
+       }
+       else if(G.obpose){
+               error ("Duplicate not possible in posemode.");
+       }
+       else adduplicate(0);
+}
+
+void toggle_shading(void) {
+       if(G.qual & LR_CTRLKEY) {
+               reshadeall_displist();
+               G.vd->drawtype= OB_SHADED;
+       }
+       else if(G.qual & LR_SHIFTKEY) {
+               if(G.vd->drawtype== OB_SHADED) G.vd->drawtype= OB_WIRE;
+               else G.vd->drawtype= OB_SHADED;
+       }
+       else if(G.qual & LR_ALTKEY) {
+               if(G.vd->drawtype== OB_TEXTURE) G.vd->drawtype= OB_SOLID;
+               else G.vd->drawtype= OB_TEXTURE;
+       }
+       else {
+               if(G.vd->drawtype==OB_SOLID || G.vd->drawtype==OB_SHADED) G.vd->drawtype= OB_WIRE;
+               else G.vd->drawtype= OB_SOLID;
+       }
+}
index 1eb06c398f4e9e7611cfa4df4f5bc329e68f9dea..63b42531f67886c73ca19cb87e03b2a0bd99e308 100644 (file)
@@ -1650,8 +1650,11 @@ static void borderselect_function(void (*select_func)(bAction *act,
        
 }
 
-void winqreadactionspace(unsigned short event, short val, char ascii)
+void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceAction *saction;
        bAction *act;
        int doredraw= 0;
index 8052de6b64c0460d8b5d3efb581986438e79e49d..c4da07e4c7c40363b8ce5218dc4c48dc2c3304f4 100644 (file)
@@ -61,6 +61,7 @@
 #include "BIF_screen.h"
 #include "BIF_interface.h"
 #include "BIF_imasel.h"
+#include "BIF_mywindow.h"
 
 #include "BSE_filesel.h"
 #include "BSE_drawimasel.h"
@@ -83,8 +84,11 @@ static void draw_icon_imasel(void)
        scrarea_queue_winredraw(curarea);
 }
 
-void winqreadimaselspace(unsigned short event, short val, char ascii)
+void winqreadimaselspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceImaSel *simasel;
        
        short mval[2];
index d1b5585824a8f309c6873de50b4c05b45769ca46..9e14858b875fe58544a8c97d1ea1911ac8f240c8 100644 (file)
@@ -1478,6 +1478,16 @@ void set_editflag_editipo()
        scrarea_queue_winredraw(curarea);
 }
 
+void ipo_toggle_showkey(void) {
+       if(G.sipo->showkey) {
+               G.sipo->showkey= 0;
+               swap_selectall_editipo();       /* sel all */
+       }
+       else G.sipo->showkey= 1;
+       free_ipokey(&G.sipo->ipokey);
+       if(G.sipo->ipo) G.sipo->ipo->showkey= G.sipo->showkey;
+}
+
 void swap_selectall_editipo()
 {
        Object *ob;
index 34522a80959203ea4189dadd2d830e34370d2edf..c74fb7892f62cff2ad2c59a84d8bef2b8ada6453 100644 (file)
@@ -111,8 +111,11 @@ extern int nla_filter (Base* base, int flags);     /* From drawnla.c */
 
 /* ******************** SPACE: NLA ********************** */
 
-void winqreadnlaspace(unsigned short event, short val, char ascii)
+void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceNla *snla = curarea->spacedata.first;
        int doredraw= 0;
        short   mval[2];
index 0672a3f7977ab796d7126c13214640029a20b382..c8b00d2f5d7644cbdd09b08b1e5fa5ee4fbdaecb 100644 (file)
@@ -887,7 +887,7 @@ void screenmain(void)
                flush_extqd_events();
                if (nafterqitems && !qtest()) {
                        append_afterqueue();
-                       event= 0;
+                       event= val= ascii= 0;
                } else {
                        event= screen_qread(&val, &ascii);
                }
index 6afdffcf31759e234c3ab78958e6729b4e937600..637c0efc8af0489790c3f1b3607094c4d88d95ba 100644 (file)
@@ -556,7 +556,7 @@ static void add_image_strips(char *name)
        
        /* is voor restore windowmatrices */
        areawinset(curarea->win);
-       drawseqspace();
+       drawseqspace(curarea, curarea->spacedata.first);
 
        /* sfile zoeken */
        sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
@@ -616,7 +616,7 @@ static void add_movie_strip(char *name)
        
        /* is voor restore windowmatrices */
        areawinset(curarea->win);
-       drawseqspace();
+       drawseqspace(curarea, curarea->spacedata.first);
 
        /* sfile zoeken */
        sfile= scrarea_find_space_of_type(curarea, SPACE_FILE);
index a3ae24d4a4081503770a949c945df6f758c4750e..4099e665d7a9655f85ba1019b5f9272c17c52632 100644 (file)
@@ -91,14 +91,17 @@ static SND_AudioDeviceInterfaceHandle ghAudioDeviceInterface;
 bSound *sound_find_sound(char *id_name);
 void sound_read_wav_data(bSound * sound, PackedFile * pf);
 void sound_stop_sound(void *object, bSound *sound);
-void winqreadsoundspace(unsigned short event, short val, char ascii);
+void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 /*  void sound_stop_all_sounds(void); already in BIF_editsound.h */
 
 
 
 /* Right. Now for some implementation: */
-void winqreadsoundspace(unsigned short event, short val, char ascii)
+void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        float dx, dy;
        int doredraw= 0, cfra, first = 0;
        short mval[2];
@@ -430,8 +433,9 @@ void sound_read_wav_data(bSound* sound, PackedFile* pf)
 /* ugly, but it works (for now) */
 int sound_get_filetype_from_header(bSound* sound, PackedFile* pf)
 {
-       int i, filetype = SAMPLE_INVALID;
+       int filetype = SAMPLE_INVALID;
 #if GAMEBLENDER == 1
+       int i;
        char buffer[25];
        short shortbuf;
        
index 34e0ea8d68cd2089b138bf1003ddbf1ec6c152bd..62edd0e34e8c247b9da965a0fd29d2f9d82358ba 100644 (file)
@@ -1049,7 +1049,7 @@ static void draw_filetext(SpaceFile *sfile)
        glRecti(textrct.xmax+2,  textrct.ymin,  textrct.xmax+10,  textrct.ymax);
 }
 
-void drawfilespace()
+void drawfilespace(ScrArea *sa, void *spacedata)
 {
        SpaceFile *sfile;
        uiBlock *block;
@@ -1706,8 +1706,11 @@ static void fs_fake_users(SpaceFile *sfile)
        scrarea_queue_winredraw(curarea);
 }
 
-void winqreadfilespace(unsigned short event, short val, char ascii)
+void winqreadfilespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        static int acto=0;
        SpaceFile *sfile;
        int act, do_draw= 0, i, test, ret = 0;
index e4f02b92a196d4f13ff8a3e9d615d0b6544b8db3..c73c9ca9de9cb88f527f4ea2f6c7e62a0b7d7795 100644 (file)
@@ -2462,23 +2462,19 @@ static void do_info_editmenu(void *arg, int event)
        case 2:
                /* Circle Select */
                /*if(select_area(SPACE_VIEW3D)) {
-                       winqreadview3dspace(BKEY, 1, 0);        // XXX - kill me
-                       winqreadview3dspace(BKEY, 1, 0);        // XXX - kill me
+                       ;
                }*/
                break;
        case 3:
                /* Duplicate */
                if(select_area(SPACE_VIEW3D)) {
-                       oldqual = G.qual;
-                       G.qual = LR_SHIFTKEY;
-                       winqreadview3dspace(DKEY, 1, 0);        // XXX - kill me
-                       G.qual = oldqual;
+                       duplicate_context_selected();
                }
                break;
        case 4:
                /* Delete */
                if(select_area(SPACE_VIEW3D)) {
-                       winqreadview3dspace(XKEY, 1, 0);        // XXX - kill me
+                       delete_context_selected();
                }
                break;
        case 5:
@@ -2532,19 +2528,13 @@ static void do_info_editmenu(void *arg, int event)
                        /* ### */
                }       
                if(select_area(SPACE_VIEW3D)) {
-                       oldqual = G.qual;
-                       G.qual = LR_SHIFTKEY;
-                       winqreadview3dspace(WKEY, 1, 0);        // XXX - kill me
-                       G.qual = oldqual;
+                       transform('w');
                }
                break;
        case 11:
                /* Snap */
                if(select_area(SPACE_VIEW3D)) {
-                       oldqual = G.qual;
-                       G.qual = LR_SHIFTKEY;
-                       winqreadview3dspace(SKEY, 1, 0);        // XXX - kill me
-                       G.qual = oldqual;
+                       snapmenu();
                }
                break;
        }
@@ -3930,7 +3920,10 @@ void do_ipo_buttons(short event)
        case B_IPOSHOWKEY:
                /* waarde omkeren vanwege winqread */
                G.sipo->showkey= 1-G.sipo->showkey;
-               winqreadipospace(KKEY, 1, 0);           // XXX - kill me
+               ipo_toggle_showkey();
+               scrarea_queue_headredraw(curarea);
+               scrarea_queue_winredraw(curarea);
+               allqueue(REDRAWVIEW3D, 0);
                break;
        case B_VIEW2DZOOM:
                viewmovetemp= 0;
index dbc6bd03719f34ca1bc245094582ea2a489cea08..b344c7483440c603d294bf4edf62bb5a461dce1f 100644 (file)
@@ -180,8 +180,8 @@ static int renderwin_win_to_image_co(RenderWin *rw, int winco[2], int imgco_r[2]
        
        renderwin_get_disprect(rw, disprect);
        
-       imgco_r[0]= (winco[0]-disprect[0][0])/rw->zoom;
-       imgco_r[1]= (winco[1]-disprect[0][1])/rw->zoom;
+       imgco_r[0]= (int) ((winco[0]-disprect[0][0])/rw->zoom);
+       imgco_r[1]= (int) ((winco[1]-disprect[0][1])/rw->zoom);
        
        return (imgco_r[0]>=0 && imgco_r[1]>=0 && imgco_r[0]<R.rectx && imgco_r[1]<R.recty);
 }
@@ -196,8 +196,8 @@ static int renderwin_win_to_ndc(RenderWin *rw, int win_co[2], float ndc_r[2])
 
        window_get_size(rw->win, &w, &h);
 
-       ndc_r[0]= (float) (win_co[0]*2)/(w-1) - 1.0;
-       ndc_r[1]= (float) (win_co[1]*2)/(h-1) - 1.0;
+       ndc_r[0]= (float) ((win_co[0]*2)/(w-1) - 1.0);
+       ndc_r[1]= (float) ((win_co[1]*2)/(h-1) - 1.0);
 
        return (fabs(ndc_r[0])<=1.0 && fabs(ndc_r[1])<=1.0);
 }
index 03e7416e1796794c494b434b8c7d5995230f1a1e..c35e616ace35c166c1342b56d34e998452292c7c 100644 (file)
@@ -153,7 +153,7 @@ void free_soundspace(SpaceSound *ssound);
 
 /* ************* SPACE: VIEW3D  ************* */
 
-/*  extern void drawview3dspace(); BSE_drawview.h */
+/*  extern void drawview3dspace(ScrArea *sa, void *spacedata); BSE_drawview.h */
 
 
 void copy_view3d_lock(short val)
@@ -384,11 +384,9 @@ void start_game(void)
 #endif
 }
 
-void changeview3d()
+static void changeview3dspace(ScrArea *sa, void *spacedata)
 {
-       
        setwinmatrixview3d(0);  /* 0= geen pick rect */
-       
 }
 
        /* Callable from editmode and faceselect mode from the
@@ -419,8 +417,11 @@ static void align_view_to_selected(View3D *v3d)
        }
 }
 
-void winqreadview3dspace(unsigned short event, short val, char ascii)
+void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        View3D *v3d= curarea->spacedata.first;
        Object *ob;
        float *curs;
@@ -676,16 +677,7 @@ void winqreadview3dspace(unsigned short event, short val, char ascii)
                                break;
                        case DKEY:
                                if(G.qual & LR_SHIFTKEY) {
-                                       if(G.obedit) {
-                                               if(G.obedit->type==OB_MESH) adduplicate_mesh();
-                                               else if(G.obedit->type==OB_ARMATURE) adduplicate_armature();
-                                               else if(G.obedit->type==OB_MBALL) adduplicate_mball();
-                                               else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) adduplicate_nurb();
-                                       }
-                                       else if(G.obpose){
-                                               error ("Duplicate not possible in posemode.");
-                                       }
-                                       else adduplicate(0);
+                                       duplicate_context_selected();
                                }
                                else if(G.qual & LR_ALTKEY) {
                                        if(G.obpose) error ("Duplicate not possible in posemode.");
@@ -958,13 +950,7 @@ void winqreadview3dspace(unsigned short event, short val, char ascii)
                                break;
                        case XKEY:
                        case DELKEY:
-                               if(G.obedit) {
-                                       if(G.obedit->type==OB_MESH) delete_mesh();
-                                       else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) delNurb();
-                                       else if(G.obedit->type==OB_MBALL) delete_mball();
-                                       else if (G.obedit->type==OB_ARMATURE) delete_armature();
-                               }
-                               else delete_obj(0);
+                               delete_context_selected();
                                break;
                        case YKEY:
                                if(G.obedit) {
@@ -972,23 +958,7 @@ void winqreadview3dspace(unsigned short event, short val, char ascii)
                                }
                                break;
                        case ZKEY:
-                               if(G.qual & LR_CTRLKEY) {
-                                       reshadeall_displist();
-                                       G.vd->drawtype= OB_SHADED;
-                               }
-                               else if(G.qual & LR_SHIFTKEY) {
-                                       if(G.vd->drawtype== OB_SHADED) G.vd->drawtype= OB_WIRE;
-                                       else G.vd->drawtype= OB_SHADED;
-                               }
-                               else if(G.qual & LR_ALTKEY) {
-                                       if(G.vd->drawtype== OB_TEXTURE) G.vd->drawtype= OB_SOLID;
-                                       else G.vd->drawtype= OB_TEXTURE;
-                               }
-                               else {
-                                       if(G.vd->drawtype==OB_SOLID || G.vd->drawtype==OB_SHADED) G.vd->drawtype= OB_WIRE;
-                                       else G.vd->drawtype= OB_SOLID;
-                               }
-                               
+                               toggle_shading();
                                
                                scrarea_queue_headredraw(curarea);
                                scrarea_queue_winredraw(curarea);
@@ -1094,7 +1064,7 @@ void initview3d(ScrArea *sa)
 
 /* ******************** SPACE: IPO ********************** */
 
-void changeview2d()
+static void changeview2dspace(ScrArea *sa, void *spacedata)
 {
        if(G.v2d==0) return;
 
@@ -1102,8 +1072,11 @@ void changeview2d()
        myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
 }
 
-void winqreadipospace(unsigned short event, short val, char ascii)
+void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceIpo *sipo= curarea->spacedata.first;
        View2D *v2d= &sipo->v2d;
        float dx, dy;
@@ -1163,30 +1136,11 @@ void winqreadipospace(unsigned short event, short val, char ascii)
                        allqueue(REDRAWNLA, 0);
                        break;
                case PADPLUSKEY:
-
-                       dx= 0.1154*(v2d->cur.xmax-v2d->cur.xmin);
-                       dy= 0.1154*(v2d->cur.ymax-v2d->cur.ymin);
-                       if(val==SPACE_BUTS) {
-                               dx/=2.0; dy/= 2.0;
-                       }
-                       v2d->cur.xmin+= dx;
-                       v2d->cur.xmax-= dx;
-                       v2d->cur.ymin+= dy;
-                       v2d->cur.ymax-= dy;
-                       test_view2d(G.v2d, curarea->winx, curarea->winy);
+                       view2d_zoom(v2d, 0.1154, curarea->winx, curarea->winy);
                        doredraw= 1;
                        break;
                case PADMINUS:
-                       dx= 0.15*(v2d->cur.xmax-v2d->cur.xmin);
-                       dy= 0.15*(v2d->cur.ymax-v2d->cur.ymin);
-                       if(val==SPACE_BUTS) {
-                               dx/=2.0; dy/= 2.0;
-                       }
-                       v2d->cur.xmin-= dx;
-                       v2d->cur.xmax+= dx;
-                       v2d->cur.ymin-= dy;
-                       v2d->cur.ymax+= dy;
-                       test_view2d(G.v2d, curarea->winx, curarea->winy);
+                       view2d_zoom(v2d, -0.15, curarea->winx, curarea->winy);
                        doredraw= 1;
                        break;
                case PAGEUPKEY:
@@ -1230,14 +1184,7 @@ void winqreadipospace(unsigned short event, short val, char ascii)
                        join_ipo();
                        break;
                case KKEY:
-                       if(G.sipo->showkey) {
-                               G.sipo->showkey= 0;
-                               swap_selectall_editipo();       /* sel all */
-                       }
-                       else G.sipo->showkey= 1;
-                       free_ipokey(&G.sipo->ipokey);
-                       if(G.sipo->ipo) G.sipo->ipo->showkey= G.sipo->showkey;
-
+                       ipo_toggle_showkey();
                        scrarea_queue_headredraw(curarea);
                        allqueue(REDRAWVIEW3D, 0);
                        doredraw= 1;
@@ -1314,7 +1261,7 @@ void space_sound_button_function(int event)
        }
 }
 
-void drawinfospace(void)
+void drawinfospace(ScrArea *sa, void *spacedata)
 {
        uiBlock *block;
        float fac;
@@ -1448,8 +1395,11 @@ void drawinfospace(void)
        uiDrawBlock(block);
 }
 
-void winqreadinfospace(unsigned short event, short val, char ascii)
+void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        if(val) {
                if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
 
@@ -1472,9 +1422,9 @@ void init_infospace(ScrArea *sa)
 
 /* ******************** SPACE: BUTS ********************** */
 
-extern void drawbutspace(void);        /* buttons.c */
+extern void drawbutspace(ScrArea *sa, void *spacedata);        /* buttons.c */
 
-void changebutspace(void)
+static void changebutspace(ScrArea *sa, void *spacedata)
 {
        if(G.v2d==0) return;
        
@@ -1482,10 +1432,13 @@ void changebutspace(void)
        myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
 }
 
-void winqreadbutspace(unsigned short event, short val, char ascii)
+void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceButs *sbuts= curarea->spacedata.first;
-       ScrArea *sa, *sa3d;
+       ScrArea *sa2, *sa3d;
        int doredraw= 0;
 
        if(val) {
@@ -1504,9 +1457,12 @@ void winqreadbutspace(unsigned short event, short val, char ascii)
                        break;
 
                case PADPLUSKEY:
+                       view2d_zoom(&sbuts->v2d, 0.06, curarea->winx, curarea->winy);
+                       scrarea_queue_winredraw(curarea);
+                       break;
                case PADMINUS:
-                       val= SPACE_BUTS;
-                       winqreadipospace(event, val, 0);        // XXX - kill me
+                       view2d_zoom(&sbuts->v2d, -0.075, curarea->winx, curarea->winy);
+                       scrarea_queue_winredraw(curarea);
                        break;
                case RENDERPREVIEW:
                        BIF_previewrender(sbuts);
@@ -1522,20 +1478,20 @@ void winqreadbutspace(unsigned short event, short val, char ascii)
                case PAD5: case PAD7: case PAD9:
                case PADENTER: case ZKEY: case PKEY:
                        sa3d= 0;
-                       sa= G.curscreen->areabase.first;
-                       while(sa) {
-                               if(sa->spacetype==SPACE_VIEW3D) {
+                       sa2= G.curscreen->areabase.first;
+                       while(sa2) {
+                               if(sa2->spacetype==SPACE_VIEW3D) {
                                        if(sa3d) return;
-                                       sa3d= sa;
+                                       sa3d= sa2;
                                }
-                               sa= sa->next;
+                               sa2= sa2->next;
                        }
                        if(sa3d) {
                                sa= curarea;
                                areawinset(sa3d->win);
                                
                                if(event==PKEY) start_game();
-                               else if(event==ZKEY) winqreadview3dspace(event, val, 0);        // XXX - kill me
+                               else if(event==ZKEY) toggle_shading();
                                else persptoetsen(event);
                                
                                scrarea_queue_winredraw(sa3d);
@@ -1633,10 +1589,13 @@ void extern_set_butspace(int fkey)
 
 /* ******************** SPACE: SEQUENCE ********************** */
 
-/*  extern void drawseqspace(); BIF_drawseq.h */
+/*  extern void drawseqspace(ScrArea *sa, void *spacedata); BIF_drawseq.h */
 
-void winqreadseqspace(unsigned short event, short val, char ascii)
+void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceSeq *sseq= curarea->spacedata.first;
        View2D *v2d= &sseq->v2d;
        extern Sequence *last_seq;
@@ -1832,8 +1791,8 @@ void init_seqspace(ScrArea *sa)
 }
 
 /* ******************** SPACE: ACTION ********************** */
-extern void drawactionspace(void);
-extern void winqreadactionspace(unsigned short, short, char ascii);
+extern void drawactionspace(ScrArea *sa, void *spacedata);
+extern void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
 void init_actionspace(ScrArea *sa)
 {
@@ -1954,8 +1913,8 @@ void init_imaselspace(ScrArea *sa)
 
 /* ******************** SPACE: SOUND ********************** */
 
-extern void drawsoundspace(void);
-extern void winqreadsoundspace(unsigned short, short, char ascii);
+extern void drawsoundspace(ScrArea *sa, void *spacedata);
+extern void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
 void init_soundspace(ScrArea *sa)
 {
@@ -2003,10 +1962,13 @@ void free_soundspace(SpaceSound *ssound)
 
 /* ******************** SPACE: IMAGE ********************** */
 
-/*  extern void drawimagespace(); BIF_drawimage.h */
+/*  extern void drawimagespace(ScrArea *sa, void *spacedata); BIF_drawimage.h */
 
-void winqreadimagespace(unsigned short event, short val, char ascii)
+void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceImage *sima= curarea->spacedata.first;
        View2D *v2d= &sima->v2d;
 #ifdef NAN_TPT
@@ -2145,8 +2107,8 @@ void init_imagespace(ScrArea *sa)
 
 /* ******************** SPACE: IMASEL ********************** */
 
-extern void drawimaselspace(void);
-extern void winqreadimaselspace(unsigned short, short, char ascii);
+extern void drawimaselspace(ScrArea *sa, void *spacedata);
+extern void winqreadimaselspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
 
 /* alles naar imasel.c */
@@ -2154,10 +2116,13 @@ extern void winqreadimaselspace(unsigned short, short, char ascii);
 
 /* ******************** SPACE: OOPS ********************** */
 
-extern void drawoopsspace(void);
+extern void drawoopsspace(ScrArea *sa, void *spacedata);
 
-void winqreadoopsspace(unsigned short event, short val, char ascii)
+void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
 {
+       unsigned short event= evt->event;
+       short val= evt->val;
+       char ascii= evt->ascii;
        SpaceOops *soops= curarea->spacedata.first;
        View2D *v2d= &soops->v2d;
        float dx, dy;
@@ -2301,8 +2266,8 @@ void init_oopsspace(ScrArea *sa)
 
 /* ******************** SPACE: Text ********************** */
 
-extern void drawtextspace(void);
-extern void winqreadtextspace(unsigned short, short, char ascii);
+extern void drawtextspace(ScrArea *sa, void *spacedata);
+extern void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
 
 /* ******************** SPACE: ALGEMEEN ********************** */
 
@@ -2918,7 +2883,7 @@ SpaceType *spaceaction_get_type(void)
        
        if (!st) {
                st= spacetype_new("Action");
-               spacetype_set_winfuncs(st, drawactionspace, changeview2d, winqreadactionspace);
+               spacetype_set_winfuncs(st, drawactionspace, changeview2dspace, winqreadactionspace);
        }
 
        return st;
@@ -2984,7 +2949,7 @@ SpaceType *spaceipo_get_type(void)
        
        if (!st) {
                st= spacetype_new("Ipo");
-               spacetype_set_winfuncs(st, drawipospace, changeview2d, winqreadipospace);
+               spacetype_set_winfuncs(st, drawipospace, changeview2dspace, winqreadipospace);
        }
 
        return st;
@@ -2995,7 +2960,7 @@ SpaceType *spacenla_get_type(void)
        
        if (!st) {
                st= spacetype_new("Nla");
-               spacetype_set_winfuncs(st, drawnlaspace, changeview2d, winqreadnlaspace);
+               spacetype_set_winfuncs(st, drawnlaspace, changeview2dspace, winqreadnlaspace);
        }
 
        return st;
@@ -3006,7 +2971,7 @@ SpaceType *spaceoops_get_type(void)
        
        if (!st) {
                st= spacetype_new("Oops");
-               spacetype_set_winfuncs(st, drawoopsspace, changeview2d, winqreadoopsspace);
+               spacetype_set_winfuncs(st, drawoopsspace, changeview2dspace, winqreadoopsspace);
        }
 
        return st;
@@ -3017,7 +2982,7 @@ SpaceType *spaceseq_get_type(void)
        
        if (!st) {
                st= spacetype_new("Sequence");
-               spacetype_set_winfuncs(st, drawseqspace, changeview2d, winqreadseqspace);
+               spacetype_set_winfuncs(st, drawseqspace, changeview2dspace, winqreadseqspace);
        }
 
        return st;
@@ -3050,7 +3015,7 @@ SpaceType *spaceview3d_get_type(void)
        
        if (!st) {
                st= spacetype_new("View3D");
-               spacetype_set_winfuncs(st, drawview3dspace, changeview3d, winqreadview3dspace);
+               spacetype_set_winfuncs(st, drawview3dspace, changeview3dspace, winqreadview3dspace);
        }
 
        return st;
index 2eb923896d2319f37bb20122d08bd960097f169d..8a0ba57f37303ef61c98ab19960f3207cba29816 100644 (file)
@@ -105,7 +105,7 @@ void scrarea_do_windraw(ScrArea *area)
        areawinset(area->win);
 
        if(area->win && st->windraw) {
-               st->windraw();
+               st->windraw(area, area->spacedata.first);
        }
        else {
                glClearColor(0.4375, 0.4375, 0.4375, 0.0); 
@@ -121,7 +121,7 @@ void scrarea_do_winchange(ScrArea *area)
        areawinset(area->win);
 
        if (st->winchange) {
-               st->winchange();
+               st->winchange(area, area->spacedata.first);
        } else {
                if (!BLI_rcti_is_empty(&area->winrct)) {
                        bwin_ortho2(area->win, -0.5, area->winrct.xmax-area->winrct.xmin-0.5, -0.5, area->winrct.ymax-area->winrct.ymin-0.5);
@@ -136,6 +136,6 @@ void scrarea_do_winhandle(ScrArea *area, BWinEvent *evt)
        areawinset(area->win);
        
        if (st->winhandle) {
-               st->winhandle(evt->event, evt->val, evt->ascii);
+               st->winhandle(area, area->spacedata.first, evt);
        }
 }
index e5350142acdc5aa78dc68ab0ec9ea94d5587ac15..4d8dfc46b6127fdb80d8abe528b9ff4bd66cfdff 100644 (file)
@@ -45,6 +45,7 @@
 
 #ifdef WIN32
 #include "BLI_winstuff.h"
+#include <process.h> /* getpid */
 #else
 #include <unistd.h> /* getpid */
 #endif
index 002d161580358467a258fe706ec1bacdbc88b1b9..0cca17ac6768c06c3327b9a40553285c0e258270 100644 (file)
@@ -763,7 +763,6 @@ void append_avi_codec(int frame)
 
 int get_codec_settings(void)
 {
-       char name[2048];
        int ret_val = 0;
        AVICOMPRESSOPTIONS *aopts[1] = {&opts};
        AviCodecData *acd = G.scene->r.avicodecdata;