comparison src/video/directfb/SDL_DirectFB_mouse.c @ 2259:1e690901ecd7

Date: Fri, 17 Aug 2007 01:12:31 +0200 From: Couriersud Subject: fix for audio dsp exit crash / various dfb issues improved cursor handling fixes some mouse and event related bugs
author Sam Lantinga <slouken@libsdl.org>
date Fri, 17 Aug 2007 02:54:50 +0000
parents 0e70b4b8cf84
children e1da92da346c e82a0e3e9b0e
comparison
equal deleted inserted replaced
2258:771bd3389e3a 2259:1e690901ecd7
110 110
111 /* Show the specified cursor, or hide if cursor is NULL */ 111 /* Show the specified cursor, or hide if cursor is NULL */
112 static int 112 static int
113 DirectFB_ShowCursor(SDL_Cursor * cursor) 113 DirectFB_ShowCursor(SDL_Cursor * cursor)
114 { 114 {
115 //FIXME check for null cursor here
115 SDL_DFB_CURSORDATA(cursor); 116 SDL_DFB_CURSORDATA(cursor);
116 SDL_VideoDevice *dev = SDL_GetVideoDevice(); 117 SDL_VideoDevice *dev = SDL_GetVideoDevice();
117 SDL_DFB_DEVICEDATA(dev); 118 SDL_DFB_DEVICEDATA(dev);
118 #if 0 119 #if 0
119 DFB_DisplayData *dispdata = 120 DFB_DisplayData *dispdata =
128 else { 129 else {
129 SDL_Window *window = SDL_GetWindowFromID(wid); 130 SDL_Window *window = SDL_GetWindowFromID(wid);
130 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window); 131 SDL_VideoDisplay *display = SDL_GetDisplayFromWindow(window);
131 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata; 132 DFB_DisplayData *dispdata = (DFB_DisplayData *) display->driverdata;
132 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata; 133 DFB_WindowData *windata = (DFB_WindowData *) window->driverdata;
133 SDL_DFB_CHECKERR(windata->window-> 134
134 SetCursorShape(windata->window, curdata->surf, 135 if (cursor)
135 curdata->hotx, curdata->hoty)); 136 SDL_DFB_CHECKERR(windata->window->
137 SetCursorShape(windata->window, curdata->surf,
138 curdata->hotx, curdata->hoty));
136 //FIXME: This is somehow a directfb issue 139 //FIXME: This is somehow a directfb issue
140 //TODO: Check administrative
137 SDL_DFB_CHECKERR(dispdata->layer-> 141 SDL_DFB_CHECKERR(dispdata->layer->
138 SetCooperativeLevel(dispdata->layer, 142 SetCooperativeLevel(dispdata->layer,
139 DLSCL_ADMINISTRATIVE)); 143 DLSCL_ADMINISTRATIVE));
140 SDL_DFB_CHECKERR(dispdata->layer-> 144 SDL_DFB_CHECKERR(dispdata->layer->
141 SetCursorOpacity(dispdata->layer, 0xC0)); 145 SetCursorOpacity(dispdata->layer,
146 cursor ? 0xC0 : 0x00));
142 SDL_DFB_CHECKERR(dispdata->layer-> 147 SDL_DFB_CHECKERR(dispdata->layer->
143 SetCooperativeLevel(dispdata->layer, DLSCL_SHARED)); 148 SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
144 } 149 }
145 #if 0
146 //TODO: Check administrative
147 SDL_DFB_CHECKERR(dispdata->layer->
148 SetCooperativeLevel(dispdata->layer,
149 DLSCL_ADMINISTRATIVE));
150 SDL_DFB_CHECKERR(dispdata->layer->
151 SetCursorShape(dispdata->layer, curdata->surf,
152 curdata->hotx, curdata->hoty));
153 SDL_DFB_CHECKERR(dispdata->layer->
154 SetCursorOpacity(dispdata->layer, 0xC0));
155 SDL_DFB_CHECKERR(dispdata->layer->
156 SetCooperativeLevel(dispdata->layer, DLSCL_SHARED));
157
158 #endif
159 150
160 return 0; 151 return 0;
161 error: 152 error:
162 return -1; 153 return -1;
163 } 154 }