Commit 86ec9803 authored by Sam Lantinga's avatar Sam Lantinga

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

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40768
parent 60d9c91d
...@@ -52,6 +52,11 @@ static char rcsid = ...@@ -52,6 +52,11 @@ static char rcsid =
#include "SDL_DirectFB_events.h" #include "SDL_DirectFB_events.h"
#include "SDL_DirectFB_yuv.h" #include "SDL_DirectFB_yuv.h"
/* The implementation dependent data for the window manager cursor */
struct WMcursor {
int unused;
};
/* Initialization/Query functions */ /* Initialization/Query functions */
static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat); static int DirectFB_VideoInit(_THIS, SDL_PixelFormat *vformat);
...@@ -73,6 +78,7 @@ static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect, ...@@ -73,6 +78,7 @@ static int DirectFB_HWAccelBlit(SDL_Surface *src, SDL_Rect *srcrect,
static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key); static int DirectFB_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha); static int DirectFB_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 alpha);
static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface); static int DirectFB_FlipHWSurface(_THIS, SDL_Surface *surface);
static int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor);
/* Various screen update functions available */ /* Various screen update functions available */
static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); static void DirectFB_DirectUpdate(_THIS, int numrects, SDL_Rect *rects);
...@@ -139,6 +145,7 @@ static SDL_VideoDevice *DirectFB_CreateDevice(int devindex) ...@@ -139,6 +145,7 @@ static SDL_VideoDevice *DirectFB_CreateDevice(int devindex)
device->UnlockHWSurface = DirectFB_UnlockHWSurface; device->UnlockHWSurface = DirectFB_UnlockHWSurface;
device->FlipHWSurface = DirectFB_FlipHWSurface; device->FlipHWSurface = DirectFB_FlipHWSurface;
device->FreeHWSurface = DirectFB_FreeHWSurface; device->FreeHWSurface = DirectFB_FreeHWSurface;
device->ShowWMCursor = DirectFB_ShowWMCursor;
device->SetCaption = NULL; device->SetCaption = NULL;
device->SetIcon = NULL; device->SetIcon = NULL;
device->IconifyWindow = NULL; device->IconifyWindow = NULL;
...@@ -1143,6 +1150,21 @@ void DirectFB_VideoQuit(_THIS) ...@@ -1143,6 +1150,21 @@ void DirectFB_VideoQuit(_THIS)
HIDDEN->initialized = 0; HIDDEN->initialized = 0;
} }
int DirectFB_ShowWMCursor(_THIS, WMcursor *cursor)
{
/* We can only hide or show the default cursor */
if ( cursor == NULL )
{
SetCursorOpacity(HIDDEN->layer, 0);
}
else
{
SetCursorOpacity(HIDDEN->layer, 256);
}
return 1;
}
void DirectFB_FinalQuit(void) void DirectFB_FinalQuit(void)
{ {
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment