From: Jacek Caban jacek@codeweavers.com
Signed-off-by: Jacek Caban jacek@codeweavers.com --- dlls/winex11.drv/dllmain.c | 36 ++++++++++++++++++++++++++++++ dlls/winex11.drv/unixlib.h | 8 +++++++ dlls/winex11.drv/wintab.c | 45 +++++++++++++++++++++----------------- dlls/winex11.drv/x11drv.h | 4 ++++ 4 files changed, 73 insertions(+), 20 deletions(-)
diff --git a/dlls/winex11.drv/dllmain.c b/dlls/winex11.drv/dllmain.c index f5e829d73af..84c20217c78 100644 --- a/dlls/winex11.drv/dllmain.c +++ b/dlls/winex11.drv/dllmain.c @@ -144,3 +144,39 @@ BOOL CDECL wine_create_desktop( UINT width, UINT height ) struct create_desktop_params params = { .width = width, .height = height }; return x11drv_create_desktop( ¶ms ); } + +/*********************************************************************** + * AttachEventQueueToTablet (winex11.@) + */ +int CDECL X11DRV_AttachEventQueueToTablet( HWND owner ) +{ + return x11drv_tablet_attach_queue( owner ); +} + +/*********************************************************************** + * GetCurrentPacket (winex11.@) + */ +int CDECL X11DRV_GetCurrentPacket( void *packet ) +{ + return x11drv_tablet_get_packet( packet ); +} + +/*********************************************************************** + * LoadTabletInfo (winex11.@) + */ +BOOL CDECL X11DRV_LoadTabletInfo( HWND hwnd ) +{ + return x11drv_tablet_load_info( hwnd ); +} + +/*********************************************************************** + * WTInfoW (winex11.@) + */ +UINT CDECL X11DRV_WTInfoW( UINT category, UINT index, void *output ) +{ + struct tablet_info_params params; + params.category = category; + params.index = index; + params.output = output; + return x11drv_tablet_info( ¶ms ); +} diff --git a/dlls/winex11.drv/unixlib.h b/dlls/winex11.drv/unixlib.h index 43a00b619c1..231beb055dc 100644 --- a/dlls/winex11.drv/unixlib.h +++ b/dlls/winex11.drv/unixlib.h @@ -35,6 +35,14 @@ struct create_desktop_params UINT height; };
+/* x11drv_tablet_info params */ +struct tablet_info_params +{ + UINT category; + UINT index; + void *output; +}; + /* DnD support */
struct format_entry diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index aa0d7be2fd0..edd6fb8d271 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -481,9 +481,9 @@ static void disable_system_cursors(void)
/*********************************************************************** - * X11DRV_LoadTabletInfo (X11DRV.@) + * x11drv_tablet_load_info */ -BOOL CDECL X11DRV_LoadTabletInfo(HWND hwnddefault) +NTSTATUS x11drv_tablet_load_info( void *hwnd ) { static const WCHAR SZ_CONTEXT_NAME[] = {'W','i','n','e',' ','T','a','b','l','e','t',' ','C','o','n','t','e','x','t',0}; static const WCHAR SZ_DEVICE_NAME[] = {'W','i','n','e',' ','T','a','b','l','e','t',' ','D','e','v','i','c','e',0}; @@ -509,7 +509,7 @@ BOOL CDECL X11DRV_LoadTabletInfo(HWND hwnddefault) return FALSE; }
- hwndTabletDefault = hwnddefault; + hwndTabletDefault = hwnd;
/* Do base initialization */ strcpyW(gSysContext.lcName, SZ_CONTEXT_NAME); @@ -1001,9 +1001,9 @@ static BOOL proximity_event( HWND hwnd, XEvent *event ) }
/*********************************************************************** - * X11DRV_AttachEventQueueToTablet (X11DRV.@) + * x11drv_tablet_attach_queue */ -int CDECL X11DRV_AttachEventQueueToTablet(HWND hOwner) +NTSTATUS x11drv_tablet_attach_queue( void *owner ) { struct x11drv_thread_data *data = x11drv_init_thread_data(); int num_devices; @@ -1013,11 +1013,11 @@ int CDECL X11DRV_AttachEventQueueToTablet(HWND hOwner) XDeviceInfo *target = NULL; XDevice *the_device; XEventClass event_list[7]; - Window win = X11DRV_get_whole_window( hOwner ); + Window win = X11DRV_get_whole_window( owner );
if (!win || !xinput_handle) return 0;
- TRACE("Creating context for window %p (%lx) %i cursors\n", hOwner, win, gNumCursors); + TRACE("Creating context for window %p (%lx) %i cursors\n", owner, win, gNumCursors);
devices = pXListInputDevices(data->display, &num_devices);
@@ -1093,11 +1093,11 @@ int CDECL X11DRV_AttachEventQueueToTablet(HWND hOwner) }
/*********************************************************************** - * X11DRV_GetCurrentPacket (X11DRV.@) + * x11drv_tablet_get_packet */ -int CDECL X11DRV_GetCurrentPacket(LPWTPACKET packet) +NTSTATUS x11drv_tablet_get_packet( void *packet ) { - *packet = gMsgPacket; + *(WTPACKET *)packet = gMsgPacket; return 1; }
@@ -1114,10 +1114,15 @@ static inline int CopyTabletData(LPVOID target, LPCVOID src, INT size) }
/*********************************************************************** - * X11DRV_WTInfoW (X11DRV.@) + * x11drv_tablet_info */ -UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) +NTSTATUS x11drv_tablet_info( void *arg ) { + struct tablet_info_params *params = arg; + UINT wCategory = params->category; + UINT nIndex = params->index; + void *lpOutput = params->output; + /* * It is valid to call WTInfoA with lpOutput == NULL, as per standard. * lpOutput == NULL signifies the user only wishes @@ -1546,33 +1551,33 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) #else /* SONAME_LIBXI */
/*********************************************************************** - * AttachEventQueueToTablet (X11DRV.@) + * x11drv_tablet_attach_queue */ -int CDECL X11DRV_AttachEventQueueToTablet(HWND hOwner) +NTSTATUS x11drv_tablet_attach_queue( void *owner ) { return 0; }
/*********************************************************************** - * GetCurrentPacket (X11DRV.@) + * x11drv_tablet_get_packet */ -int CDECL X11DRV_GetCurrentPacket(LPWTPACKET packet) +NTSTATUS x11drv_tablet_get_packet( void *arg ) { return 0; }
/*********************************************************************** - * LoadTabletInfo (X11DRV.@) + * x11drv_tablet_load_info */ -BOOL CDECL X11DRV_LoadTabletInfo(HWND hwnddefault) +NTSTATUS x11drv_tablet_load_info( void *arg ) { return FALSE; }
/*********************************************************************** - * WTInfoW (X11DRV.@) + * x11drv_tablet_info */ -UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) +NTSTATUS x11drv_tablet_info( void *arg ) { return 0; } diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index bda4322d26b..5f49f609e1e 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -846,6 +846,10 @@ static inline BOOL is_window_rect_mapped( const RECT *rect ) extern NTSTATUS x11drv_init( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_clipboard_message( void *arg ) DECLSPEC_HIDDEN; extern NTSTATUS x11drv_create_desktop( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_tablet_attach_queue( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_tablet_get_packet( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_tablet_load_info( void *arg ) DECLSPEC_HIDDEN; +extern NTSTATUS x11drv_tablet_info( void *arg ) DECLSPEC_HIDDEN;
extern NTSTATUS WINAPI x11drv_post_drop( void *data, ULONG size ) DECLSPEC_HIDDEN;