From a9f23d0bcacda846aa0978163cd0de2d64a991ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9=20van=20Geldorp?= Date: Sun, 16 Nov 2003 12:36:24 +0000 Subject: [PATCH] - Fix problems with non-zero cursor hotspots - Add auto dependency tracking to vga ddi driver - Changes for w32api svn path=/trunk/; revision=6658 --- reactos/drivers/dd/vga/display/.cvsignore | 1 + .../drivers/dd/vga/display/main/.cvsignore | 1 + reactos/drivers/dd/vga/display/main/enable.c | 18 +-- reactos/drivers/dd/vga/display/makefile | 6 +- .../drivers/dd/vga/display/objects/.cvsignore | 1 + .../drivers/dd/vga/display/objects/bitblt.c | 42 +++--- .../drivers/dd/vga/display/objects/copybits.c | 12 +- .../drivers/dd/vga/display/objects/lineto.c | 10 +- .../drivers/dd/vga/display/objects/pointer.c | 126 ++++++++++-------- .../drivers/dd/vga/display/objects/transblt.c | 12 +- reactos/drivers/dd/vga/display/vgaddi.h | 2 +- .../dd/vga/display/vgavideo/.cvsignore | 1 + .../dd/vga/display/vgavideo/vgavideo.c | 3 +- .../dd/vga/display/vgavideo/vgavideo.h | 2 +- reactos/include/ddk/winddi.h | 6 +- reactos/subsys/win32k/eng/mouse.c | 9 +- 16 files changed, 140 insertions(+), 112 deletions(-) diff --git a/reactos/drivers/dd/vga/display/.cvsignore b/reactos/drivers/dd/vga/display/.cvsignore index d8ac7efac4b..36574fe6c63 100644 --- a/reactos/drivers/dd/vga/display/.cvsignore +++ b/reactos/drivers/dd/vga/display/.cvsignore @@ -4,3 +4,4 @@ vgaddi.coff *.dll *.map *.tmp +.*.d diff --git a/reactos/drivers/dd/vga/display/main/.cvsignore b/reactos/drivers/dd/vga/display/main/.cvsignore index ecc3f45a042..0abd2c98ac8 100644 --- a/reactos/drivers/dd/vga/display/main/.cvsignore +++ b/reactos/drivers/dd/vga/display/main/.cvsignore @@ -1,2 +1,3 @@ *.o *.map +.*.d diff --git a/reactos/drivers/dd/vga/display/main/enable.c b/reactos/drivers/dd/vga/display/main/enable.c index fd5f8e86071..d044924157b 100644 --- a/reactos/drivers/dd/vga/display/main/enable.c +++ b/reactos/drivers/dd/vga/display/main/enable.c @@ -1,9 +1,9 @@ /* * entry.c * - * $Revision: 1.29 $ - * $Author: weiden $ - * $Date: 2003/11/14 17:13:25 $ + * $Revision: 1.30 $ + * $Author: gvg $ + * $Date: 2003/11/16 12:36:24 $ * */ @@ -196,7 +196,7 @@ DrvEnableDriver(IN ULONG EngineVersion, DriveEnableData->pdrvfn = FuncList; DriveEnableData->c = sizeof(FuncList) / sizeof(DRVFN); - DriveEnableData->iDriverVersion = DDI_DRIVER_VERSION; + DriveEnableData->iDriverVersion = DDI_DRIVER_VERSION_NT4; return TRUE; } @@ -229,9 +229,9 @@ DrvDisableDriver(VOID) // IN ULONG PatternCount number of patterns expected // OUT HSURF * SurfPatterns array to contain pattern handles // IN ULONG GDIInfoSize the size of the GDIInfo object passed in -// OUT GDIINFO * GDIInfo GDI Info object +// OUT ULONG * GDIInfo GDI Info object // IN ULONG DevInfoSize the size of the DevInfo object passed in -// OUT DEVINFO * DevInfo Device Info object +// OUT ULONG * DevInfo Device Info object // IN LPWSTR DevDataFile ignore // IN LPWSTR DeviceName Device name // IN HANDLE Driver handle to KM driver @@ -244,10 +244,10 @@ DrvEnablePDEV(IN DEVMODEW *DM, IN ULONG PatternCount, OUT HSURF *SurfPatterns, IN ULONG GDIInfoSize, - OUT GDIINFO *GDIInfo, + OUT ULONG *GDIInfo, IN ULONG DevInfoSize, OUT DEVINFO *DevInfo, - IN LPWSTR DevDataFile, + IN HDEV Dev, IN LPWSTR DeviceName, IN HANDLE Driver) { @@ -283,7 +283,7 @@ DrvEnablePDEV(IN DEVMODEW *DM, } memcpy(DevInfo, &devinfoVGA, DevInfoSize); - return(PDev); + return (DHPDEV) PDev; } diff --git a/reactos/drivers/dd/vga/display/makefile b/reactos/drivers/dd/vga/display/makefile index 835237d8eb8..adfde556e16 100644 --- a/reactos/drivers/dd/vga/display/makefile +++ b/reactos/drivers/dd/vga/display/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.21 2003/11/14 17:13:25 weiden Exp $ +# $Id: makefile,v 1.22 2003/11/16 12:36:23 gvg Exp $ PATH_TO_TOP = ../../../.. @@ -40,4 +40,8 @@ include $(PATH_TO_TOP)/rules.mak include $(TOOLS_PATH)/helper.mk +# Automatic dependency tracking +DEP_OBJECTS := $(TARGET_OBJECTS) +include $(PATH_TO_TOP)/tools/depend.mk + # EOF diff --git a/reactos/drivers/dd/vga/display/objects/.cvsignore b/reactos/drivers/dd/vga/display/objects/.cvsignore index ecc3f45a042..0abd2c98ac8 100644 --- a/reactos/drivers/dd/vga/display/objects/.cvsignore +++ b/reactos/drivers/dd/vga/display/objects/.cvsignore @@ -1,2 +1,3 @@ *.o *.map +.*.d diff --git a/reactos/drivers/dd/vga/display/objects/bitblt.c b/reactos/drivers/dd/vga/display/objects/bitblt.c index 0fd8ee28d99..9e7868119d9 100644 --- a/reactos/drivers/dd/vga/display/objects/bitblt.c +++ b/reactos/drivers/dd/vga/display/objects/bitblt.c @@ -7,18 +7,18 @@ #include "bitblt.h" typedef BOOL (*PFN_VGABlt)(SURFOBJ*, SURFOBJ*, XLATEOBJ*, RECTL*, POINTL*); -typedef BOOL STDCALL (*PBLTRECTFUNC)(PSURFOBJ OutputObj, - PSURFOBJ InputObj, - PSURFOBJ Mask, - PXLATEOBJ ColorTranslation, - PRECTL OutputRect, - PPOINTL InputPoint, - PPOINTL MaskOrigin, - PBRUSHOBJ Brush, - PPOINTL BrushOrigin, +typedef BOOL STDCALL (*PBLTRECTFUNC)(SURFOBJ* OutputObj, + SURFOBJ* InputObj, + SURFOBJ* Mask, + XLATEOBJ* ColorTranslation, + RECTL* OutputRect, + POINTL* InputPoint, + POINTL* MaskOrigin, + BRUSHOBJ* Brush, + POINTL* BrushOrigin, ROP4 Rop4); -static BOOL FASTCALL VGADDI_IntersectRect(PRECTL prcDst, PRECTL prcSrc1, PRECTL prcSrc2) +static BOOL FASTCALL VGADDI_IntersectRect(RECTL* prcDst, RECTL* prcSrc1, RECTL* prcSrc2) { static const RECTL rclEmpty = { 0, 0, 0, 0 }; @@ -168,10 +168,10 @@ VGAtoVGA(SURFOBJ *Dest, SURFOBJ *Source, XLATEOBJ *ColorTranslation, } BOOL STDCALL -VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf, - PXLATEOBJ ColorTranslation, PRECT DestRect, - PPOINTL SourcePoint, PPOINTL MaskPoint, - PBRUSHOBJ Brush, PPOINTL BrushPoint, ROP4 Rop4) +VGADDI_BltBrush(SURFOBJ* Dest, SURFOBJ* Source, SURFOBJ* MaskSurf, + XLATEOBJ* ColorTranslation, RECTL* DestRect, + POINTL* SourcePoint, POINTL* MaskPoint, + BRUSHOBJ* Brush, POINTL* BrushPoint, ROP4 Rop4) { UCHAR SolidColor = 0; ULONG Left; @@ -292,9 +292,9 @@ VGADDI_BltBrush(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ MaskSurf, } BOOL STDCALL -VGADDI_BltSrc(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ Mask, - PXLATEOBJ ColorTranslation, PRECTL DestRect, PPOINTL SourcePoint, - PPOINTL MaskOrigin, PBRUSHOBJ Brush, PPOINTL BrushOrigin, ROP4 Rop4) +VGADDI_BltSrc(SURFOBJ* Dest, SURFOBJ* Source, SURFOBJ* Mask, + XLATEOBJ* ColorTranslation, RECTL* DestRect, POINTL* SourcePoint, + POINTL* MaskOrigin, BRUSHOBJ* Brush, POINTL* BrushOrigin, ROP4 Rop4) { PFN_VGABlt BltOperation; ULONG SourceType; @@ -332,10 +332,10 @@ VGADDI_BltSrc(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ Mask, } BOOL STDCALL -VGADDI_BltMask(PSURFOBJ Dest, PSURFOBJ Source, PSURFOBJ Mask, - PXLATEOBJ ColorTranslation, PRECTL DestRect, - PPOINTL SourcePoint, PPOINTL MaskPoint, BRUSHOBJ* Brush, - PPOINTL BrushPoint, ROP4 Rop4) +VGADDI_BltMask(SURFOBJ* Dest, SURFOBJ* Source, SURFOBJ* Mask, + XLATEOBJ* ColorTranslation, RECTL* DestRect, + POINTL* SourcePoint, POINTL* MaskPoint, BRUSHOBJ* Brush, + POINTL* BrushPoint, ROP4 Rop4) { LONG i, j, dx, dy, c8; BYTE *tMask, *lMask; diff --git a/reactos/drivers/dd/vga/display/objects/copybits.c b/reactos/drivers/dd/vga/display/objects/copybits.c index d3c03c5aedb..dd072b2ef47 100644 --- a/reactos/drivers/dd/vga/display/objects/copybits.c +++ b/reactos/drivers/dd/vga/display/objects/copybits.c @@ -5,12 +5,12 @@ #include BOOL STDCALL -DrvCopyBits(OUT PSURFOBJ DestObj, - IN PSURFOBJ SourceObj, - IN PCLIPOBJ ClipObj, - IN PXLATEOBJ XLateObj, - IN PRECTL DestRectL, - IN PPOINTL SrcPointL) +DrvCopyBits(OUT SURFOBJ* DestObj, + IN SURFOBJ* SourceObj, + IN CLIPOBJ* ClipObj, + IN XLATEOBJ* XLateObj, + IN RECTL* DestRectL, + IN POINTL* SrcPointL) { BOOL Done = FALSE; diff --git a/reactos/drivers/dd/vga/display/objects/lineto.c b/reactos/drivers/dd/vga/display/objects/lineto.c index 3319a4667a8..82106071c50 100644 --- a/reactos/drivers/dd/vga/display/objects/lineto.c +++ b/reactos/drivers/dd/vga/display/objects/lineto.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * - * $Id: lineto.c,v 1.16 2003/11/14 17:13:25 weiden Exp $ + * $Id: lineto.c,v 1.17 2003/11/16 12:36:24 gvg Exp $ */ #include "../vgaddi.h" @@ -26,7 +26,7 @@ * Draw a line from top-left to bottom-right */ static void FASTCALL -vgaNWtoSE(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay) +vgaNWtoSE(CLIPOBJ* Clip, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay) { int i; int error; @@ -92,7 +92,7 @@ vgaNWtoSE(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG delt } static void FASTCALL -vgaSWtoNE(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay) +vgaSWtoNE(CLIPOBJ* Clip, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay) { int i; int error; @@ -157,7 +157,7 @@ vgaSWtoNE(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG delt } static void FASTCALL -vgaNEtoSW(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay) +vgaNEtoSW(CLIPOBJ* Clip, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay) { int i; int error; @@ -222,7 +222,7 @@ vgaNEtoSW(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG delt } static void FASTCALL -vgaSEtoNW(PCLIPOBJ Clip, PBRUSHOBJ Brush, LONG x, LONG y, LONG deltax, LONG deltay) +vgaSEtoNW(CLIPOBJ* Clip, BRUSHOBJ* Brush, LONG x, LONG y, LONG deltax, LONG deltay) { int i; int error; diff --git a/reactos/drivers/dd/vga/display/objects/pointer.c b/reactos/drivers/dd/vga/display/objects/pointer.c index c75bb9313f3..d3f351176c2 100644 --- a/reactos/drivers/dd/vga/display/objects/pointer.c +++ b/reactos/drivers/dd/vga/display/objects/pointer.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: pointer.c,v 1.17 2003/11/14 17:13:25 weiden Exp $ +/* $Id: pointer.c,v 1.18 2003/11/16 12:36:24 gvg Exp $ * * PROJECT: ReactOS VGA16 display driver * FILE: drivers/dd/vga/display/objects/pointer.c @@ -30,7 +30,7 @@ /* GLOBALS *******************************************************************/ -static ULONG oldx, oldy; +static LONG oldx, oldy; static PSAVED_SCREEN_BITS ImageBehindCursor = NULL; VOID VGADDI_HideCursor(PPDEV ppdev); VOID VGADDI_ShowCursor(PPDEV ppdev); @@ -38,10 +38,10 @@ VOID VGADDI_ShowCursor(PPDEV ppdev); /* FUNCTIONS *****************************************************************/ VOID -VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, +VGADDI_BltPointerToVGA(LONG StartX, LONG StartY, ULONG SizeX, ULONG SizeY, PUCHAR MaskBits, ULONG MaskPitch, ULONG MaskOp) { - ULONG EndX, EndY; + ULONG DestX, EndX, DestY, EndY; UCHAR Mask; PUCHAR Video; PUCHAR Src; @@ -49,7 +49,10 @@ VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, ULONG i, j; ULONG Left; ULONG Length; + LONG Bits; + DestX = StartX < 0 ? 0 : StartX; + DestY = StartY < 0 ? 0 : StartY; EndX = StartX + SizeX; EndY = StartY + SizeY; @@ -61,11 +64,11 @@ VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, WRITE_PORT_UCHAR((PUCHAR)GRA_I, 3); WRITE_PORT_UCHAR((PUCHAR)GRA_D, MaskOp); - if ((StartX % 8) != 0) + if ((DestX % 8) != 0) { /* Disable writes to pixels outside of the destination rectangle. */ - Mask = (1 << (8 - (StartX % 8))) - 1; - if ((EndX - StartX) < (8 - (StartX % 8))) + Mask = (1 << (8 - (DestX % 8))) - 1; + if ((EndX - DestX) < (8 - (DestX % 8))) { Mask &= ~((1 << (8 - (EndX % 8))) - 1); } @@ -73,12 +76,12 @@ VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, WRITE_PORT_UCHAR((PUCHAR)GRA_D, Mask); /* Write the mask. */ - Video = (PUCHAR)vidmem + StartY * 80 + (StartX >> 3); - Src = MaskBits + SizeY * MaskPitch; - for (i = 0; i < SizeY; i++, Video+=80) + Video = (PUCHAR)vidmem + DestY * 80 + (DestX >> 3); + Src = MaskBits + (SizeY - (DestY - StartY)) * MaskPitch; + for (i = DestY; i < EndY; i++, Video += 80) { Src -= MaskPitch; - SrcValue = (*Src) >> (StartX % 8); + SrcValue = (*Src) >> (DestX % 8); (VOID)READ_REGISTER_UCHAR(Video); WRITE_REGISTER_UCHAR(Video, SrcValue); } @@ -89,24 +92,30 @@ VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, WRITE_PORT_UCHAR((PUCHAR)GRA_D, 0xFF); /* Have we finished. */ - if ((EndX - StartX) < (8 - (StartX % 8))) + if ((EndX - DestX) < (8 - (DestX % 8))) { return; } /* Fill any whole rows of eight pixels. */ - Left = (StartX + 7) & ~0x7; + Left = (DestX + 7) & ~0x7; Length = (EndX >> 3) - (Left >> 3); - for (i = StartY; i < EndY; i++) + Bits = StartX; + while (Bits < 0) + { + Bits += 8; + } + Bits = Bits % 8; + for (i = DestY; i < EndY; i++) { Video = (PUCHAR)vidmem + i * 80 + (Left >> 3); - Src = MaskBits + (EndY - i - 1) * MaskPitch; + Src = MaskBits + (EndY - i - 1) * MaskPitch + ((DestX - StartX) >> 3); for (j = 0; j < Length; j++, Video++, Src++) { - if ((StartX % 8) != 0) + if (Bits != 0) { - SrcValue = (Src[0] << (8 - (StartX % 8))); - SrcValue |= (Src[1] >> (StartX % 8)); + SrcValue = (Src[0] << (8 - Bits)); + SrcValue |= (Src[1] >> Bits); } else { @@ -125,12 +134,12 @@ VGADDI_BltPointerToVGA(ULONG StartX, ULONG StartY, ULONG SizeX, WRITE_PORT_UCHAR((PUCHAR)GRA_I, 0x8); WRITE_PORT_UCHAR((PUCHAR)GRA_D, Mask); - Video = (PUCHAR)vidmem + StartY * 80 + (EndX >> 3); - Src = MaskBits + SizeY * MaskPitch + (SizeX >> 3) - 1; - for (i = StartY; i < EndY; i++, Video+=80) + Video = (PUCHAR)vidmem + DestY * 80 + (EndX >> 3); + Src = MaskBits + (SizeY - (DestY - StartY)) * MaskPitch + (SizeX >> 3) - 1; + for (i = DestY; i < EndY; i++, Video+=80) { Src -= MaskPitch; - SrcValue = (Src[0] << (8 - (StartX % 8))); + SrcValue = (Src[0] << (8 - Bits)); (VOID)READ_REGISTER_UCHAR(Video); WRITE_REGISTER_UCHAR(Video, SrcValue); } @@ -177,16 +186,16 @@ BOOL InitPointer(PPDEV ppdev) return(TRUE); } - VOID STDCALL -DrvMovePointer(IN PSURFOBJ pso, +DrvMovePointer(IN SURFOBJ* pso, IN LONG x, IN LONG y, IN PRECTL prcl) { PPDEV ppdev = (PPDEV)pso->dhpdev; - if (x < 0 ) + + if (x < 0 && 0 == (ppdev->flCursor & CURSOR_DOWN)) { /* x < 0 and y < 0 indicates we must hide the cursor */ VGADDI_HideCursor(ppdev); @@ -196,7 +205,10 @@ DrvMovePointer(IN PSURFOBJ pso, ppdev->xyCursor.x = x; ppdev->xyCursor.y = y; - VGADDI_ShowCursor(ppdev); + if (0 == (ppdev->flCursor & CURSOR_DOWN)) + { + VGADDI_ShowCursor(ppdev); + } /* Give feedback on the new cursor rectangle */ /*if (prcl != NULL) ComputePointerRect(ppdev, prcl);*/ @@ -204,10 +216,10 @@ DrvMovePointer(IN PSURFOBJ pso, ULONG STDCALL -DrvSetPointerShape(PSURFOBJ pso, - PSURFOBJ psoMask, - PSURFOBJ psoColor, - PXLATEOBJ pxlo, +DrvSetPointerShape(SURFOBJ* pso, + SURFOBJ* psoMask, + SURFOBJ* psoColor, + XLATEOBJ* pxlo, LONG xHot, LONG yHot, LONG x, @@ -219,22 +231,24 @@ DrvSetPointerShape(PSURFOBJ pso, ULONG NewWidth, NewHeight; PUCHAR Src, Dest; ULONG i; - - if(!psoMask) - { - VGADDI_HideCursor(ppdev); - return SPS_ACCEPT_EXCLUDE; - } - - NewWidth = psoMask->lDelta << 3; - NewHeight = (psoMask->cjBits / psoMask->lDelta) / 2; /* Hide the cursor */ - if(ppdev->pPointerAttributes->Enable != 0) + if (ppdev->pPointerAttributes->Enable != 0 + && 0 == (ppdev->flCursor & CURSOR_DOWN)) { VGADDI_HideCursor(ppdev); } + if (! psoMask) + { + ppdev->flCursor = CURSOR_DOWN; + return SPS_ACCEPT_EXCLUDE; + } + ppdev->flCursor = ppdev->flCursor & (~ CURSOR_DOWN); + + NewWidth = psoMask->lDelta << 3; + NewHeight = (psoMask->cjBits / psoMask->lDelta) / 2; + /* Reallocate the space for the cursor if necessary. */ if (ppdev->pPointerAttributes->Width != NewWidth || ppdev->pPointerAttributes->Height != NewHeight) @@ -282,6 +296,8 @@ DrvSetPointerShape(PSURFOBJ pso, /* Set the new cursor position */ ppdev->xyCursor.x = x; ppdev->xyCursor.y = y; + ppdev->xyHotSpot.x = xHot; + ppdev->xyHotSpot.y = yHot; /* Show the cursor */ VGADDI_ShowCursor(ppdev); @@ -298,8 +314,8 @@ VGADDI_HideCursor(PPDEV ppdev) SizeX = min(((oldx + ppdev->pPointerAttributes->Width) + 7) & ~0x7, ppdev->sizeSurf.cx); SizeX -= (oldx & ~0x7); SizeY = min(ppdev->pPointerAttributes->Height, ppdev->sizeSurf.cy - oldy); - VGADDI_BltFromSavedScreenBits(oldx & ~0x7, - oldy, + VGADDI_BltFromSavedScreenBits(max(oldx, 0) & ~0x7, + max(oldy, 0), ImageBehindCursor, SizeX, SizeY); @@ -310,7 +326,7 @@ VGADDI_HideCursor(PPDEV ppdev) VOID VGADDI_ShowCursor(PPDEV ppdev) { - ULONG cx, cy; + LONG cx, cy; PUCHAR AndMask, XorMask; ULONG SizeX, SizeY; @@ -320,8 +336,8 @@ VGADDI_ShowCursor(PPDEV ppdev) } /* Capture pixels behind the cursor */ - cx = ppdev->xyCursor.x; - cy = ppdev->xyCursor.y; + cx = ppdev->xyCursor.x - ppdev->xyHotSpot.x; + cy = ppdev->xyCursor.y - ppdev->xyHotSpot.y; /* Used to repaint background */ SizeX = min(((cx + ppdev->pPointerAttributes->Width) + 7) & ~0x7, ppdev->sizeSurf.cx); @@ -329,18 +345,18 @@ VGADDI_ShowCursor(PPDEV ppdev) SizeY = min(ppdev->pPointerAttributes->Height, ppdev->sizeSurf.cy - cy); VGADDI_BltToSavedScreenBits(ImageBehindCursor, - cx & ~0x7, - cy, + max(cx, 0) & ~0x7, + max(cy, 0), SizeX, SizeY); /* Display the cursor. */ - SizeX = min(ppdev->pPointerAttributes->Width, ppdev->sizeSurf.cx - ppdev->xyCursor.x); - SizeY = min(ppdev->pPointerAttributes->Height, ppdev->sizeSurf.cy - ppdev->xyCursor.y); + SizeX = min(ppdev->pPointerAttributes->Width, ppdev->sizeSurf.cx - cx); + SizeY = min(ppdev->pPointerAttributes->Height, ppdev->sizeSurf.cy - cy); AndMask = ppdev->pPointerAttributes->Pixels + (ppdev->pPointerAttributes->Height - SizeY) * ppdev->pPointerAttributes->WidthInBytes; - VGADDI_BltPointerToVGA(ppdev->xyCursor.x, - ppdev->xyCursor.y, + VGADDI_BltPointerToVGA(cx, + cy, SizeX, SizeY, AndMask, @@ -349,8 +365,8 @@ VGADDI_ShowCursor(PPDEV ppdev) XorMask = AndMask + ppdev->pPointerAttributes->WidthInBytes * ppdev->pPointerAttributes->Height; - VGADDI_BltPointerToVGA(ppdev->xyCursor.x, - ppdev->xyCursor.y, + VGADDI_BltPointerToVGA(cx, + cy, SizeX, SizeY, XorMask, @@ -358,8 +374,8 @@ VGADDI_ShowCursor(PPDEV ppdev) VGA_XOR); /* Save the new cursor location. */ - oldx = ppdev->xyCursor.x; - oldy = ppdev->xyCursor.y; + oldx = cx; + oldy = cy; /* Mark the cursor as currently displayed. */ ppdev->pPointerAttributes->Enable = 1; diff --git a/reactos/drivers/dd/vga/display/objects/transblt.c b/reactos/drivers/dd/vga/display/objects/transblt.c index f4f8fd203e3..25eb5fc0c2b 100644 --- a/reactos/drivers/dd/vga/display/objects/transblt.c +++ b/reactos/drivers/dd/vga/display/objects/transblt.c @@ -7,12 +7,12 @@ #include "bitblt.h" BOOL STDCALL -DrvTransparentBlt(PSURFOBJ Dest, - PSURFOBJ Source, - PCLIPOBJ Clip, - PXLATEOBJ ColorTranslation, - PRECTL DestRect, - PRECTL SourceRect, +DrvTransparentBlt(SURFOBJ* Dest, + SURFOBJ* Source, + CLIPOBJ* Clip, + XLATEOBJ* ColorTranslation, + RECTL* DestRect, + RECTL* SourceRect, ULONG TransparentColor, ULONG Reserved) { diff --git a/reactos/drivers/dd/vga/display/vgaddi.h b/reactos/drivers/dd/vga/display/vgaddi.h index 4610d35358a..1a00de0b7a1 100644 --- a/reactos/drivers/dd/vga/display/vgaddi.h +++ b/reactos/drivers/dd/vga/display/vgaddi.h @@ -10,7 +10,6 @@ #define POW2(stride) (!((stride) & ((stride)-1))) // TRUE if stride is power of 2 #define BROKEN_RASTERS(stride,cy) ((!(POW2(stride))) && ((stride*cy) > 0x10000)) -#define DM_SPECVERSION 1 // FIXME: What is this really? #define ENUM_RECT_LIMIT 50 typedef struct _RECT_ENUM @@ -45,6 +44,7 @@ typedef struct _PDEV // Cursor XYPAIR xyCursor; // cursor position + XYPAIR xyHotSpot; // cursor hotspot POINTL ptlExtent; // cursor extent ULONG cExtent; // effective cursor extent ULONG flCursor; // cursor status diff --git a/reactos/drivers/dd/vga/display/vgavideo/.cvsignore b/reactos/drivers/dd/vga/display/vgavideo/.cvsignore index ecc3f45a042..0abd2c98ac8 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/.cvsignore +++ b/reactos/drivers/dd/vga/display/vgavideo/.cvsignore @@ -1,2 +1,3 @@ *.o *.map +.*.d diff --git a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c index e2a73167fb9..eb11205c2a7 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c +++ b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.c @@ -2,6 +2,7 @@ #include #include #include +#include #include "vgavideo.h" UCHAR PreCalcReverseByte[256]; @@ -569,7 +570,7 @@ void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, int St /* DIB blt to the VGA. */ -void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate) +void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, XLATEOBJ* Xlate) { PBYTE pb, opb = b; ULONG i, j; diff --git a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h index 7ecc0900832..5a49675ad8a 100644 --- a/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h +++ b/reactos/drivers/dd/vga/display/vgavideo/vgavideo.h @@ -71,5 +71,5 @@ void get_masks(int x, int w); #define mod2(n) ((n)&1) void DIB_BltFromVGA(int x, int y, int w, int h, void *b, int Dest_lDelta); void DIB_BltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, int StartMod); -void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, PXLATEOBJ Xlate); +void DIB_BltToVGAWithXlate(int x, int y, int w, int h, void *b, int Source_lDelta, XLATEOBJ* Xlate); void DIB_TransparentBltToVGA(int x, int y, int w, int h, void *b, int Source_lDelta, ULONG trans); diff --git a/reactos/include/ddk/winddi.h b/reactos/include/ddk/winddi.h index c0f6183e2bf..2f697149d32 100644 --- a/reactos/include/ddk/winddi.h +++ b/reactos/include/ddk/winddi.h @@ -34,6 +34,8 @@ typedef DWORD PTRDIFF; #endif +#define DM_SPECVERSION 0x0320 + #define DDI_DRIVER_VERSION_NT4 0x20000 #define DDI_DRIVER_VERSION_SP3 0x20003 #define DDI_DRIVER_VERSION_NT5 0x30000 @@ -1009,10 +1011,10 @@ DrvEnablePDEV(IN DEVMODEW *DM, IN ULONG PatternCount, OUT HSURF *SurfPatterns, IN ULONG GDIInfoSize, - OUT GDIINFO *GDIInfo, + OUT ULONG *GDIInfo, IN ULONG DevInfoSize, OUT DEVINFO *DevInfo, - IN LPWSTR DevDataFile, + IN HDEV Dev, IN LPWSTR DeviceName, IN HANDLE Driver); HSURF STDCALL diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index 7a057cdbe74..05472c77c3f 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mouse.c,v 1.44 2003/11/10 17:44:49 weiden Exp $ +/* $Id: mouse.c,v 1.45 2003/11/16 12:36:24 gvg Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -43,7 +43,6 @@ #define NDEBUG #include - #define GETSYSCURSOR(x) ((x) - OCR_NORMAL) /* FUNCTIONS *****************************************************************/ @@ -177,8 +176,10 @@ MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1, tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp; } - if (((CurInfo->x + Cursor->Size.cx) >= HazardX1) && (CurInfo->x <= HazardX2) && - ((CurInfo->y + Cursor->Size.cy) >= HazardY1) && (CurInfo->y <= HazardY2)) + if (CurInfo->x - (INT) Cursor->IconInfo.xHotspot + Cursor->Size.cx >= HazardX1 + && CurInfo->x - (INT) Cursor->IconInfo.xHotspot <= HazardX2 + && CurInfo->y - (INT) Cursor->IconInfo.yHotspot + Cursor->Size.cy >= HazardY1 + && CurInfo->y - (INT) Cursor->IconInfo.yHotspot <= HazardY2) { /* Mouse is not allowed to move if GDI is busy drawing */ ExAcquireFastMutexUnsafe(&CurInfo->CursorMutex);