code cleanup: use const events for modal and invoke operators.
[blender.git] / source / blender / windowmanager / intern / wm_event_system.c
index 4e181ec930be743529b8635f6c60ef1bcaf28c22..5a24b371a9859ca282739a7ec6bdd838c80cdb1b 100644 (file)
@@ -2487,14 +2487,14 @@ void WM_event_add_mousemove_window(wmWindow *window)
 }
 
 /* for modal callbacks, check configuration for how to interpret exit with tweaks  */
-int WM_modal_tweak_exit(wmEvent *evt, int tweak_event)
+int WM_modal_tweak_exit(const wmEvent *event, int tweak_event)
 {
        /* if the release-confirm userpref setting is enabled, 
         * tweak events can be canceled when mouse is released
         */
        if (U.flag & USER_RELEASECONFIRM) {
                /* option on, so can exit with km-release */
-               if (evt->val == KM_RELEASE) {
+               if (event->val == KM_RELEASE) {
                        switch (tweak_event) {
                                case EVT_TWEAK_L:
                                case EVT_TWEAK_M:
@@ -2515,7 +2515,7 @@ int WM_modal_tweak_exit(wmEvent *evt, int tweak_event)
                 * some items (i.e. markers) being tweaked may end up getting
                 * dropped all over
                 */
-               if (evt->val != KM_RELEASE)
+               if (event->val != KM_RELEASE)
                        return 1;
        }
        
@@ -2745,9 +2745,9 @@ static void attach_ndof_data(wmEvent *event, const GHOST_TEventNDOFMotionData *g
 }
 
 /* imperfect but probably usable... draw/enable drags to other windows */
-static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *evt)
+static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *win, wmEvent *event)
 {
-       int mx = evt->x, my = evt->y;
+       int mx = event->x, my = event->y;
        
        if (wm->windows.first == wm->windows.last)
                return NULL;
@@ -2779,8 +2779,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi
                                if (mx - posx >= 0 && owin->posy >= 0 &&
                                    mx - posx <= WM_window_pixels_x(owin) && my - posy <= WM_window_pixels_y(owin))
                                {
-                                       evt->x = mx - (int)(U.pixelsize * owin->posx);
-                                       evt->y = my - (int)(U.pixelsize * owin->posy);
+                                       event->x = mx - (int)(U.pixelsize * owin->posx);
+                                       event->y = my - (int)(U.pixelsize * owin->posy);
                                        
                                        return owin;
                                }