src/events/SDL_mouse.c
changeset 3685 64ce267332c6
parent 3585 f8816ffa210b
child 3689 af25b5586af7
     1.1 --- a/src/events/SDL_mouse.c	Thu Jan 21 05:49:41 2010 +0000
     1.2 +++ b/src/events/SDL_mouse.c	Thu Jan 21 06:21:52 2010 +0000
     1.3 @@ -26,6 +26,7 @@
     1.4  #include "SDL_events.h"
     1.5  #include "SDL_events_c.h"
     1.6  #include "default_cursor.h"
     1.7 +#include "../video/SDL_sysvideo.h"
     1.8  
     1.9  
    1.10  static int SDL_num_mice = 0;
    1.11 @@ -190,7 +191,7 @@
    1.12      return SDL_current_mouse;
    1.13  }
    1.14  
    1.15 -SDL_WindowID
    1.16 +SDL_Window *
    1.17  SDL_GetMouseFocusWindow(int index)
    1.18  {
    1.19      SDL_Mouse *mouse = SDL_GetMouse(index);
    1.20 @@ -302,14 +303,14 @@
    1.21  }
    1.22  
    1.23  void
    1.24 -SDL_SetMouseFocus(int id, SDL_WindowID windowID)
    1.25 +SDL_SetMouseFocus(int id, SDL_Window * window)
    1.26  {
    1.27      int index = SDL_GetMouseIndexId(id);
    1.28      SDL_Mouse *mouse = SDL_GetMouse(index);
    1.29      int i;
    1.30      SDL_bool focus;
    1.31  
    1.32 -    if (!mouse || (mouse->focus == windowID)) {
    1.33 +    if (!mouse || (mouse->focus == window)) {
    1.34          return;
    1.35      }
    1.36  
    1.37 @@ -331,7 +332,7 @@
    1.38          }
    1.39      }
    1.40  
    1.41 -    mouse->focus = windowID;
    1.42 +    mouse->focus = window;
    1.43  
    1.44      if (mouse->focus) {
    1.45          focus = SDL_FALSE;
    1.46 @@ -372,7 +373,7 @@
    1.47          event.proximity.cursor = mouse->current_end;
    1.48          event.proximity.type = type;
    1.49          /* FIXME: is this right? */
    1.50 -        event.proximity.windowID = mouse->focus;
    1.51 +        event.proximity.windowID = mouse->focus->id;
    1.52          posted = (SDL_PushEvent(&event) > 0);
    1.53          if (type == SDL_PROXIMITYIN) {
    1.54              mouse->proximity = SDL_TRUE;
    1.55 @@ -478,7 +479,7 @@
    1.56          event.motion.cursor = mouse->current_end;
    1.57          event.motion.xrel = xrel;
    1.58          event.motion.yrel = yrel;
    1.59 -        event.motion.windowID = mouse->focus;
    1.60 +        event.motion.windowID = mouse->focus->id;
    1.61          posted = (SDL_PushEvent(&event) > 0);
    1.62      }
    1.63      mouse->last_x = mouse->x;
    1.64 @@ -531,7 +532,7 @@
    1.65          event.button.button = button;
    1.66          event.button.x = mouse->x;
    1.67          event.button.y = mouse->y;
    1.68 -        event.button.windowID = mouse->focus;
    1.69 +        event.button.windowID = mouse->focus->id;
    1.70          posted = (SDL_PushEvent(&event) > 0);
    1.71      }
    1.72      return posted;
    1.73 @@ -555,14 +556,14 @@
    1.74          event.wheel.which = (Uint8) index;
    1.75          event.wheel.x = x;
    1.76          event.wheel.y = y;
    1.77 -        event.wheel.windowID = mouse->focus;
    1.78 +        event.wheel.windowID = mouse->focus->id;
    1.79          posted = (SDL_PushEvent(&event) > 0);
    1.80      }
    1.81      return posted;
    1.82  }
    1.83  
    1.84  void
    1.85 -SDL_WarpMouseInWindow(SDL_WindowID windowID, int x, int y)
    1.86 +SDL_WarpMouseInWindow(SDL_Window * window, int x, int y)
    1.87  {
    1.88      SDL_Mouse *mouse = SDL_GetMouse(SDL_current_mouse);
    1.89  
    1.90 @@ -571,9 +572,9 @@
    1.91      }
    1.92  
    1.93      if (mouse->WarpMouse) {
    1.94 -        mouse->WarpMouse(mouse, windowID, x, y);
    1.95 +        mouse->WarpMouse(mouse, window, x, y);
    1.96      } else {
    1.97 -        SDL_SetMouseFocus(SDL_current_mouse, windowID);
    1.98 +        SDL_SetMouseFocus(SDL_current_mouse, window);
    1.99          SDL_SendMouseMotion(SDL_current_mouse, 0, x, y, 0);
   1.100      }
   1.101  }