[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 * 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,7 +34,6 @@ 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;
@ -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;
@ -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);
@ -321,7 +296,6 @@ IntShowMousePointer(PDEVOBJ *ppdev, SURFOBJ *psoDest)
/* /*
* @implemented * @implemented
*/ */
ULONG APIENTRY ULONG APIENTRY
EngSetPointerShape( EngSetPointerShape(
IN SURFOBJ *pso, IN SURFOBJ *pso,
@ -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,8 +469,10 @@ 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)