Commit 32fb5805 authored by Alexandre Julliard's avatar Alexandre Julliard

Changed X11 mouse driver to use SendInput, and removed WINE_MOUSEEVENT

hack. Moved mouse.c to dlls/x11drv. Added KeymapNotify event handler, and fixed handling with multiple alt/shift/control keys. Removed dinput functions from USER driver.
parent 7641ce3a
......@@ -29,7 +29,6 @@ struct tagWND;
struct tagCURSORICONINFO;
struct tagCREATESTRUCTA;
struct tagWINDOWPOS;
struct DIDEVICEOBJECTDATA;
#if defined(HAVE_LIBCURSES) || defined(HAVE_LIBNCURSES)
#define WINE_CURSES
......
......@@ -47,15 +47,11 @@ debug_channels (ttydrv)
# USER driver
@ cdecl InitKeyboard() TTYDRV_InitKeyboard
@ cdecl VkKeyScan(long) TTYDRV_VkKeyScan
@ cdecl MapVirtualKey(long long) TTYDRV_MapVirtualKey
@ cdecl GetKeyNameText(long str long) TTYDRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) TTYDRV_ToUnicode
@ cdecl Beep() TTYDRV_Beep
@ cdecl GetDIState(long ptr) TTYDRV_GetDIState
@ cdecl GetDIData(ptr long ptr ptr long) TTYDRV_GetDIData
@ cdecl InitMouse(ptr) TTYDRV_InitMouse
@ cdecl SetCursor(ptr) TTYDRV_SetCursor
@ cdecl GetScreenSaveActive() TTYDRV_GetScreenSaveActive
@ cdecl SetScreenSaveActive(long) TTYDRV_SetScreenSaveActive
......
......@@ -13,13 +13,6 @@ DEFAULT_DEBUG_CHANNEL(ttydrv);
/***********************************************************************
* InitKeyboard (TTYDRV.@)
*/
void TTYDRV_InitKeyboard(void)
{
}
/***********************************************************************
* VkKeyScan (TTYDRV.@)
*/
WORD TTYDRV_VkKeyScan(CHAR cChar)
......@@ -64,30 +57,6 @@ void TTYDRV_Beep(void)
}
/***********************************************************************
* GetDIState (TTYDRV.@)
*/
BOOL TTYDRV_GetDIState(DWORD len, LPVOID ptr)
{
return TRUE;
}
/***********************************************************************
* GetDIData (TTYDRV.@)
*/
BOOL TTYDRV_GetDIData( BYTE *keystate, DWORD dodsize, LPDIDEVICEOBJECTDATA dod,
LPDWORD entries, DWORD flags )
{
return TRUE;
}
/***********************************************************************
* InitMouse (TTYDRV.@)
*/
void TTYDRV_InitMouse(LPMOUSE_EVENT_PROC proc)
{
}
/***********************************************************************
* SetCursor (TTYDRV.@)
*/
void TTYDRV_SetCursor( struct tagCURSORICONINFO *lpCursor )
......
......@@ -10,7 +10,6 @@
#include "debugtools.h"
#include "callback.h"
#include "builtin16.h"
#include "mouse.h"
#include "windef.h"
#include "wingdi.h"
#include "winuser.h"
......@@ -35,6 +34,8 @@ typedef struct _MOUSEINFO
/**********************************************************************/
typedef VOID CALLBACK (*LPMOUSE_EVENT_PROC)(DWORD,DWORD,DWORD,DWORD,DWORD);
static LPMOUSE_EVENT_PROC DefMouseEventProc = NULL;
/***********************************************************************
......@@ -55,16 +56,6 @@ WORD WINAPI MOUSE_Inquire(LPMOUSEINFO mouseInfo)
return sizeof(MOUSEINFO);
}
/***********************************************************************
* Enable (MOUSE.2)
*/
VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc)
{
THUNK_Free( (FARPROC)DefMouseEventProc );
DefMouseEventProc = lpMouseEventProc;
USER_Driver.pInitMouse( lpMouseEventProc );
}
/**********************************************************************/
static VOID WINAPI MOUSE_CallMouseEventProc( FARPROC16 proc,
......@@ -86,14 +77,13 @@ static VOID WINAPI MOUSE_CallMouseEventProc( FARPROC16 proc,
wine_call_to_16_regs_short( &context, 0 );
}
/**********************************************************************/
VOID WINAPI WIN16_MOUSE_Enable( FARPROC16 proc )
/***********************************************************************
* Enable (MOUSE.2)
*/
VOID WINAPI MOUSE_Enable( FARPROC16 proc )
{
LPMOUSE_EVENT_PROC thunk =
(LPMOUSE_EVENT_PROC)THUNK_Alloc( proc, (RELAY)MOUSE_CallMouseEventProc );
MOUSE_Enable( thunk );
THUNK_Free( (FARPROC)DefMouseEventProc );
DefMouseEventProc = (LPMOUSE_EVENT_PROC)THUNK_Alloc( proc, (RELAY)MOUSE_CallMouseEventProc );
}
/***********************************************************************
......@@ -103,5 +93,4 @@ VOID WINAPI MOUSE_Disable(VOID)
{
THUNK_Free( (FARPROC)DefMouseEventProc );
DefMouseEventProc = 0;
USER_Driver.pInitMouse( 0 );
}
......@@ -4,7 +4,7 @@ owner user32
rsrc resources/mouse.res
1 pascal16 Inquire(ptr) MOUSE_Inquire
2 pascal16 Enable(segptr) WIN16_MOUSE_Enable
2 pascal16 Enable(segptr) MOUSE_Enable
3 pascal16 Disable() MOUSE_Disable
4 stub MOUSEGETINTVECT
5 stub GETSETMOUSEDATA
......
......@@ -67,8 +67,6 @@ static BOOL load_driver(void)
GET_USER_FUNC(GetKeyNameText);
GET_USER_FUNC(ToUnicode);
GET_USER_FUNC(Beep);
GET_USER_FUNC(GetDIState);
GET_USER_FUNC(GetDIData);
GET_USER_FUNC(InitMouse);
GET_USER_FUNC(SetCursor);
GET_USER_FUNC(GetCursorPos);
......@@ -245,10 +243,10 @@ static BOOL process_attach(void)
if (!WIN_CreateDesktopWindow()) return FALSE;
/* Initialize keyboard driver */
USER_Driver.pInitKeyboard( InputKeyStateTable );
if (USER_Driver.pInitKeyboard) USER_Driver.pInitKeyboard( InputKeyStateTable );
/* Initialize mouse driver */
MOUSE_Enable( mouse_event );
if (USER_Driver.pInitMouse) USER_Driver.pInitMouse( InputKeyStateTable );
/* Initialize 16-bit serial communications */
COMM_Init();
......
......@@ -9,6 +9,7 @@ IMPORTS = user32 gdi32 kernel32
C_SRCS = \
desktop.c \
dga2.c \
mouse.c \
scroll.c \
window.c \
winpos.c \
......
......@@ -117,7 +117,7 @@ static int get_window_attributes( Display *display, WND *win, XSetWindowAttribut
ButtonPressMask | ButtonReleaseMask);
if (is_window_top_level( win ))
{
attr->event_mask |= StructureNotifyMask | FocusChangeMask;
attr->event_mask |= StructureNotifyMask | FocusChangeMask | KeymapStateMask;
attr->cursor = X11DRV_GetCursor( display, GlobalLock16(GetCursor()) );
}
return (CWOverrideRedirect | CWSaveUnder | CWEventMask | CWColormap | CWCursor);
......
......@@ -66,8 +66,6 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics
@ cdecl GetKeyNameText(long str long) X11DRV_GetKeyNameText
@ cdecl ToUnicode(long long ptr ptr long long) X11DRV_ToUnicode
@ cdecl Beep() X11DRV_Beep
@ cdecl GetDIState(long ptr) X11DRV_GetDIState
@ cdecl GetDIData(ptr long ptr ptr long) X11DRV_GetDIData
@ cdecl InitMouse(ptr) X11DRV_InitMouse
@ cdecl SetCursor(ptr) X11DRV_SetCursor
@ cdecl GetCursorPos(ptr) X11DRV_GetCursorPos
......
/*
* MOUSE driver interface
*
* Copyright 1998 Ulrich Weigand
*/
#ifndef __WINE_MOUSE_H
#define __WINE_MOUSE_H
#include "windef.h"
#include "user.h"
/* Wine internals */
#define WINE_MOUSEEVENT_MAGIC ( ('M'<<24)|('A'<<16)|('U'<<8)|'S' )
typedef struct _WINE_MOUSEEVENT
{
DWORD magic;
DWORD keyState;
DWORD time;
HWND hWnd;
} WINE_MOUSEEVENT;
#endif /* __WINE_MOUSE_H */
......@@ -31,9 +31,6 @@ extern WORD USER_HeapSel;
#define USUD_FIRSTCLASS 0x0005
struct tagCURSORICONINFO;
struct DIDEVICEOBJECTDATA;
typedef VOID CALLBACK (*LPMOUSE_EVENT_PROC)(DWORD,DWORD,DWORD,DWORD,DWORD);
/* internal messages codes */
enum wine_internal_message
......@@ -44,6 +41,10 @@ enum wine_internal_message
WM_WINE_SETPARENT
};
/* internal SendInput codes (FIXME) */
#define WINE_INTERNAL_INPUT_MOUSE (16+INPUT_MOUSE)
#define WINE_INTERNAL_INPUT_KEYBOARD (16+INPUT_KEYBOARD)
typedef struct tagUSER_DRIVER {
/* keyboard functions */
void (*pInitKeyboard)(LPBYTE);
......@@ -52,10 +53,8 @@ typedef struct tagUSER_DRIVER {
INT (*pGetKeyNameText)(LONG,LPSTR,INT);
INT (*pToUnicode)(UINT, UINT, LPBYTE, LPWSTR, int, UINT);
void (*pBeep)(void);
BOOL (*pGetDIState)(DWORD, LPVOID);
BOOL (*pGetDIData)(BYTE *, DWORD, struct DIDEVICEOBJECTDATA *, LPDWORD, DWORD);
/* mouse functions */
void (*pInitMouse)(LPMOUSE_EVENT_PROC);
void (*pInitMouse)(LPBYTE);
void (*pSetCursor)(struct tagCURSORICONINFO *);
void (*pGetCursorPos)(LPPOINT);
void (*pSetCursorPos)(INT,INT);
......@@ -108,9 +107,6 @@ extern void USER_CheckNotLock(void);
extern BOOL USER_IsExitingThread( DWORD tid );
VOID WINAPI MOUSE_Enable(LPMOUSE_EVENT_PROC lpMouseEventProc);
VOID WINAPI MOUSE_Disable(VOID);
/* Wine look */
typedef enum
......
......@@ -30,7 +30,6 @@ struct tagDC;
struct tagDeviceCaps;
struct tagPALETTEOBJ;
struct tagWINDOWPOS;
struct DIDEVICEOBJECTDATA;
/* X physical pen */
typedef struct
......@@ -349,8 +348,6 @@ extern BOOL X11DRV_GetClipboardData(UINT wFormat);
/* X11 event driver */
extern WORD X11DRV_EVENT_XStateToKeyState( int state ) ;
typedef enum {
X11DRV_INPUT_RELATIVE,
X11DRV_INPUT_ABSOLUTE
......@@ -361,14 +358,6 @@ extern INPUT_TYPE X11DRV_EVENT_SetInputMethod(INPUT_TYPE type);
void X11DRV_EVENT_SetDGAStatus(HWND hwnd, int event_base) ;
#endif
/* X11 mouse driver */
extern void X11DRV_InitMouse(LPMOUSE_EVENT_PROC);
extern void X11DRV_SetCursor(struct tagCURSORICONINFO *lpCursor);
extern void X11DRV_MoveCursor(WORD wAbsX, WORD wAbsY);
extern void X11DRV_SendEvent( DWORD mouseStatus, DWORD posX, DWORD posY,
WORD keyState, DWORD data, DWORD time, HWND hWnd );
/* x11drv private window data */
struct x11drv_win_data
{
......
......@@ -8,8 +8,7 @@ MODULE = x11drv
C_SRCS = \
clipboard.c \
event.c \
keyboard.c \
mouse.c
keyboard.c
PROGRAMS = wineclipsrv
......
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