Fix #27849: 3D manipulator widget lost on mesh in edge mode.
[blender.git] / source / blender / editors / transform / transform_manipulator.c
index 238f53cbb8704aa361054b3adb89f5351402ca17..d62227a122d7081ebc5efc36bd031206b32ef3a5 100644 (file)
@@ -1,4 +1,4 @@
-/**
+/*
 * $Id$
  *
  * ***** BEGIN GPL LICENSE BLOCK *****
  * ***** END GPL LICENSE BLOCK *****
  */
 
+/** \file blender/editors/transform/transform_manipulator.c
+ *  \ingroup edtransform
+ */
+
+
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>
@@ -59,6 +64,7 @@
 
 #include "BLI_math.h"
 #include "BLI_editVert.h"
+#include "BLI_utildefines.h"
 
 #include "BIF_gl.h"
 
@@ -272,6 +278,7 @@ int calc_manipulator_stats(const bContext *C)
        ARegion *ar= CTX_wm_region(C);
        Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
+       ToolSettings *ts = CTX_data_tool_settings(C);
        View3D *v3d= sa->spacedata.first;
        RegionView3D *rv3d= ar->regiondata;
        Base *base;
@@ -303,11 +310,63 @@ int calc_manipulator_stats(const bContext *C)
                                calc_tw_center(scene, vec);
                                totsel= 1;
                        } else {
-                               /* do vertices for center, and if still no normal found, use vertex normals */
-                               for(eve= em->verts.first; eve; eve= eve->next) {
-                                       if(eve->f & SELECT) {
-                                               totsel++;
-                                               calc_tw_center(scene, eve->co);
+                               /* do vertices/edges/faces for center depending on selection
+                                  mode. note we can't use just vertex selection flag because
+                                  it is not flush down on changes */
+                               if(ts->selectmode & SCE_SELECT_VERTEX) {
+                                       for(eve= em->verts.first; eve; eve= eve->next) {
+                                               if(eve->f & SELECT) {
+                                                       totsel++;
+                                                       calc_tw_center(scene, eve->co);
+                                               }
+                                       }
+                               }
+                               else if(ts->selectmode & SCE_SELECT_EDGE) {
+                                       EditEdge *eed;
+
+                                       for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
+                                       for(eed= em->edges.first; eed; eed= eed->next) {
+                                               if(eed->h==0 && (eed->f & SELECT)) {
+                                                       if(!eed->v1->f1) {
+                                                               eed->v1->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, eed->v1->co);
+                                                       }
+                                                       if(!eed->v2->f1) {
+                                                               eed->v2->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, eed->v2->co);
+                                                       }
+                                               }
+                                       }
+                               }
+                               else {
+                                       EditFace *efa;
+
+                                       for(eve= em->verts.first; eve; eve= eve->next) eve->f1= 0;
+                                       for(efa= em->faces.first; efa; efa= efa->next) {
+                                               if(efa->h==0 && (efa->f & SELECT)) {
+                                                       if(!efa->v1->f1) {
+                                                               efa->v1->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, efa->v1->co);
+                                                       }
+                                                       if(!efa->v2->f1) {
+                                                               efa->v2->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, efa->v2->co);
+                                                       }
+                                                       if(!efa->v3->f1) {
+                                                               efa->v3->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, efa->v3->co);
+                                                       }
+                                                       if(efa->v4 && !efa->v4->f1) {
+                                                               efa->v4->f1= 1;
+                                                               totsel++;
+                                                               calc_tw_center(scene, efa->v4->co);
+                                                       }
+                                               }
                                        }
                                }
                        }
@@ -545,38 +604,38 @@ int calc_manipulator_stats(const bContext *C)
 }
 
 /* don't draw axis perpendicular to the view */
