From e35db3408bf79e1e72fb99004848cc5eb1d9a34d Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Wed, 21 Feb 2007 16:17:34 +0800 Subject: [PATCH] user32: Add traces to the cursor APIs. --- dlls/user32/cursoricon.c | 24 ++++++++++++++++++++++-- dlls/winex11.drv/mouse.c | 6 ++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 7bbb79a8272..e17d4c6a831 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -950,6 +950,9 @@ static HICON CURSORICON_Load(HINSTANCE hInstance, LPCWSTR name, WORD wResId; DWORD dwBytesInRes; + TRACE("%p, %s, %dx%d, colors %d, fCursor %d, flags 0x%04x\n", + hInstance, debugstr_w(name), width, height, colors, fCursor, loadflags); + if ( loadflags & LR_LOADFROMFILE ) /* Load from file */ return CURSORICON_LoadFromFile( name, width, height, colors, fCursor, loadflags ); @@ -1395,6 +1398,8 @@ BOOL WINAPI DrawIcon( HDC hdc, INT x, INT y, HICON hIcon ) HBITMAP hXorBits, hAndBits; COLORREF oldFg, oldBg; + TRACE("%p, (%d,%d), %p\n", hdc, x, y, hIcon); + if (!(ptr = (CURSORICONINFO *)GlobalLock16(HICON_16(hIcon)))) return FALSE; if (!(hMemDC = CreateCompatibleDC( hdc ))) return FALSE; hAndBits = CreateBitmap( ptr->nWidth, ptr->nHeight, 1, 1, @@ -1455,7 +1460,7 @@ HCURSOR WINAPI SetCursor( HCURSOR hCursor /* [in] Handle of cursor to show */ ) HCURSOR hOldCursor; if (hCursor == thread_info->cursor) return hCursor; /* No change */ - TRACE_(cursor)("%p\n", hCursor ); + TRACE("%p\n", hCursor); hOldCursor = thread_info->cursor; thread_info->cursor = hCursor; /* Change the cursor shape only if it is visible */ @@ -1474,7 +1479,7 @@ INT WINAPI ShowCursor( BOOL bShow ) { struct user_thread_info *thread_info = get_user_thread_info(); - TRACE_(cursor)("%d, count=%d\n", bShow, thread_info->cursor_count ); + TRACE("%d, count=%d\n", bShow, thread_info->cursor_count ); if (bShow) { @@ -1664,6 +1669,8 @@ HICON16 WINAPI LoadIconHandler16( HGLOBAL16 hResource, BOOL16 bNew ) */ HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance, LPCWSTR name) { + TRACE("%p, %s\n", hInstance, debugstr_w(name)); + return LoadImageW( hInstance, name, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1673,6 +1680,8 @@ HCURSOR WINAPI LoadCursorW(HINSTANCE hInstance, LPCWSTR name) */ HCURSOR WINAPI LoadCursorA(HINSTANCE hInstance, LPCSTR name) { + TRACE("%p, %s\n", hInstance, debugstr_a(name)); + return LoadImageA( hInstance, name, IMAGE_CURSOR, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1682,6 +1691,8 @@ HCURSOR WINAPI LoadCursorA(HINSTANCE hInstance, LPCSTR name) */ HCURSOR WINAPI LoadCursorFromFileW (LPCWSTR name) { + TRACE("%s\n", debugstr_w(name)); + return LoadImageW( 0, name, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE ); } @@ -1691,6 +1702,8 @@ HCURSOR WINAPI LoadCursorFromFileW (LPCWSTR name) */ HCURSOR WINAPI LoadCursorFromFileA (LPCSTR name) { + TRACE("%s\n", debugstr_a(name)); + return LoadImageA( 0, name, IMAGE_CURSOR, 0, 0, LR_LOADFROMFILE | LR_DEFAULTSIZE ); } @@ -1700,6 +1713,8 @@ HCURSOR WINAPI LoadCursorFromFileA (LPCSTR name) */ HICON WINAPI LoadIconW(HINSTANCE hInstance, LPCWSTR name) { + TRACE("%p, %s\n", hInstance, debugstr_w(name)); + return LoadImageW( hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1709,6 +1724,8 @@ HICON WINAPI LoadIconW(HINSTANCE hInstance, LPCWSTR name) */ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name) { + TRACE("%p, %s\n", hInstance, debugstr_a(name)); + return LoadImageA( hInstance, name, IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE ); } @@ -1725,6 +1742,9 @@ BOOL WINAPI GetIconInfo(HICON hIcon, PICONINFO iconinfo) if (!ciconinfo) return FALSE; + TRACE("%p => %dx%d, %d bpp\n", hIcon, + ciconinfo->nWidth, ciconinfo->nHeight, ciconinfo->bBitsPerPixel); + if ( (ciconinfo->ptHotSpot.x == ICON_HOTSPOT) && (ciconinfo->ptHotSpot.y == ICON_HOTSPOT) ) { diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c index 069333a689e..1016c697127 100644 --- a/dlls/winex11.drv/mouse.c +++ b/dlls/winex11.drv/mouse.c @@ -649,6 +649,12 @@ void X11DRV_SetCursor( CURSORICONINFO *lpCursor ) { Cursor cursor; + if (lpCursor) + TRACE("%ux%u, planes %u, bpp %u\n", + lpCursor->nWidth, lpCursor->nHeight, lpCursor->bPlanes, lpCursor->bBitsPerPixel); + else + TRACE("NULL\n"); + if (root_window != DefaultRootWindow(gdi_display)) { /* If in desktop mode, set the cursor on the desktop window */