Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2b5d564e
Commit
2b5d564e
authored
Jun 08, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged mouse dll into USER.
parent
01e819ad
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
120 additions
and
171 deletions
+120
-171
Makefile.in
Makefile.in
+0
-2
configure
configure
+0
-2
configure.in
configure.in
+0
-1
Makefile.in
dlls/Makefile.in
+2
-1
Makefile.in
dlls/dinput/Makefile.in
+1
-0
dinput.spec
dlls/dinput/dinput.spec
+2
-0
.cvsignore
dlls/mouse/.cvsignore
+0
-3
Makefile.in
dlls/mouse/Makefile.in
+0
-21
ttydrv_main.c
dlls/ttydrv/ttydrv_main.c
+0
-2
.cvsignore
dlls/user/.cvsignore
+1
-0
Makefile.in
dlls/user/Makefile.in
+7
-4
display.c
dlls/user/display.c
+0
-1
display.spec
dlls/user/display.spec
+1
-1
mouse.c
dlls/user/mouse.c
+17
-49
mouse.spec
dlls/user/mouse.spec
+1
-1
mouserc.rc
dlls/user/mouserc.rc
+0
-0
user_main.c
dlls/user/user_main.c
+0
-1
x11drv_main.c
dlls/x11drv/x11drv_main.c
+0
-1
mouse.h
include/mouse.h
+1
-26
ttydrv.h
include/ttydrv.h
+2
-2
user.h
include/user.h
+6
-2
x11drv.h
include/x11drv.h
+6
-4
mouse.c
windows/ttydrv/mouse.c
+1
-9
event.c
windows/x11drv/event.c
+15
-15
mouse.c
windows/x11drv/mouse.c
+57
-23
No files found.
Makefile.in
View file @
2b5d564e
...
...
@@ -31,7 +31,6 @@ LIBSUBDIRS = \
dlls/advapi32
\
dlls/crtdll
\
dlls/kernel
\
dlls/mouse
\
dlls/ntdll
\
files
\
graphics
\
...
...
@@ -97,7 +96,6 @@ LIBOBJS = \
console/console.o
\
dlls/advapi32/advapi32.o
\
dlls/crtdll/crtdll.o
\
dlls/mouse/mouse.o
\
dlls/ntdll/ntdll.o
\
files/files.o
\
graphics/graphics.o
\
...
...
configure
View file @
2b5d564e
...
...
@@ -6208,7 +6208,6 @@ dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/kernel/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile
...
...
@@ -6442,7 +6441,6 @@ dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/kernel/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile
...
...
configure.in
View file @
2b5d564e
...
...
@@ -1002,7 +1002,6 @@ dlls/imagehlp/Makefile
dlls/imm32/Makefile
dlls/kernel/Makefile
dlls/lzexpand/Makefile
dlls/mouse/Makefile
dlls/mpr/Makefile
dlls/msacm/Makefile
dlls/msacm32/Makefile
...
...
dlls/Makefile.in
View file @
2b5d564e
...
...
@@ -85,6 +85,7 @@ EXTRADLLNAMES = \
keyboard
\
lzexpand
\
mmsystem
\
mouse
\
msvideo
\
ole2
\
ole2conv
\
...
...
@@ -303,7 +304,7 @@ libttydrv.@LIBEXT@: ttydrv/libttydrv.@LIBEXT@
liburlmon.@LIBEXT@
:
urlmon/liburlmon.@LIBEXT@
$(RM)
$@
&&
$(LN_S)
urlmon/liburlmon.@LIBEXT@
$@
libuser32.@LIBEXT@ libuser.@LIBEXT@ libkeyboard.@LIBEXT@ libddeml.@LIBEXT@ libdisplay.@LIBEXT@
:
user/libuser32.@LIBEXT@
libuser32.@LIBEXT@ libuser.@LIBEXT@ libkeyboard.@LIBEXT@ libddeml.@LIBEXT@ libdisplay.@LIBEXT@
libmouse.@LIBEXT@
:
user/libuser32.@LIBEXT@
$(RM)
$@
&&
$(LN_S)
user/libuser32.@LIBEXT@
$@
libversion.@LIBEXT@ libver.@LIBEXT@
:
version/libversion.@LIBEXT@
...
...
dlls/dinput/Makefile.in
View file @
2b5d564e
...
...
@@ -4,6 +4,7 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
dinput
SOVERSION
=
1.0
IMPORTS
=
user32
SPEC_SRCS
=
dinput.spec
...
...
dlls/dinput/dinput.spec
View file @
2b5d564e
name dinput
type win32
import user32.dll
@ stdcall DirectInputCreateA(long long ptr ptr) DirectInputCreateA
@ stub DirectInputCreateW
@ stdcall DllCanUnloadNow() DINPUT_DllCanUnloadNow
...
...
dlls/mouse/.cvsignore
deleted
100644 → 0
View file @
01e819ad
Makefile
mouse.spec.c
mouserc.s
dlls/mouse/Makefile.in
deleted
100644 → 0
View file @
01e819ad
DEFS
=
@DLLFLAGS@
-D__WINE__
TOPSRCDIR
=
@top_srcdir@
TOPOBJDIR
=
../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
mouse
WRCEXTRA
=
-s
-w16
-pmouse
SPEC_SRCS
=
mouse.spec
C_SRCS
=
\
mouse_main.c
RC_SRCS
=
\
mouserc.rc
all
:
$(MODULE).o
@MAKE_RULES@
### Dependencies:
dlls/ttydrv/ttydrv_main.c
View file @
2b5d564e
...
...
@@ -12,7 +12,6 @@
#include "gdi.h"
#include "message.h"
#include "monitor.h"
#include "mouse.h"
#include "user.h"
#include "win.h"
#include "debugtools.h"
...
...
@@ -43,7 +42,6 @@ static USER_DRIVER user_driver =
TTYDRV_MOUSE_Init
,
TTYDRV_MOUSE_SetCursor
,
TTYDRV_MOUSE_MoveCursor
,
TTYDRV_MOUSE_EnableWarpPointer
,
/* screen saver functions */
TTYDRV_GetScreenSaveActive
,
TTYDRV_SetScreenSaveActive
,
...
...
dlls/user/.cvsignore
View file @
2b5d564e
...
...
@@ -3,4 +3,5 @@
Makefile
disp.s
libuser32.so.1.0
mouserc.s
thunk.glue.c
dlls/user/Makefile.in
View file @
2b5d564e
...
...
@@ -4,24 +4,27 @@ SRCDIR = @srcdir@
VPATH
=
@srcdir@
MODULE
=
user32
SOVERSION
=
1.0
WRCEXTRA
=
-
s
-w16
-pdisplay
ALTNAMES
=
user keyboard ddeml display
WRCEXTRA
=
-
w16
ALTNAMES
=
user keyboard ddeml display
mouse
SPEC_SRCS
=
\
user32.spec
\
user.spec
\
keyboard.spec
\
ddeml.spec
\
display.spec
display.spec
\
mouse.spec
C_SRCS
=
\
ddeml.c
\
display.c
\
mouse.c
\
user_main.c
\
thunk.c
RC_SRCS
=
\
disp.rc
disp.rc
\
mouserc.rc
GLUE
=
thunk.c
...
...
dlls/user/display.c
View file @
2b5d564e
...
...
@@ -6,7 +6,6 @@
*/
#include "debugtools.h"
#include "mouse.h"
#include "windef.h"
#include "user.h"
#include "wine/winuser16.h"
...
...
dlls/user/display.spec
View file @
2b5d564e
name display
type win16
rsrc disp
lay
rsrc disp
1 stub BitBlt
2 stub ColorInfo
...
...
dlls/
mouse/mouse_main
.c
→
dlls/
user/mouse
.c
View file @
2b5d564e
...
...
@@ -12,16 +12,28 @@
#include "builtin16.h"
#include "module.h"
#include "mouse.h"
#include "monitor.h"
#include "user.h"
#include "windef.h"
#include "wingdi.h"
#include "winuser.h"
#include "win.h"
#include "wine/winbase16.h"
DEFAULT_DEBUG_CHANNEL
(
event
);
#include "pshpack1.h"
typedef
struct
_MOUSEINFO
{
BYTE
msExist
;
BYTE
msRelative
;
WORD
msNumButtons
;
WORD
msRate
;
WORD
msXThreshold
;
WORD
msYThreshold
;
WORD
msXRes
;
WORD
msYRes
;
WORD
msMouseCommPort
;
}
MOUSEINFO
,
*
LPMOUSEINFO
;
#include "poppack.h"
/**********************************************************************/
static
LPMOUSE_EVENT_PROC
DefMouseEventProc
=
NULL
;
...
...
@@ -49,17 +61,9 @@ WORD WINAPI MOUSE_Inquire(LPMOUSEINFO mouseInfo)
*/
VOID
WINAPI
MOUSE_Enable
(
LPMOUSE_EVENT_PROC
lpMouseEventProc
)
{
static
BOOL
initDone
=
FALSE
;
THUNK_Free
(
(
FARPROC
)
DefMouseEventProc
);
DefMouseEventProc
=
lpMouseEventProc
;
/* Now initialize the mouse driver */
if
(
initDone
==
FALSE
)
{
USER_Driver
->
pInitMouse
();
initDone
=
TRUE
;
}
USER_Driver
->
pInitMouse
(
lpMouseEventProc
);
}
static
VOID
WINAPI
MOUSE_CallMouseEventProc
(
FARPROC16
proc
,
...
...
@@ -96,41 +100,5 @@ VOID WINAPI MOUSE_Disable(VOID)
{
THUNK_Free
(
(
FARPROC
)
DefMouseEventProc
);
DefMouseEventProc
=
0
;
}
/***********************************************************************
* MOUSE_SendEvent
*/
void
MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
DWORD
keyState
,
DWORD
time
,
HWND
hWnd
)
{
int
width
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
);
int
height
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
);
int
iWndsLocks
;
WINE_MOUSEEVENT
wme
;
if
(
!
DefMouseEventProc
)
return
;
TRACE
(
"(%04lX,%ld,%ld)
\n
"
,
mouseStatus
,
posX
,
posY
);
if
(
mouseStatus
&
MOUSEEVENTF_MOVE
)
{
if
(
mouseStatus
&
MOUSEEVENTF_ABSOLUTE
)
{
/* Relative mouse movements seems not to be scaled as absolute ones */
posX
=
(((
long
)
posX
<<
16
)
+
width
-
1
)
/
width
;
posY
=
(((
long
)
posY
<<
16
)
+
height
-
1
)
/
height
;
}
}
wme
.
magic
=
WINE_MOUSEEVENT_MAGIC
;
wme
.
time
=
time
;
wme
.
hWnd
=
hWnd
;
wme
.
keyState
=
keyState
;
USER_Driver
->
pEnableWarpPointer
(
FALSE
);
/* To avoid deadlocks, we have to suspend all locks on windows structures
before the program control is passed to the mouse driver */
iWndsLocks
=
WIN_SuspendWndsLock
();
DefMouseEventProc
(
mouseStatus
,
posX
,
posY
,
0
,
(
DWORD
)
&
wme
);
WIN_RestoreWndsLock
(
iWndsLocks
);
USER_Driver
->
pEnableWarpPointer
(
TRUE
);
USER_Driver
->
pInitMouse
(
0
);
}
dlls/
mouse
/mouse.spec
→
dlls/
user
/mouse.spec
View file @
2b5d564e
name mouse
type win16
rsrc mouse
rsrc mouse
rc
1 pascal16 Inquire(ptr) MOUSE_Inquire
2 pascal16 Enable(segptr) WIN16_MOUSE_Enable
...
...
dlls/
mouse
/mouserc.rc
→
dlls/
user
/mouserc.rc
View file @
2b5d564e
File moved
dlls/user/user_main.c
View file @
2b5d564e
...
...
@@ -14,7 +14,6 @@
#include "keyboard.h"
#include "menu.h"
#include "message.h"
#include "mouse.h"
#include "queue.h"
#include "spy.h"
#include "sysmetrics.h"
...
...
dlls/x11drv/x11drv_main.c
View file @
2b5d564e
...
...
@@ -54,7 +54,6 @@ static USER_DRIVER user_driver =
X11DRV_MOUSE_Init
,
X11DRV_MOUSE_SetCursor
,
X11DRV_MOUSE_MoveCursor
,
X11DRV_MOUSE_EnableWarpPointer
,
/* screen saver functions */
X11DRV_GetScreenSaveActive
,
X11DRV_SetScreenSaveActive
,
...
...
include/mouse.h
View file @
2b5d564e
...
...
@@ -8,29 +8,7 @@
#define __WINE_MOUSE_H
#include "windef.h"
struct
tagCURSORICONINFO
;
#include "pshpack1.h"
typedef
struct
_MOUSEINFO
{
BYTE
msExist
;
BYTE
msRelative
;
WORD
msNumButtons
;
WORD
msRate
;
WORD
msXThreshold
;
WORD
msYThreshold
;
WORD
msXRes
;
WORD
msYRes
;
WORD
msMouseCommPort
;
}
MOUSEINFO
,
*
LPMOUSEINFO
;
#include "poppack.h"
typedef
VOID
(
CALLBACK
*
LPMOUSE_EVENT_PROC
)(
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
WORD
WINAPI
MOUSE_Inquire
(
LPMOUSEINFO
lpMouseInfo
);
VOID
WINAPI
MOUSE_Enable
(
LPMOUSE_EVENT_PROC
lpMouseEventProc
);
VOID
WINAPI
MOUSE_Disable
(
VOID
);
#include "user.h"
/* Wine internals */
...
...
@@ -44,9 +22,6 @@ typedef struct _WINE_MOUSEEVENT
}
WINE_MOUSEEVENT
;
extern
void
MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
DWORD
keyState
,
DWORD
time
,
HWND
hWnd
);
/***********************************
* MouseWheel support (defines)
*/
...
...
include/ttydrv.h
View file @
2b5d564e
...
...
@@ -18,6 +18,7 @@
#include "wingdi.h"
#include "wine/winuser16.h"
#include "wine/wingdi16.h"
#include "user.h"
struct
tagBITMAPOBJ
;
struct
tagCLASS
;
...
...
@@ -170,10 +171,9 @@ extern void TTYDRV_KEYBOARD_SetKeyboardConfig(struct tagKEYBOARD_CONFIG *cfg, DW
/* TTY mouse driver */
extern
void
TTYDRV_MOUSE_Init
();
extern
void
TTYDRV_MOUSE_Init
(
LPMOUSE_EVENT_PROC
);
extern
void
TTYDRV_MOUSE_SetCursor
(
struct
tagCURSORICONINFO
*
lpCursor
);
extern
void
TTYDRV_MOUSE_MoveCursor
(
WORD
wAbsX
,
WORD
wAbsY
);
extern
LONG
TTYDRV_MOUSE_EnableWarpPointer
(
BOOL
bEnable
);
/* TTY windows driver */
...
...
include/user.h
View file @
2b5d564e
...
...
@@ -37,6 +37,8 @@ typedef struct tagKEYBOARD_CONFIG {
BOOL
auto_repeat
;
}
KEYBOARD_CONFIG
;
typedef
VOID
(
CALLBACK
*
LPMOUSE_EVENT_PROC
)(
DWORD
,
DWORD
,
DWORD
,
DWORD
,
DWORD
);
typedef
struct
tagUSER_DRIVER
{
/* event functions */
void
(
*
pSynchronize
)(
void
);
...
...
@@ -56,10 +58,9 @@ typedef struct tagUSER_DRIVER {
void
(
*
pGetKeyboardConfig
)(
KEYBOARD_CONFIG
*
);
void
(
*
pSetKeyboardConfig
)(
KEYBOARD_CONFIG
*
,
DWORD
);
/* mouse functions */
void
(
*
pInitMouse
)(
void
);
void
(
*
pInitMouse
)(
LPMOUSE_EVENT_PROC
);
void
(
*
pSetCursor
)(
struct
tagCURSORICONINFO
*
);
void
(
*
pMoveCursor
)(
WORD
,
WORD
);
LONG
(
*
pEnableWarpPointer
)(
BOOL
);
/* screen saver functions */
BOOL
(
*
pGetScreenSaveActive
)(
void
);
void
(
*
pSetScreenSaveActive
)(
BOOL
);
...
...
@@ -74,4 +75,7 @@ extern USER_DRIVER *USER_Driver;
WORD
WINAPI
UserSignalProc
(
UINT
uCode
,
DWORD
dwThreadOrProcessID
,
DWORD
dwFlags
,
HMODULE16
hModule
);
VOID
WINAPI
MOUSE_Enable
(
LPMOUSE_EVENT_PROC
lpMouseEventProc
);
VOID
WINAPI
MOUSE_Disable
(
VOID
);
#endif
/* __WINE_USER_H */
include/x11drv.h
View file @
2b5d564e
...
...
@@ -15,9 +15,10 @@
# include <X11/extensions/XShm.h>
#endif
/* defined(HAVE_LIBXXSHM) */
#include "gdi.h"
#include "winbase.h"
#include "windef.h"
#include "winbase.h"
#include "gdi.h"
#include "user.h"
#define MAX_PIXELFORMATS 8
...
...
@@ -393,10 +394,11 @@ extern void X11DRV_KEYBOARD_HandleEvent(struct tagWND *pWnd, XKeyEvent *event);
/* X11 mouse driver */
extern
void
X11DRV_MOUSE_Init
();
extern
void
X11DRV_MOUSE_Init
(
LPMOUSE_EVENT_PROC
);
extern
void
X11DRV_MOUSE_SetCursor
(
struct
tagCURSORICONINFO
*
lpCursor
);
extern
void
X11DRV_MOUSE_MoveCursor
(
WORD
wAbsX
,
WORD
wAbsY
);
extern
LONG
X11DRV_MOUSE_EnableWarpPointer
(
BOOL
bEnable
);
extern
void
X11DRV_MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
DWORD
keyState
,
DWORD
time
,
HWND
hWnd
);
/* X11 windows driver */
...
...
windows/ttydrv/mouse.c
View file @
2b5d564e
...
...
@@ -21,16 +21,8 @@ void TTYDRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY)
}
/***********************************************************************
* TTYDRV_MOUSE_EnableWarpPointer
*/
LONG
TTYDRV_MOUSE_EnableWarpPointer
(
BOOL
bEnable
)
{
return
0
;
}
/***********************************************************************
* TTYDRV_MOUSE_Init
*/
void
TTYDRV_MOUSE_Init
()
void
TTYDRV_MOUSE_Init
(
LPMOUSE_EVENT_PROC
proc
)
{
}
windows/x11drv/event.c
View file @
2b5d564e
...
...
@@ -694,15 +694,15 @@ static void EVENT_MotionNotify( HWND hWnd, XMotionEvent *event )
int
yOffset
=
pWnd
?
pWnd
->
rectWindow
.
top
:
0
;
WIN_ReleaseWndPtr
(
pWnd
);
MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
,
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
X11DRV_EVENT_XStateToKeyState
(
event
->
state
),
event
->
time
,
hWnd
);
X11DRV_
MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
,
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
X11DRV_EVENT_XStateToKeyState
(
event
->
state
),
event
->
time
,
hWnd
);
}
else
{
MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
,
event
->
x_root
,
event
->
y_root
,
X11DRV_EVENT_XStateToKeyState
(
event
->
state
),
event
->
time
,
hWnd
);
X11DRV_
MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
,
event
->
x_root
,
event
->
y_root
,
X11DRV_EVENT_XStateToKeyState
(
event
->
state
),
event
->
time
,
hWnd
);
}
}
...
...
@@ -753,10 +753,10 @@ static void EVENT_ButtonPress( HWND hWnd, XButtonEvent *event )
break
;
}
MOUSE_SendEvent
(
statusCodes
[
buttonNum
],
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
MAKEWPARAM
(
keystate
,
wData
),
event
->
time
,
hWnd
);
X11DRV_
MOUSE_SendEvent
(
statusCodes
[
buttonNum
],
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
MAKEWPARAM
(
keystate
,
wData
),
event
->
time
,
hWnd
);
}
...
...
@@ -801,9 +801,9 @@ static void EVENT_ButtonRelease( HWND hWnd, XButtonEvent *event )
return
;
}
MOUSE_SendEvent
(
statusCodes
[
buttonNum
],
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
keystate
,
event
->
time
,
hWnd
);
X11DRV_
MOUSE_SendEvent
(
statusCodes
[
buttonNum
],
xOffset
+
event
->
x
,
yOffset
+
event
->
y
,
keystate
,
event
->
time
,
hWnd
);
}
...
...
windows/x11drv/mouse.c
View file @
2b5d564e
...
...
@@ -11,17 +11,19 @@
#include "callback.h"
#include "debugtools.h"
#include "mouse.h"
#include "monitor.h"
#include "win.h"
#include "windef.h"
#include "x11drv.h"
DEFAULT_DEBUG_CHANNEL
(
cursor
)
DEFAULT_DEBUG_CHANNEL
(
cursor
)
;
/**********************************************************************/
Cursor
X11DRV_MOUSE_XCursor
=
None
;
/* Current X cursor */
static
LONG
X11DRV_MOUSE_WarpPointer
=
0
;
/* hack; see DISPLAY_MoveCursor */
static
LPMOUSE_EVENT_PROC
DefMouseEventProc
=
NULL
;
/***********************************************************************
* X11DRV_MOUSE_DoSetCursor
...
...
@@ -240,33 +242,65 @@ void X11DRV_MOUSE_MoveCursor(WORD wAbsX, WORD wAbsY)
}
/***********************************************************************
* X11DRV_MOUSE_
EnableWarpPointer
* X11DRV_MOUSE_
Init
*/
LONG
X11DRV_MOUSE_EnableWarpPointer
(
BOOL
bEnable
)
void
X11DRV_MOUSE_Init
(
LPMOUSE_EVENT_PROC
proc
)
{
if
(
bEnable
)
return
InterlockedIncrement
(
&
X11DRV_MOUSE_WarpPointer
);
else
return
InterlockedDecrement
(
&
X11DRV_MOUSE_WarpPointer
);
static
int
init_done
;
DefMouseEventProc
=
proc
;
if
(
!
init_done
)
{
Window
root
,
child
;
int
root_x
,
root_y
,
child_x
,
child_y
;
unsigned
int
KeyState
;
init_done
=
1
;
/* Get the current mouse position and simulate an absolute mouse
movement to initialize the mouse global variables */
TSXQueryPointer
(
display
,
X11DRV_GetXRootWindow
(),
&
root
,
&
child
,
&
root_x
,
&
root_y
,
&
child_x
,
&
child_y
,
&
KeyState
);
X11DRV_MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
,
root_x
,
root_y
,
X11DRV_EVENT_XStateToKeyState
(
KeyState
),
GetTickCount
(),
0
);
}
}
/***********************************************************************
* X11DRV_MOUSE_
Ini
t
* X11DRV_MOUSE_
SendEven
t
*/
void
X11DRV_MOUSE_Init
()
void
X11DRV_MOUSE_SendEvent
(
DWORD
mouseStatus
,
DWORD
posX
,
DWORD
posY
,
DWORD
keyState
,
DWORD
time
,
HWND
hWnd
)
{
Window
root
,
child
;
int
root_x
,
root_y
,
child_x
,
child_y
;
unsigned
int
KeyState
;
/* Get the current mouse position and simulate an absolute mouse
movement to initialize the mouse global variables */
TSXQueryPointer
(
display
,
X11DRV_GetXRootWindow
(),
&
root
,
&
child
,
&
root_x
,
&
root_y
,
&
child_x
,
&
child_y
,
&
KeyState
);
MOUSE_SendEvent
(
MOUSEEVENTF_MOVE
|
MOUSEEVENTF_ABSOLUTE
,
root_x
,
root_y
,
X11DRV_EVENT_XStateToKeyState
(
KeyState
),
GetTickCount
(),
0
);
int
width
=
MONITOR_GetWidth
(
&
MONITOR_PrimaryMonitor
);
int
height
=
MONITOR_GetHeight
(
&
MONITOR_PrimaryMonitor
);
int
iWndsLocks
;
WINE_MOUSEEVENT
wme
;
if
(
!
DefMouseEventProc
)
return
;
TRACE
(
"(%04lX,%ld,%ld)
\n
"
,
mouseStatus
,
posX
,
posY
);
if
(
mouseStatus
&
MOUSEEVENTF_MOVE
)
{
if
(
mouseStatus
&
MOUSEEVENTF_ABSOLUTE
)
{
/* Relative mouse movements seems not to be scaled as absolute ones */
posX
=
(((
long
)
posX
<<
16
)
+
width
-
1
)
/
width
;
posY
=
(((
long
)
posY
<<
16
)
+
height
-
1
)
/
height
;
}
}
wme
.
magic
=
WINE_MOUSEEVENT_MAGIC
;
wme
.
time
=
time
;
wme
.
hWnd
=
hWnd
;
wme
.
keyState
=
keyState
;
InterlockedDecrement
(
&
X11DRV_MOUSE_WarpPointer
);
/* To avoid deadlocks, we have to suspend all locks on windows structures
before the program control is passed to the mouse driver */
iWndsLocks
=
WIN_SuspendWndsLock
();
DefMouseEventProc
(
mouseStatus
,
posX
,
posY
,
0
,
(
DWORD
)
&
wme
);
WIN_RestoreWndsLock
(
iWndsLocks
);
InterlockedIncrement
(
&
X11DRV_MOUSE_WarpPointer
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment