Commit e776f3cc authored by Erich Hoover's avatar Erich Hoover Committed by Alexandre Julliard

user32: Implement semi-stub of GetCursorFrameInfo.

parent 7b0ab606
......@@ -101,7 +101,7 @@ struct cursoricon_object
UINT height;
POINT hotspot;
UINT num_frames; /* number of frames in the icon/cursor */
UINT ms_delay; /* delay between frames (in milliseconds) */
UINT delay; /* delay between frames (in jiffies) */
struct cursoricon_frame frames[1]; /* icon frame information */
};
......@@ -111,6 +111,7 @@ static HICON alloc_icon_handle( UINT num_frames )
FIELD_OFFSET( struct cursoricon_object, frames[num_frames] ));
if (!obj) return 0;
obj->delay = 0;
obj->num_frames = num_frames;
return alloc_user_handle( &obj->obj, USER_ICON );
}
......@@ -1027,8 +1028,8 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
info = get_icon_ptr( cursor );
info->is_icon = FALSE;
/* The .ANI stores the display rate in 1/60s, we store the delay between frames in ms */
info->ms_delay = (100 * header.display_rate) / 6;
/* The .ANI stores the display rate in jiffies (1/60s) */
info->delay = header.display_rate;
icon_chunk = fram_chunk.data;
icon_data = fram_chunk.data + (2 * sizeof(DWORD));
......@@ -1084,7 +1085,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
if (info->frames[i].alpha) DeleteObject( info->frames[i].alpha );
}
info->num_frames = 1;
info->ms_delay = 0;
info->delay = 0;
}
info->width = header.width;
info->height = header.height;
......@@ -1697,6 +1698,40 @@ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name)
}
/**********************************************************************
* GetCursorFrameInfo (USER32.@)
*/
HCURSOR WINAPI GetCursorFrameInfo(HCURSOR hCursor, DWORD unk1, DWORD rate_index_num, DWORD *rate_jiffies, DWORD *is_static)
{
struct cursoricon_object *ptr;
HCURSOR ret = 0;
if (rate_jiffies == NULL || is_static == NULL) return 0;
if (!(ptr = get_icon_ptr( hCursor ))) return 0;
FIXME("semi-stub! %p => %d %d %p %p\n", hCursor, unk1, rate_index_num, rate_jiffies, is_static);
if (ptr->num_frames == 1 || rate_index_num == 0)
{
ret = hCursor;
if (ptr->num_frames == 1)
{
*rate_jiffies = 0;
*is_static = 1;
}
else
{
*is_static = ~0;
*rate_jiffies = ptr->delay;
}
}
release_icon_ptr( hCursor, ptr );
return ret;
}
/**********************************************************************
* GetIconInfo (USER32.@)
*/
BOOL WINAPI GetIconInfo(HICON hIcon, PICONINFO iconinfo)
......
......@@ -272,7 +272,7 @@
@ stdcall GetClipboardViewer()
@ stdcall GetComboBoxInfo(long ptr)
@ stdcall GetCursor()
# @ stub GetCursorFrameInfo
@ stdcall GetCursorFrameInfo(long long long ptr ptr)
@ stdcall GetCursorInfo(ptr)
@ stdcall GetCursorPos(ptr)
@ stdcall GetDC(long)
......
......@@ -4646,6 +4646,7 @@ WINUSERAPI BOOL WINAPI GetClipCursor(LPRECT);
WINUSERAPI BOOL WINAPI GetComboBoxInfo(HWND,PCOMBOBOXINFO);
WINUSERAPI HCURSOR WINAPI GetCursor(void);
WINUSERAPI BOOL WINAPI GetCursorInfo(PCURSORINFO);
WINUSERAPI HCURSOR WINAPI GetCursorFrameInfo(HCURSOR,DWORD,DWORD,DWORD*,DWORD*);
WINUSERAPI BOOL WINAPI GetCursorPos(LPPOINT);
WINUSERAPI HDC WINAPI GetDC(HWND);
WINUSERAPI HDC WINAPI GetDCEx(HWND,HRGN,DWORD);
......
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