From 698d0a3be535d4e742c0e79d80215964ea0cc2a8 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Sat, 17 Jan 2004 15:21:09 +0000 Subject: [PATCH] Preparing for the win32k emulated mouse cursor support. svn path=/trunk/; revision=7714 --- reactos/include/ddk/winddi.h | 25 +++++++++++++- reactos/subsys/win32k/eng/mouse.c | 39 +++++++++++++++++++++- reactos/subsys/win32k/eng/objects.h | 4 +-- reactos/subsys/win32k/objects/cursoricon.c | 21 +++++++++--- reactos/subsys/win32k/stubs/stubs.c | 37 -------------------- 5 files changed, 81 insertions(+), 45 deletions(-) diff --git a/reactos/include/ddk/winddi.h b/reactos/include/ddk/winddi.h index cb143321ef1..ba9da611ea6 100644 --- a/reactos/include/ddk/winddi.h +++ b/reactos/include/ddk/winddi.h @@ -1507,11 +1507,34 @@ EngSaveFloatingPointState EngSecureMem EngSetEvent EngSetLastError -EngSetPointerShape EngSetPointerTag EngSetPrinterData */ +ULONG +STDCALL +EngSetPointerShape( + 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 + ); + +VOID +STDCALL +EngMovePointer( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl + ); + typedef int CDECL (*SORTCOMP)(const void *Elem1, const void *Elem2); void STDCALL diff --git a/reactos/subsys/win32k/eng/mouse.c b/reactos/subsys/win32k/eng/mouse.c index b5df3d23594..37dfaaba560 100644 --- a/reactos/subsys/win32k/eng/mouse.c +++ b/reactos/subsys/win32k/eng/mouse.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: mouse.c,v 1.55 2004/01/16 19:32:00 gvg Exp $ +/* $Id: mouse.c,v 1.56 2004/01/17 15:20:25 navaraf Exp $ * * PROJECT: ReactOS kernel * PURPOSE: Mouse @@ -532,4 +532,41 @@ EnableMouse(HDC hDisplayDC) } } } + +ULONG +STDCALL +EngSetPointerShape( + 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 + ) +{ + // www.osr.com/ddk/graphics/gdifncs_1y5j.htm + UNIMPLEMENTED; + return 0; +} + +/* + * @unimplemented + */ +VOID +STDCALL +EngMovePointer( + IN SURFOBJ *pso, + IN LONG x, + IN LONG y, + IN RECTL *prcl + ) +{ + // www.osr.com/ddk/graphics/gdifncs_8wfb.htm + UNIMPLEMENTED; +} + /* EOF */ diff --git a/reactos/subsys/win32k/eng/objects.h b/reactos/subsys/win32k/eng/objects.h index 05e41cb1d6f..69e8b66e4a2 100644 --- a/reactos/subsys/win32k/eng/objects.h +++ b/reactos/subsys/win32k/eng/objects.h @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: objects.h,v 1.25 2004/01/16 19:32:00 gvg Exp $ +/* $Id: objects.h,v 1.26 2004/01/17 15:20:25 navaraf Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -138,7 +138,7 @@ typedef VOID STDCALL (*PFN_Synchronize)(DHPDEV, RECTL *); typedef VOID STDCALL (*PFN_MovePointer)(SURFOBJ *, LONG, LONG, RECTL *); typedef ULONG STDCALL (*PFN_SetPointerShape)(SURFOBJ *, SURFOBJ *, SURFOBJ *, XLATEOBJ *, - LONG, LONG, LONG, LONG, RECTL *, ULONG); + LONG, LONG, LONG, LONG, RECTL *, FLONG); typedef HBITMAP STDCALL (*PFN_CreateDeviceBitmap)(DHPDEV, SIZEL, ULONG); diff --git a/reactos/subsys/win32k/objects/cursoricon.c b/reactos/subsys/win32k/objects/cursoricon.c index 4c98fb50cf1..d78b3f2fd2d 100644 --- a/reactos/subsys/win32k/objects/cursoricon.c +++ b/reactos/subsys/win32k/objects/cursoricon.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: cursoricon.c,v 1.43 2004/01/16 19:32:00 gvg Exp $ */ +/* $Id: cursoricon.c,v 1.44 2004/01/17 15:20:25 navaraf Exp $ */ #undef WIN32_LEAN_AND_MEAN @@ -227,6 +227,21 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo &PointerRect, SPS_CHANGE); ExReleaseFastMutex(SurfGDI->DriverLock); + + if(SurfGDI->PointerStatus == SPS_DECLINE) + { + SurfGDI->SetPointerShape = EngSetPointerShape; + SurfGDI->MovePointer = EngMovePointer; + EngSetPointerShape(SurfObj, soMask, soColor, XlateObj, + NewCursor->IconInfo.xHotspot, + NewCursor->IconInfo.yHotspot, + CurInfo->x, + CurInfo->y, + &PointerRect, + SPS_CHANGE); + DbgPrint("SetCursor: DrvSetPointerShape() returned SPS_DECLINE\n"); + } + SetPointerRect(CurInfo, &PointerRect); if(hMask) @@ -242,9 +257,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo EngDeleteXlate(XlateObj); } - if(SurfGDI->PointerStatus == SPS_DECLINE) - DbgPrint("SetCursor: DrvSetPointerShape() returned SPS_DECLINE\n"); - else if(SurfGDI->PointerStatus == SPS_ERROR) + if(SurfGDI->PointerStatus == SPS_ERROR) DbgPrint("SetCursor: DrvSetPointerShape() returned SPS_ERROR\n"); return Ret; diff --git a/reactos/subsys/win32k/stubs/stubs.c b/reactos/subsys/win32k/stubs/stubs.c index a8eec3b43b1..f944ca6f761 100644 --- a/reactos/subsys/win32k/stubs/stubs.c +++ b/reactos/subsys/win32k/stubs/stubs.c @@ -531,23 +531,6 @@ EngMarkBandingSurface ( IN HSURF hsurf ) return FALSE; } -/* - * @unimplemented - */ -VOID -STDCALL -EngMovePointer( - IN SURFOBJ *pso, - IN LONG x, - IN LONG y, - IN RECTL *prcl - ) -{ - // www.osr.com/ddk/graphics/gdifncs_8wfb.htm - UNIMPLEMENTED; -} - - INT STDCALL EngMultiByteToWideChar( @@ -606,26 +589,6 @@ EngSaveFloatingPointState( return 0; } -ULONG -STDCALL -EngSetPointerShape( - 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 - ) -{ - // www.osr.com/ddk/graphics/gdifncs_1y5j.htm - UNIMPLEMENTED; - return 0; -} - BOOL STDCALL EngSetPointerTag(