From da316f337e6c65013b8e782e58c82bf67d56e814 Mon Sep 17 00:00:00 2001 From: Andrew Riedi Date: Sat, 24 Nov 2007 12:37:01 -0800 Subject: [PATCH] user32: Add stub load_ani_cursor(). Patch based off of Henri Verbeet's patchset. --- dlls/user32/cursoricon.c | 32 ++++++++++++++++++++++++++++++-- 1 files changed, 30 insertions(+), 2 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index d528bee..1a93eb1 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -5,6 +5,7 @@ * 1996 Martin Von Loewis * 1997 Alex Korobka * 1998 Turchanov Sergey + * 2007 Andrew Riedi * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -39,8 +40,6 @@ * the X client instead of in the server like other bitmaps; however, * some programs (notably Paint Brush) expect to be able to manipulate * the bits directly :-( - * - * FIXME: what are we going to do with animation and color (bpp > 1) cursors ?! */ #include "config.h" @@ -885,6 +884,28 @@ HICON WINAPI CreateIconFromResource( LPBYTE bits, UINT cbSize, } +/********************************************************************** + * load_ani_cursor + * + * This function loads the animated cursor into memory. + */ +static HCURSOR load_ani_cursor( const LPBYTE bits, DWORD bits_size, + INT width, INT height ) +{ + TRACE("bits: %p, bits_size: %i, width: %i, height: %i\n", + bits, bits_size, width, height); + + if (!bits) + { + ERR("Failed to find bits for .ani cursor."); + return NULL; + } + + FIXME("No support for .ani cursors.\n"); + + return NULL; +} + static HICON CURSORICON_LoadFromFile( LPCWSTR filename, INT width, INT height, INT colors, BOOL fCursor, UINT loadflags) @@ -901,6 +922,13 @@ static HICON CURSORICON_LoadFromFile( LPCWSTR filename, if (!bits) return hIcon; + /* Check for .ani. */ + if (memcmp( bits, "RIFF", 4 ) == 0) + { + hIcon = load_ani_cursor( bits, filesize, width, height ); + goto end; + } + dir = (CURSORICONFILEDIR*) bits; if ( filesize < sizeof(*dir) ) goto end; -- 1.4.4.2