Test program at:
http://rtfm.insomnia.org/~qg/animatedcursor.exe
Probably doesn't support all the possible animated cursors supported under windows, and correct timing of animation hasn't been attempted.
Trent
Hi Trent, thanks for the patch. Generally cc'ing wine-devel isn't necessary unless you have a specific question.
+// functions for decoding animated cursors
No C++-style comments, please.
+ //DWORD form = *(DWORD*)chunk->ckData;
Dead code should be omitted rather than commented out.
+ANIHEADER *anih = NULL; +LPBYTE *ani_frames = NULL; +DWORD ani_frame_idx = 0;
These should be static (and initializing them to 0/NULL is unnecessary.)
+ switch(chunk->ckID) { + case 0x46464952: // RIFF + {
This indenting style doesn't match the rest of the file.
+ if (anih) {
Nor does this.
+void decodeAnimatedCursor(LPBYTE data, DWORD size, LPBYTE **frames, DWORD *nFrames)
This should be static, as should:
+BOOL isAnimatedCursor(LPBYTE bits)
--Juan
On 27/08/07, Trent Waddington trent.waddington@gmail.com wrote:
+ANIHEADER *anih = NULL; +LPBYTE *ani_frames = NULL; +DWORD ani_frame_idx = 0;
I don't think you want to be using global variables for that.
USER_Driver->pSetCursor( (CURSORICONINFO*)GlobalLock16(HCURSOR_16(hCursor)) );
CURSORICONINFO *info = (CURSORICONINFO*)GlobalLock16(HCURSOR_16(hCursor));
if (info->hNext && !animate_timer_started) {
animate_timer_started = TRUE;
SetTimer(NULL, 0, 55, animate_cursor);
}
USER_Driver->pSetCursor( info );
You should use the timing and frame sequence info from the .ani. Also, Xcursor actually supports proper animated cursors, so it would be better to handle the animation in winex11.drv
@@ -156,6 +156,7 @@ typedef struct tagCURSORICONINFO WORD nWidthBytes; BYTE bPlanes; BYTE bBitsPerPixel;
- HICON16 hNext;
} CURSORICONINFO;
As explained in the comment at the top of cursoricon.c, you can't do that, because it will break win16 applications.