comparison src/video/directfb/SDL_DirectFB_video.c @ 767:d9e79e31a7b7

Date: Mon, 17 Nov 2003 21:59:24 -0800 From: Pete Shinners Subject: [SDL] directfb cursor patch here is a quick and dirty patch that allows directfb to change the visibility of the cursor. this display backend still has no way to change the actual cursor shape, but being able to set the cursor visibility is a simple change that should offer some benefits. the code was largely based on the cursor code for other sdl backends. and this documentation. http://directfb.org/documentation/DirectFB_Reference/IDirectFBDisplayLayer_SetCursorOpacity.html
author Sam Lantinga <slouken@libsdl.org>
date Sun, 04 Jan 2004 15:57:16 +0000
parents 26ac9609211f
children b8d311d90021
comparison
equal deleted inserted replaced
766:ed57c876700d 767:d9e79e31a7b7
49 #include "SDL_pixels_c.h" 49 #include "SDL_pixels_c.h"
50 #include "SDL_events_c.h" 50 #include "SDL_events_c.h"
51 #include "SDL_DirectFB_video.h" 51 #include "SDL_DirectFB_video.h"
52 #include "SDL_DirectFB_events.h" 52 #include "SDL_DirectFB_events.h"
53 #include "SDL_DirectFB_yuv.h" 53 #include "SDL_DirectFB_yuv.h"
54
55 /* The implementation dependent data for the window manager cursor */
56 struct WMcursor {
57 int unused;
58 };
54 59
55 60
56 /* Initialization/Query functions */ 61 /* Initialization/Query functions */
57 static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat); 62 static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat);
58 static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); 63 static SDL_Rect **DirectFB_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
71 static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, 76 static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
72 SDL_Surface *dst, SDL_Rect *dstrect); 77 SDL_Surface *dst, SDL_Rect *dstrect);
73 static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key); 78 static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
74 static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha); 79 static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
75 static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface); 80 static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface);
81 static int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor);
76 82
77 /* Various screen update functions available */ 83 /* Various screen update functions available */
78 static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); 84 static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
79 static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects); 85 static void DirectFB_WindowedUpdate(_THIS, int numrects, SDL_Rect *rects);
80 86
137 device->SetHWAlpha = DirectFB_SetHWAlpha; 143 device->SetHWAlpha = DirectFB_SetHWAlpha;
138 device->LockHWSurface = DirectFB_LockHWSurface; 144 device->LockHWSurface = DirectFB_LockHWSurface;
139 device->UnlockHWSurface = DirectFB_UnlockHWSurface; 145 device->UnlockHWSurface = DirectFB_UnlockHWSurface;
140 device->FlipHWSurface = DirectFB_FlipHWSurface; 146 device->FlipHWSurface = DirectFB_FlipHWSurface;
141 device->FreeHWSurface = DirectFB_FreeHWSurface; 147 device->FreeHWSurface = DirectFB_FreeHWSurface;
148 device->ShowWMCursor = DirectFB_ShowWMCursor;
142 device->SetCaption = NULL; 149 device->SetCaption = NULL;
143 device->SetIcon = NULL; 150 device->SetIcon = NULL;
144 device->IconifyWindow = NULL; 151 device->IconifyWindow = NULL;
145 device->GrabInput = NULL; 152 device->GrabInput = NULL;
146 device->GetWMInfo = NULL; 153 device->GetWMInfo = NULL;
1141 enumlist = NULL; 1148 enumlist = NULL;
1142 1149
1143 HIDDEN->initialized = 0; 1150 HIDDEN->initialized = 0;
1144 } 1151 }
1145 1152
1153
1154 int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor)
1155 {
1156 /* We can only hide or show the default cursor */
1157 if ( cursor == NULL )
1158 {
1159 SetCursorOpacity(HIDDEN->layer, 0);
1160 }
1161 else
1162 {
1163 SetCursorOpacity(HIDDEN->layer, 256);
1164 }
1165 return 1;
1166 }
1167
1146 void DirectFB_FinalQuit(void) 1168 void DirectFB_FinalQuit(void)
1147 { 1169 {
1148 } 1170 }