mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 07:52:56 +00:00
[FORMATTING]
- fix indentation - remove the large file header, fix the small one svn path=/trunk/; revision=40390
This commit is contained in:
parent
579dc0993e
commit
f0179f8ce1
1 changed files with 398 additions and 431 deletions
|
@ -1,26 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* ReactOS W32 Subsystem
|
* PROJECT: ReactOS win32 subsystem
|
||||||
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
|
* PURPOSE: Mouse pointer functions
|
||||||
*
|
* FILE: subsystems/win32k/eng/mouse.c
|
||||||
* This program is free software; you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation; either version 2 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
*/
|
|
||||||
/* $Id$
|
|
||||||
*
|
|
||||||
* PROJECT: ReactOS kernel
|
|
||||||
* PURPOSE: Mouse
|
|
||||||
* FILE: subsys/win32k/eng/mouse.c
|
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
* REVISION HISTORY:
|
* REVISION HISTORY:
|
||||||
* 06-06-2001 CSH Created
|
* 06-06-2001 CSH Created
|
||||||
|
@ -34,13 +15,17 @@
|
||||||
|
|
||||||
/* FUNCTIONS *****************************************************************/
|
/* FUNCTIONS *****************************************************************/
|
||||||
|
|
||||||
INT INTERNAL_CALL
|
|
||||||
MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
|
||||||
LONG HazardY1, LONG HazardX2, LONG HazardY2)
|
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Notify the mouse driver that drawing is about to begin in
|
* FUNCTION: Notify the mouse driver that drawing is about to begin in
|
||||||
* a rectangle on a particular surface.
|
* a rectangle on a particular surface.
|
||||||
*/
|
*/
|
||||||
|
INT INTERNAL_CALL
|
||||||
|
MouseSafetyOnDrawStart(
|
||||||
|
SURFOBJ *SurfObj,
|
||||||
|
LONG HazardX1,
|
||||||
|
LONG HazardY1,
|
||||||
|
LONG HazardX2,
|
||||||
|
LONG HazardY2)
|
||||||
{
|
{
|
||||||
LONG tmp;
|
LONG tmp;
|
||||||
PDEVOBJ *ppdev;
|
PDEVOBJ *ppdev;
|
||||||
|
@ -49,8 +34,7 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
ASSERT(SurfObj != NULL);
|
ASSERT(SurfObj != NULL);
|
||||||
|
|
||||||
ppdev = GDIDEV(SurfObj);
|
ppdev = GDIDEV(SurfObj);
|
||||||
|
if (ppdev == NULL)
|
||||||
if(ppdev == NULL)
|
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
@ -65,11 +49,15 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
|
|
||||||
if (HazardX1 > HazardX2)
|
if (HazardX1 > HazardX2)
|
||||||
{
|
{
|
||||||
tmp = HazardX2; HazardX2 = HazardX1; HazardX1 = tmp;
|
tmp = HazardX2;
|
||||||
|
HazardX2 = HazardX1;
|
||||||
|
HazardX1 = tmp;
|
||||||
}
|
}
|
||||||
if (HazardY1 > HazardY2)
|
if (HazardY1 > HazardY2)
|
||||||
{
|
{
|
||||||
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
|
tmp = HazardY2;
|
||||||
|
HazardY2 = HazardY1;
|
||||||
|
HazardY1 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ppdev->SafetyRemoveLevel != 0)
|
if (ppdev->SafetyRemoveLevel != 0)
|
||||||
|
@ -95,11 +83,12 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
INT INTERNAL_CALL
|
|
||||||
MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
|
||||||
/*
|
/*
|
||||||
* FUNCTION: Notify the mouse driver that drawing has finished on a surface.
|
* FUNCTION: Notify the mouse driver that drawing has finished on a surface.
|
||||||
*/
|
*/
|
||||||
|
INT INTERNAL_CALL
|
||||||
|
MouseSafetyOnDrawEnd(
|
||||||
|
SURFOBJ *SurfObj)
|
||||||
{
|
{
|
||||||
PDEVOBJ *ppdev;
|
PDEVOBJ *ppdev;
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
|
@ -108,14 +97,14 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
||||||
|
|
||||||
ppdev = GDIDEV(SurfObj);
|
ppdev = GDIDEV(SurfObj);
|
||||||
|
|
||||||
if(ppdev == NULL)
|
if (ppdev == NULL)
|
||||||
{
|
{
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
pgp = &ppdev->Pointer;
|
pgp = &ppdev->Pointer;
|
||||||
|
|
||||||
if(SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
|
if (SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
|
||||||
pgp->Exclude.right == -1)
|
pgp->Exclude.right == -1)
|
||||||
{
|
{
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -138,7 +127,9 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
|
||||||
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
|
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
|
||||||
|
|
||||||
VOID INTERNAL_CALL
|
VOID INTERNAL_CALL
|
||||||
IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
IntHideMousePointer(
|
||||||
|
PDEVOBJ *ppdev,
|
||||||
|
SURFOBJ *psoDest)
|
||||||
{
|
{
|
||||||
GDIPOINTER *pgp;
|
GDIPOINTER *pgp;
|
||||||
POINTL pt;
|
POINTL pt;
|
||||||
|
@ -153,22 +144,15 @@ IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pgp->Enabled = FALSE;
|
pgp->Enabled = FALSE;
|
||||||
|
|
||||||
/*
|
/* The mouse is hide from ShowCours and it is frist ?? */
|
||||||
* The mouse is hide from ShowCours and it is frist ??
|
|
||||||
*/
|
|
||||||
if (pgp->ShowPointer < 0)
|
if (pgp->ShowPointer < 0)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Hide the cours */
|
||||||
/*
|
|
||||||
* Hide the cours
|
|
||||||
*/
|
|
||||||
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
|
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
|
||||||
pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
|
pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
|
||||||
|
|
||||||
|
@ -192,9 +176,9 @@ IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
SrcPoint.x = max(-pt.x, 0);
|
SrcPoint.x = max(-pt.x, 0);
|
||||||
SrcPoint.y = max(-pt.y, 0);
|
SrcPoint.y = max(-pt.y, 0);
|
||||||
|
|
||||||
if((SaveSurface = EngLockSurface(pgp->SaveSurface)))
|
if ((SaveSurface = EngLockSurface(pgp->SaveSurface)))
|
||||||
{
|
{
|
||||||
if((MaskSurface = EngLockSurface(pgp->MaskSurface)))
|
if ((MaskSurface = EngLockSurface(pgp->MaskSurface)))
|
||||||
{
|
{
|
||||||
IntEngBitBltEx(psoDest, SaveSurface, MaskSurface, NULL, NULL,
|
IntEngBitBltEx(psoDest, SaveSurface, MaskSurface, NULL, NULL,
|
||||||
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
|
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
|
||||||
|
@ -225,9 +209,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
|
|
||||||
pgp->Enabled = TRUE;
|
pgp->Enabled = TRUE;
|
||||||
|
|
||||||
/*
|
/* Do not blt the mouse if it in hide */
|
||||||
* Do not blt the mouse if it in hide
|
|
||||||
*/
|
|
||||||
if (pgp->ShowPointer < 0)
|
if (pgp->ShowPointer < 0)
|
||||||
{
|
{
|
||||||
return ;
|
return ;
|
||||||
|
@ -236,10 +218,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
|
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
|
||||||
pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
|
pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
|
||||||
|
|
||||||
/*
|
/* Copy the pixels under the cursor to temporary surface. */
|
||||||
* Copy the pixels under the cursor to temporary surface.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (pgp->SaveSurface != NULL &&
|
if (pgp->SaveSurface != NULL &&
|
||||||
(SaveSurface = EngLockSurface(pgp->SaveSurface)))
|
(SaveSurface = EngLockSurface(pgp->SaveSurface)))
|
||||||
{
|
{
|
||||||
|
@ -265,10 +244,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/* Blit the cursor on the screen. */
|
||||||
* Blit the cursor on the screen.
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
{
|
||||||
RECTL DestRect;
|
RECTL DestRect;
|
||||||
POINTL SrcPoint;
|
POINTL SrcPoint;
|
||||||
|
@ -287,7 +263,6 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
SrcPoint.x = max(-pt.x, 0);
|
SrcPoint.x = max(-pt.x, 0);
|
||||||
SrcPoint.y = max(-pt.y, 0);
|
SrcPoint.y = max(-pt.y, 0);
|
||||||
|
|
||||||
|
|
||||||
if (pgp->MaskSurface)
|
if (pgp->MaskSurface)
|
||||||
psoMask = EngLockSurface(pgp->MaskSurface);
|
psoMask = EngLockSurface(pgp->MaskSurface);
|
||||||
|
|
||||||
|
@ -295,7 +270,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
{
|
{
|
||||||
if (pgp->ColorSurface != NULL)
|
if (pgp->ColorSurface != NULL)
|
||||||
{
|
{
|
||||||
if((psoColor = EngLockSurface(pgp->ColorSurface)))
|
if ((psoColor = EngLockSurface(pgp->ColorSurface)))
|
||||||
{
|
{
|
||||||
IntEngBitBltEx(psoDest, psoColor, psoMask, NULL,
|
IntEngBitBltEx(psoDest, psoColor, psoMask, NULL,
|
||||||
pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
|
pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
|
||||||
|
@ -321,7 +296,6 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
|
||||||
/*
|
/*
|
||||||
* @implemented
|
* @implemented
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ULONG APIENTRY
|
ULONG APIENTRY
|
||||||
EngSetPointerShape(
|
EngSetPointerShape(
|
||||||
IN SURFOBJ *pso,
|
IN SURFOBJ *pso,
|
||||||
|
@ -349,7 +323,7 @@ EngSetPointerShape(
|
||||||
if (pgp->ColorSurface != NULL)
|
if (pgp->ColorSurface != NULL)
|
||||||
{
|
{
|
||||||
/* FIXME: Is this really needed? */
|
/* FIXME: Is this really needed? */
|
||||||
if((psoTemp = EngLockSurface(pgp->ColorSurface)))
|
if ((psoTemp = EngLockSurface(pgp->ColorSurface)))
|
||||||
{
|
{
|
||||||
EngFreeMem(psoTemp->pvBits);
|
EngFreeMem(psoTemp->pvBits);
|
||||||
psoTemp->pvBits = 0;
|
psoTemp->pvBits = 0;
|
||||||
|
@ -363,7 +337,7 @@ EngSetPointerShape(
|
||||||
if (pgp->MaskSurface != NULL)
|
if (pgp->MaskSurface != NULL)
|
||||||
{
|
{
|
||||||
/* FIXME: Is this really needed? */
|
/* FIXME: Is this really needed? */
|
||||||
if((psoTemp = EngLockSurface(pgp->MaskSurface)))
|
if ((psoTemp = EngLockSurface(pgp->MaskSurface)))
|
||||||
{
|
{
|
||||||
EngFreeMem(psoTemp->pvBits);
|
EngFreeMem(psoTemp->pvBits);
|
||||||
psoTemp->pvBits = 0;
|
psoTemp->pvBits = 0;
|
||||||
|
@ -386,10 +360,7 @@ EngSetPointerShape(
|
||||||
pgp->XlateObject = NULL;
|
pgp->XlateObject = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* See if we are being asked to hide the pointer. */
|
||||||
* See if we are being asked to hide the pointer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (psoMask == NULL)
|
if (psoMask == NULL)
|
||||||
{
|
{
|
||||||
return SPS_ACCEPT_NOEXCLUDE;
|
return SPS_ACCEPT_NOEXCLUDE;
|
||||||
|
@ -449,11 +420,8 @@ EngSetPointerShape(
|
||||||
psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN, Bits);
|
psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN, Bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Create an XLATEOBJ that will be used for drawing masks.
|
||||||
* Create an XLATEOBJ that will be used for drawing masks.
|
* FIXME: We should get this in pxlo parameter! */
|
||||||
* FIXME: We should get this in pxlo parameter!
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (pxlo == NULL)
|
if (pxlo == NULL)
|
||||||
{
|
{
|
||||||
HPALETTE BWPalette, DestPalette;
|
HPALETTE BWPalette, DestPalette;
|
||||||
|
@ -472,10 +440,7 @@ EngSetPointerShape(
|
||||||
pgp->XlateObject = pxlo;
|
pgp->XlateObject = pxlo;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/* Create surface for saving the pixels under the cursor. */
|
||||||
* Create surface for saving the pixels under the cursor.
|
|
||||||
*/
|
|
||||||
|
|
||||||
{
|
{
|
||||||
LONG lDelta;
|
LONG lDelta;
|
||||||
|
|
||||||
|
@ -504,11 +469,13 @@ EngSetPointerShape(
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
pgp->SaveSurface = (HSURF)EngCreateBitmap(
|
pgp->SaveSurface = (HSURF)EngCreateBitmap(pgp->Size,
|
||||||
pgp->Size, lDelta, pso->iBitmapFormat, BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
|
lDelta,
|
||||||
|
pso->iBitmapFormat,
|
||||||
|
BMF_TOPDOWN | BMF_NOZEROINIT, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(x != -1)
|
if (x != -1)
|
||||||
{
|
{
|
||||||
IntShowMousePointer(ppdev, pso);
|
IntShowMousePointer(ppdev, pso);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue