[FORMATTING]

- fix indentation
- remove the large file header, fix the small one

svn path=/trunk/; revision=40390
This commit is contained in:
Timo Kreuzer 2009-04-06 03:20:25 +00:00
parent 579dc0993e
commit f0179f8ce1

View file

@ -1,26 +1,7 @@
/*
* ReactOS W32 Subsystem
* Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
*
* 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
* PROJECT: ReactOS win32 subsystem
* PURPOSE: Mouse pointer functions
* FILE: subsystems/win32k/eng/mouse.c
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
* REVISION HISTORY:
* 06-06-2001 CSH Created
@ -34,13 +15,17 @@
/* 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
* a rectangle on a particular surface.
*/
INT INTERNAL_CALL
MouseSafetyOnDrawStart(
SURFOBJ *SurfObj,
LONG HazardX1,
LONG HazardY1,
LONG HazardX2,
LONG HazardY2)
{
LONG tmp;
PDEVOBJ *ppdev;
@ -49,8 +34,7 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
ASSERT(SurfObj != NULL);
ppdev = GDIDEV(SurfObj);
if(ppdev == NULL)
if (ppdev == NULL)
{
return(FALSE);
}
@ -65,11 +49,15 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
if (HazardX1 > HazardX2)
{
tmp = HazardX2; HazardX2 = HazardX1; HazardX1 = tmp;
tmp = HazardX2;
HazardX2 = HazardX1;
HazardX1 = tmp;
}
if (HazardY1 > HazardY2)
{
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
tmp = HazardY2;
HazardY2 = HazardY1;
HazardY1 = tmp;
}
if (ppdev->SafetyRemoveLevel != 0)
@ -95,11 +83,12 @@ MouseSafetyOnDrawStart(SURFOBJ *SurfObj, LONG HazardX1,
return(TRUE);
}
INT INTERNAL_CALL
MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
/*
* FUNCTION: Notify the mouse driver that drawing has finished on a surface.
*/
INT INTERNAL_CALL
MouseSafetyOnDrawEnd(
SURFOBJ *SurfObj)
{
PDEVOBJ *ppdev;
GDIPOINTER *pgp;
@ -108,14 +97,14 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
ppdev = GDIDEV(SurfObj);
if(ppdev == NULL)
if (ppdev == NULL)
{
return(FALSE);
}
pgp = &ppdev->Pointer;
if(SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
if (SPS_ACCEPT_NOEXCLUDE == pgp->Status ||
pgp->Exclude.right == -1)
{
return FALSE;
@ -138,7 +127,9 @@ MouseSafetyOnDrawEnd(SURFOBJ *SurfObj)
/* SOFTWARE MOUSE POINTER IMPLEMENTATION **************************************/
VOID INTERNAL_CALL
IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
IntHideMousePointer(
PDEVOBJ *ppdev,
SURFOBJ *psoDest)
{
GDIPOINTER *pgp;
POINTL pt;
@ -153,22 +144,15 @@ IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
return;
}
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)
{
return ;
}
/*
* Hide the cours
*/
/* Hide the cours */
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
pt.y = gpsi->ptCursor.y - pgp->HotSpot.y;
@ -192,9 +176,9 @@ IntHideMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
SrcPoint.x = max(-pt.x, 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,
&DestRect, &SrcPoint, &SrcPoint, NULL, NULL,
@ -225,9 +209,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
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)
{
return ;
@ -236,10 +218,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
pt.x = gpsi->ptCursor.x - pgp->HotSpot.x;
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 &&
(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;
POINTL SrcPoint;
@ -287,7 +263,6 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
SrcPoint.x = max(-pt.x, 0);
SrcPoint.y = max(-pt.y, 0);
if (pgp->MaskSurface)
psoMask = EngLockSurface(pgp->MaskSurface);
@ -295,7 +270,7 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
{
if (pgp->ColorSurface != NULL)
{
if((psoColor = EngLockSurface(pgp->ColorSurface)))
if ((psoColor = EngLockSurface(pgp->ColorSurface)))
{
IntEngBitBltEx(psoDest, psoColor, psoMask, NULL,
pgp->XlateObject, &DestRect, &SrcPoint, &SrcPoint,
@ -321,7 +296,6 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
/*
* @implemented
*/
ULONG APIENTRY
EngSetPointerShape(
IN SURFOBJ *pso,
@ -349,7 +323,7 @@ EngSetPointerShape(
if (pgp->ColorSurface != NULL)
{
/* FIXME: Is this really needed? */
if((psoTemp = EngLockSurface(pgp->ColorSurface)))
if ((psoTemp = EngLockSurface(pgp->ColorSurface)))
{
EngFreeMem(psoTemp->pvBits);
psoTemp->pvBits = 0;
@ -363,7 +337,7 @@ EngSetPointerShape(
if (pgp->MaskSurface != NULL)
{
/* FIXME: Is this really needed? */
if((psoTemp = EngLockSurface(pgp->MaskSurface)))
if ((psoTemp = EngLockSurface(pgp->MaskSurface)))
{
EngFreeMem(psoTemp->pvBits);
psoTemp->pvBits = 0;
@ -386,10 +360,7 @@ EngSetPointerShape(
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)
{
return SPS_ACCEPT_NOEXCLUDE;
@ -449,11 +420,8 @@ EngSetPointerShape(
psoMask->lDelta < 0 ? 0 : BMF_TOPDOWN, Bits);
}
/*
* Create an XLATEOBJ that will be used for drawing masks.
* FIXME: We should get this in pxlo parameter!
*/
/* Create an XLATEOBJ that will be used for drawing masks.
* FIXME: We should get this in pxlo parameter! */
if (pxlo == NULL)
{
HPALETTE BWPalette, DestPalette;
@ -472,10 +440,7 @@ EngSetPointerShape(
pgp->XlateObject = pxlo;
}
/*
* Create surface for saving the pixels under the cursor.
*/
/* Create surface for saving the pixels under the cursor. */
{
LONG lDelta;
@ -504,11 +469,13 @@ EngSetPointerShape(
break;
}
pgp->SaveSurface = (HSURF)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);
}
if(x != -1)
if (x != -1)
{
IntShowMousePointer(ppdev, pso);