-void test_manipulator_axis(const bContext *C)
+static void test_manipulator_axis(const bContext *C)
 {
        RegionView3D *rv3d= CTX_wm_region_view3d(C);
        float angle;
        float vec[3];
 
-       viewvector(rv3d, rv3d->twmat[3], vec);
+       ED_view3d_global_to_vector(rv3d, rv3d->twmat[3], vec);
 
        angle = fabs(angle_v3v3(rv3d->twmat[0], vec));
-       if (angle > M_PI / 2) {
-               angle = M_PI - angle;
+       if (angle > (float)M_PI / 2.0f) {
+               angle = (float)M_PI - angle;
        }
-       angle = rv3d->twangle[0] = 180.0f * angle / M_PI;
-       if (angle < 5) {
+       angle = rv3d->twangle[0] = RAD2DEGF(angle);
+       if (angle < 5.0f) {
                rv3d->twdrawflag &= ~(MAN_TRANS_X|MAN_SCALE_X);
        }
 
        angle = fabs(angle_v3v3(rv3d->twmat[1], vec));
-       if (angle > M_PI / 2) {
-               angle = M_PI - angle;
+       if (angle > (float)M_PI / 2.0f) {
+               angle = (float)M_PI - angle;
        }
-       angle = rv3d->twangle[1] = 180.0f * angle / M_PI;
-       if (angle < 5) {
+       angle = rv3d->twangle[1] = RAD2DEGF(angle);
+       if (angle < 5.0f) {
                rv3d->twdrawflag &= ~(MAN_TRANS_Y|MAN_SCALE_Y);
        }
 
        angle = fabs(angle_v3v3(rv3d->twmat[2], vec));
-       if (angle > M_PI / 2) {
-               angle = M_PI - angle;
+       if (angle > (float)M_PI / 2.0f) {
+               angle = (float)M_PI - angle;
        }
-       angle = rv3d->twangle[2] = 180.0f * angle / M_PI;
-       if (angle < 5) {
+       angle = rv3d->twangle[2] = RAD2DEGF(angle);
+       if (angle < 5.0f) {
                rv3d->twdrawflag &= ~(MAN_TRANS_Z|MAN_SCALE_Z);
        }
 }
@@ -708,7 +767,7 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned c
        }
        else {
                switch(axis) {
-               case 'c':
+               case 'C':
                        UI_GetThemeColor3ubv(TH_TRANSFORM, col);
                        if(v3d->twmode == V3D_MANIP_LOCAL) {
                                col[0]= col[0]>200?255:col[0]+55;
@@ -721,17 +780,19 @@ static void manipulator_setcolor(View3D *v3d, char axis, int colcode, unsigned c
                                col[2]= col[2]<55?0:col[2]-55;
                        }
                        break;
-               case 'x':
+               case 'X':
                        col[0]= 220;
                        break;
-               case 'y':
+               case 'Y':
                        col[1]= 220;
                        break;
-               case 'z':
+               case 'Z':
                        col[0]= 30;
                        col[1]= 30;
                        col[2]= 220;
                        break;
+               default:
+                       BLI_assert(!"invalid axis arg");
                }
        }
 
@@ -744,7 +805,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
 
        /* axes */
        if(flagx) {
-               manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+               manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
                if(flagx & MAN_SCALE_X) glLoadName(MAN_SCALE_X);
                else if(flagx & MAN_TRANS_X) glLoadName(MAN_TRANS_X);
                glBegin(GL_LINES);
@@ -755,7 +816,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
        if(flagy) {
                if(flagy & MAN_SCALE_Y) glLoadName(MAN_SCALE_Y);
                else if(flagy & MAN_TRANS_Y) glLoadName(MAN_TRANS_Y);
-               manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+               manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
                glBegin(GL_LINES);
                glVertex3f(0.0f, 0.2f, 0.0f);
                glVertex3f(0.0f, 1.0f, 0.0f);
@@ -764,7 +825,7 @@ static void draw_manipulator_axes(View3D *v3d, RegionView3D *rv3d, int colcode,
        if(flagz) {
                if(flagz & MAN_SCALE_Z) glLoadName(MAN_SCALE_Z);
                else if(flagz & MAN_TRANS_Z) glLoadName(MAN_TRANS_Z);
-               manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+               manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
                glBegin(GL_LINES);
                glVertex3f(0.0f, 0.0f, 0.2f);
                glVertex3f(0.0f, 0.0f, 1.0f);
@@ -824,7 +885,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
        if(arcs) {
                /* clipplane makes nice handles, calc here because of multmatrix but with translate! */
                VECCOPY(plane, rv3d->viewinv[2]);
-               plane[3]= -0.02*size; // clip just a bit more
+               plane[3]= -0.02f*size; // clip just a bit more
                glClipPlane(GL_CLIP_PLANE0, plane);
        }
        /* sets view screen aligned */
@@ -893,7 +954,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                                /* axis */
                                if( (drawflags & MAN_ROT_X) || (moving && (drawflags & MAN_ROT_Z)) ) {
                                        preOrthoFront(ortho, rv3d->twmat, 2);
-                                       manipulator_setcolor(v3d, 'x', colcode, 255);
+                                       manipulator_setcolor(v3d, 'X', colcode, 255);
                                        glBegin(GL_LINES);
                                        glVertex3f(0.2f, 0.0f, 0.0f);
                                        glVertex3f(1.0f, 0.0f, 0.0f);
@@ -902,7 +963,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                                }
                                if( (drawflags & MAN_ROT_Y) || (moving && (drawflags & MAN_ROT_X)) ) {
                                        preOrthoFront(ortho, rv3d->twmat, 0);
-                                       manipulator_setcolor(v3d, 'y', colcode, 255);
+                                       manipulator_setcolor(v3d, 'Y', colcode, 255);
                                        glBegin(GL_LINES);
                                        glVertex3f(0.0f, 0.2f, 0.0f);
                                        glVertex3f(0.0f, 1.0f, 0.0f);
@@ -911,7 +972,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                                }
                                if( (drawflags & MAN_ROT_Z) || (moving && (drawflags & MAN_ROT_Y)) ) {
                                        preOrthoFront(ortho, rv3d->twmat, 1);
-                                       manipulator_setcolor(v3d, 'z', colcode, 255);
+                                       manipulator_setcolor(v3d, 'Z', colcode, 255);
                                        glBegin(GL_LINES);
                                        glVertex3f(0.0f, 0.0f, 0.2f);
                                        glVertex3f(0.0f, 0.0f, 1.0f);
@@ -928,7 +989,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                if(drawflags & MAN_ROT_Z) {
                        preOrthoFront(ortho, matt, 2);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
-                       manipulator_setcolor(v3d, 'z', colcode, 255);
+                       manipulator_setcolor(v3d, 'Z', colcode, 255);
                        drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
                        postOrtho(ortho);
                }
@@ -937,7 +998,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, matt, 0);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
                        glRotatef(90.0, 0.0, 1.0, 0.0);
-                       manipulator_setcolor(v3d, 'x', colcode, 255);
+                       manipulator_setcolor(v3d, 'X', colcode, 255);
                        drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
                        glRotatef(-90.0, 0.0, 1.0, 0.0);
                        postOrtho(ortho);
@@ -947,7 +1008,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, matt, 1);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
                        glRotatef(-90.0, 1.0, 0.0, 0.0);
-                       manipulator_setcolor(v3d, 'y', colcode, 255);
+                       manipulator_setcolor(v3d, 'Y', colcode, 255);
                        drawcircball(GL_LINE_LOOP, unitmat[3], 1.0, unitmat);
                        glRotatef(90.0, 1.0, 0.0, 0.0);
                        postOrtho(ortho);
@@ -963,7 +1024,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                if(drawflags & MAN_ROT_Z) {
                        preOrthoFront(ortho, rv3d->twmat, 2);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
-                       manipulator_setcolor(v3d, 'z', colcode, 255);
+                       manipulator_setcolor(v3d, 'Z', colcode, 255);
                        partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
                        postOrtho(ortho);
                }
@@ -972,7 +1033,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, rv3d->twmat, 0);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
                        glRotatef(90.0, 0.0, 1.0, 0.0);
-                       manipulator_setcolor(v3d, 'x', colcode, 255);
+                       manipulator_setcolor(v3d, 'X', colcode, 255);
                        partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
                        glRotatef(-90.0, 0.0, 1.0, 0.0);
                        postOrtho(ortho);
@@ -982,7 +1043,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, rv3d->twmat, 1);
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
                        glRotatef(-90.0, 1.0, 0.0, 0.0);
-                       manipulator_setcolor(v3d, 'y', colcode, 255);
+                       manipulator_setcolor(v3d, 'Y', colcode, 255);
                        partial_donut(cusize/4.0f, 1.0f, 0, 48, 8, 48);
                        glRotatef(90.0, 1.0, 0.0, 0.0);
                        postOrtho(ortho);
@@ -998,7 +1059,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, rv3d->twmat, 2);
                        glPushMatrix();
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
-                       manipulator_setcolor(v3d, 'z', colcode, 255);
+                       manipulator_setcolor(v3d, 'Z', colcode, 255);
 
                        partial_donut(0.7f*cusize, 1.0f, 31, 33, 8, 64);
 
@@ -1011,7 +1072,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, rv3d->twmat, 1);
                        glPushMatrix();
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
-                       manipulator_setcolor(v3d, 'y', colcode, 255);
+                       manipulator_setcolor(v3d, 'Y', colcode, 255);
 
                        glRotatef(90.0, 1.0, 0.0, 0.0);
                        glRotatef(90.0, 0.0, 0.0, 1.0);
@@ -1026,7 +1087,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving,
                        preOrthoFront(ortho, rv3d->twmat, 0);
                        glPushMatrix();
                        if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
-                       manipulator_setcolor(v3d, 'x', colcode, 255);
+                       manipulator_setcolor(v3d, 'X', colcode, 255);
 
                        glRotatef(-90.0, 0.0, 1.0, 0.0);
                        glRotatef(90.0, 0.0, 0.0, 1.0);
@@ -1125,7 +1186,7 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
                /* center circle, do not add to selection when shift is pressed (planar constraint)  */
                if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_SCALE_C);
 
-               manipulator_setcolor(v3d, 'c', colcode, 255);
+               manipulator_setcolor(v3d, 'C', colcode, 255);
                glPushMatrix();
                size= screen_aligned(rv3d, rv3d->twmat);
                unit_m4(unitmat);
@@ -1158,21 +1219,21 @@ static void draw_manipulator_scale(View3D *v3d, RegionView3D *rv3d, int moving,
        glTranslatef(0.0, 0.0, dz);
        if(drawflags & MAN_SCALE_Z) {
                if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Z);
-               manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+               manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
                drawsolidcube(cusize);
        }
        /* X cube */
        glTranslatef(dz, 0.0, -dz);
        if(drawflags & MAN_SCALE_X) {
                if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_X);
-               manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+               manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
                drawsolidcube(cusize);
        }
        /* Y cube */
        glTranslatef(-dz, dz, 0.0);
        if(drawflags & MAN_SCALE_Y) {
                if(G.f & G_PICKSEL) glLoadName(MAN_SCALE_Y);
-               manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+               manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
                drawsolidcube(cusize);
        }
 
@@ -1243,7 +1304,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
        /* center circle, do not add to selection when shift is pressed (planar constraint) */
        if( (G.f & G_PICKSEL) && shift==0) glLoadName(MAN_TRANS_C);
 
-       manipulator_setcolor(v3d, 'c', colcode, 255);
+       manipulator_setcolor(v3d, 'C', colcode, 255);
        glPushMatrix();
        size= screen_aligned(rv3d, rv3d->twmat);
        unit_m4(unitmat);
@@ -1270,7 +1331,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
        glTranslatef(0.0, 0.0, dz);
        if(drawflags & MAN_TRANS_Z) {
                if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Z);
-               manipulator_setcolor(v3d, 'z', colcode, axisBlendAngle(rv3d->twangle[2]));
+               manipulator_setcolor(v3d, 'Z', colcode, axisBlendAngle(rv3d->twangle[2]));
                draw_cone(qobj, cylen, cywid);
        }
        /* X Cone */
@@ -1278,7 +1339,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
        if(drawflags & MAN_TRANS_X) {
                if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_X);
                glRotatef(90.0, 0.0, 1.0, 0.0);
-               manipulator_setcolor(v3d, 'x', colcode, axisBlendAngle(rv3d->twangle[0]));
+               manipulator_setcolor(v3d, 'X', colcode, axisBlendAngle(rv3d->twangle[0]));
                draw_cone(qobj, cylen, cywid);
                glRotatef(-90.0, 0.0, 1.0, 0.0);
        }
@@ -1287,7 +1348,7 @@ static void draw_manipulator_translate(View3D *v3d, RegionView3D *rv3d, int UNUS
        if(drawflags & MAN_TRANS_Y) {
                if(G.f & G_PICKSEL) glLoadName(MAN_TRANS_Y);
                glRotatef(-90.0, 1.0, 0.0, 0.0);
-               manipulator_setcolor(v3d, 'y', colcode, axisBlendAngle(rv3d->twangle[1]));
+               manipulator_setcolor(v3d, 'Y', colcode, axisBlendAngle(rv3d->twangle[1]));
                draw_cone(qobj, cylen, cywid);
        }
 
@@ -1369,7 +1430,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
        glTranslatef(0.0, 0.0, 1.0);
        if(drawflags & MAN_ROT_Z) {
                if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Z);
-               manipulator_setcolor(v3d, 'z', colcode, 255);
+               manipulator_setcolor(v3d, 'Z', colcode, 255);
                draw_cylinder(qobj, cylen, cywid);
        }
        /* X cyl */
@@ -1377,7 +1438,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
        if(drawflags & MAN_ROT_X) {
                if(G.f & G_PICKSEL) glLoadName(MAN_ROT_X);
                glRotatef(90.0, 0.0, 1.0, 0.0);
-               manipulator_setcolor(v3d, 'x', colcode, 255);
+               manipulator_setcolor(v3d, 'X', colcode, 255);
                draw_cylinder(qobj, cylen, cywid);
                glRotatef(-90.0, 0.0, 1.0, 0.0);
        }
@@ -1386,7 +1447,7 @@ static void draw_manipulator_rotate_cyl(View3D *v3d, RegionView3D *rv3d, int mov
        if(drawflags & MAN_ROT_Y) {
                if(G.f & G_PICKSEL) glLoadName(MAN_ROT_Y);
                glRotatef(-90.0, 1.0, 0.0, 0.0);
-               manipulator_setcolor(v3d, 'y', colcode, 255);
+               manipulator_setcolor(v3d, 'Y', colcode, 255);
                draw_cylinder(qobj, cylen, cywid);
        }
 
@@ -1449,7 +1510,7 @@ void BIF_draw_manipulator(const bContext *C)
                        break;
                }
 
-               mul_mat3_m4_fl(rv3d->twmat, view3d_pixel_size(rv3d, rv3d->twmat[3]) * U.tw_size * 5.0f);
+               mul_mat3_m4_fl(rv3d->twmat, ED_view3d_pixel_size(rv3d, rv3d->twmat[3]) * U.tw_size * 5.0f);
        }
 
        test_manipulator_axis(C);
@@ -1479,7 +1540,7 @@ void BIF_draw_manipulator(const bContext *C)
        }
 }
 
-static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float hotspot)
+static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, const int mval[2], float hotspot)
 {
        View3D *v3d= sa->spacedata.first;
        RegionView3D *rv3d= ar->regiondata;
@@ -1558,7 +1619,6 @@ static int manipulator_selectbuf(ScrArea *sa, ARegion *ar, short *mval, float ho
        return 0;
 }
 
-int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, PointerRNA *properties, ReportList *reports);
 
 /* return 0; nothing happened */
 int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
@@ -1615,7 +1675,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
                        }
                        RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
                        WM_operator_name_call(C, "TRANSFORM_OT_translate", WM_OP_INVOKE_DEFAULT, op->ptr);
-                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL);
+                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_translate", 0), event, op->ptr, NULL, FALSE);
                }
                else if (drawflags & MAN_SCALE_C) {
                        switch(drawflags) {
@@ -1646,11 +1706,11 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
                        }
                        RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
                        WM_operator_name_call(C, "TRANSFORM_OT_resize", WM_OP_INVOKE_DEFAULT, op->ptr);
-                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL);
+                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL, FALSE);
                }
                else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */
-                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL);
                        WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, op->ptr);
+                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL, FALSE);
                }
                else if (drawflags & MAN_ROT_C) {
                        switch(drawflags) {
@@ -1666,7 +1726,7 @@ int BIF_do_manipulator(bContext *C, struct wmEvent *event, wmOperator *op)
                        }
                        RNA_boolean_set_array(op->ptr, "constraint_axis", constraint_axis);
                        WM_operator_name_call(C, "TRANSFORM_OT_rotate", WM_OP_INVOKE_DEFAULT, op->ptr);
-                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL);
+                       //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_rotate", 0), event, op->ptr, NULL, FALSE);
                }
        }
        /* after transform, restore drawflags */