Commit c6a835a6 authored by Alexandre Julliard's avatar Alexandre Julliard

Remove Get/SetBeepActive from USER driver and manage it locally inside

SystemParametersInfo.
parent acb08a39
......@@ -17,8 +17,6 @@ debug_channels (ttydrv)
@ cdecl MapVirtualKey(long long) TTYDRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) TTYDRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) TTYDRV_ToUnicode
@ cdecl GetBeepActive() TTYDRV_GetBeepActive
@ cdecl SetBeepActive(long) TTYDRV_SetBeepActive
@ cdecl Beep() TTYDRV_Beep
@ cdecl GetDIState(long ptr) TTYDRV_GetDIState
@ cdecl GetDIData(ptr long ptr ptr long) TTYDRV_GetDIData
......
......@@ -64,21 +64,6 @@ INT TTYDRV_ToUnicode( UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
}
/***********************************************************************
* TTYDRV_GetBeepActive
*/
BOOL TTYDRV_GetBeepActive(void)
{
return FALSE;
}
/***********************************************************************
* TTYDRV_SetBeepActive
*/
void TTYDRV_SetBeepActive(BOOL bActivate)
{
}
/***********************************************************************
* TTYDRV_Beep
*/
void TTYDRV_Beep(void)
......
......@@ -64,8 +64,6 @@ static BOOL load_driver(void)
GET_USER_FUNC(MapVirtualKey);
GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(ToUnicode);
GET_USER_FUNC(GetBeepActive);
GET_USER_FUNC(SetBeepActive);
GET_USER_FUNC(Beep);
GET_USER_FUNC(GetDIState);
GET_USER_FUNC(GetDIData);
......
......@@ -17,8 +17,6 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
@ cdecl MapVirtualKey(long long) X11DRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) X11DRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) X11DRV_ToUnicode
@ cdecl GetBeepActive() X11DRV_GetBeepActive
@ cdecl SetBeepActive(long) X11DRV_SetBeepActive
@ cdecl Beep() X11DRV_Beep
@ cdecl GetDIState(long ptr) X11DRV_GetDIState
@ cdecl GetDIData(ptr long ptr ptr long) X11DRV_GetDIData
......
......@@ -43,7 +43,6 @@ static int *ph_errno = &h_errno;
DEFAULT_DEBUG_CHANNEL(x11drv);
static XKeyboardState keyboard_state;
static void (*old_tsx11_lock)(void);
static void (*old_tsx11_unlock)(void);
......@@ -420,9 +419,6 @@ static void process_attach(void)
ExitProcess(1);
}
/* save keyboard setup */
TSXGetKeyboardControl(display, &keyboard_state);
/* initialize event handling */
X11DRV_EVENT_Init();
......@@ -449,18 +445,6 @@ static void process_attach(void)
*/
static void process_detach(void)
{
/* restore keyboard setup */
XKeyboardControl keyboard_value;
keyboard_value.key_click_percent = keyboard_state.key_click_percent;
keyboard_value.bell_percent = keyboard_state.bell_percent;
keyboard_value.bell_pitch = keyboard_state.bell_pitch;
keyboard_value.bell_duration = keyboard_state.bell_duration;
keyboard_value.auto_repeat_mode = keyboard_state.global_auto_repeat;
TSXChangeKeyboardControl(display, KBKeyClickPercent | KBBellPercent |
KBBellPitch | KBBellDuration | KBAutoRepeatMode, &keyboard_value);
#ifdef HAVE_OPENGL
/* cleanup GLX */
/*X11DRV_GLX_Cleanup();*/
......
......@@ -29,9 +29,6 @@ VOID WINAPI KEYBOARD_Disable(VOID);
/* Wine internals */
extern BOOL KEYBOARD_GetBeepActive(void);
extern void KEYBOARD_SetBeepActive(BOOL bActivate);
extern void KEYBOARD_SendEvent(BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD posX, DWORD posY, DWORD time);
#define WINE_KEYBDEVENT_MAGIC ( ('K'<<24)|('E'<<16)|('Y'<<8)|'B' )
......
......@@ -46,8 +46,6 @@ typedef struct tagUSER_DRIVER {
UINT16 (*pMapVirtualKey)(UINT16, UINT16);
INT16 (*pGetKeyNameText)(LONG, LPSTR, INT16);
INT (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
BOOL (*pGetBeepActive)(void);
void (*pSetBeepActive)(BOOL);
void (*pBeep)(void);
BOOL (*pGetDIState)(DWORD, LPVOID);
BOOL (*pGetDIData)(BYTE *, DWORD, struct DIDEVICEOBJECTDATA *, LPDWORD, DWORD);
......
......@@ -259,22 +259,6 @@ INT16 WINAPI ToAscii16(UINT16 virtKey,UINT16 scanCode, LPBYTE lpKeyState,
}
/***********************************************************************
* KEYBOARD_GetBeepActive
*/
BOOL KEYBOARD_GetBeepActive()
{
return USER_Driver.pGetBeepActive();
}
/***********************************************************************
* KEYBOARD_SetBeepActive
*/
void KEYBOARD_SetBeepActive(BOOL bActivate)
{
USER_Driver.pSetBeepActive(bActivate);
}
/***********************************************************************
* MessageBeep (USER.104)
*/
void WINAPI MessageBeep16( UINT16 i )
......@@ -287,6 +271,8 @@ void WINAPI MessageBeep16( UINT16 i )
*/
BOOL WINAPI MessageBeep( UINT i )
{
USER_Driver.pBeep();
BOOL active = TRUE;
SystemParametersInfoA( SPI_GETBEEP, 0, &active, FALSE );
if (active) USER_Driver.pBeep();
return TRUE;
}
......@@ -23,6 +23,8 @@
DEFAULT_DEBUG_CHANNEL(system);
static BOOL beep_active = TRUE;
/***********************************************************************
* GetTimerResolution (USER.14)
*/
......@@ -137,10 +139,10 @@ BOOL WINAPI SystemParametersInfoA( UINT uiAction, UINT uiParam,
switch (uiAction)
{
case SPI_GETBEEP: /* 1 */
*(BOOL *)pvParam = KEYBOARD_GetBeepActive();
*(BOOL *)pvParam = beep_active;
break;
case SPI_SETBEEP: /* 2 */
KEYBOARD_SetBeepActive( uiParam );
beep_active = uiParam;
break;
WINE_SPI_FIXME(SPI_GETMOUSE); /* 3 */
......
......@@ -1624,33 +1624,6 @@ INT X11DRV_ToUnicode(UINT virtKey, UINT scanCode, LPBYTE lpKeyState,
}
/***********************************************************************
* GetBeepActive (X11DRV.@)
*/
BOOL X11DRV_GetBeepActive(void)
{
XKeyboardState keyboard_state;
TSXGetKeyboardControl(display, &keyboard_state);
return keyboard_state.bell_percent != 0;
}
/***********************************************************************
* SetBeepActive (X11DRV.@)
*/
void X11DRV_SetBeepActive(BOOL bActivate)
{
XKeyboardControl keyboard_value;
if(bActivate)
keyboard_value.bell_percent = -1;
else
keyboard_value.bell_percent = 0;
TSXChangeKeyboardControl(display, KBBellPercent, &keyboard_value);
}
/***********************************************************************
* Beep (X11DRV.@)
*/
void X11DRV_Beep(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment