Author: gschneider
Date: Wed Apr 15 01:30:03 2009
New Revision: 40510
URL: http://svn.reactos.org/svn/reactos?rev=40510&view=rev
Log:
- ICON_CreateCursorFromData should pass a header that fits to the bitmap data to SetDIBits to allow color conversion if necessary; create the color cursor if requested in the same function
- Winamp 2.95 now shows a custom cursor, but it's still surrounded by blackness, bug #4370
- Misc typo fixes, cleanup
Modified:
trunk/reactos/dll/win32/user32/windows/bitmap.c
trunk/reactos/dll/win32/user32/windows/icon.c
Modified: trunk/reactos/dll/win32/user32/windows/bitmap.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/b…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/bitmap.c [iso-8859-1] Wed Apr 15 01:30:03 2009
@@ -56,8 +56,7 @@
#include "poppack.h"
-/*forward declerations... actualy in user32\windows\icon.c but usful here****/
-HICON ICON_CreateCursorFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot);
+/* forward declerations... actually in user32\windows\icon.c but usful here */
HICON ICON_CreateIconFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot);
CURSORICONDIRENTRY *CURSORICON_FindBestIcon( CURSORICONDIR *dir, int width, int height, int colors);
CURSORICONDIRENTRY *CURSORICON_FindBestCursor( CURSORICONDIR *dir, int width, int height, int colors);
Modified: trunk/reactos/dll/win32/user32/windows/icon.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/i…
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/icon.c [iso-8859-1] Wed Apr 15 01:30:03 2009
@@ -94,9 +94,9 @@
HICON
ICON_CreateCursorFromData(HDC hDC, PVOID ImageData, ICONIMAGE* IconImage, int cxDesired, int cyDesired, int xHotspot, int yHotspot)
{
- /* FIXME - color cursors */
BYTE BitmapInfoBuffer[sizeof(BITMAPINFOHEADER) + 2 * sizeof(RGBQUAD)];
BITMAPINFO *bwBIH = (BITMAPINFO *)BitmapInfoBuffer;
+ BITMAPINFO *orgBIH = (BITMAPINFO *)IconImage;
ICONINFO IconInfo;
PVOID XORImageData = ImageData;
@@ -104,7 +104,7 @@
IconInfo.xHotspot = xHotspot;
IconInfo.yHotspot = yHotspot;
- /* Create a BITMAPINFO header for the monocrome part of the icon */
+ /* Create a BITMAPINFO header for the monochrome part of the icon */
bwBIH->bmiHeader.biBitCount = 1;
bwBIH->bmiHeader.biWidth = IconImage->icHeader.biWidth;
bwBIH->bmiHeader.biHeight = IconImage->icHeader.biHeight;
@@ -133,10 +133,24 @@
if (IconInfo.hbmMask)
{
SetDIBits(hDC, IconInfo.hbmMask, 0, IconImage->icHeader.biHeight,
- XORImageData, bwBIH, DIB_RGB_COLORS);
+ XORImageData, orgBIH, DIB_RGB_COLORS);
}
- IconInfo.hbmColor = (HBITMAP)0;
+ if (IconImage->icHeader.biBitCount == 1)
+ {
+ IconInfo.hbmColor = (HBITMAP)0;
+ }
+ else
+ {
+ /* Create the color part of the icon */
+ IconInfo.hbmColor = CreateDIBitmap(hDC, &IconImage->icHeader, 0,
+ XORImageData, orgBIH, DIB_RGB_COLORS);
+ if (IconInfo.hbmColor)
+ {
+ SetDIBits(hDC, IconInfo.hbmColor, 0, IconImage->icHeader.biHeight,
+ XORImageData, orgBIH, DIB_RGB_COLORS);
+ }
+ }
/* Create the icon based on everything we have so far */
return NtUserCreateCursorIconHandle(&IconInfo, FALSE);
Author: tkreuzer
Date: Tue Apr 14 20:41:48 2009
New Revision: 40504
URL: http://svn.reactos.org/svn/reactos?rev=40504&view=rev
Log:
Make the SURFACE structure more like the one from Windows
Modified:
trunk/reactos/subsystems/win32/win32k/include/surface.h
Modified: trunk/reactos/subsystems/win32/win32k/include/surface.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/surface.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/surface.h [iso-8859-1] Tue Apr 14 20:41:48 2009
@@ -12,20 +12,33 @@
SURFOBJ SurfObj;
FLONG flHooks;
FLONG flFlags;
- SIZE dimension; /* For SetBitmapDimension(), do NOT use
+ struct _PALETTE *ppal;
+
+ union
+ {
+ HANDLE hSecureUMPD; // if UMPD_SURFACE set
+ HANDLE hMirrorParent;// if MIRROR_SURFACE set
+ HANDLE hDDSurface; // if DIRECTDRAW_SURFACE set
+ };
+
+ SIZEL dimension; /* For SetBitmapDimension(), do NOT use
to get width/height of bitmap, use
bitmap.bmWidth/bitmap.bmHeight for
that */
- PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
- the actual bits in the bitmap */
+
+ HDC hDC; // Doc in "Undocumented Windows", page 546, seems to be supported with XP.
+ ULONG cRef; // 0x064
+ HPALETTE hpalHint;
/* For device-independent bitmaps: */
HANDLE hDIBSection;
HANDLE hSecure;
DWORD dwOffset;
+ /* reactos specific */
+ PFAST_MUTEX BitsLock; /* You need to hold this lock before you touch
+ the actual bits in the bitmap */
HPALETTE hDIBPalette;
- HDC hDC; // Doc in "Undocumented Windows", page 546, seems to be supported with XP.
DWORD dsBitfields[3]; // hack, should probably use palette instead
DWORD biClrUsed;
DWORD biClrImportant;