Signed-off-by: Elaine Lefler elaineclefler@gmail.com ---
v2: Splitting into smaller patches as per feedback.
CopyTabletData has been renamed to TABLET_CopyData due to a name conflict and for consistency with other wintab32 functions. --- dlls/winex11.drv/wintab.c | 326 +++++++++++++++++--------------------- include/wintab.h | 48 +++++- 2 files changed, 188 insertions(+), 186 deletions(-)
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index a157d44807c..5fc1e8089b8 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -203,37 +203,6 @@ typedef struct tagWTI_DEVICES_INFO } WTI_DEVICES_INFO, *LPWTI_DEVICES_INFO;
-/*********************************************************************** - * WACOM WINTAB EXTENSIONS TO SUPPORT CSR_TYPE - * In Wintab 1.2, a CSR_TYPE feature was added. This adds the - * ability to return a type of cursor on a tablet. - * Unfortunately, we cannot get the cursor type directly from X, - * and it is not specified directly anywhere. So we virtualize - * the type here. (This is unfortunate, the kernel module has - * the exact type, but we have no way of getting that module to - * pass us that type). - * - * Reference linuxwacom driver project wcmCommon.c function - * idtotype for a much larger list of CSR_TYPE. - * - * http://linuxwacom.cvs.sourceforge.net/linuxwacom/linuxwacom-prod/src/xdrv/wc... - * - * The WTI_CURSORS_INFO.TYPE data is supposed to be used like this: - * (cursor.TYPE & 0x0F06) == target_cursor_type - * Reference: Section Unique ID - * http://www.wacomeng.com/devsupport/ibmpc/gddevpc.html - */ -#define CSR_TYPE_PEN 0x822 -#define CSR_TYPE_ERASER 0x82a -#define CSR_TYPE_MOUSE_2D 0x007 -#define CSR_TYPE_MOUSE_4D 0x094 -/* CSR_TYPE_OTHER is a special value! assumed no real world significance - * if a stylus type or eraser type eventually have this value - * it'll be a bug. As of 2008 05 21 we can be sure because - * linux wacom lists all the known values and this isn't one of them */ -#define CSR_TYPE_OTHER 0x000 - - #ifdef SONAME_LIBXI
#include <X11/Xlib.h> @@ -1085,17 +1054,6 @@ int CDECL X11DRV_GetCurrentPacket(LPPACKET packet) }
-static inline int CopyTabletData(LPVOID target, LPCVOID src, INT size) -{ - /* - * It is valid to call CopyTabletData with NULL. - * This handles the WTInfo() case where lpOutput is null. - */ - if(target != NULL) - memcpy(target,src,size); - return(size); -} - /*********************************************************************** * X11DRV_WTInfoW (X11DRV.@) */ @@ -1106,7 +1064,7 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) * lpOutput == NULL signifies the user only wishes * to find the size of the data. * NOTE: - * From now on use CopyTabletData to fill lpOutput. memcpy will break + * From now on use TABLET_CopyData to fill lpOutput. memcpy will break * the code. */ int rc = 0; @@ -1134,24 +1092,24 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) case IFC_WINTABID: { static const WCHAR driver[] = {'W','i','n','e',' ','W','i','n','t','a','b',' ','1','.','1',0}; - rc = CopyTabletData(lpOutput, driver, (strlenW(driver) + 1) * sizeof(WCHAR)); + rc = TABLET_CopyData(lpOutput, driver, (strlenW(driver) + 1) * sizeof(WCHAR)); break; } case IFC_SPECVERSION: version = (0x01) | (0x01 << 8); - rc = CopyTabletData(lpOutput, &version,sizeof(WORD)); + rc = TABLET_CopyData(lpOutput, &version,sizeof(WORD)); break; case IFC_IMPLVERSION: version = (0x00) | (0x01 << 8); - rc = CopyTabletData(lpOutput, &version,sizeof(WORD)); + rc = TABLET_CopyData(lpOutput, &version,sizeof(WORD)); break; case IFC_NDEVICES: num = 1; - rc = CopyTabletData(lpOutput, &num,sizeof(num)); + rc = TABLET_CopyData(lpOutput, &num,sizeof(num)); break; case IFC_NCURSORS: num = gNumCursors; - rc = CopyTabletData(lpOutput, &num,sizeof(num)); + rc = TABLET_CopyData(lpOutput, &num,sizeof(num)); break; default: FIXME("WTI_INTERFACE unhandled index %i\n",nIndex); @@ -1168,144 +1126,144 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) if (0 == gNumCursors) rc = 0; else - rc = CopyTabletData(lpOutput, &gSysContext, + rc = TABLET_CopyData(lpOutput, &gSysContext, sizeof(LOGCONTEXTW)); break; case CTX_NAME: - rc = CopyTabletData(lpOutput, gSysContext.lcName, + rc = TABLET_CopyData(lpOutput, gSysContext.lcName, (strlenW(gSysContext.lcName)+1) * sizeof(WCHAR)); break; case CTX_OPTIONS: - rc = CopyTabletData(lpOutput, &gSysContext.lcOptions, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOptions, + sizeof(UINT)); break; case CTX_STATUS: - rc = CopyTabletData(lpOutput, &gSysContext.lcStatus, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcStatus, + sizeof(UINT)); break; case CTX_LOCKS: - rc= CopyTabletData (lpOutput, &gSysContext.lcLocks, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcLocks, + sizeof(UINT)); break; case CTX_MSGBASE: - rc = CopyTabletData(lpOutput, &gSysContext.lcMsgBase, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcMsgBase, + sizeof(UINT)); break; case CTX_DEVICE: - rc = CopyTabletData(lpOutput, &gSysContext.lcDevice, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcDevice, + sizeof(UINT)); break; case CTX_PKTRATE: - rc = CopyTabletData(lpOutput, &gSysContext.lcPktRate, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcPktRate, + sizeof(UINT)); break; case CTX_PKTDATA: - rc = CopyTabletData(lpOutput, &gSysContext.lcPktData, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcPktData, + sizeof(WTPKT)); break; case CTX_PKTMODE: - rc = CopyTabletData(lpOutput, &gSysContext.lcPktMode, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcPktMode, + sizeof(WTPKT)); break; case CTX_MOVEMASK: - rc = CopyTabletData(lpOutput, &gSysContext.lcMoveMask, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcMoveMask, + sizeof(WTPKT)); break; case CTX_BTNDNMASK: - rc = CopyTabletData(lpOutput, &gSysContext.lcBtnDnMask, - sizeof(DWORD)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcBtnDnMask, + sizeof(DWORD)); break; case CTX_BTNUPMASK: - rc = CopyTabletData(lpOutput, &gSysContext.lcBtnUpMask, - sizeof(DWORD)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcBtnUpMask, + sizeof(DWORD)); break; case CTX_INORGX: - rc = CopyTabletData(lpOutput, &gSysContext.lcInOrgX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInOrgX, + sizeof(LONG)); break; case CTX_INORGY: - rc = CopyTabletData(lpOutput, &gSysContext.lcInOrgY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInOrgY, + sizeof(LONG)); break; case CTX_INORGZ: - rc = CopyTabletData(lpOutput, &gSysContext.lcInOrgZ, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInOrgZ, + sizeof(LONG)); break; case CTX_INEXTX: - rc = CopyTabletData(lpOutput, &gSysContext.lcInExtX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInExtX, + sizeof(LONG)); break; case CTX_INEXTY: - rc = CopyTabletData(lpOutput, &gSysContext.lcInExtY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInExtY, + sizeof(LONG)); break; case CTX_INEXTZ: - rc = CopyTabletData(lpOutput, &gSysContext.lcInExtZ, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcInExtZ, + sizeof(LONG)); break; case CTX_OUTORGX: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutOrgX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutOrgX, + sizeof(LONG)); break; case CTX_OUTORGY: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutOrgY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutOrgY, + sizeof(LONG)); break; case CTX_OUTORGZ: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutOrgZ, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutOrgZ, + sizeof(LONG)); break; case CTX_OUTEXTX: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutExtX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutExtX, + sizeof(LONG)); break; case CTX_OUTEXTY: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutExtY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutExtY, + sizeof(LONG)); break; case CTX_OUTEXTZ: - rc = CopyTabletData(lpOutput, &gSysContext.lcOutExtZ, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcOutExtZ, + sizeof(LONG)); break; case CTX_SENSX: - rc = CopyTabletData(lpOutput, &gSysContext.lcSensX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSensX, + sizeof(LONG)); break; case CTX_SENSY: - rc = CopyTabletData(lpOutput, &gSysContext.lcSensY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSensY, + sizeof(LONG)); break; case CTX_SENSZ: - rc = CopyTabletData(lpOutput, &gSysContext.lcSensZ, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSensZ, + sizeof(LONG)); break; case CTX_SYSMODE: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysMode, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysMode, + sizeof(LONG)); break; case CTX_SYSORGX: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysOrgX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysOrgX, + sizeof(LONG)); break; case CTX_SYSORGY: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysOrgY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysOrgY, + sizeof(LONG)); break; case CTX_SYSEXTX: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysExtX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysExtX, + sizeof(LONG)); break; case CTX_SYSEXTY: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysExtY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysExtY, + sizeof(LONG)); break; case CTX_SYSSENSX: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysSensX, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysSensX, + sizeof(LONG)); break; case CTX_SYSSENSY: - rc = CopyTabletData(lpOutput, &gSysContext.lcSysSensY, - sizeof(LONG)); + rc = TABLET_CopyData(lpOutput, &gSysContext.lcSysSensY, + sizeof(LONG)); break; default: FIXME("WTI_DEFSYSCTX unhandled index %i\n",nIndex); @@ -1336,57 +1294,57 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) switch (nIndex) { case CSR_NAME: - rc = CopyTabletData(lpOutput, tgtcursor->NAME, - (strlenW(tgtcursor->NAME)+1) * sizeof(WCHAR)); + rc = TABLET_CopyData(lpOutput, tgtcursor->NAME, + (strlenW(tgtcursor->NAME)+1) * sizeof(WCHAR)); break; case CSR_ACTIVE: - rc = CopyTabletData(lpOutput,&tgtcursor->ACTIVE, - sizeof(BOOL)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->ACTIVE, + sizeof(BOOL)); break; case CSR_PKTDATA: - rc = CopyTabletData(lpOutput,&tgtcursor->PKTDATA, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->PKTDATA, + sizeof(WTPKT)); break; case CSR_BUTTONS: - rc = CopyTabletData(lpOutput,&tgtcursor->BUTTONS, - sizeof(BYTE)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->BUTTONS, + sizeof(BYTE)); break; case CSR_BUTTONBITS: - rc = CopyTabletData(lpOutput,&tgtcursor->BUTTONBITS, - sizeof(BYTE)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->BUTTONBITS, + sizeof(BYTE)); break; case CSR_BTNNAMES: FIXME("Button Names not returned correctly\n"); - rc = CopyTabletData(lpOutput,&tgtcursor->BTNNAMES, - tgtcursor->cchBTNNAMES*sizeof(WCHAR)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->BTNNAMES, + tgtcursor->cchBTNNAMES*sizeof(WCHAR)); break; case CSR_BUTTONMAP: - rc = CopyTabletData(lpOutput,tgtcursor->BUTTONMAP, - sizeof(BYTE)*32); + rc = TABLET_CopyData(lpOutput,tgtcursor->BUTTONMAP, + sizeof(BYTE)*32); break; case CSR_SYSBTNMAP: - rc = CopyTabletData(lpOutput,tgtcursor->SYSBTNMAP, - sizeof(BYTE)*32); + rc = TABLET_CopyData(lpOutput,tgtcursor->SYSBTNMAP, + sizeof(BYTE)*32); break; case CSR_NPBTNMARKS: - rc = CopyTabletData(lpOutput,tgtcursor->NPBTNMARKS, - sizeof(UINT)*2); + rc = TABLET_CopyData(lpOutput,tgtcursor->NPBTNMARKS, + sizeof(UINT)*2); break; case CSR_NPBUTTON: - rc = CopyTabletData(lpOutput,&tgtcursor->NPBUTTON, - sizeof(BYTE)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->NPBUTTON, + sizeof(BYTE)); break; case CSR_NPRESPONSE: FIXME("Not returning CSR_NPRESPONSE correctly\n"); rc = 0; break; case CSR_TPBUTTON: - rc = CopyTabletData(lpOutput,&tgtcursor->TPBUTTON, - sizeof(BYTE)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->TPBUTTON, + sizeof(BYTE)); break; case CSR_TPBTNMARKS: - rc = CopyTabletData(lpOutput,tgtcursor->TPBTNMARKS, - sizeof(UINT)*2); + rc = TABLET_CopyData(lpOutput,tgtcursor->TPBTNMARKS, + sizeof(UINT)*2); break; case CSR_TPRESPONSE: FIXME("Not returning CSR_TPRESPONSE correctly\n"); @@ -1396,26 +1354,26 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) { DWORD id; id = tgtcursor->PHYSID; - rc = CopyTabletData(lpOutput,&id,sizeof(DWORD)); + rc = TABLET_CopyData(lpOutput,&id,sizeof(DWORD)); } break; case CSR_MODE: - rc = CopyTabletData(lpOutput,&tgtcursor->MODE,sizeof(UINT)); + rc = TABLET_CopyData(lpOutput,&tgtcursor->MODE,sizeof(UINT)); break; case CSR_MINPKTDATA: - rc = CopyTabletData(lpOutput,&tgtcursor->MINPKTDATA, + rc = TABLET_CopyData(lpOutput,&tgtcursor->MINPKTDATA, sizeof(UINT)); break; case CSR_MINBUTTONS: - rc = CopyTabletData(lpOutput,&tgtcursor->MINBUTTONS, + rc = TABLET_CopyData(lpOutput,&tgtcursor->MINBUTTONS, sizeof(UINT)); break; case CSR_CAPABILITIES: - rc = CopyTabletData(lpOutput,&tgtcursor->CAPABILITIES, + rc = TABLET_CopyData(lpOutput,&tgtcursor->CAPABILITIES, sizeof(UINT)); break; case CSR_TYPE: - rc = CopyTabletData(lpOutput,&tgtcursor->TYPE, + rc = TABLET_CopyData(lpOutput,&tgtcursor->TYPE, sizeof(UINT)); break; default: @@ -1428,92 +1386,92 @@ UINT CDECL X11DRV_WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput) switch (nIndex) { case DVC_NAME: - rc = CopyTabletData(lpOutput,gSysDevice.NAME, - (strlenW(gSysDevice.NAME)+1) * sizeof(WCHAR)); + rc = TABLET_CopyData(lpOutput,gSysDevice.NAME, + (strlenW(gSysDevice.NAME)+1) * sizeof(WCHAR)); break; case DVC_HARDWARE: - rc = CopyTabletData(lpOutput,&gSysDevice.HARDWARE, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.HARDWARE, + sizeof(UINT)); break; case DVC_NCSRTYPES: - rc = CopyTabletData(lpOutput,&gSysDevice.NCSRTYPES, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.NCSRTYPES, + sizeof(UINT)); break; case DVC_FIRSTCSR: - rc = CopyTabletData(lpOutput,&gSysDevice.FIRSTCSR, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.FIRSTCSR, + sizeof(UINT)); break; case DVC_PKTRATE: - rc = CopyTabletData(lpOutput,&gSysDevice.PKTRATE, - sizeof(UINT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.PKTRATE, + sizeof(UINT)); break; case DVC_PKTDATA: - rc = CopyTabletData(lpOutput,&gSysDevice.PKTDATA, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.PKTDATA, + sizeof(WTPKT)); break; case DVC_PKTMODE: - rc = CopyTabletData(lpOutput,&gSysDevice.PKTMODE, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.PKTMODE, + sizeof(WTPKT)); break; case DVC_CSRDATA: - rc = CopyTabletData(lpOutput,&gSysDevice.CSRDATA, - sizeof(WTPKT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.CSRDATA, + sizeof(WTPKT)); break; case DVC_XMARGIN: - rc = CopyTabletData(lpOutput,&gSysDevice.XMARGIN, - sizeof(INT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.XMARGIN, + sizeof(INT)); break; case DVC_YMARGIN: - rc = CopyTabletData(lpOutput,&gSysDevice.YMARGIN, - sizeof(INT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.YMARGIN, + sizeof(INT)); break; case DVC_ZMARGIN: rc = 0; /* unsupported */ /* - rc = CopyTabletData(lpOutput,&gSysDevice.ZMARGIN, - sizeof(INT)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.ZMARGIN, + sizeof(INT)); */ break; case DVC_X: - rc = CopyTabletData(lpOutput,&gSysDevice.X, - sizeof(AXIS)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.X, + sizeof(AXIS)); break; case DVC_Y: - rc = CopyTabletData(lpOutput,&gSysDevice.Y, - sizeof(AXIS)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.Y, + sizeof(AXIS)); break; case DVC_Z: rc = 0; /* unsupported */ /* - rc = CopyTabletData(lpOutput,&gSysDevice.Z, - sizeof(AXIS)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.Z, + sizeof(AXIS)); */ break; case DVC_NPRESSURE: - rc = CopyTabletData(lpOutput,&gSysDevice.NPRESSURE, - sizeof(AXIS)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.NPRESSURE, + sizeof(AXIS)); break; case DVC_TPRESSURE: rc = 0; /* unsupported */ /* - rc = CopyTabletData(lpOutput,&gSysDevice.TPRESSURE, - sizeof(AXIS)); + rc = TABLET_CopyData(lpOutput,&gSysDevice.TPRESSURE, + sizeof(AXIS)); */ break; case DVC_ORIENTATION: - rc = CopyTabletData(lpOutput,gSysDevice.ORIENTATION, - sizeof(AXIS)*3); + rc = TABLET_CopyData(lpOutput,gSysDevice.ORIENTATION, + sizeof(AXIS)*3); break; case DVC_ROTATION: rc = 0; /* unsupported */ /* - rc = CopyTabletData(lpOutput,&gSysDevice.ROTATION, - sizeof(AXIS)*3); + rc = TABLET_CopyData(lpOutput,&gSysDevice.ROTATION, + sizeof(AXIS)*3); */ break; case DVC_PNPID: - rc = CopyTabletData(lpOutput,gSysDevice.PNPID, - (strlenW(gSysDevice.PNPID)+1)*sizeof(WCHAR)); + rc = TABLET_CopyData(lpOutput,gSysDevice.PNPID, + (strlenW(gSysDevice.PNPID)+1)*sizeof(WCHAR)); break; default: FIXME("WTI_DEVICES unhandled index %i\n",nIndex); diff --git a/include/wintab.h b/include/wintab.h index d1298b9c20b..e758a52a174 100644 --- a/include/wintab.h +++ b/include/wintab.h @@ -794,10 +794,54 @@ BOOL WINAPI WTMgrCsrPressureBtnMarksEx(HMGR, UINT, UINT *, UINT *);
#endif
-#endif +/*********************************************************************** + * WACOM WINTAB EXTENSIONS TO SUPPORT CSR_TYPE + * In Wintab 1.2, a CSR_TYPE feature was added. This adds the + * ability to return a type of cursor on a tablet. + * Unfortunately, we cannot get the cursor type directly from X, + * and it is not specified directly anywhere. So we virtualize + * the type here. (This is unfortunate, the kernel module has + * the exact type, but we have no way of getting that module to + * pass us that type). + * + * Reference linuxwacom driver project wcmCommon.c function + * idtotype for a much larger list of CSR_TYPE. + * + * http://linuxwacom.cvs.sourceforge.net/linuxwacom/linuxwacom-prod/src/xdrv/wc... + * + * The WTI_CURSORS_INFO.TYPE data is supposed to be used like this: + * (cursor.TYPE & 0x0F06) == target_cursor_type + * Reference: Section Unique ID + * http://www.wacomeng.com/devsupport/ibmpc/gddevpc.html + */ +#define CSR_TYPE_PEN 0x822 +#define CSR_TYPE_ERASER 0x82a +#define CSR_TYPE_MOUSE_2D 0x007 +#define CSR_TYPE_MOUSE_4D 0x094 +/* CSR_TYPE_OTHER is a special value! assumed no real world significance + * if a stylus type or eraser type eventually have this value + * it'll be a bug. As of 2008 05 21 we can be sure because + * linux wacom lists all the known values and this isn't one of them */ +#define CSR_TYPE_OTHER 0x000 + +/*********************************************************************** + * WINE HELPER FUNCTIONS + */ + +/* Helper for WTInfoW. It is valid to call WTInfoW with lpOutput == NULL, in + * which case it must return the size of the data without copying anything. + * This function handles that case. */ +static inline int TABLET_CopyData(LPVOID target, LPCVOID src, INT size) +{ + if(target != NULL) + memcpy(target,src,size); + return(size); +} + +#endif /* !defined(NOWTFUNCTIONS) */
#ifdef __cplusplus } /* extern "C" */ #endif /* defined(__cplusplus) */
-#endif /* defined(__WINE_WINTAB_H */ +#endif /* !defined(__WINE_WINTAB_H) */