mirror of
https://github.com/reactos/reactos.git
synced 2025-02-28 19:32:59 +00:00
WIP [WIN32K] Improve IntEngSetPointerShape
This commit is contained in:
parent
c5e7af9ff8
commit
ec8a3bc4d8
2 changed files with 60 additions and 46 deletions
|
@ -627,11 +627,9 @@ IntEngSetPointerShape(
|
||||||
ULONG ulResult = SPS_DECLINE;
|
ULONG ulResult = SPS_DECLINE;
|
||||||
PFN_DrvSetPointerShape pfnSetPointerShape;
|
PFN_DrvSetPointerShape pfnSetPointerShape;
|
||||||
PPDEVOBJ ppdev = GDIDEV(pso);
|
PPDEVOBJ ppdev = GDIDEV(pso);
|
||||||
BOOL bHardwarePointer = FALSE;
|
|
||||||
BOOL bSoftwarePointer = TRUE;
|
|
||||||
|
|
||||||
pfnSetPointerShape = GDIDEVFUNCS(pso).SetPointerShape;
|
|
||||||
|
|
||||||
|
/* Try the driver function */
|
||||||
|
pfnSetPointerShape = ppdev->pfn.SetPointerShape;
|
||||||
if (pfnSetPointerShape)
|
if (pfnSetPointerShape)
|
||||||
{
|
{
|
||||||
/* Drivers expect to get an XLATEOBJ */
|
/* Drivers expect to get an XLATEOBJ */
|
||||||
|
@ -652,49 +650,67 @@ IntEngSetPointerShape(
|
||||||
|
|
||||||
/* Check if the driver accepted it */
|
/* Check if the driver accepted it */
|
||||||
if (ulResult == SPS_ACCEPT_NOEXCLUDE)
|
if (ulResult == SPS_ACCEPT_NOEXCLUDE)
|
||||||
bHardwarePointer = TRUE;
|
{
|
||||||
|
/* Check of we need to enable the hardware pointer */
|
||||||
|
if (!(ppdev->flFlags & PDEV_HARDWARE_POINTER))
|
||||||
|
{
|
||||||
|
/* Save current software pointer position */
|
||||||
|
POINTL ptlPointer = ppdev->ptlPointer;
|
||||||
|
|
||||||
bSoftwarePointer = !bHardwarePointer;
|
/* Disable software pointer */
|
||||||
|
EngMovePointer(pso, -1, -1, NULL);
|
||||||
|
ppdev->flFlags &= ~PDEV_SOFTWARE_POINTER;
|
||||||
|
|
||||||
|
/* Set MovePointer to the driver function */
|
||||||
|
ppdev->pfnMovePointer = ppdev->pfn.MovePointer;
|
||||||
|
ppdev->flFlags |= PDEV_HARDWARE_POINTER;
|
||||||
|
|
||||||
|
/* Enable the hardware pointer */
|
||||||
|
ppdev->pfnMovePointer(pso,
|
||||||
|
ptlPointer.x,
|
||||||
|
ptlPointer.x,
|
||||||
|
&ppdev->Pointer.Exclude);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ulResult;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bSoftwarePointer)
|
/* Set software pointer */
|
||||||
|
ulResult = EngSetPointerShape(pso,
|
||||||
|
psoMask,
|
||||||
|
psoColor,
|
||||||
|
pxlo,
|
||||||
|
xHot,
|
||||||
|
yHot,
|
||||||
|
x,
|
||||||
|
y,
|
||||||
|
prcl,
|
||||||
|
fl);
|
||||||
|
|
||||||
|
/* Check if GDI accepted it */
|
||||||
|
if (ulResult == SPS_ACCEPT_NOEXCLUDE)
|
||||||
{
|
{
|
||||||
/* Set software pointer */
|
/* Check of we need to enable the software pointer */
|
||||||
ulResult = EngSetPointerShape(pso,
|
if (!(ppdev->flFlags & PDEV_SOFTWARE_POINTER))
|
||||||
psoMask,
|
{
|
||||||
psoColor,
|
/* Disable hardware pointer */
|
||||||
pxlo,
|
if (ppdev->pfn.MovePointer)
|
||||||
xHot,
|
ppdev->pfn.MovePointer(pso, -1, -1, NULL);
|
||||||
yHot,
|
ppdev->flFlags &= ~PDEV_HARDWARE_POINTER;
|
||||||
x,
|
|
||||||
y,
|
/* Set MovePointer to the eng function */
|
||||||
prcl,
|
ppdev->pfnMovePointer = EngMovePointer;
|
||||||
fl);
|
ppdev->flFlags |= PDEV_SOFTWARE_POINTER;
|
||||||
|
|
||||||
|
/* Enable software pointer */
|
||||||
|
EngMovePointer(pso,
|
||||||
|
ppdev->ptlPointer.x,
|
||||||
|
ppdev->ptlPointer.x,
|
||||||
|
&ppdev->Pointer.Exclude);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bSoftwarePointer && ppdev->flFlags & PDEV_SOFTWARE_POINTER)
|
|
||||||
{
|
|
||||||
/* Disable software pointer */
|
|
||||||
EngMovePointer(pso, -1, -1, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!bHardwarePointer && ppdev->flFlags & PDEV_HARDWARE_POINTER)
|
|
||||||
{
|
|
||||||
/* Disable hardware pointer */
|
|
||||||
ppdev->pfnMovePointer(pso, -1, -1, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Update flags */
|
|
||||||
if (bSoftwarePointer)
|
|
||||||
ppdev->flFlags |= PDEV_SOFTWARE_POINTER;
|
|
||||||
else
|
|
||||||
ppdev->flFlags &= ~PDEV_SOFTWARE_POINTER;
|
|
||||||
|
|
||||||
if (bHardwarePointer)
|
|
||||||
ppdev->flFlags |= PDEV_HARDWARE_POINTER;
|
|
||||||
else
|
|
||||||
ppdev->flFlags &= ~PDEV_HARDWARE_POINTER;
|
|
||||||
|
|
||||||
return ulResult;
|
return ulResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -824,11 +840,8 @@ GreMovePointer(
|
||||||
/* Store the cursor exclude position in the PDEV */
|
/* Store the cursor exclude position in the PDEV */
|
||||||
prcl = &pdc->ppdev->Pointer.Exclude;
|
prcl = &pdc->ppdev->Pointer.Exclude;
|
||||||
|
|
||||||
/* Send new position of the hot spot of the pointer (will likely redraw cursor) */
|
/* Call Eng/Drv function */
|
||||||
if (pdc->ppdev->flFlags & PDEV_HARDWARE_POINTER)
|
pdc->ppdev->pfnMovePointer(pso, x, y, prcl);
|
||||||
pdc->ppdev->pfnMovePointer(pso, x, y, prcl);
|
|
||||||
else if (pdc->ppdev->flFlags & PDEV_SOFTWARE_POINTER)
|
|
||||||
EngMovePointer(pso, x, y, prcl);
|
|
||||||
|
|
||||||
/* If panning device, and we're not hiding the cursor, notify cursor's current position.
|
/* If panning device, and we're not hiding the cursor, notify cursor's current position.
|
||||||
* (driver may already have been called if it also supports hardware pointers) */
|
* (driver may already have been called if it also supports hardware pointers) */
|
||||||
|
|
|
@ -136,6 +136,7 @@ typedef struct _PDEVOBJ
|
||||||
{
|
{
|
||||||
DRIVER_FUNCTIONS DriverFunctions;
|
DRIVER_FUNCTIONS DriverFunctions;
|
||||||
DRIVER_FUNCTIONS pfn;
|
DRIVER_FUNCTIONS pfn;
|
||||||
|
DRIVER_FUNCTIONS drvfn;
|
||||||
PVOID apfn[INDEX_LAST]; // B8C 0x0598
|
PVOID apfn[INDEX_LAST]; // B8C 0x0598
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue