Author: greatlrd
Date: Sat Jul 7 22:17:03 2007
New Revision: 27454
URL:
http://svn.reactos.org/svn/reactos?rev=27454&view=rev
Log:
patch from Yaroslav Ponomarenko yarryp at gmail dot com
implement pointers
MouseSpeed, CursorAccelerationInfo.FirstThreshold ,
CursorAccelerationInfo.SecondThreshold, CursorAccelerationInfo.Acceleration,
MouseHoverTime, MouseHoverWidth, MouseHoverHeight
for SPI_SETMOUSEHOVERTIME, SPI_SETMOUSEHOVERWIDTH, SPI_SETMOUSEHOVERHEIGHT, SPI_SETMOUSE,
SPI_SETMOUSESPEED.
WARING :
Some of them are not 100% support in win32k for they are need be fill in from the mouse
drv and
send them to the mouse drv as well, this part are not done yet.
Modified:
trunk/reactos/subsystems/win32/win32k/include/cursoricon.h
trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
Modified: trunk/reactos/subsystems/win32/win32k/include/cursoricon.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/in…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/cursoricon.h (original)
+++ trunk/reactos/subsystems/win32/win32k/include/cursoricon.h Sat Jul 7 22:17:03 2007
@@ -31,6 +31,13 @@
UINT Bottom;
} CURSORCLIP_INFO, *PCURSORCLIP_INFO;
+typedef struct _CURSORACCELERATION_INFO
+{
+ UINT FirstThreshold;
+ UINT SecondThreshold;
+ UINT Acceleration;
+} CURSORACCELERATION_INFO, *PCURSORACCELERATION_INFO;
+
typedef struct _SYSTEM_CURSORINFO
{
BOOL Enabled;
@@ -44,6 +51,14 @@
UINT DblClickSpeed;
UINT DblClickWidth;
UINT DblClickHeight;
+
+ UINT MouseHoverTime;
+ UINT MouseHoverWidth;
+ UINT MouseHoverHeight;
+
+ UINT MouseSpeed;
+ CURSORACCELERATION_INFO CursorAccelerationInfo;
+
DWORD LastBtnDown;
LONG LastBtnDownX;
LONG LastBtnDownY;
@@ -72,3 +87,4 @@
/* EOF */
+
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/misc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/misc.c Sat Jul 7 22:17:03 2007
@@ -900,6 +900,7 @@
}
}
+
ULONG FASTCALL
IntSystemParametersInfo(
UINT uiAction,
@@ -961,6 +962,11 @@
case SPI_SETSCREENSAVERRUNNING:
case SPI_SETSCREENSAVETIMEOUT:
case SPI_SETFLATMENU:
+ case SPI_SETMOUSEHOVERTIME:
+ case SPI_SETMOUSEHOVERWIDTH:
+ case SPI_SETMOUSEHOVERHEIGHT:
+ case SPI_SETMOUSE:
+ case SPI_SETMOUSESPEED:
/* We will change something, so set the flag here */
bChanged = TRUE;
case SPI_GETDESKWALLPAPER:
@@ -970,6 +976,11 @@
case SPI_GETSCREENSAVETIMEOUT:
case SPI_GETSCREENSAVEACTIVE:
case SPI_GETFLATMENU:
+ case SPI_GETMOUSEHOVERTIME:
+ case SPI_GETMOUSEHOVERWIDTH:
+ case SPI_GETMOUSEHOVERHEIGHT:
+ case SPI_GETMOUSE:
+ case SPI_GETMOUSESPEED:
{
PSYSTEM_CURSORINFO CurInfo;
@@ -1041,6 +1052,60 @@
/* FIXME limit the maximum time to 1000 ms? */
CurInfo->DblClickSpeed = uiParam;
break;
+ case SPI_GETMOUSEHOVERTIME:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ *((UINT*)pvParam) = CurInfo->MouseHoverTime;
+ break;
+ case SPI_SETMOUSEHOVERTIME:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ CurInfo->MouseHoverTime = uiParam;
+ if(CurInfo->MouseHoverTime < USER_TIMER_MINIMUM)
+ {
+ CurInfo->MouseHoverTime = USER_TIMER_MINIMUM;
+ }
+ /* FIXME limit the maximum time to 1000 ms? */
+ break;
+ case SPI_GETMOUSEHOVERWIDTH:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ *(PUINT)pvParam = CurInfo->MouseHoverWidth;
+ break;
+ case SPI_GETMOUSEHOVERHEIGHT:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ *(PUINT)pvParam = CurInfo->MouseHoverHeight;
+ break;
+ case SPI_SETMOUSEHOVERWIDTH:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ CurInfo->MouseHoverWidth = uiParam;
+ break;
+ case SPI_SETMOUSEHOVERHEIGHT:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ CurInfo->MouseHoverHeight = uiParam;
+ break;
+ case SPI_SETMOUSE:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ CurInfo->CursorAccelerationInfo =
*(PCURSORACCELERATION_INFO)pvParam;
+ break;
+ case SPI_GETMOUSE:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ *(PCURSORACCELERATION_INFO)pvParam =
CurInfo->CursorAccelerationInfo;
+ break;
+ case SPI_SETMOUSESPEED:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ CurInfo->MouseSpeed = uiParam;
+ /* Limit value to 1...20 range */
+ if(CurInfo->MouseSpeed < 1)
+ {
+ CurInfo->MouseSpeed = 1;
+ }
+ else if(CurInfo->MouseSpeed > 20)
+ {
+ CurInfo->MouseSpeed = 20;
+ }
+ break;
+ case SPI_GETMOUSESPEED:
+ CurInfo = IntGetSysCursorInfo(WinStaObject);
+ *(PUINT)pvParam = CurInfo->MouseSpeed;
+ break;
case SPI_SETDESKWALLPAPER:
{
/* This function expects different parameters than the user mode
version!
@@ -1374,7 +1439,7 @@
PVOID pvParam,
UINT fWinIni)
{
- NTSTATUS Status;
+ NTSTATUS Status = STATUS_SUCCESS;
switch(uiAction)
{
@@ -1385,9 +1450,57 @@
case SPI_SETFONTSMOOTHING:
case SPI_SETFOCUSBORDERHEIGHT:
case SPI_SETFOCUSBORDERWIDTH:
+ case SPI_SETMOUSEHOVERTIME:
+ case SPI_SETMOUSEHOVERWIDTH:
+ case SPI_SETMOUSEHOVERHEIGHT:
+ case SPI_SETMOUSESPEED:
{
return (DWORD)IntSystemParametersInfo(uiAction, uiParam, pvParam, fWinIni);
}
+ case SPI_SETMOUSE:
+ {
+ CURSORACCELERATION_INFO CursorAccelerationInfo;
+ _SEH_TRY
+ {
+ ProbeForRead(pvParam, sizeof( CURSORACCELERATION_INFO ), 1);
+
RtlCopyMemory(&CursorAccelerationInfo,pvParam,sizeof(CURSORACCELERATION_INFO));
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return( FALSE);
+ }
+ return IntSystemParametersInfo(uiAction, uiParam,
&CursorAccelerationInfo, fWinIni);
+ }
+ case SPI_GETMOUSE:
+ {
+ CURSORACCELERATION_INFO CursorAccelerationInfo;
+ if(!IntSystemParametersInfo(uiAction, uiParam, &CursorAccelerationInfo,
fWinIni))
+ {
+ return( FALSE);
+ }
+ _SEH_TRY
+ {
+ ProbeForWrite(pvParam, sizeof( CURSORACCELERATION_INFO ), 1);
+
RtlCopyMemory(pvParam,&CursorAccelerationInfo,sizeof(CURSORACCELERATION_INFO));
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return( FALSE);
+ }
+ return( TRUE);
+ }
case SPI_SETWORKAREA:
{
RECT rc;
@@ -1430,22 +1543,33 @@
case SPI_GETSCREENSAVEACTIVE:
case SPI_GETFLATMENU:
case SPI_SETFLATMENU:
- {
- BOOL Ret;
-
- if(!IntSystemParametersInfo(uiAction, uiParam, &Ret, fWinIni))
- {
- return( FALSE);
- }
-
- Status = MmCopyToCaller(pvParam, &Ret, sizeof(BOOL));
- if(!NT_SUCCESS(Status))
- {
- SetLastNtError(Status);
- return( FALSE);
- }
- return( TRUE);
- }
+ case SPI_GETMOUSEHOVERHEIGHT:
+ case SPI_GETMOUSEHOVERWIDTH:
+ case SPI_GETMOUSEHOVERTIME:
+ case SPI_GETMOUSESPEED:
+ {
+ UINT Ret;
+ if(!IntSystemParametersInfo(uiAction, uiParam, &Ret, fWinIni))
+ {
+ return( FALSE);
+ }
+ _SEH_TRY
+ {
+ ProbeForWrite(pvParam, sizeof(UINT ), 1);
+ *(PUINT)pvParam = Ret;
+ }
+ _SEH_HANDLE
+ {
+ Status = _SEH_GetExceptionCode();
+ }
+ _SEH_END;
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ return( FALSE);
+ }
+ return( TRUE);
+ }
case SPI_SETDESKWALLPAPER:
{
/* !!! As opposed to the user mode version this version accepts a handle
Modified: trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/nt…
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c (original)
+++ trunk/reactos/subsystems/win32/win32k/ntuser/winsta.c Sat Jul 7 22:17:03 2007
@@ -521,17 +521,23 @@
CurInfo->WheelScroLines = 3;
CurInfo->WheelScroChars = 3;
-
-
/* FIXME: Obtain the following information from the registry */
CurInfo->SwapButtons = FALSE;
CurInfo->DblClickSpeed = 500;
CurInfo->DblClickWidth = 4;
CurInfo->DblClickHeight = 4;
- WindowStationObject->SystemCursor = CurInfo;
-
-
+ CurInfo->MouseSpeed = 10;
+ CurInfo->CursorAccelerationInfo.FirstThreshold = 6;
+ CurInfo->CursorAccelerationInfo.SecondThreshold = 10;
+ CurInfo->CursorAccelerationInfo.Acceleration = 1;
+
+ CurInfo->MouseHoverTime = 80;
+ CurInfo->MouseHoverWidth = 4;
+ CurInfo->MouseHoverHeight = 4;
+
+ WindowStationObject->SystemCursor = CurInfo;
+
if (!IntSetupClipboard(WindowStationObject))
{
DPRINT1("WindowStation: Error Setting up the clipboard!!!\n");