comparison src/video/directfb/SDL_DirectFB_mouse.c @ 3685:64ce267332c6

Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
author Sam Lantinga <slouken@libsdl.org>
date Thu, 21 Jan 2010 06:21:52 +0000
parents d72a0dd80e8b
children f7b03b6838cb
comparison
equal deleted inserted replaced
3684:cc564f08884f 3685:64ce267332c6
29 static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface, 29 static SDL_Cursor *DirectFB_CreateCursor(SDL_Surface * surface,
30 int hot_x, int hot_y); 30 int hot_x, int hot_y);
31 static int DirectFB_ShowCursor(SDL_Cursor * cursor); 31 static int DirectFB_ShowCursor(SDL_Cursor * cursor);
32 static void DirectFB_MoveCursor(SDL_Cursor * cursor); 32 static void DirectFB_MoveCursor(SDL_Cursor * cursor);
33 static void DirectFB_FreeCursor(SDL_Cursor * cursor); 33 static void DirectFB_FreeCursor(SDL_Cursor * cursor);
34 static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID, 34 static void DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window,
35 int x, int y); 35 int x, int y);
36 static void DirectFB_FreeMouse(SDL_Mouse * mouse); 36 static void DirectFB_FreeMouse(SDL_Mouse * mouse);
37 37
38 static int id_mask; 38 static int id_mask;
39 39
157 static int 157 static int
158 DirectFB_ShowCursor(SDL_Cursor * cursor) 158 DirectFB_ShowCursor(SDL_Cursor * cursor)
159 { 159 {
160 SDL_DFB_CURSORDATA(cursor); 160 SDL_DFB_CURSORDATA(cursor);
161 DFBResult ret; 161 DFBResult ret;
162 SDL_WindowID wid; 162 SDL_Window *window;
163 163
164 wid = SDL_GetFocusWindow(); 164 window = SDL_GetFocusWindow();
165 if (wid <= 0) 165 if (!window)
166 return -1; 166 return -1;
167 else { 167 else {
168 SDL_Window *window = SDL_GetWindowFromID(wid); 168 SDL_VideoDisplay *display = window->display;
169 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
170 169
171 if (display) { 170 if (display) {
172 DFB_DisplayData *dispdata = 171 DFB_DisplayData *dispdata =
173 (DFB_DisplayData *) display->driverdata; 172 (DFB_DisplayData *) display->driverdata;
174 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 173 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
214 SDL_DFB_FREE(cursor); 213 SDL_DFB_FREE(cursor);
215 } 214 }
216 215
217 /* Warp the mouse to (x,y) */ 216 /* Warp the mouse to (x,y) */
218 static void 217 static void
219 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_WindowID windowID, int x, int y) 218 DirectFB_WarpMouse(SDL_Mouse * mouse, SDL_Window * window, int x, int y)
220 { 219 {
221 SDL_Window *window = SDL_GetWindowFromID(windowID); 220 SDL_VideoDisplay *display = window->display;
222 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
223 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 221 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
224 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 222 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
225 DFBResult ret; 223 DFBResult ret;
226 int cx, cy; 224 int cx, cy;
227 225