mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:12:59 +00:00
Don't use RECTL structure in ntoskrnl
svn path=/trunk/; revision=7686
This commit is contained in:
parent
c97ad8c5de
commit
0fd869efa8
3 changed files with 44 additions and 13 deletions
|
@ -25,7 +25,10 @@ typedef struct _SYSTEM_CURSORINFO
|
||||||
LONG x, y;
|
LONG x, y;
|
||||||
BOOL SafetySwitch;
|
BOOL SafetySwitch;
|
||||||
UINT SafetyRemoveCount;
|
UINT SafetyRemoveCount;
|
||||||
RECTL PointerRect;
|
LONG PointerRectLeft;
|
||||||
|
LONG PointerRectTop;
|
||||||
|
LONG PointerRectRight;
|
||||||
|
LONG PointerRectBottom;
|
||||||
FAST_MUTEX CursorMutex;
|
FAST_MUTEX CursorMutex;
|
||||||
CURSORCLIP_INFO CursorClipInfo;
|
CURSORCLIP_INFO CursorClipInfo;
|
||||||
PVOID CurIconHandleTable;
|
PVOID CurIconHandleTable;
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: mouse.c,v 1.53 2004/01/16 13:18:23 gvg Exp $
|
/* $Id: mouse.c,v 1.54 2004/01/16 15:39:28 gvg Exp $
|
||||||
*
|
*
|
||||||
* PROJECT: ReactOS kernel
|
* PROJECT: ReactOS kernel
|
||||||
* PURPOSE: Mouse
|
* PURPOSE: Mouse
|
||||||
|
@ -135,10 +135,10 @@ MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1,
|
||||||
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
|
tmp = HazardY2; HazardY2 = HazardY1; HazardY1 = tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CurInfo->PointerRect.right >= HazardX1
|
if (CurInfo->PointerRectRight >= HazardX1
|
||||||
&& CurInfo->PointerRect.left <= HazardX2
|
&& CurInfo->PointerRectLeft <= HazardX2
|
||||||
&& CurInfo->PointerRect.bottom >= HazardY1
|
&& CurInfo->PointerRectBottom >= HazardY1
|
||||||
&& CurInfo->PointerRect.top <= HazardY2)
|
&& CurInfo->PointerRectTop <= HazardY2)
|
||||||
{
|
{
|
||||||
/* Mouse is not allowed to move if GDI is busy drawing */
|
/* Mouse is not allowed to move if GDI is busy drawing */
|
||||||
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
||||||
|
@ -158,6 +158,15 @@ MouseSafetyOnDrawStart(PSURFOBJ SurfObj, PSURFGDI SurfGDI, LONG HazardX1,
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC VOID FASTCALL
|
||||||
|
SetPointerRect(PSYSTEM_CURSORINFO CurInfo, PRECTL PointerRect)
|
||||||
|
{
|
||||||
|
CurInfo->PointerRectLeft = PointerRect->left;
|
||||||
|
CurInfo->PointerRectRight = PointerRect->right;
|
||||||
|
CurInfo->PointerRectTop = PointerRect->top;
|
||||||
|
CurInfo->PointerRectBottom = PointerRect->bottom;
|
||||||
|
}
|
||||||
|
|
||||||
INT FASTCALL
|
INT FASTCALL
|
||||||
MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI)
|
MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI)
|
||||||
/*
|
/*
|
||||||
|
@ -166,6 +175,7 @@ MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI)
|
||||||
{
|
{
|
||||||
PSYSTEM_CURSORINFO CurInfo;
|
PSYSTEM_CURSORINFO CurInfo;
|
||||||
BOOL MouseEnabled = FALSE;
|
BOOL MouseEnabled = FALSE;
|
||||||
|
RECTL PointerRect;
|
||||||
|
|
||||||
if(IntGetWindowStationObject(InputWindowStation))
|
if(IntGetWindowStationObject(InputWindowStation))
|
||||||
{
|
{
|
||||||
|
@ -208,7 +218,8 @@ MouseSafetyOnDrawEnd(PSURFOBJ SurfObj, PSURFGDI SurfGDI)
|
||||||
ObDereferenceObject(InputWindowStation);
|
ObDereferenceObject(InputWindowStation);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &CurInfo->PointerRect);
|
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
CurInfo->SafetySwitch = FALSE;
|
CurInfo->SafetySwitch = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -229,6 +240,7 @@ MouseMoveCursor(LONG X, LONG Y)
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
LARGE_INTEGER LargeTickCount;
|
LARGE_INTEGER LargeTickCount;
|
||||||
ULONG TickCount;
|
ULONG TickCount;
|
||||||
|
RECTL PointerRect;
|
||||||
|
|
||||||
if(!InputWindowStation)
|
if(!InputWindowStation)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -260,7 +272,8 @@ MouseMoveCursor(LONG X, LONG Y)
|
||||||
if(CurInfo->Enabled)
|
if(CurInfo->Enabled)
|
||||||
{
|
{
|
||||||
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
||||||
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &CurInfo->PointerRect);
|
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
||||||
}
|
}
|
||||||
/* send MOUSEMOVE message */
|
/* send MOUSEMOVE message */
|
||||||
|
@ -301,6 +314,7 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
||||||
PSURFOBJ SurfObj;
|
PSURFOBJ SurfObj;
|
||||||
PSURFGDI SurfGDI;
|
PSURFGDI SurfGDI;
|
||||||
MSG Msg;
|
MSG Msg;
|
||||||
|
RECTL PointerRect;
|
||||||
|
|
||||||
hDC = IntGetScreenDC();
|
hDC = IntGetScreenDC();
|
||||||
|
|
||||||
|
@ -417,7 +431,8 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
||||||
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
|
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
|
||||||
{
|
{
|
||||||
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
||||||
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &CurInfo->PointerRect);
|
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
||||||
mouse_cx = 0;
|
mouse_cx = 0;
|
||||||
mouse_cy = 0;
|
mouse_cy = 0;
|
||||||
|
@ -444,7 +459,8 @@ MouseGDICallBack(PMOUSE_INPUT_DATA Data, ULONG InputCount)
|
||||||
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
|
((mouse_ox != CurInfo->x) || (mouse_oy != CurInfo->y)))
|
||||||
{
|
{
|
||||||
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
ExAcquireFastMutex(&CurInfo->CursorMutex);
|
||||||
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &CurInfo->PointerRect);
|
SurfGDI->MovePointer(SurfObj, CurInfo->x, CurInfo->y, &PointerRect);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
ExReleaseFastMutex(&CurInfo->CursorMutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program; if not, write to the Free Software
|
* along with this program; if not, write to the Free Software
|
||||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||||
*/
|
*/
|
||||||
/* $Id: cursoricon.c,v 1.41 2004/01/16 13:18:23 gvg Exp $ */
|
/* $Id: cursoricon.c,v 1.42 2004/01/16 15:39:28 gvg Exp $ */
|
||||||
|
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
@ -87,6 +87,15 @@ IntCopyBitmap(HBITMAP bmp)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
STATIC VOID FASTCALL
|
||||||
|
SetPointerRect(PSYSTEM_CURSORINFO CurInfo, PRECTL PointerRect)
|
||||||
|
{
|
||||||
|
CurInfo->PointerRectLeft = PointerRect->left;
|
||||||
|
CurInfo->PointerRectRight = PointerRect->right;
|
||||||
|
CurInfo->PointerRectTop = PointerRect->top;
|
||||||
|
CurInfo->PointerRectBottom = PointerRect->bottom;
|
||||||
|
}
|
||||||
|
|
||||||
#define COLORCURSORS_ALLOWED FALSE
|
#define COLORCURSORS_ALLOWED FALSE
|
||||||
HCURSOR FASTCALL
|
HCURSOR FASTCALL
|
||||||
IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL ForceChange)
|
IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL ForceChange)
|
||||||
|
@ -102,6 +111,7 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo
|
||||||
HBITMAP hMask = (HBITMAP)0, hColor = (HBITMAP)0;
|
HBITMAP hMask = (HBITMAP)0, hColor = (HBITMAP)0;
|
||||||
PSURFOBJ soMask = NULL, soColor = NULL;
|
PSURFOBJ soMask = NULL, soColor = NULL;
|
||||||
PXLATEOBJ XlateObj = NULL;
|
PXLATEOBJ XlateObj = NULL;
|
||||||
|
RECTL PointerRect;
|
||||||
|
|
||||||
CurInfo = &WinStaObject->SystemCursor;
|
CurInfo = &WinStaObject->SystemCursor;
|
||||||
OldCursor = CurInfo->CurrentCursorObject;
|
OldCursor = CurInfo->CurrentCursorObject;
|
||||||
|
@ -136,8 +146,9 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo
|
||||||
0,
|
0,
|
||||||
CurInfo->x,
|
CurInfo->x,
|
||||||
CurInfo->y,
|
CurInfo->y,
|
||||||
&CurInfo->PointerRect,
|
&PointerRect,
|
||||||
SPS_CHANGE);
|
SPS_CHANGE);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
|
|
||||||
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
|
CurInfo->CurrentCursorObject = NewCursor; /* i.e. CurrentCursorObject = NULL */
|
||||||
CurInfo->ShowingCursor = 0;
|
CurInfo->ShowingCursor = 0;
|
||||||
|
@ -210,8 +221,9 @@ IntSetCursor(PWINSTATION_OBJECT WinStaObject, PCURICON_OBJECT NewCursor, BOOL Fo
|
||||||
NewCursor->IconInfo.yHotspot,
|
NewCursor->IconInfo.yHotspot,
|
||||||
CurInfo->x,
|
CurInfo->x,
|
||||||
CurInfo->y,
|
CurInfo->y,
|
||||||
&CurInfo->PointerRect,
|
&PointerRect,
|
||||||
SPS_CHANGE);
|
SPS_CHANGE);
|
||||||
|
SetPointerRect(CurInfo, &PointerRect);
|
||||||
|
|
||||||
if(hMask)
|
if(hMask)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue