psurfSource = CONTAINING_RECORD(psoSource, SURFACE, SurfObj);
SURFACE_LockBitmapBits(psurfSource);
- MouseSafetyOnDrawStart(psoSource, SourcePoint->x, SourcePoint->y,
- (SourcePoint->x + abs(DestRect->right - DestRect->left)),
- (SourcePoint->y + abs(DestRect->bottom - DestRect->top)));
psurfDest = CONTAINING_RECORD(psoDest, SURFACE, SurfObj);
if (psoDest != psoSource)
SURFACE_LockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawStart(psoDest, DestRect->left, DestRect->top, DestRect->right, DestRect->bottom);
-
// FIXME: Don't punt to the driver's DrvCopyBits immediately. Instead,
// mark the copy block function to be DrvCopyBits instead of the
// GDI's copy bit function so as to remove clipping from the
ret = GDIDEVFUNCS(psoDest).CopyBits(
psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint);
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return ret;
ret = GDIDEVFUNCS(psoSource).CopyBits(
psoDest, psoSource, Clip, ColorTranslation, DestRect, SourcePoint);
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return ret;
NULL, Clip, ColorTranslation, DestRect, SourcePoint,
NULL, NULL, NULL, ROP3_TO_ROP4(SRCCOPY));
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return ret;
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return(TRUE);
DibFunctionsForBitmapFormat[psoDest->iBitmapFormat].DIB_BitBltSrcCopy(&BltInfo);
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return(TRUE);
} while(EnumMore);
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return(TRUE);
}
- MouseSafetyOnDrawEnd(psoDest);
if (psoDest != psoSource)
{
SURFACE_UnlockBitmapBits(psurfDest);
}
- MouseSafetyOnDrawEnd(psoSource);
SURFACE_UnlockBitmapBits(psurfSource);
return FALSE;
}
+BOOL APIENTRY
+IntEngCopyBits(
+ SURFOBJ *psoDest,
+ SURFOBJ *psoSource,
+ CLIPOBJ *pco,
+ XLATEOBJ *pxlo,
+ RECTL *prclDest,
+ POINTL *ptlSource)
+{
+ BOOL bResult;
+
+ MouseSafetyOnDrawStart(psoSource, ptlSource->x, ptlSource->y,
+ (ptlSource->x + abs(prclDest->right - prclDest->left)),
+ (ptlSource->y + abs(prclDest->bottom - prclDest->top)));
+
+ MouseSafetyOnDrawStart(psoDest, prclDest->left, prclDest->top, prclDest->right, prclDest->bottom);
+
+ bResult = EngCopyBits(psoDest, psoSource, pco, pxlo, prclDest, ptlSource);
+
+ MouseSafetyOnDrawEnd(psoDest);
+ MouseSafetyOnDrawEnd(psoSource);
+
+ return bResult;
+}
+
+
/* EOF */
* PURPOSE: Mouse pointer functions
* FILE: subsystems/win32k/eng/mouse.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
+ * Timo Kreuzer (timo.kreuzer@reactos.org)
* REVISION HISTORY:
* 06-06-2001 CSH Created
*/
*/
INT INTERNAL_CALL
MouseSafetyOnDrawStart(
- SURFOBJ *SurfObj,
+ SURFOBJ *pso,
LONG HazardX1,
LONG HazardY1,
LONG HazardX2,
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
- ASSERT(SurfObj != NULL);
+ ASSERT(pso != NULL);
- ppdev = GDIDEV(SurfObj);
+ ppdev = GDIDEV(pso);
if (ppdev == NULL)
{
- return(FALSE);
+ return FALSE;
}
pgp = &ppdev->Pointer;
- if (SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
- pgp->Exclude.right == -1)
+ if (pgp->Exclude.right == -1)
{
- return(FALSE);
+ return FALSE;
+ }
+
+ ppdev->SafetyRemoveCount++;
+
+ if (ppdev->SafetyRemoveLevel != 0)
+ {
+ return FALSE;
}
if (HazardX1 > HazardX2)
HazardY1 = tmp;
}
- if (ppdev->SafetyRemoveLevel != 0)
- {
- ppdev->SafetyRemoveCount++;
- return FALSE;
- }
-
- ppdev->SafetyRemoveCount++;
-
if (pgp->Exclude.right >= HazardX1
&& pgp->Exclude.left <= HazardX2
&& pgp->Exclude.bottom >= HazardY1
&& pgp->Exclude.top <= HazardY2)
{
ppdev->SafetyRemoveLevel = ppdev->SafetyRemoveCount;
- if (pgp->MovePointer)
- pgp->MovePointer(SurfObj, -1, -1, NULL);
- else
- EngMovePointer(SurfObj, -1, -1, NULL);
+ ppdev->pfnMovePointer(pso, -1, -1, NULL);
}
return(TRUE);
*/
INT INTERNAL_CALL
MouseSafetyOnDrawEnd(
- SURFOBJ *SurfObj)
+ SURFOBJ *pso)
{
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
- ASSERT(SurfObj != NULL);
+ ASSERT(pso != NULL);
- ppdev = GDIDEV(SurfObj);
+ ppdev = (PDEVOBJ*)pso->hdev;
if (ppdev == NULL)
{
pgp = &ppdev->Pointer;
- if (SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
- pgp->Exclude.right == -1)
+ if (pgp->Exclude.right == -1)
{
return FALSE;
}
{
return FALSE;
}
- if (pgp->MovePointer)
- pgp->MovePointer(SurfObj, gpsi->ptCursor.x, gpsi->ptCursor.y, &pgp->Exclude);
- else
- EngMovePointer(SurfObj, gpsi->ptCursor.x, gpsi->ptCursor.y, &pgp->Exclude);
+
+ ppdev->pfnMovePointer(pso, gpsi->ptCursor.x, gpsi->ptCursor.y, &pgp->Exclude);
ppdev->SafetyRemoveLevel = 0;
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
-VOID INTERNAL_CALL
+VOID
+INTERNAL_CALL
IntHideMousePointer(
PDEVOBJ *ppdev,
SURFOBJ *psoDest)
{
GDIPOINTER *pgp;
POINTL pt;
+ RECTL rclDest;
+ POINTL ptlSave;
ASSERT(ppdev);
ASSERT(psoDest);
/* The mouse is hide from ShowCours and it is frist ?? */
if (pgp->ShowPointer < 0)
{
- return ;
+ return;
}
- /* Hide the cours */
- pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
- pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
-
-
- if (pgp->SaveSurface != NULL)
+ if (!pgp->psurfSave)
{
- RECTL DestRect;
- POINTL SrcPoint;
- SURFOBJ *SaveSurface;
- SURFOBJ *MaskSurface;
-
- DestRect.left = max(pt.x, 0);
- DestRect.top = max(pt.y, 0);
- DestRect.right = min(
- pt.x + pgp->Size.cx,
- psoDest->sizlBitmap.cx);
- DestRect.bottom = min(
- pt.y + pgp->Size.cy,
- psoDest->sizlBitmap.cy);
-
- SrcPoint.x = max(-pt.x, 0);
- SrcPoint.y = max(-pt.y, 0);
-
- if ((SaveSurface = EngLockSurface(pgp->SaveSurface)))
- {
- if ((MaskSurface = EngLockSurface(pgp->MaskSurface)))
- {
- IntEngBitBltEx(psoDest, SaveSurface, MaskSurface, NULL, NULL,
- &DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
- ROP3_TO_ROP4(SRCCOPY), FALSE);
- EngUnlockSurface(MaskSurface);
- }
- EngUnlockSurface(SaveSurface);
- }
+ DPRINT1("No SaveSurface!\n");
+ return;
}
+
+ /* Calculate cursor coordinates */
+ pt.x = ppdev->ptlPointer.x - pgp->HotSpot.x;
+ pt.y = ppdev->ptlPointer.y - pgp->HotSpot.y;
+
+ rclDest.left = max(pt.x, 0);
+ rclDest.top = max(pt.y, 0);
+ rclDest.right = min(pt.x + pgp->Size.cx, psoDest->sizlBitmap.cx);
+ rclDest.bottom = min(pt.y + pgp->Size.cy, psoDest->sizlBitmap.cy);
+
+ ptlSave.x = rclDest.left - pt.x;
+ ptlSave.y = rclDest.top - pt.y;
+
+ IntEngBitBltEx(psoDest,
+ &pgp->psurfSave->SurfObj,
+ NULL,
+ NULL,
+ NULL,
+ &rclDest,
+ &ptlSave,
+ &ptlSave,
+ NULL,
+ NULL,
+ ROP3_TO_ROP4(SRCCOPY),
+ FALSE);
}
-VOID INTERNAL_CALL
+VOID
+INTERNAL_CALL
IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
{
GDIPOINTER *pgp;
- SURFOBJ *SaveSurface;
POINTL pt;
+ RECTL rclSurf, rclPointer;
ASSERT(ppdev);
ASSERT(psoDest);
pgp->Enabled = TRUE;
- /* Do not blt the mouse if it in hide */
+ /* Do not blt the pointer, if it is hidden */
if (pgp->ShowPointer < 0)
{
return ;
}
- pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
- pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
+ /* Calculate pointer coordinates */
+ pt.x = ppdev->ptlPointer.x - pgp->HotSpot.x;
+ pt.y = ppdev->ptlPointer.y - pgp->HotSpot.y;
- /* Copy the pixels under the cursor to temporary surface. */
- if (pgp->SaveSurface != NULL &&
- (SaveSurface = EngLockSurface(pgp->SaveSurface)))
- {
- RECTL DestRect;
- POINTL SrcPoint;
-
- SrcPoint.x = max(pt.x, 0);
- SrcPoint.y = max(pt.y, 0);
-
- DestRect.left = SrcPoint.x - pt.x;
- DestRect.top = SrcPoint.y - pt.y;
- DestRect.right = min(
- pgp->Size.cx,
- psoDest->sizlBitmap.cx - pt.x);
- DestRect.bottom = min(
- pgp->Size.cy,
- psoDest->sizlBitmap.cy - pt.y);
-
- IntEngBitBltEx(SaveSurface, psoDest, NULL, NULL, NULL,
- &DestRect, &SrcPoint, NULL, NULL, NULL,
- ROP3_TO_ROP4(SRCCOPY), FALSE);
- EngUnlockSurface(SaveSurface);
- }
+ /* Calculate the rect on the surface */
+ rclSurf.left = max(pt.x, 0);
+ rclSurf.top = max(pt.y, 0);
+ rclSurf.right = min(pt.x + pgp->Size.cx, psoDest->sizlBitmap.cx);
+ rclSurf.bottom = min(pt.y + pgp->Size.cy, psoDest->sizlBitmap.cy);
+ /* Calculate the rect in the pointer bitmap */
+ rclPointer.left = rclSurf.left - pt.x;
+ rclPointer.top = rclSurf.top - pt.y;
+ rclPointer.right = min(pgp->Size.cx, psoDest->sizlBitmap.cx - pt.x);
+ rclPointer.bottom = min(pgp->Size.cy, psoDest->sizlBitmap.cy - pt.y);
- /* Blit the cursor on the screen. */
+ /* Copy the pixels under the cursor to temporary surface. */
+ IntEngBitBltEx(&pgp->psurfSave->SurfObj,
+ psoDest,
+ NULL,
+ NULL,
+ NULL,
+ &rclPointer,
+ (POINTL*)&rclSurf,
+ NULL,
+ NULL,
+ NULL,
+ ROP3_TO_ROP4(SRCCOPY),
+ FALSE);
+
+ /* Blt the pointer on the screen. */
+ if (pgp->psurfColor)
+ {
+ IntEngBitBltEx(psoDest,
+ &pgp->psurfColor->SurfObj,
+ &pgp->psurfMask->SurfObj,
+ NULL,
+ pgp->XlateObject,
+ &rclSurf,
+ (POINTL*)&rclPointer,
+ (POINTL*)&rclPointer,
+ NULL,
+ NULL,
+ R4_MASK,
+ FALSE);
+ }
+ else
{
- RECTL DestRect;
- POINTL SrcPoint;
- SURFOBJ *psoColor;
- SURFOBJ *psoMask = NULL;
-
- DestRect.left = max(pt.x, 0);
- DestRect.top = max(pt.y, 0);
- DestRect.right = min(
- pt.x + pgp->Size.cx,
- psoDest->sizlBitmap.cx);
- DestRect.bottom = min(
- pt.y + pgp->Size.cy,
- psoDest->sizlBitmap.cy);
-
- SrcPoint.x = max(-pt.x, 0);
- SrcPoint.y = max(-pt.y, 0);
-
- if (pgp->MaskSurface)
- psoMask = EngLockSurface(pgp->MaskSurface);
-
- if (psoMask != NULL)
- {
- if (pgp->ColorSurface != NULL)
- {
- if ((psoColor = EngLockSurface(pgp->ColorSurface)))
- {
- IntEngBitBltEx(psoDest, psoColor, psoMask, NULL,
- pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
- NULL, NULL, R4_MASK, FALSE);
- EngUnlockSurface(psoColor);
- }
- }
- else
- {
- IntEngBitBltEx(psoDest, psoMask, NULL, NULL, pgp->XlateObject,
- &DestRect, &SrcPoint, NULL, NULL, NULL,
- ROP3_TO_ROP4(SRCAND), FALSE);
- SrcPoint.y += pgp->Size.cy;
- IntEngBitBltEx(psoDest, psoMask, NULL, NULL, pgp->XlateObject,
- &DestRect, &SrcPoint, NULL, NULL, NULL,
- ROP3_TO_ROP4(SRCINVERT), FALSE);
- }
- EngUnlockSurface(psoMask);
- }
+ IntEngBitBltEx(psoDest,
+ &pgp->psurfMask->SurfObj,
+ NULL,
+ NULL,
+ pgp->XlateObject,
+ &rclSurf,
+ (POINTL*)&rclPointer,
+ NULL,
+ NULL,
+ NULL,
+ ROP3_TO_ROP4(SRCAND),
+ FALSE);
+
+ rclPointer.top += pgp->Size.cy;
+
+ IntEngBitBltEx(psoDest,
+ &pgp->psurfMask->SurfObj,
+ NULL,
+ NULL,
+ pgp->XlateObject,
+ &rclSurf,
+ (POINTL*)&rclPointer,
+ NULL,
+ NULL,
+ NULL,
+ ROP3_TO_ROP4(SRCINVERT),
+ FALSE);
}
}
IN FLONG fl)
{
PDEVOBJ *ppdev;
- SURFOBJ *psoTemp;
GDIPOINTER *pgp;
+ PBYTE Bits;
+ SIZEL Size;
+ LONG lDelta;
+ HBITMAP hbmp;
ASSERT(pso);
IntHideMousePointer(ppdev, pso);
- if (pgp->ColorSurface != NULL)
+ if (pgp->psurfColor)
{
- /* FIXME: Is this really needed? */
- if ((psoTemp = EngLockSurface(pgp->ColorSurface)))
- {
- EngFreeMem(psoTemp->pvBits);
- psoTemp->pvBits = 0;
- EngUnlockSurface(psoTemp);
- }
+ /* FIXME: let GDI allocate/free memory */
+ EngFreeMem(pgp->psurfColor->SurfObj.pvBits);
+ pgp->psurfColor->SurfObj.pvBits = 0;
- EngDeleteSurface(pgp->ColorSurface);
- pgp->MaskSurface = NULL;
+ EngDeleteSurface(pgp->psurfColor->BaseObject.hHmgr);
+ SURFACE_ShareUnlockSurface(pgp->psurfColor);
+ pgp->psurfColor = NULL;
}
- if (pgp->MaskSurface != NULL)
+ if (pgp->psurfMask)
{
- /* FIXME: Is this really needed? */
- if ((psoTemp = EngLockSurface(pgp->MaskSurface)))
- {
- EngFreeMem(psoTemp->pvBits);
- psoTemp->pvBits = 0;
- EngUnlockSurface(psoTemp);
- }
+ /* FIXME: let GDI allocate/free memory */
+ EngFreeMem(pgp->psurfMask->SurfObj.pvBits);
+ pgp->psurfMask->SurfObj.pvBits = 0;
- EngDeleteSurface(pgp->MaskSurface);
- pgp->MaskSurface = NULL;
+ EngDeleteSurface(pgp->psurfMask->BaseObject.hHmgr);
+ SURFACE_ShareUnlockSurface(pgp->psurfMask);
+ pgp->psurfMask = NULL;
}
- if (pgp->SaveSurface != NULL)
+ if (pgp->psurfSave != NULL)
{
- EngDeleteSurface(pgp->SaveSurface);
- pgp->SaveSurface = NULL;
+ EngDeleteSurface(pgp->psurfSave->BaseObject.hHmgr);
+ SURFACE_ShareUnlockSurface(pgp->psurfSave);
+ pgp->psurfSave = NULL;
}
if (pgp->XlateObject != NULL)
pgp->HotSpot.x = xHot;
pgp->HotSpot.y = yHot;
- /* Actually this should be set by 'the other side', but it would be
- * done right after this. It helps IntShowMousePointer. */
if (x != -1)
{
- gpsi->ptCursor.x = x;
- gpsi->ptCursor.y = y;
+ ppdev->ptlPointer.x = x;
+ ppdev->ptlPointer.y = y;
}
pgp->Size.cx = abs(psoMask->lDelta) << 3;
if (psoColor != NULL)
{
- PBYTE Bits;
-
+ /* FIXME: let GDI allocate/free memory */
Bits = EngAllocMem(0, psoColor->cjBits, TAG_MOUSE);
if (Bits == NULL)
{
memcpy(Bits, psoColor->pvBits, psoColor->cjBits);
- pgp->ColorSurface = (HSURF)EngCreateBitmap(pgp->Size,
- psoColor->lDelta, psoColor->iBitmapFormat,
- psoColor->lDelta < 0 ? 0 : BMF_TOPDOWN, Bits);
+ hbmp = EngCreateBitmap(pgp->Size,
+ psoColor->lDelta,
+ psoColor->iBitmapFormat,
+ psoColor->lDelta < 0 ? 0 : BMF_TOPDOWN,
+ Bits);
+
+ pgp->psurfColor = SURFACE_ShareLockSurface(hbmp);
}
else
{
- pgp->ColorSurface = NULL;
+ pgp->psurfColor = NULL;
}
+ Size.cx = pgp->Size.cx;
+ Size.cy = pgp->Size.cy << 1;
+ Bits = EngAllocMem(0, psoMask->cjBits, TAG_MOUSE);
+ if (Bits == NULL)
{
- SIZEL Size;
- PBYTE Bits;
+ return SPS_ERROR;
+ }
- Size.cx = pgp->Size.cx;
- Size.cy = pgp->Size.cy << 1;
- Bits = EngAllocMem(0, psoMask->cjBits, TAG_MOUSE);
- if (Bits == NULL)
- {
- return SPS_ERROR;
- }
+ memcpy(Bits, psoMask->pvBits, psoMask->cjBits);
- memcpy(Bits, psoMask->pvBits, psoMask->cjBits);
+ hbmp = EngCreateBitmap(Size,
+ psoMask->lDelta,
+ psoMask->iBitmapFormat,
+ psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN,
+ Bits);
- pgp->MaskSurface = (HSURF)EngCreateBitmap(Size,
- psoMask->lDelta, psoMask->iBitmapFormat,
- psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN, Bits);
- }
+ pgp->psurfMask = SURFACE_ShareLockSurface(hbmp);
/* Create an XLATEOBJ that will be used for drawing masks.
* FIXME: We should get this in pxlo parameter! */
}
/* Create surface for saving the pixels under the cursor. */
- {
- LONG lDelta;
+ switch (pso->iBitmapFormat)
+ {
+ case BMF_1BPP:
+ lDelta = pgp->Size.cx >> 3;
+ break;
+ case BMF_4BPP:
+ lDelta = pgp->Size.cx >> 1;
+ break;
+ case BMF_8BPP:
+ lDelta = pgp->Size.cx;
+ break;
+ case BMF_16BPP:
+ lDelta = pgp->Size.cx << 1;
+ break;
+ case BMF_24BPP:
+ lDelta = pgp->Size.cx * 3;
+ break;
+ case BMF_32BPP:
+ lDelta = pgp->Size.cx << 2;
+ break;
+ default:
+ lDelta = 0;
+ break;
+ }
- switch (pso->iBitmapFormat)
- {
- case BMF_1BPP:
- lDelta = pgp->Size.cx >> 3;
- break;
- case BMF_4BPP:
- lDelta = pgp->Size.cx >> 1;
- break;
- case BMF_8BPP:
- lDelta = pgp->Size.cx;
- break;
- case BMF_16BPP:
- lDelta = pgp->Size.cx << 1;
- break;
- case BMF_24BPP:
- lDelta = pgp->Size.cx * 3;
- break;
- case BMF_32BPP:
- lDelta = pgp->Size.cx << 2;
- break;
- default:
- lDelta = 0;
- break;
- }
+ hbmp = EngCreateBitmap(pgp->Size,
+ lDelta,
+ pso->iBitmapFormat,
+ BMF_TOPDOWN | BMF_NOZEROINIT,
+ NULL);
- pgp->SaveSurface = (HSURF)EngCreateBitmap(pgp->Size,
- lDelta,
- pso->iBitmapFormat,
- BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
- }
+ pgp->psurfSave = SURFACE_ShareLockSurface(hbmp);
if (x != -1)
{
} else if (prcl != NULL)
prcl->left = prcl->top = prcl->right = prcl->bottom = -1;
- return SPS_ACCEPT_EXCLUDE;
+ return SPS_ACCEPT_NOEXCLUDE;
}
/*
ASSERT(pso);
ppdev = GDIDEV(pso);
-
ASSERT(ppdev);
pgp = &ppdev->Pointer;
IntHideMousePointer(ppdev, pso);
+
+ ppdev->ptlPointer.x = x;
+ ppdev->ptlPointer.y = y;
+
if (x != -1)
{
- /* Actually this should be set by 'the other side', but it would be
- * done right after this. It helps IntShowMousePointer. */
- gpsi->ptCursor.x = x;
- gpsi->ptCursor.y = y;
IntShowMousePointer(ppdev, pso);
if (prcl != NULL)
{
}
} else if (prcl != NULL)
prcl->left = prcl->top = prcl->right = prcl->bottom = -1;
-
}
VOID APIENTRY
IN RECTL *prcl)
{
SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
+ PPDEVOBJ ppdev = (PPDEVOBJ)pso->hdev;
SURFACE_LockBitmapBits(psurf);
- if (GDIDEV(pso)->Pointer.MovePointer)
+ ppdev->pfnMovePointer(pso, x, y, prcl);
+ SURFACE_UnlockBitmapBits(psurf);
+}
+
+ULONG APIENTRY
+IntEngSetPointerShape(
+ IN SURFOBJ *pso,
+ IN SURFOBJ *psoMask,
+ IN SURFOBJ *psoColor,
+ IN XLATEOBJ *pxlo,
+ IN LONG xHot,
+ IN LONG yHot,
+ IN LONG x,
+ IN LONG y,
+ IN RECTL *prcl,
+ IN FLONG fl)
+{
+ ULONG ulResult = SPS_DECLINE;
+ SURFACE *psurf = CONTAINING_RECORD(pso, SURFACE, SurfObj);
+ PFN_DrvSetPointerShape pfnSetPointerShape;
+ PPDEVOBJ ppdev = GDIDEV(pso);
+
+ pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
+
+ SURFACE_LockBitmapBits(psurf);
+ if (pfnSetPointerShape)
+ {
+ ulResult = pfnSetPointerShape(pso,
+ psoMask,
+ psoColor,
+ pxlo,
+ xHot,
+ yHot,
+ x,
+ y,
+ prcl,
+ fl);
+ }
+
+ /* Check if the driver accepted it */
+ if (ulResult == SPS_ACCEPT_NOEXCLUDE)
{
- GDIDEV(pso)->Pointer.MovePointer(pso, x, y, prcl);
+ /* Set MovePointer to the driver function */
+ ppdev->pfnMovePointer = GDIDEVFUNCS(pso).MovePointer;
}
else
{
- EngMovePointer(pso, x, y, prcl);
+ /* Set software pointer */
+ ulResult = EngSetPointerShape(pso,
+ psoMask,
+ psoColor,
+ pxlo,
+ xHot,
+ yHot,
+ x,
+ y,
+ prcl,
+ fl);
+ /* Set MovePointer to the eng function */
+ ppdev->pfnMovePointer = EngMovePointer;
}
+
SURFACE_UnlockBitmapBits(psurf);
+
+ return ulResult;
}
/* EOF */
XLATEOBJ *XlateObj = NULL;
HDC Screen;
PDC dc;
+ ULONG Status;
CurInfo = IntGetSysCursorInfo(WinSta);
OldCursor = CurInfo->CurrentCursorObject;
UserDereferenceObject(CurInfo->CurrentCursorObject);
if (CurInfo->ShowingCursor)
{
- DPRINT1("Removing pointer!\n");
+ DPRINT("Removing pointer!\n");
/* Remove the cursor if it was displayed */
IntEngMovePointer(pso, -1, -1, &GDIDEV(pso)->Pointer.Exclude);
}
}
- GDIDEV(pso)->Pointer.Status = SPS_ACCEPT_NOEXCLUDE;
-
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
CurInfo->ShowingCursor = 0;
}
return (HCURSOR)0;
}
soMask = EngLockSurface((HSURF)hMask);
- EngCopyBits(soMask, &MaskBmpObj->SurfObj, NULL, NULL,
+ IntEngCopyBits(soMask, &MaskBmpObj->SurfObj, NULL, NULL,
&DestRect, &SourcePoint);
SURFACE_UnlockSurface(MaskBmpObj);
}
UserDereferenceObject(OldCursor);
}
- if (GDIDEVFUNCS(pso).SetPointerShape)
- {
- GDIDEV(pso)->Pointer.Status =
- GDIDEVFUNCS(pso).SetPointerShape(
- pso, soMask, soColor, XlateObj,
- NewCursor->IconInfo.xHotspot,
- NewCursor->IconInfo.yHotspot,
- gpsi->ptCursor.x,
- gpsi->ptCursor.y,
- &(GDIDEV(pso)->Pointer.Exclude),
- SPS_CHANGE);
- DPRINT("SetCursor: DrvSetPointerShape() returned %x\n",
- GDIDEV(pso)->Pointer.Status);
- }
- else
- {
- GDIDEV(pso)->Pointer.Status = SPS_DECLINE;
- }
+ Status = IntEngSetPointerShape(pso,
+ soMask,
+ soColor,
+ XlateObj,
+ NewCursor->IconInfo.xHotspot,
+ NewCursor->IconInfo.yHotspot,
+ gpsi->ptCursor.x,
+ gpsi->ptCursor.y,
+ &(GDIDEV(pso)->Pointer.Exclude),
+ SPS_CHANGE);
- if(GDIDEV(pso)->Pointer.Status == SPS_DECLINE)
+ if (Status != SPS_ACCEPT_NOEXCLUDE)
{
- GDIDEV(pso)->Pointer.Status = EngSetPointerShape(
- pso, soMask, soColor, XlateObj,
- NewCursor->IconInfo.xHotspot,
- NewCursor->IconInfo.yHotspot,
- gpsi->ptCursor.x,
- gpsi->ptCursor.y,
- &(GDIDEV(pso)->Pointer.Exclude),
- SPS_CHANGE);
- GDIDEV(pso)->Pointer.MovePointer = NULL;
- }
- else
- {
- GDIDEV(pso)->Pointer.MovePointer = GDIDEVFUNCS(pso).MovePointer;
+ DPRINT1("IntEngSetPointerShape returned %lx\n", Status);
}
SURFACE_UnlockSurface(psurf);
EngDeleteXlate(XlateObj);
}
- if(GDIDEV(pso)->Pointer.Status == SPS_ERROR)
- DPRINT1("SetCursor: DrvSetPointerShape() returned SPS_ERROR\n");
-
return Ret;
}
{
//ppdev->SafetyRemoveCount = 1;
//ppdev->SafetyRemoveLevel = 1;
- EngMovePointer(SurfObj,-1,-1,NULL);
+ IntEngMovePointer(SurfObj,-1,-1,NULL);
CurInfo->ShowingCursor = 0;
}
{
//ppdev->SafetyRemoveCount = 0;
//ppdev->SafetyRemoveLevel = 0;
- EngMovePointer(SurfObj,-1,-1,NULL);
+ IntEngMovePointer(SurfObj,-1,-1,NULL);
CurInfo->ShowingCursor = CURSOR_SHOWING;
}
}