Added Wacom API headers.
authorSam Lantinga <slouken@libsdl.org>
Tue, 26 Aug 2008 05:26:28 +0000
changeset 27240e2b65f32298
parent 2723 911db724ea24
child 2725 6ce6d56b63bf
Added Wacom API headers.
FIXME: Dynamically load the Wacom API functions from wintab32.dll
src/video/win32/SDL_win32events.c
src/video/win32/SDL_win32keyboard.c
src/video/win32/SDL_win32mouse.c
src/video/win32/SDL_win32video.c
src/video/win32/SDL_win32video.h
src/video/win32/SDL_win32window.c
src/video/win32/wactab/pktdef.h
src/video/win32/wactab/wintab.h
src/video/win32/wactab/wintabx.h
     1.1 --- a/src/video/win32/SDL_win32events.c	Tue Aug 26 02:47:26 2008 +0000
     1.2 +++ b/src/video/win32/SDL_win32events.c	Tue Aug 26 05:26:28 2008 +0000
     1.3 @@ -32,11 +32,6 @@
     1.4  #include "SDL_vkeys.h"
     1.5  #include "../../events/SDL_events_c.h"
     1.6  
     1.7 -#include <wintab.h>
     1.8 -#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
     1.9 -#define PACKETMODE 0
    1.10 -#include <pktdef.h>
    1.11 -
    1.12  /*#define WMMSG_DEBUG*/
    1.13  #ifdef WMMSG_DEBUG
    1.14  #include <stdio.h>
    1.15 @@ -152,17 +147,15 @@
    1.16          {
    1.17              /* checking where the proximity message showed up */
    1.18              int h_context = LOWORD(lParam);
    1.19 -            LPPOINT point;
    1.20 +            POINT point;
    1.21              GetCursorPos(&point);
    1.22              ScreenToClient(hwnd, &point);
    1.23  
    1.24              /* are we in proximity or out of proximity */
    1.25              if (h_context == 0) {
    1.26 -                SDL_SendProximity(tablet, (int) (&point->x),
    1.27 -                                  (int) (&point->y), SDL_PROXIMITYOUT);
    1.28 +                SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYOUT);
    1.29              } else {
    1.30 -                SDL_SendProximity(tablet, (int) (&point->x),
    1.31 -                                  (int) (&point->y), SDL_PROXIMITYIN);
    1.32 +                SDL_SendProximity(tablet, point.x, point.y, SDL_PROXIMITYIN);
    1.33              }
    1.34          }
    1.35          break;
    1.36 @@ -222,7 +215,7 @@
    1.37              int i;
    1.38              int size = 0;
    1.39              const RAWMOUSE *raw_mouse = NULL;
    1.40 -            LPPOINT point;
    1.41 +            POINT point;
    1.42              USHORT flags;
    1.43  
    1.44              /* we're collecting data from the mouse */
    1.45 @@ -249,11 +242,9 @@
    1.46  
    1.47              /* if the message was sent by a tablet we have to send also pressure */
    1.48              if (i == tablet) {
    1.49 -                SDL_SendMouseMotion(index, 0, (int) (&point->x),
    1.50 -                                    (int) (&point->y), pressure);
    1.51 +                SDL_SendMouseMotion(index, 0, point.x, point.y, pressure);
    1.52              } else {
    1.53 -                SDL_SendMouseMotion(index, 0, (int) (&point->x),
    1.54 -                                    (int) (&point->y), 0);
    1.55 +                SDL_SendMouseMotion(index, 0, point.x, point.y, 0);
    1.56              }
    1.57              /* we're sending mouse buttons messages to check up if sth changed */
    1.58              if (flags & RI_MOUSE_BUTTON_1_DOWN) {
     2.1 --- a/src/video/win32/SDL_win32keyboard.c	Tue Aug 26 02:47:26 2008 +0000
     2.2 +++ b/src/video/win32/SDL_win32keyboard.c	Tue Aug 26 05:26:28 2008 +0000
     2.3 @@ -54,20 +54,26 @@
     2.4  
     2.5      /* Make sure the alpha scancodes are correct.  T isn't usually remapped */
     2.6      if (MapVirtualKey('T', MAPVK_VK_TO_VSC) != alpha_scancodes['T' - 'A']) {
     2.7 -        printf
     2.8 -            ("Fixing alpha scancode map, assuming US QWERTY layout!\nPlease send the following 26 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n");
     2.9 +#if 0
    2.10 +        printf("Fixing alpha scancode map, assuming US QWERTY layout!\nPlease send the following 26 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n");
    2.11 +#endif
    2.12          for (i = 0; i < SDL_arraysize(alpha_scancodes); ++i) {
    2.13              alpha_scancodes[i] = MapVirtualKey('A' + i, MAPVK_VK_TO_VSC);
    2.14 +#if 0
    2.15              printf("%d = %d\n", i, alpha_scancodes[i]);
    2.16 +#endif
    2.17          }
    2.18      }
    2.19      if (MapVirtualKey(VK_NUMPAD0, MAPVK_VK_TO_VSC) != keypad_scancodes[0]) {
    2.20 -        printf
    2.21 -            ("Fixing keypad scancode map!\nPlease send the following 10 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n");
    2.22 +#if 0
    2.23 +        printf("Fixing keypad scancode map!\nPlease send the following 10 lines of output to the SDL mailing list <sdl@libsdl.org>, including a description of your keyboard hardware.\n");
    2.24 +#endif
    2.25          for (i = 0; i < SDL_arraysize(keypad_scancodes); ++i) {
    2.26              keypad_scancodes[i] =
    2.27                  MapVirtualKey(VK_NUMPAD0 + i, MAPVK_VK_TO_VSC);
    2.28 +#if 0
    2.29              printf("%d = %d\n", i, keypad_scancodes[i]);
    2.30 +#endif
    2.31          }
    2.32      }
    2.33  
     3.1 --- a/src/video/win32/SDL_win32mouse.c	Tue Aug 26 02:47:26 2008 +0000
     3.2 +++ b/src/video/win32/SDL_win32mouse.c	Tue Aug 26 05:26:28 2008 +0000
     3.3 @@ -33,11 +33,6 @@
     3.4  
     3.5  #include "../../events/SDL_mouse_c.h"
     3.6  
     3.7 -#include <wintab.h>
     3.8 -
     3.9 -#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
    3.10 -#define PACKETMODE 0
    3.11 -#include <pktdef.h>
    3.12  extern HANDLE *mice;
    3.13  extern int total_mice;
    3.14  extern int tablet;
     4.1 --- a/src/video/win32/SDL_win32video.c	Tue Aug 26 02:47:26 2008 +0000
     4.2 +++ b/src/video/win32/SDL_win32video.c	Tue Aug 26 05:26:28 2008 +0000
     4.3 @@ -31,8 +31,6 @@
     4.4  #include "SDL_d3drender.h"
     4.5  #include "SDL_gdirender.h"
     4.6  
     4.7 -#include <wintab.h>
     4.8 -
     4.9  /* Initialization/Query functions */
    4.10  static int WIN_VideoInit(_THIS);
    4.11  static void WIN_VideoQuit(_THIS);
     5.1 --- a/src/video/win32/SDL_win32video.h	Tue Aug 26 02:47:26 2008 +0000
     5.2 +++ b/src/video/win32/SDL_win32video.h	Tue Aug 26 05:26:28 2008 +0000
     5.3 @@ -37,6 +37,11 @@
     5.4  #include "d3d9.h"
     5.5  #endif
     5.6  
     5.7 +#include "wactab/wintab.h"
     5.8 +#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
     5.9 +#define PACKETMODE 0
    5.10 +#include "wactab/pktdef.h"
    5.11 +
    5.12  #include "SDL_win32events.h"
    5.13  #include "SDL_win32gamma.h"
    5.14  #include "SDL_win32keyboard.h"
     6.1 --- a/src/video/win32/SDL_win32window.c	Tue Aug 26 02:47:26 2008 +0000
     6.2 +++ b/src/video/win32/SDL_win32window.c	Tue Aug 26 05:26:28 2008 +0000
     6.3 @@ -37,13 +37,6 @@
     6.4  /* This is included after SDL_win32video.h, which includes windows.h */
     6.5  #include "SDL_syswm.h"
     6.6  
     6.7 -#include <wintab.h>
     6.8 -
     6.9 -/* we're telling wintab that we want to receive movement, button events and pressure information in packets */
    6.10 -#define PACKETDATA ( PK_X | PK_Y | PK_BUTTONS | PK_NORMAL_PRESSURE | PK_CURSOR)
    6.11 -#define PACKETMODE 0
    6.12 -#include <pktdef.h>
    6.13 -
    6.14  extern HCTX *g_hCtx;            /* the table of tablet event contexts, each windows has to have it's own tablet context */
    6.15  int highestId = 0;              /* the highest id of the tablet context */
    6.16  
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/video/win32/wactab/pktdef.h	Tue Aug 26 05:26:28 2008 +0000
     7.3 @@ -0,0 +1,236 @@
     7.4 +/* -------------------------------- pktdef.h -------------------------------- */
     7.5 +/* Combined 16 & 32-bit version. */
     7.6 +
     7.7 +/*------------------------------------------------------------------------------
     7.8 +The text and information contained in this file may be freely used,
     7.9 +copied, or distributed without compensation or licensing restrictions.
    7.10 +
    7.11 +This file is copyright 1991-1998 by LCS/Telegraphics.
    7.12 +------------------------------------------------------------------------------*/
    7.13 +/*------------------------------------------------------------------------------
    7.14 +
    7.15 +How to use pktdef.h:
    7.16 +
    7.17 +1. Include wintab.h
    7.18 +2. if using just one packet format:
    7.19 +	a. Define PACKETDATA and PACKETMODE as or'ed combinations of WTPKT bits
    7.20 +	   (use the PK_* identifiers).
    7.21 +	b. Include pktdef.h.
    7.22 +	c. The generated structure typedef will be called PACKET.  Use PACKETDATA
    7.23 +	   and PACKETMODE to fill in the LOGCONTEXT structure.
    7.24 +3. If using multiple packet formats, for each one:
    7.25 +	a. Define PACKETNAME. Its text value will be a prefix for this packet's
    7.26 +	   parameters and names.
    7.27 +	b. Define <PACKETNAME>PACKETDATA and <PACKETNAME>PACKETMODE similar to
    7.28 +	   2.a. above.
    7.29 +	c. Include pktdef.h.
    7.30 +	d. The generated structure typedef will be called
    7.31 +	   <PACKETNAME>PACKET. Compare with 2.c. above and example #2 below.
    7.32 +4. If using extension packet data, do the following additional steps
    7.33 +   for each extension:
    7.34 +	a. Before including pktdef.h, define <PACKETNAME>PACKET<EXTENSION>
    7.35 +	   as either PKEXT_ABSOLUTE or PKEXT_RELATIVE.
    7.36 +	b. The generated structure typedef will contain a field for the
    7.37 +	   extension data.
    7.38 +	c. Scan the WTI_EXTENSION categories to find the extension's
    7.39 +	   packet mask bit.
    7.40 +	d. OR the packet mask bit with <PACKETNAME>PACKETDATA and use the
    7.41 +	   result in the lcPktData field of the LOGCONTEXT structure.
    7.42 +	e. If <PACKETNAME>PACKET<EXTENSION> was PKEXT_RELATIVE, OR the
    7.43 +	   packet mask bit with <PACKETNAME>PACKETMODE and use the result
    7.44 +	   in the lcPktMode field of the LOGCONTEXT structure.
    7.45 +
    7.46 +
    7.47 +Example #1.	-- single packet format
    7.48 +
    7.49 +#include <wintab.h>
    7.50 +#define PACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
    7.51 +#define PACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
    7.52 +#include <pktdef.h>
    7.53 +...
    7.54 +	lc.lcPktData = PACKETDATA;
    7.55 +	lc.lcPktMode = PACKETMODE;
    7.56 +
    7.57 +Example #2. -- multiple formats
    7.58 +
    7.59 +#include <wintab.h>
    7.60 +#define PACKETNAME		MOE
    7.61 +#define MOEPACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
    7.62 +#define MOEPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
    7.63 +#include <pktdef.h>
    7.64 +#define PACKETNAME		LARRY
    7.65 +#define LARRYPACKETDATA	PK_Y | PK_Z | PK_BUTTONS	/@ y, z, buttons @/
    7.66 +#define LARRYPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
    7.67 +#include <pktdef.h>
    7.68 +#define PACKETNAME		CURLY
    7.69 +#define CURLYPACKETDATA	PK_X | PK_Z | PK_BUTTONS	/@ x, z, buttons @/
    7.70 +#define CURLYPACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
    7.71 +#include <pktdef.h>
    7.72 +...
    7.73 +	lcMOE.lcPktData = MOEPACKETDATA;
    7.74 +	lcMOE.lcPktMode = MOEPACKETMODE;
    7.75 +...
    7.76 +	lcLARRY.lcPktData = LARRYPACKETDATA;
    7.77 +	lcLARRY.lcPktMode = LARRYPACKETMODE;
    7.78 +...
    7.79 +	lcCURLY.lcPktData = CURLYPACKETDATA;
    7.80 +	lcCURLY.lcPktMode = CURLYPACKETMODE;
    7.81 +
    7.82 +Example #3. -- extension packet data "XFOO".
    7.83 +	
    7.84 +#include <wintab.h>
    7.85 +#define PACKETDATA	PK_X | PK_Y | PK_BUTTONS	/@ x, y, buttons @/
    7.86 +#define PACKETMODE	PK_BUTTONS					/@ buttons relative mode @/
    7.87 +#define PACKETXFOO	PKEXT_ABSOLUTE				/@ XFOO absolute mode @/
    7.88 +#include <pktdef.h>
    7.89 +...
    7.90 +UINT ScanExts(UINT wTag)
    7.91 +{
    7.92 +	UINT i;
    7.93 +	UINT wScanTag;
    7.94 +
    7.95 +	/@ scan for wTag's info category. @/
    7.96 +	for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) {
    7.97 +		 if (wTag == wScanTag) {
    7.98 +			/@ return category offset from WTI_EXTENSIONS. @/
    7.99 +			return i;
   7.100 +		}
   7.101 +	}
   7.102 +	/@ return error code. @/
   7.103 +	return 0xFFFF;
   7.104 +}
   7.105 +...
   7.106 +	lc.lcPktData = PACKETDATA;
   7.107 +	lc.lcPktMode = PACKETMODE;
   7.108 +#ifdef PACKETXFOO
   7.109 +	categoryXFOO = ScanExts(WTX_XFOO);
   7.110 +	WTInfo(WTI_EXTENSIONS + categoryXFOO, EXT_MASK, &maskXFOO);
   7.111 +	lc.lcPktData |= maskXFOO;
   7.112 +#if PACKETXFOO == PKEXT_RELATIVE
   7.113 +	lc.lcPktMode |= maskXFOO;
   7.114 +#endif
   7.115 +#endif
   7.116 +	WTOpen(hWnd, &lc, TRUE);
   7.117 +
   7.118 +
   7.119 +------------------------------------------------------------------------------*/
   7.120 +#ifdef __cplusplus
   7.121 +extern "C" {
   7.122 +#endif	/* __cplusplus */
   7.123 +
   7.124 +#ifndef PACKETNAME
   7.125 +	/* if no packet name prefix */
   7.126 +	#define __PFX(x)	x
   7.127 +	#define __IFX(x,y)	x ## y
   7.128 +#else
   7.129 +	/* add prefixes and infixes to packet format names */
   7.130 +	#define __PFX(x)		__PFX2(PACKETNAME,x)
   7.131 +	#define __PFX2(p,x)		__PFX3(p,x)
   7.132 +	#define __PFX3(p,x)		p ## x
   7.133 +	#define __IFX(x,y)		__IFX2(x,PACKETNAME,y)
   7.134 +	#define __IFX2(x,i,y)	__IFX3(x,i,y)
   7.135 +	#define __IFX3(x,i,y)	x ## i ## y
   7.136 +#endif
   7.137 +
   7.138 +#define __SFX2(x,s)		__SFX3(x,s)
   7.139 +#define __SFX3(x,s)		x ## s
   7.140 +
   7.141 +#define __TAG  	__IFX(tag,PACKET)
   7.142 +#define __TYPES	__PFX(PACKET), * __IFX(P,PACKET), NEAR * __IFX(NP,PACKET), \
   7.143 +					FAR * __IFX(LP,PACKET)
   7.144 +
   7.145 +#define __DATA		(__PFX(PACKETDATA))
   7.146 +#define __MODE		(__PFX(PACKETMODE))
   7.147 +#define __EXT(x)	__SFX2(__PFX(PACKET),x)
   7.148 +
   7.149 +	
   7.150 +typedef struct __TAG {
   7.151 +	#if (__DATA & PK_CONTEXT)
   7.152 +		HCTX			pkContext;
   7.153 +	#endif
   7.154 +	#if (__DATA & PK_STATUS)
   7.155 +		UINT			pkStatus;
   7.156 +	#endif
   7.157 +	#if (__DATA & PK_TIME)
   7.158 +		DWORD			pkTime;
   7.159 +	#endif
   7.160 +	#if (__DATA & PK_CHANGED)
   7.161 +		WTPKT			pkChanged;
   7.162 +	#endif
   7.163 +	#if (__DATA & PK_SERIAL_NUMBER)
   7.164 +		UINT			pkSerialNumber;
   7.165 +	#endif
   7.166 +	#if (__DATA & PK_CURSOR)
   7.167 +		UINT			pkCursor;
   7.168 +	#endif
   7.169 +	#if (__DATA & PK_BUTTONS)
   7.170 +		DWORD			pkButtons;
   7.171 +	#endif
   7.172 +	#if (__DATA & PK_X)
   7.173 +		LONG			pkX;
   7.174 +	#endif
   7.175 +	#if (__DATA & PK_Y)
   7.176 +		LONG			pkY;
   7.177 +	#endif
   7.178 +	#if (__DATA & PK_Z)
   7.179 +		LONG			pkZ;
   7.180 +	#endif
   7.181 +	#if (__DATA & PK_NORMAL_PRESSURE)
   7.182 +		#if (__MODE & PK_NORMAL_PRESSURE)
   7.183 +			/* relative */
   7.184 +			int			pkNormalPressure;
   7.185 +		#else
   7.186 +			/* absolute */
   7.187 +			UINT		pkNormalPressure;
   7.188 +		#endif
   7.189 +	#endif
   7.190 +	#if (__DATA & PK_TANGENT_PRESSURE)
   7.191 +		#if (__MODE & PK_TANGENT_PRESSURE)
   7.192 +			/* relative */
   7.193 +			int			pkTangentPressure;
   7.194 +		#else
   7.195 +			/* absolute */
   7.196 +			UINT		pkTangentPressure;
   7.197 +		#endif
   7.198 +	#endif
   7.199 +	#if (__DATA & PK_ORIENTATION)
   7.200 +		ORIENTATION		pkOrientation;
   7.201 +	#endif
   7.202 +	#if (__DATA & PK_ROTATION)
   7.203 +		ROTATION		pkRotation; /* 1.1 */
   7.204 +	#endif
   7.205 +
   7.206 +#ifndef NOWTEXTENSIONS
   7.207 +	/* extensions begin here. */
   7.208 +	#if (__EXT(FKEYS) == PKEXT_RELATIVE) || (__EXT(FKEYS) == PKEXT_ABSOLUTE)
   7.209 +		UINT			pkFKeys;
   7.210 +	#endif
   7.211 +	#if (__EXT(TILT) == PKEXT_RELATIVE) || (__EXT(TILT) == PKEXT_ABSOLUTE)
   7.212 +		TILT			pkTilt;
   7.213 +	#endif
   7.214 +	#if (__EXT(EXPKEYS) == PKEXT_RELATIVE) || (__EXT(EXPKEYS) == PKEXT_ABSOLUTE)
   7.215 +		WORD			pkExpKeys[4]; /* 1.3 */
   7.216 +	#endif
   7.217 +#endif
   7.218 +
   7.219 +} __TYPES ;
   7.220 +
   7.221 +#undef PACKETNAME
   7.222 +#undef __TAG
   7.223 +#undef __TAG2
   7.224 +#undef __TYPES
   7.225 +#undef __TYPES2
   7.226 +#undef __DATA
   7.227 +#undef __MODE
   7.228 +#undef __PFX
   7.229 +#undef __PFX2
   7.230 +#undef __PFX3
   7.231 +#undef __IFX
   7.232 +#undef __IFX2
   7.233 +#undef __IFX3
   7.234 +#undef __SFX2
   7.235 +#undef __SFX3
   7.236 +
   7.237 +#ifdef __cplusplus
   7.238 +}
   7.239 +#endif	/* __cplusplus */
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/video/win32/wactab/wintab.h	Tue Aug 26 05:26:28 2008 +0000
     8.3 @@ -0,0 +1,865 @@
     8.4 +/* -------------------------------- wintab.h -------------------------------- */
     8.5 +/* Combined 16 & 32-bit version. */
     8.6 +
     8.7 +/*------------------------------------------------------------------------------
     8.8 +The text and information contained in this file may be freely used,
     8.9 +copied, or distributed without compensation or licensing restrictions.
    8.10 +
    8.11 +This file is copyright 1991-1998 by LCS/Telegraphics.
    8.12 +------------------------------------------------------------------------------*/
    8.13 +
    8.14 +#ifndef _INC_WINTAB     /* prevent multiple includes */
    8.15 +#define _INC_WINTAB
    8.16 +
    8.17 +#ifdef __cplusplus
    8.18 +extern "C" {
    8.19 +#endif	/* __cplusplus */
    8.20 +
    8.21 +/* -------------------------------------------------------------------------- */
    8.22 +/* Messages */
    8.23 +#ifndef NOWTMESSAGES
    8.24 +
    8.25 +	#define WT_DEFBASE		0x7FF0
    8.26 +	#define WT_MAXOFFSET	0xF
    8.27 +
    8.28 +	#define _WT_PACKET(b)		((b)+0)
    8.29 +	#define _WT_CTXOPEN(b)		((b)+1)
    8.30 +	#define _WT_CTXCLOSE(b)		((b)+2)
    8.31 +	#define _WT_CTXUPDATE(b)	((b)+3)
    8.32 +	#define _WT_CTXOVERLAP(b)	((b)+4)
    8.33 +	#define _WT_PROXIMITY(b)	((b)+5)
    8.34 +	#define _WT_INFOCHANGE(b)	((b)+6)
    8.35 +	#define _WT_CSRCHANGE(b)	((b)+7) /* 1.1 */
    8.36 +	#define _WT_MAX(b)			((b)+WT_MAXOFFSET)
    8.37 +	
    8.38 +	#define WT_PACKET			_WT_PACKET(WT_DEFBASE)
    8.39 +	#define WT_CTXOPEN			_WT_CTXOPEN(WT_DEFBASE)
    8.40 +	#define WT_CTXCLOSE			_WT_CTXCLOSE(WT_DEFBASE)
    8.41 +	#define WT_CTXUPDATE		_WT_CTXUPDATE(WT_DEFBASE)
    8.42 +	#define WT_CTXOVERLAP		_WT_CTXOVERLAP(WT_DEFBASE)
    8.43 +	#define WT_PROXIMITY		_WT_PROXIMITY(WT_DEFBASE)
    8.44 +	#define WT_INFOCHANGE		_WT_INFOCHANGE(WT_DEFBASE)
    8.45 +	#define WT_CSRCHANGE		_WT_CSRCHANGE(WT_DEFBASE) /* 1.1 */
    8.46 +	#define WT_MAX				_WT_MAX(WT_DEFBASE)
    8.47 +
    8.48 +#endif
    8.49 +
    8.50 +/* -------------------------------------------------------------------------- */
    8.51 +/* -------------------------------------------------------------------------- */
    8.52 +/* Data Types */
    8.53 +
    8.54 +/* -------------------------------------------------------------------------- */
    8.55 +/* COMMON DATA DEFS */
    8.56 +
    8.57 +DECLARE_HANDLE(HMGR);		/* manager handle */
    8.58 +DECLARE_HANDLE(HCTX);		/* context handle */
    8.59 +DECLARE_HANDLE(HWTHOOK);	/* hook handle */
    8.60 +
    8.61 +typedef DWORD WTPKT;		/* packet mask */
    8.62 +
    8.63 +
    8.64 +#ifndef NOWTPKT
    8.65 +
    8.66 +	/* WTPKT bits */
    8.67 +	#define PK_CONTEXT			0x0001	/* reporting context */
    8.68 +	#define PK_STATUS			0x0002	/* status bits */
    8.69 +	#define PK_TIME				0x0004	/* time stamp */
    8.70 +	#define PK_CHANGED			0x0008	/* change bit vector */
    8.71 +	#define PK_SERIAL_NUMBER   	0x0010	/* packet serial number */
    8.72 +	#define PK_CURSOR			0x0020	/* reporting cursor */
    8.73 +	#define PK_BUTTONS			0x0040	/* button information */
    8.74 +	#define PK_X				0x0080	/* x axis */
    8.75 +	#define PK_Y				0x0100	/* y axis */
    8.76 +	#define PK_Z				0x0200	/* z axis */
    8.77 +	#define PK_NORMAL_PRESSURE	0x0400	/* normal or tip pressure */
    8.78 +	#define PK_TANGENT_PRESSURE	0x0800	/* tangential or barrel pressure */
    8.79 +	#define PK_ORIENTATION		0x1000	/* orientation info: tilts */
    8.80 +	#define PK_ROTATION			0x2000	/* rotation info; 1.1 */
    8.81 +
    8.82 +#endif
    8.83 +
    8.84 +typedef DWORD FIX32;				/* fixed-point arithmetic type */
    8.85 +
    8.86 +#ifndef NOFIX32
    8.87 +	#define INT(x)	HIWORD(x)
    8.88 +	#define FRAC(x)	LOWORD(x)
    8.89 +
    8.90 +	#define CASTFIX32(x)	((FIX32)((x)*65536L))
    8.91 +
    8.92 +	#define ROUND(x)		(INT(x) + (FRAC(x) > (WORD)0x8000))
    8.93 +
    8.94 +	#define FIX_MUL(c, a, b)						\
    8.95 +		(c = (((DWORD)FRAC(a) * FRAC(b)) >> 16) +	\
    8.96 +			(DWORD)INT(a) * FRAC(b) +				\
    8.97 +			(DWORD)INT(b) * FRAC(a) +				\
    8.98 +			((DWORD)INT(a) * INT(b) << 16))
    8.99 +
   8.100 +	#ifdef _WINDLL
   8.101 +		#define FIX_DIV_SC static
   8.102 +	#else
   8.103 +		#define FIX_DIV_SC
   8.104 +	#endif
   8.105 +
   8.106 +	#define FIX_DIV(c, a, b)					\
   8.107 +		{							   			\
   8.108 +			FIX_DIV_SC DWORD temp, rem, btemp;	\
   8.109 +									   			\
   8.110 +			/* fraction done bytewise */		\
   8.111 +			temp = ((a / b) << 16);				\
   8.112 +			rem = a % b;			   			\
   8.113 +			btemp = b;							\
   8.114 +			if (INT(btemp) < 256) {				\
   8.115 +				rem <<= 8;				   		\
   8.116 +			}									\
   8.117 +			else {								\
   8.118 +				btemp >>= 8;					\
   8.119 +			}									\
   8.120 +			temp += ((rem / btemp) << 8);  		\
   8.121 +			rem %= btemp;			   			\
   8.122 +			rem <<= 8;				   			\
   8.123 +			temp += rem / btemp;		   		\
   8.124 +			c = temp;				   			\
   8.125 +		}
   8.126 +#endif
   8.127 +
   8.128 +/* -------------------------------------------------------------------------- */
   8.129 +/* INFO DATA DEFS */
   8.130 +
   8.131 +#ifndef NOWTINFO
   8.132 +
   8.133 +#ifndef NOWTAXIS
   8.134 +
   8.135 +typedef struct tagAXIS {
   8.136 +	LONG	axMin;
   8.137 +	LONG	axMax;
   8.138 +	UINT	axUnits;
   8.139 +	FIX32	axResolution;
   8.140 +} AXIS, *PAXIS, NEAR *NPAXIS, FAR *LPAXIS;
   8.141 +
   8.142 +	/* unit specifiers */
   8.143 +	#define TU_NONE			0
   8.144 +	#define TU_INCHES		1
   8.145 +	#define TU_CENTIMETERS	2
   8.146 +	#define TU_CIRCLE		3
   8.147 +
   8.148 +#endif
   8.149 +
   8.150 +#ifndef NOWTSYSBUTTONS
   8.151 +
   8.152 +/* system button assignment values */
   8.153 +#define SBN_NONE		0x00
   8.154 +#define SBN_LCLICK		0x01
   8.155 +#define SBN_LDBLCLICK	0x02
   8.156 +#define SBN_LDRAG		0x03
   8.157 +#define SBN_RCLICK		0x04
   8.158 +#define SBN_RDBLCLICK	0x05
   8.159 +#define SBN_RDRAG		0x06
   8.160 +#define SBN_MCLICK		0x07
   8.161 +#define SBN_MDBLCLICK	0x08
   8.162 +#define SBN_MDRAG		0x09
   8.163 +/* for Pen Windows */
   8.164 +#define SBN_PTCLICK		0x10
   8.165 +#define SBN_PTDBLCLICK	0x20
   8.166 +#define SBN_PTDRAG		0x30
   8.167 +#define SBN_PNCLICK		0x40
   8.168 +#define SBN_PNDBLCLICK	0x50
   8.169 +#define SBN_PNDRAG		0x60
   8.170 +#define SBN_P1CLICK		0x70
   8.171 +#define SBN_P1DBLCLICK	0x80
   8.172 +#define SBN_P1DRAG		0x90
   8.173 +#define SBN_P2CLICK		0xA0
   8.174 +#define SBN_P2DBLCLICK	0xB0
   8.175 +#define SBN_P2DRAG		0xC0
   8.176 +#define SBN_P3CLICK		0xD0
   8.177 +#define SBN_P3DBLCLICK	0xE0
   8.178 +#define SBN_P3DRAG		0xF0
   8.179 +
   8.180 +#endif
   8.181 +
   8.182 +#ifndef NOWTCAPABILITIES
   8.183 +
   8.184 +/* hardware capabilities */
   8.185 +#define HWC_INTEGRATED		0x0001
   8.186 +#define HWC_TOUCH			0x0002
   8.187 +#define HWC_HARDPROX		0x0004
   8.188 +#define HWC_PHYSID_CURSORS	0x0008 /* 1.1 */
   8.189 +#endif
   8.190 +
   8.191 +#ifndef NOWTIFC
   8.192 +
   8.193 +#ifndef NOWTCURSORS 
   8.194 +
   8.195 +/* cursor capabilities */
   8.196 +#define CRC_MULTIMODE	0x0001 /* 1.1 */
   8.197 +#define CRC_AGGREGATE	0x0002 /* 1.1 */
   8.198 +#define CRC_INVERT		0x0004 /* 1.1 */
   8.199 +
   8.200 +#endif 
   8.201 +
   8.202 +/* info categories */
   8.203 +#define WTI_INTERFACE		1
   8.204 +	#define IFC_WINTABID		1
   8.205 +	#define IFC_SPECVERSION		2
   8.206 +	#define IFC_IMPLVERSION		3
   8.207 +	#define IFC_NDEVICES		4
   8.208 +	#define IFC_NCURSORS		5
   8.209 +	#define IFC_NCONTEXTS		6
   8.210 +	#define IFC_CTXOPTIONS		7
   8.211 +	#define IFC_CTXSAVESIZE		8
   8.212 +	#define IFC_NEXTENSIONS		9
   8.213 +	#define IFC_NMANAGERS		10
   8.214 +	#define IFC_MAX				10
   8.215 +
   8.216 +
   8.217 +#endif
   8.218 +
   8.219 +#ifndef NOWTSTATUS
   8.220 +
   8.221 +#define WTI_STATUS			2
   8.222 +	#define STA_CONTEXTS		1
   8.223 +	#define STA_SYSCTXS			2
   8.224 +	#define STA_PKTRATE			3
   8.225 +	#define STA_PKTDATA			4
   8.226 +	#define STA_MANAGERS		5
   8.227 +	#define STA_SYSTEM			6
   8.228 +	#define STA_BUTTONUSE		7
   8.229 +	#define STA_SYSBTNUSE		8
   8.230 +	#define STA_MAX				8
   8.231 +
   8.232 +#endif
   8.233 +
   8.234 +#ifndef NOWTDEFCONTEXT
   8.235 +
   8.236 +#define WTI_DEFCONTEXT	3
   8.237 +#define WTI_DEFSYSCTX	4
   8.238 +#define WTI_DDCTXS		400 /* 1.1 */
   8.239 +#define WTI_DSCTXS		500 /* 1.1 */
   8.240 +	#define CTX_NAME		1
   8.241 +	#define CTX_OPTIONS		2
   8.242 +	#define CTX_STATUS		3
   8.243 +	#define CTX_LOCKS		4
   8.244 +	#define CTX_MSGBASE		5
   8.245 +	#define CTX_DEVICE		6
   8.246 +	#define CTX_PKTRATE		7
   8.247 +	#define CTX_PKTDATA		8
   8.248 +	#define CTX_PKTMODE		9
   8.249 +	#define CTX_MOVEMASK	10
   8.250 +	#define CTX_BTNDNMASK	11
   8.251 +	#define CTX_BTNUPMASK	12
   8.252 +	#define CTX_INORGX		13
   8.253 +	#define CTX_INORGY		14
   8.254 +	#define CTX_INORGZ		15
   8.255 +	#define CTX_INEXTX		16
   8.256 +	#define CTX_INEXTY		17
   8.257 +	#define CTX_INEXTZ		18
   8.258 +	#define CTX_OUTORGX		19
   8.259 +	#define CTX_OUTORGY		20
   8.260 +	#define CTX_OUTORGZ		21
   8.261 +	#define CTX_OUTEXTX		22
   8.262 +	#define CTX_OUTEXTY		23
   8.263 +	#define CTX_OUTEXTZ		24
   8.264 +	#define CTX_SENSX		25
   8.265 +	#define CTX_SENSY		26
   8.266 +	#define CTX_SENSZ		27
   8.267 +	#define CTX_SYSMODE		28
   8.268 +	#define CTX_SYSORGX		29
   8.269 +	#define CTX_SYSORGY		30
   8.270 +	#define CTX_SYSEXTX		31
   8.271 +	#define CTX_SYSEXTY		32
   8.272 +	#define CTX_SYSSENSX	33
   8.273 +	#define CTX_SYSSENSY	34
   8.274 +	#define CTX_MAX			34
   8.275 +
   8.276 +#endif
   8.277 +
   8.278 +#ifndef NOWTDEVICES
   8.279 +
   8.280 +#define WTI_DEVICES		100
   8.281 +	#define DVC_NAME			1
   8.282 +	#define DVC_HARDWARE		2
   8.283 +	#define DVC_NCSRTYPES		3
   8.284 +	#define DVC_FIRSTCSR		4
   8.285 +	#define DVC_PKTRATE			5
   8.286 +	#define DVC_PKTDATA			6
   8.287 +	#define DVC_PKTMODE			7
   8.288 +	#define DVC_CSRDATA			8
   8.289 +	#define DVC_XMARGIN			9
   8.290 +	#define DVC_YMARGIN			10
   8.291 +	#define DVC_ZMARGIN			11
   8.292 +	#define DVC_X				12
   8.293 +	#define DVC_Y				13
   8.294 +	#define DVC_Z				14
   8.295 +	#define DVC_NPRESSURE		15
   8.296 +	#define DVC_TPRESSURE		16
   8.297 +	#define DVC_ORIENTATION		17
   8.298 +	#define DVC_ROTATION		18 /* 1.1 */
   8.299 +	#define DVC_PNPID			19 /* 1.1 */
   8.300 +	#define DVC_MAX				19
   8.301 +
   8.302 +#endif
   8.303 +
   8.304 +#ifndef NOWTCURSORS
   8.305 +
   8.306 +#define WTI_CURSORS		200
   8.307 +	#define CSR_NAME			1
   8.308 +	#define CSR_ACTIVE			2
   8.309 +	#define CSR_PKTDATA			3
   8.310 +	#define CSR_BUTTONS			4
   8.311 +	#define CSR_BUTTONBITS		5
   8.312 +	#define CSR_BTNNAMES		6
   8.313 +	#define CSR_BUTTONMAP		7
   8.314 +	#define CSR_SYSBTNMAP		8
   8.315 +	#define CSR_NPBUTTON		9
   8.316 +	#define CSR_NPBTNMARKS		10
   8.317 +	#define CSR_NPRESPONSE		11
   8.318 +	#define CSR_TPBUTTON		12
   8.319 +	#define CSR_TPBTNMARKS		13
   8.320 +	#define CSR_TPRESPONSE		14
   8.321 +	#define CSR_PHYSID			15 /* 1.1 */
   8.322 +	#define CSR_MODE			16 /* 1.1 */
   8.323 +	#define CSR_MINPKTDATA		17 /* 1.1 */
   8.324 +	#define CSR_MINBUTTONS		18 /* 1.1 */
   8.325 +	#define CSR_CAPABILITIES	19 /* 1.1 */
   8.326 +	#define CSR_TYPE				20 /* 1.2 */
   8.327 +	#define CSR_MAX				20
   8.328 +
   8.329 +#endif
   8.330 +
   8.331 +#ifndef NOWTEXTENSIONS
   8.332 +
   8.333 +#define WTI_EXTENSIONS	300
   8.334 +	#define EXT_NAME		1
   8.335 +	#define EXT_TAG			2
   8.336 +	#define EXT_MASK		3
   8.337 +	#define EXT_SIZE		4
   8.338 +	#define EXT_AXES		5
   8.339 +	#define EXT_DEFAULT		6
   8.340 +	#define EXT_DEFCONTEXT	7
   8.341 +	#define EXT_DEFSYSCTX	8
   8.342 +	#define EXT_CURSORS		9 
   8.343 +	#define EXT_MAX			109 /* Allow 100 cursors */
   8.344 +
   8.345 +#endif
   8.346 +
   8.347 +#endif
   8.348 +
   8.349 +/* -------------------------------------------------------------------------- */
   8.350 +/* CONTEXT DATA DEFS */
   8.351 +
   8.352 +#define LCNAMELEN	40
   8.353 +#define LC_NAMELEN	40
   8.354 +#ifdef WIN32
   8.355 +typedef struct tagLOGCONTEXTA {
   8.356 +	char	lcName[LCNAMELEN];
   8.357 +	UINT	lcOptions;
   8.358 +	UINT	lcStatus;
   8.359 +	UINT	lcLocks;
   8.360 +	UINT	lcMsgBase;
   8.361 +	UINT	lcDevice;
   8.362 +	UINT	lcPktRate;
   8.363 +	WTPKT	lcPktData;
   8.364 +	WTPKT	lcPktMode;
   8.365 +	WTPKT	lcMoveMask;
   8.366 +	DWORD	lcBtnDnMask;
   8.367 +	DWORD	lcBtnUpMask;
   8.368 +	LONG	lcInOrgX;
   8.369 +	LONG	lcInOrgY;
   8.370 +	LONG	lcInOrgZ;
   8.371 +	LONG	lcInExtX;
   8.372 +	LONG	lcInExtY;
   8.373 +	LONG	lcInExtZ;
   8.374 +	LONG	lcOutOrgX;
   8.375 +	LONG	lcOutOrgY;
   8.376 +	LONG	lcOutOrgZ;
   8.377 +	LONG	lcOutExtX;
   8.378 +	LONG	lcOutExtY;
   8.379 +	LONG	lcOutExtZ;
   8.380 +	FIX32	lcSensX;
   8.381 +	FIX32	lcSensY;
   8.382 +	FIX32	lcSensZ;
   8.383 +	BOOL	lcSysMode;
   8.384 +	int		lcSysOrgX;
   8.385 +	int		lcSysOrgY;
   8.386 +	int		lcSysExtX;
   8.387 +	int		lcSysExtY;
   8.388 +	FIX32	lcSysSensX;
   8.389 +	FIX32	lcSysSensY;
   8.390 +} LOGCONTEXTA, *PLOGCONTEXTA, NEAR *NPLOGCONTEXTA, FAR *LPLOGCONTEXTA;
   8.391 +typedef struct tagLOGCONTEXTW {
   8.392 +	WCHAR	lcName[LCNAMELEN];
   8.393 +	UINT	lcOptions;
   8.394 +	UINT	lcStatus;
   8.395 +	UINT	lcLocks;
   8.396 +	UINT	lcMsgBase;
   8.397 +	UINT	lcDevice;
   8.398 +	UINT	lcPktRate;
   8.399 +	WTPKT	lcPktData;
   8.400 +	WTPKT	lcPktMode;
   8.401 +	WTPKT	lcMoveMask;
   8.402 +	DWORD	lcBtnDnMask;
   8.403 +	DWORD	lcBtnUpMask;
   8.404 +	LONG	lcInOrgX;
   8.405 +	LONG	lcInOrgY;
   8.406 +	LONG	lcInOrgZ;
   8.407 +	LONG	lcInExtX;
   8.408 +	LONG	lcInExtY;
   8.409 +	LONG	lcInExtZ;
   8.410 +	LONG	lcOutOrgX;
   8.411 +	LONG	lcOutOrgY;
   8.412 +	LONG	lcOutOrgZ;
   8.413 +	LONG	lcOutExtX;
   8.414 +	LONG	lcOutExtY;
   8.415 +	LONG	lcOutExtZ;
   8.416 +	FIX32	lcSensX;
   8.417 +	FIX32	lcSensY;
   8.418 +	FIX32	lcSensZ;
   8.419 +	BOOL	lcSysMode;
   8.420 +	int		lcSysOrgX;
   8.421 +	int		lcSysOrgY;
   8.422 +	int		lcSysExtX;
   8.423 +	int		lcSysExtY;
   8.424 +	FIX32	lcSysSensX;
   8.425 +	FIX32	lcSysSensY;
   8.426 +} LOGCONTEXTW, *PLOGCONTEXTW, NEAR *NPLOGCONTEXTW, FAR *LPLOGCONTEXTW;
   8.427 +#ifdef UNICODE
   8.428 +typedef LOGCONTEXTW LOGCONTEXT;
   8.429 +typedef PLOGCONTEXTW PLOGCONTEXT;
   8.430 +typedef NPLOGCONTEXTW NPLOGCONTEXT;
   8.431 +typedef LPLOGCONTEXTW LPLOGCONTEXT;
   8.432 +#else
   8.433 +typedef LOGCONTEXTA LOGCONTEXT;
   8.434 +typedef PLOGCONTEXTA PLOGCONTEXT;
   8.435 +typedef NPLOGCONTEXTA NPLOGCONTEXT;
   8.436 +typedef LPLOGCONTEXTA LPLOGCONTEXT;
   8.437 +#endif /* UNICODE */
   8.438 +#else /* WIN32 */
   8.439 +typedef struct tagLOGCONTEXT {
   8.440 +	char	lcName[LCNAMELEN];
   8.441 +	UINT	lcOptions;
   8.442 +	UINT	lcStatus;
   8.443 +	UINT	lcLocks;
   8.444 +	UINT	lcMsgBase;
   8.445 +	UINT	lcDevice;
   8.446 +	UINT	lcPktRate;
   8.447 +	WTPKT	lcPktData;
   8.448 +	WTPKT	lcPktMode;
   8.449 +	WTPKT	lcMoveMask;
   8.450 +	DWORD	lcBtnDnMask;
   8.451 +	DWORD	lcBtnUpMask;
   8.452 +	LONG	lcInOrgX;
   8.453 +	LONG	lcInOrgY;
   8.454 +	LONG	lcInOrgZ;
   8.455 +	LONG	lcInExtX;
   8.456 +	LONG	lcInExtY;
   8.457 +	LONG	lcInExtZ;
   8.458 +	LONG	lcOutOrgX;
   8.459 +	LONG	lcOutOrgY;
   8.460 +	LONG	lcOutOrgZ;
   8.461 +	LONG	lcOutExtX;
   8.462 +	LONG	lcOutExtY;
   8.463 +	LONG	lcOutExtZ;
   8.464 +	FIX32	lcSensX;
   8.465 +	FIX32	lcSensY;
   8.466 +	FIX32	lcSensZ;
   8.467 +	BOOL	lcSysMode;
   8.468 +	int		lcSysOrgX;
   8.469 +	int		lcSysOrgY;
   8.470 +	int		lcSysExtX;
   8.471 +	int		lcSysExtY;
   8.472 +	FIX32	lcSysSensX;
   8.473 +	FIX32	lcSysSensY;
   8.474 +} LOGCONTEXT, *PLOGCONTEXT, NEAR *NPLOGCONTEXT, FAR *LPLOGCONTEXT;
   8.475 +#endif /* WIN32 */
   8.476 +
   8.477 +	/* context option values */
   8.478 +	#define CXO_SYSTEM		0x0001
   8.479 +	#define CXO_PEN			0x0002
   8.480 +	#define CXO_MESSAGES	0x0004
   8.481 +	#define CXO_MARGIN		0x8000
   8.482 +	#define CXO_MGNINSIDE	0x4000
   8.483 +	#define CXO_CSRMESSAGES	0x0008 /* 1.1 */
   8.484 +
   8.485 +	/* context status values */
   8.486 +	#define CXS_DISABLED	0x0001
   8.487 +	#define CXS_OBSCURED	0x0002
   8.488 +	#define CXS_ONTOP		0x0004
   8.489 +
   8.490 +	/* context lock values */
   8.491 +	#define CXL_INSIZE		0x0001
   8.492 +	#define CXL_INASPECT	0x0002
   8.493 +	#define CXL_SENSITIVITY	0x0004
   8.494 +	#define CXL_MARGIN		0x0008
   8.495 +	#define CXL_SYSOUT		0x0010
   8.496 +
   8.497 +/* -------------------------------------------------------------------------- */
   8.498 +/* EVENT DATA DEFS */
   8.499 +
   8.500 +/* For packet structure definition, see pktdef.h */
   8.501 +
   8.502 +/* packet status values */
   8.503 +#define TPS_PROXIMITY		0x0001
   8.504 +#define TPS_QUEUE_ERR		0x0002
   8.505 +#define TPS_MARGIN			0x0004
   8.506 +#define TPS_GRAB			0x0008
   8.507 +#define TPS_INVERT			0x0010 /* 1.1 */
   8.508 +
   8.509 +typedef struct tagORIENTATION {
   8.510 +	int orAzimuth;
   8.511 +	int orAltitude;
   8.512 +	int orTwist;
   8.513 +} ORIENTATION, *PORIENTATION, NEAR *NPORIENTATION, FAR *LPORIENTATION;
   8.514 +
   8.515 +typedef struct tagROTATION { /* 1.1 */
   8.516 +	int	roPitch;
   8.517 +	int roRoll;
   8.518 +	int roYaw;
   8.519 +} ROTATION, *PROTATION, NEAR *NPROTATION, FAR *LPROTATION;
   8.520 +// grandfather in obsolete member names.
   8.521 +#define rotPitch	roPitch
   8.522 +#define rotRoll		roRoll
   8.523 +#define rotYaw		roYaw
   8.524 +
   8.525 +/* relative buttons */
   8.526 +#define TBN_NONE	0
   8.527 +#define TBN_UP		1
   8.528 +#define TBN_DOWN	2
   8.529 +
   8.530 +/* -------------------------------------------------------------------------- */
   8.531 +/* DEVICE CONFIG CONSTANTS */
   8.532 +
   8.533 +#ifndef NOWTDEVCFG
   8.534 +
   8.535 +#define WTDC_NONE		0
   8.536 +#define WTDC_CANCEL		1
   8.537 +#define WTDC_OK			2
   8.538 +#define WTDC_RESTART	3
   8.539 +
   8.540 +#endif
   8.541 +
   8.542 +/* -------------------------------------------------------------------------- */
   8.543 +/* HOOK CONSTANTS */
   8.544 +
   8.545 +#ifndef NOWTHOOKS
   8.546 +
   8.547 +#define WTH_PLAYBACK		1
   8.548 +#define WTH_RECORD			2
   8.549 +
   8.550 +#define WTHC_GETLPLPFN	    (-3)
   8.551 +#define WTHC_LPLPFNNEXT	    (-2)
   8.552 +#define WTHC_LPFNNEXT	    (-1)
   8.553 +#define WTHC_ACTION		    0
   8.554 +#define WTHC_GETNEXT   	    1
   8.555 +#define WTHC_SKIP 	   		2
   8.556 +
   8.557 +#endif
   8.558 +
   8.559 +/* -------------------------------------------------------------------------- */
   8.560 +/* PREFERENCE FUNCTION CONSTANTS */
   8.561 +
   8.562 +#ifndef NOWTPREF
   8.563 +
   8.564 +#define WTP_LPDEFAULT	((LPVOID)-1L)
   8.565 +#define WTP_DWDEFAULT	((DWORD)-1L)
   8.566 +
   8.567 +#endif
   8.568 +
   8.569 +/* -------------------------------------------------------------------------- */
   8.570 +/* EXTENSION TAGS AND CONSTANTS */
   8.571 +
   8.572 +#ifndef NOWTEXTENSIONS
   8.573 +
   8.574 +/* constants for use with pktdef.h */
   8.575 +#define PKEXT_ABSOLUTE	1
   8.576 +#define PKEXT_RELATIVE	2
   8.577 +
   8.578 +/* Extension tags. */
   8.579 +#define WTX_OBT			0	/* Out of bounds tracking */
   8.580 +#define WTX_FKEYS		1	/* Function keys */
   8.581 +#define WTX_TILT		2	/* Raw Cartesian tilt; 1.1 */
   8.582 +#define WTX_CSRMASK		3	/* select input by cursor type; 1.1 */
   8.583 +#define WTX_XBTNMASK	4	/* Extended button mask; 1.1 */
   8.584 +#define WTX_EXPKEYS	5	/* ExpressKeys; 1.3 */
   8.585 +
   8.586 +typedef struct tagXBTNMASK {
   8.587 +	BYTE xBtnDnMask[32];
   8.588 +	BYTE xBtnUpMask[32];
   8.589 +} XBTNMASK;
   8.590 +
   8.591 +typedef struct tagTILT { /* 1.1 */
   8.592 +	int tiltX;
   8.593 +	int tiltY;
   8.594 +} TILT;
   8.595 +
   8.596 +#endif
   8.597 +
   8.598 +/* -------------------------------------------------------------------------- */
   8.599 +/* -------------------------------------------------------------------------- */
   8.600 +/* Functions */
   8.601 +
   8.602 +	#ifndef API
   8.603 +		#ifndef WINAPI
   8.604 +			#define API			FAR PASCAL
   8.605 +		#else
   8.606 +			#define API			WINAPI
   8.607 +		#endif
   8.608 +	#endif
   8.609 +
   8.610 +#ifndef NOWTCALLBACKS
   8.611 +
   8.612 +	#ifndef CALLBACK
   8.613 +	#define CALLBACK	FAR PASCAL
   8.614 +	#endif
   8.615 +
   8.616 +	#ifndef NOWTMANAGERFXNS
   8.617 +	/* callback function types */
   8.618 +	typedef BOOL (WINAPI * WTENUMPROC)(HCTX, LPARAM); /* changed CALLBACK->WINAPI, 1.1 */
   8.619 +	typedef BOOL (WINAPI * WTCONFIGPROC)(HCTX, HWND);
   8.620 +	typedef LRESULT (WINAPI * WTHOOKPROC)(int, WPARAM, LPARAM);
   8.621 +	typedef WTHOOKPROC FAR *LPWTHOOKPROC;
   8.622 +	#endif
   8.623 +
   8.624 +#endif
   8.625 +
   8.626 +
   8.627 +#ifndef NOWTFUNCTIONS
   8.628 +
   8.629 +	#ifndef NOWTBASICFXNS
   8.630 +	/* BASIC FUNCTIONS */
   8.631 +#ifdef WIN32
   8.632 +	UINT API WTInfoA(UINT, UINT, LPVOID);
   8.633 +	#define ORD_WTInfoA						20
   8.634 +	UINT API WTInfoW(UINT, UINT, LPVOID);
   8.635 +	#define ORD_WTInfoW					  1020
   8.636 +	#ifdef UNICODE
   8.637 +	#define WTInfo  WTInfoW
   8.638 +	#define ORD_WTInfo  ORD_WTInfoW
   8.639 +	#else
   8.640 +	#define WTInfo  WTInfoA
   8.641 +	#define ORD_WTInfo  ORD_WTInfoA
   8.642 +	#endif /* !UNICODE */
   8.643 +#else
   8.644 +	UINT API WTInfo(UINT, UINT, LPVOID);
   8.645 +	#define ORD_WTInfo						20
   8.646 +#endif
   8.647 +#ifdef WIN32
   8.648 +	HCTX API WTOpenA(HWND, LPLOGCONTEXTA, BOOL);
   8.649 +	#define ORD_WTOpenA						21
   8.650 +	HCTX API WTOpenW(HWND, LPLOGCONTEXTW, BOOL);
   8.651 +	#define ORD_WTOpenW					  1021
   8.652 +	#ifdef UNICODE
   8.653 +	#define WTOpen  WTOpenW
   8.654 +	#define ORD_WTOpen  ORD_WTOpenW
   8.655 +	#else
   8.656 +	#define WTOpen  WTOpenA
   8.657 +	#define ORD_WTOpen  ORD_WTOpenA
   8.658 +	#endif /* !UNICODE */
   8.659 +#else
   8.660 +	HCTX API WTOpen(HWND, LPLOGCONTEXT, BOOL);
   8.661 +	#define ORD_WTOpen						21
   8.662 +#endif
   8.663 +	BOOL API WTClose(HCTX);
   8.664 +	#define ORD_WTClose						22
   8.665 +	int API WTPacketsGet(HCTX, int, LPVOID);
   8.666 +	#define ORD_WTPacketsGet				23
   8.667 +	BOOL API WTPacket(HCTX, UINT, LPVOID);
   8.668 +	#define ORD_WTPacket					24
   8.669 +	#endif
   8.670 +
   8.671 +	#ifndef NOWTVISIBILITYFXNS
   8.672 +	/* VISIBILITY FUNCTIONS */
   8.673 +	BOOL API WTEnable(HCTX, BOOL);
   8.674 +	#define ORD_WTEnable					40
   8.675 +	BOOL API WTOverlap(HCTX, BOOL);
   8.676 +	#define ORD_WTOverlap					41
   8.677 +	#endif
   8.678 +
   8.679 +	#ifndef NOWTCTXEDITFXNS
   8.680 +	/* CONTEXT EDITING FUNCTIONS */
   8.681 +	BOOL API WTConfig(HCTX, HWND);
   8.682 +	#define ORD_WTConfig					60
   8.683 +#ifdef WIN32
   8.684 +	BOOL API WTGetA(HCTX, LPLOGCONTEXTA);
   8.685 +	#define ORD_WTGetA						61
   8.686 +	BOOL API WTGetW(HCTX, LPLOGCONTEXTW);
   8.687 +	#define ORD_WTGetW					  1061
   8.688 +	#ifdef UNICODE
   8.689 +	#define WTGet  WTGetW
   8.690 +	#define ORD_WTGet  ORD_WTGetW
   8.691 +	#else
   8.692 +	#define WTGet  WTGetA
   8.693 +	#define ORD_WTGet  ORD_WTGetA
   8.694 +	#endif /* !UNICODE */
   8.695 +#else
   8.696 +	BOOL API WTGet(HCTX, LPLOGCONTEXT);
   8.697 +	#define ORD_WTGet						61
   8.698 +#endif
   8.699 +#ifdef WIN32
   8.700 +	BOOL API WTSetA(HCTX, LPLOGCONTEXTA);
   8.701 +	#define ORD_WTSetA						62
   8.702 +	BOOL API WTSetW(HCTX, LPLOGCONTEXTW);
   8.703 +	#define ORD_WTSetW					  1062
   8.704 +	#ifdef UNICODE
   8.705 +	#define WTSet  WTSetW
   8.706 +	#define ORD_WTSet  ORD_WTSetW
   8.707 +	#else
   8.708 +	#define WTSet  WTSetA
   8.709 +	#define ORD_WTSet  ORD_WTSetA
   8.710 +	#endif /* !UNICODE */
   8.711 +#else
   8.712 +	BOOL API WTSet(HCTX, LPLOGCONTEXT);
   8.713 +	#define ORD_WTSet						62
   8.714 +#endif
   8.715 +	BOOL API WTExtGet(HCTX, UINT, LPVOID);
   8.716 +	#define ORD_WTExtGet					63
   8.717 +	BOOL API WTExtSet(HCTX, UINT, LPVOID);
   8.718 +	#define ORD_WTExtSet					64
   8.719 +	BOOL API WTSave(HCTX, LPVOID);
   8.720 +	#define ORD_WTSave						65
   8.721 +	HCTX API WTRestore(HWND, LPVOID, BOOL);
   8.722 +	#define ORD_WTRestore					66
   8.723 +	#endif
   8.724 +
   8.725 +	#ifndef NOWTQUEUEFXNS
   8.726 +	/* ADVANCED PACKET AND QUEUE FUNCTIONS */
   8.727 +	int API WTPacketsPeek(HCTX, int, LPVOID);
   8.728 +	#define ORD_WTPacketsPeek				80
   8.729 +	int API WTDataGet(HCTX, UINT, UINT, int, LPVOID, LPINT);
   8.730 +	#define ORD_WTDataGet					81
   8.731 +	int API WTDataPeek(HCTX, UINT, UINT, int, LPVOID, LPINT);
   8.732 +	#define ORD_WTDataPeek					82
   8.733 +#ifndef WIN32
   8.734 +/* OBSOLETE IN WIN32! */
   8.735 +	DWORD API WTQueuePackets(HCTX);
   8.736 +	#define ORD_WTQueuePackets				83
   8.737 +#endif
   8.738 +	int API WTQueueSizeGet(HCTX);
   8.739 +	#define ORD_WTQueueSizeGet				84
   8.740 +	BOOL API WTQueueSizeSet(HCTX, int);
   8.741 +	#define ORD_WTQueueSizeSet				85
   8.742 +	#endif
   8.743 +
   8.744 +	#ifndef NOWTHMGRFXNS
   8.745 +	/* MANAGER HANDLE FUNCTIONS */
   8.746 +	HMGR API WTMgrOpen(HWND, UINT);
   8.747 +	#define ORD_WTMgrOpen					100
   8.748 +	BOOL API WTMgrClose(HMGR);
   8.749 +	#define ORD_WTMgrClose					101
   8.750 +	#endif
   8.751 +
   8.752 +	#ifndef NOWTMGRCTXFXNS
   8.753 +	/* MANAGER CONTEXT FUNCTIONS */
   8.754 +	BOOL API WTMgrContextEnum(HMGR, WTENUMPROC, LPARAM);
   8.755 +	#define ORD_WTMgrContextEnum			120
   8.756 +	HWND API WTMgrContextOwner(HMGR, HCTX);
   8.757 +	#define ORD_WTMgrContextOwner			121
   8.758 +	HCTX API WTMgrDefContext(HMGR, BOOL);
   8.759 +	#define ORD_WTMgrDefContext				122
   8.760 +	HCTX API WTMgrDefContextEx(HMGR, UINT, BOOL); /* 1.1 */
   8.761 +	#define ORD_WTMgrDefContextEx			206
   8.762 +	#endif
   8.763 +	
   8.764 +	#ifndef NOWTMGRCONFIGFXNS
   8.765 +	/* MANAGER CONFIG BOX  FUNCTIONS */
   8.766 +	UINT API WTMgrDeviceConfig(HMGR, UINT, HWND);
   8.767 +	#define ORD_WTMgrDeviceConfig			140
   8.768 +#ifndef WIN32
   8.769 +/* OBSOLETE IN WIN32! */
   8.770 +	BOOL API WTMgrConfigReplace(HMGR, BOOL, WTCONFIGPROC);
   8.771 +	#define ORD_WTMgrConfigReplace			141
   8.772 +#endif
   8.773 +	#endif
   8.774 +
   8.775 +	#ifndef NOWTMGRHOOKFXNS
   8.776 +	/* MANAGER PACKET HOOK FUNCTIONS */
   8.777 +#ifndef WIN32
   8.778 +/* OBSOLETE IN WIN32! */
   8.779 +	WTHOOKPROC API WTMgrPacketHook(HMGR, BOOL, int, WTHOOKPROC);
   8.780 +	#define ORD_WTMgrPacketHook				160
   8.781 +	LRESULT API WTMgrPacketHookDefProc(int, WPARAM, LPARAM, LPWTHOOKPROC);
   8.782 +	#define ORD_WTMgrPacketHookDefProc		161
   8.783 +#endif
   8.784 +	#endif
   8.785 +
   8.786 +	#ifndef NOWTMGRPREFFXNS
   8.787 +	/* MANAGER PREFERENCE DATA FUNCTIONS */
   8.788 +	BOOL API WTMgrExt(HMGR, UINT, LPVOID);
   8.789 +	#define ORD_WTMgrExt					180
   8.790 +	BOOL API WTMgrCsrEnable(HMGR, UINT, BOOL);
   8.791 +	#define ORD_WTMgrCsrEnable				181
   8.792 +	BOOL API WTMgrCsrButtonMap(HMGR, UINT, LPBYTE, LPBYTE);
   8.793 +	#define ORD_WTMgrCsrButtonMap			182
   8.794 +	BOOL API WTMgrCsrPressureBtnMarks(HMGR, UINT, DWORD, DWORD);
   8.795 +	#define ORD_WTMgrCsrPressureBtnMarks	183
   8.796 +	BOOL API WTMgrCsrPressureResponse(HMGR, UINT, UINT FAR *, UINT FAR *);
   8.797 +	#define ORD_WTMgrCsrPressureResponse	184
   8.798 +	BOOL API WTMgrCsrExt(HMGR, UINT, UINT, LPVOID);
   8.799 +	#define ORD_WTMgrCsrExt					185
   8.800 +	#endif
   8.801 +
   8.802 +/* Win32 replacements for non-portable functions. */
   8.803 +	#ifndef NOWTQUEUEFXNS
   8.804 +	/* ADVANCED PACKET AND QUEUE FUNCTIONS */
   8.805 +	BOOL API WTQueuePacketsEx(HCTX, UINT FAR *, UINT FAR *);
   8.806 +	#define ORD_WTQueuePacketsEx			200
   8.807 +	#endif
   8.808 +
   8.809 +	#ifndef NOWTMGRCONFIGFXNS
   8.810 +	/* MANAGER CONFIG BOX  FUNCTIONS */
   8.811 +#ifdef WIN32
   8.812 +	BOOL API WTMgrConfigReplaceExA(HMGR, BOOL, LPSTR, LPSTR);
   8.813 +	#define ORD_WTMgrConfigReplaceExA		202
   8.814 +	BOOL API WTMgrConfigReplaceExW(HMGR, BOOL, LPWSTR, LPSTR);
   8.815 +	#define ORD_WTMgrConfigReplaceExW		1202
   8.816 +	#ifdef UNICODE
   8.817 +	#define WTMgrConfigReplaceEx  WTMgrConfigReplaceExW
   8.818 +	#define ORD_WTMgrConfigReplaceEx  ORD_WTMgrConfigReplaceExW
   8.819 +	#else
   8.820 +	#define WTMgrConfigReplaceEx  WTMgrConfigReplaceExA
   8.821 +	#define ORD_WTMgrConfigReplaceEx  ORD_WTMgrConfigReplaceExA
   8.822 +	#endif /* !UNICODE */
   8.823 +#else
   8.824 +	BOOL API WTMgrConfigReplaceEx(HMGR, BOOL, LPSTR, LPSTR);
   8.825 +	#define ORD_WTMgrConfigReplaceEx		202
   8.826 +#endif
   8.827 +	#endif
   8.828 +
   8.829 +	#ifndef NOWTMGRHOOKFXNS
   8.830 +	/* MANAGER PACKET HOOK FUNCTIONS */
   8.831 +#ifdef WIN32
   8.832 +	HWTHOOK API WTMgrPacketHookExA(HMGR, int, LPSTR, LPSTR);
   8.833 +	#define ORD_WTMgrPacketHookExA			203
   8.834 +	HWTHOOK API WTMgrPacketHookExW(HMGR, int, LPWSTR, LPSTR);
   8.835 +	#define ORD_WTMgrPacketHookExW			1203
   8.836 +	#ifdef UNICODE
   8.837 +	#define WTMgrPacketHookEx  WTMgrPacketHookExW
   8.838 +	#define ORD_WTMgrPacketHookEx  ORD_WTMgrPacketHookExW
   8.839 +	#else
   8.840 +	#define WTMgrPacketHookEx  WTMgrPacketHookExA
   8.841 +	#define ORD_WTMgrPacketHookEx  ORD_WTMgrPacketHookExA
   8.842 +	#endif /* !UNICODE */
   8.843 +#else
   8.844 +	HWTHOOK API WTMgrPacketHookEx(HMGR, int, LPSTR, LPSTR);
   8.845 +	#define ORD_WTMgrPacketHookEx			203
   8.846 +#endif
   8.847 +	BOOL API WTMgrPacketUnhook(HWTHOOK);
   8.848 +	#define ORD_WTMgrPacketUnhook			204
   8.849 +	LRESULT API WTMgrPacketHookNext(HWTHOOK, int, WPARAM, LPARAM);
   8.850 +	#define ORD_WTMgrPacketHookNext			205
   8.851 +	#endif
   8.852 +
   8.853 +	#ifndef NOWTMGRPREFFXNS
   8.854 +	/* MANAGER PREFERENCE DATA FUNCTIONS */
   8.855 +	BOOL API WTMgrCsrPressureBtnMarksEx(HMGR, UINT, UINT FAR *, UINT FAR *);
   8.856 +	#define ORD_WTMgrCsrPressureBtnMarksEx	201
   8.857 +	#endif
   8.858 +
   8.859 +
   8.860 +
   8.861 +#endif
   8.862 +
   8.863 +#ifdef __cplusplus
   8.864 +}
   8.865 +#endif	/* __cplusplus */
   8.866 +
   8.867 +#endif /* #define _INC_WINTAB */
   8.868 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/video/win32/wactab/wintabx.h	Tue Aug 26 05:26:28 2008 +0000
     9.3 @@ -0,0 +1,135 @@
     9.4 +/* ------------------------------- wintabx.h -------------------------------- */
     9.5 +/* Combined 16 & 32-bit version. */
     9.6 +
     9.7 +
     9.8 +/*------------------------------------------------------------------------------
     9.9 +The text and information contained in this file may be freely used,
    9.10 +copied, or distributed without compensation or licensing restrictions.
    9.11 +
    9.12 +This file is copyright 1991-1998 by LCS/Telegraphics.
    9.13 +------------------------------------------------------------------------------*/
    9.14 +
    9.15 +#ifndef _INC_WINTABX     /* prevent multiple includes */
    9.16 +#define _INC_WINTABX
    9.17 +
    9.18 +#ifdef __cplusplus
    9.19 +extern "C" {
    9.20 +#endif	/* __cplusplus */
    9.21 +
    9.22 +/* prototype for wintabx.lib. */
    9.23 +#define _UnlinkWinTab _UnlinkWintab	
    9.24 +#ifdef WIN32
    9.25 +	extern WINAPI _UnlinkWintab(void);
    9.26 +#else
    9.27 +	extern FAR _UnlinkWintab(void);
    9.28 +#endif
    9.29 +
    9.30 +/****** Wintab message crackers ***********************************************/
    9.31 +
    9.32 +#ifndef HANDLE_MSG
    9.33 +#define HANDLE_MSG(hwnd, message, fn)    \
    9.34 +    case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
    9.35 +#endif
    9.36 +
    9.37 +/* void Cls_OnWintabPacket(HWND hwnd, HCTX hCtx, UINT sn) */
    9.38 +#define HANDLE_WT_PACKET(hwnd, wParam, lParam, fn) \
    9.39 +    ((fn)((hwnd), (HCTX)(lParam), (UINT)(wParam)), 0L)
    9.40 +#define FORWARD__WT_PACKET(hwnd, bs, hCtx, sn, fn) \
    9.41 +    (void)(fn)((hwnd), _WT_PACKET(bs), (WPARAM)(UINT)(sn), (LPARAM)(HCTX)(hCtx))
    9.42 +#define FORWARD_WT_PACKET(hwnd, hCtx, sn, fn) \
    9.43 +	FORWARD__WT_PACKET(hwnd, WT_DEFBASE, hCtx, sn, fn)
    9.44 +
    9.45 +/* void Cls_OnWintabCtxOpen(HWND hwnd, HCTX hCtx, UINT sf) */
    9.46 +#define HANDLE_WT_CTXOPEN(hwnd, wParam, lParam, fn) \
    9.47 +    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
    9.48 +#define FORWARD__WT_CTXOPEN(hwnd, bs, hCtx, sf, fn) \
    9.49 +    (void)(fn)((hwnd), _WT_CTXOPEN(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
    9.50 +#define FORWARD_WT_CTXOPEN(hwnd, hCtx, sf, fn) \
    9.51 +	FORWARD__WT_CTXOPEN(hwnd, WT_DEFBASE, hCtx, sf, fn)
    9.52 +
    9.53 +/* void Cls_OnWintabCtxClose(HWND hwnd, HCTX hCtx, UINT sf) */
    9.54 +#define HANDLE_WT_CTXCLOSE(hwnd, wParam, lParam, fn) \
    9.55 +    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
    9.56 +#define FORWARD__WT_CTXCLOSE(hwnd, bs, hCtx, sf, fn) \
    9.57 +    (void)(fn)((hwnd), _WT_CTXCLOSE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
    9.58 +#define FORWARD_WT_CTXCLOSE(hwnd, hCtx, sf, fn) \
    9.59 +	FORWARD__WT_CTXCLOSE(hwnd, WT_DEFBASE, hCtx, sf, fn)
    9.60 +
    9.61 +/* void Cls_OnWintabCtxUpdate(HWND hwnd, HCTX hCtx, UINT sf) */
    9.62 +#define HANDLE_WT_CTXUPDATE(hwnd, wParam, lParam, fn) \
    9.63 +    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
    9.64 +#define FORWARD__WT_CTXUPDATE(hwnd, bs, hCtx, sf, fn) \
    9.65 +    (void)(fn)((hwnd), _WT_CTXUPDATE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
    9.66 +#define FORWARD_WT_CTXUPDATE(hwnd, hCtx, sf, fn) \
    9.67 +	FORWARD__WT_CTXUPDATE(hwnd, WT_DEFBASE, hCtx, sf, fn)
    9.68 +
    9.69 +/* void Cls_OnWintabCtxOverlap(HWND hwnd, HCTX hCtx, UINT sf) */
    9.70 +#define HANDLE_WT_CTXOVERLAP(hwnd, wParam, lParam, fn) \
    9.71 +    ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
    9.72 +#define FORWARD__WT_CTXOVERLAP(hwnd, bs, hCtx, sf, fn) \
    9.73 +    (void)(fn)((hwnd), _WT_CTXOVERLAP(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
    9.74 +#define FORWARD_WT_CTXOVERLAP(hwnd, hCtx, sf, fn) \
    9.75 +	FORWARD__WT_CTXOVERLAP(hwnd, WT_DEFBASE, hCtx, sf, fn)
    9.76 +
    9.77 +/* void Cls_OnWintabProximity(HWND hwnd, HCTX hCtx, BOOL cp, BOOL hp) */
    9.78 +#define HANDLE_WT_PROXIMITY(hwnd, wParam, lParam, fn) \
    9.79 +    ((fn)((hwnd), (HCTX)(wParam), (BOOL)LOWORD(lParam),  (BOOL)HIWORD(lParam)), 0L)
    9.80 +#define FORWARD__WT_PROXIMITY(hwnd, bs, hCtx, cp, hp, fn) \
    9.81 +    (void)(fn)((hwnd), _WT_PROXIMITY(bs), (WPARAM)(HCTX)(hCtx), MAKELPARAM((cp), (hp))
    9.82 +#define FORWARD_WT_PROXIMITY(hwnd, hCtx, sf, fn) \
    9.83 +	FORWARD__WT_PROXIMITY(hwnd, WT_DEFBASE, hCtx, cp, hp, fn)
    9.84 +
    9.85 +/* void Cls_OnWintabInfoChange(HWND hwnd, HMGR hMgr, UINT c, UINT i) */
    9.86 +#define HANDLE_WT_INFOCHANGE(hwnd, wParam, lParam, fn) \
    9.87 +    ((fn)((hwnd), (HMGR)(wParam), (UINT)LOWORD(lParam),  (UINT)HIWORD(lParam)), 0L)
    9.88 +#define FORWARD__WT_INFOCHANGE(hwnd, bs, hMgr, cp, hp, fn) \
    9.89 +    (void)(fn)((hwnd), _WT_INFOCHANGE(bs), (WPARAM)(HMGR)(hMgr), MAKELPARAM((c), (i))
    9.90 +#define FORWARD_WT_INFOCHANGE(hwnd, hMgr, sf, fn) \
    9.91 +	FORWARD__WT_INFOCHANGE(hwnd, WT_DEFBASE, hMgr, cp, hp, fn)
    9.92 +
    9.93 +/****** Alternate porting layer macros ****************************************/
    9.94 +
    9.95 +#define GET_WT_PACKET_HCTX(wp, lp)			((HCTX)lp)
    9.96 +#define GET_WT_PACKET_SERIAL(wp, lp)		(wp)
    9.97 +#define GET_WT_PACKET_MPS(h, s)				\
    9.98 +		(s), (LPARAM)(h)
    9.99 +
   9.100 +#define GET_WT_CTXOPEN_HCTX(wp, lp)			((HCTX)wp)
   9.101 +#define GET_WT_CTXOPEN_STATUS(wp, lp)		((UINT)lp)
   9.102 +#define GET_WT_CTXOPEN_MPS(h, s)			\
   9.103 +		(WPARAM)(h), (LPARAM)(s)
   9.104 +
   9.105 +#define GET_WT_CTXCLOSE_HCTX(wp, lp)		((HCTX)wp)
   9.106 +#define GET_WT_CTXCLOSE_STATUS(wp, lp)		((UINT)lp)
   9.107 +#define GET_WT_CTXCLOSE_MPS(h, s)			\
   9.108 +		(WPARAM)(h), (LPARAM)(s)
   9.109 +
   9.110 +#define GET_WT_CTXUPDATE_HCTX(wp, lp)		((HCTX)wp)
   9.111 +#define GET_WT_CTXUPDATE_STATUS(wp, lp)		((UINT)lp)
   9.112 +#define GET_WT_CTXUPDATE_MPS(h, s)			\
   9.113 +		(WPARAM)(h), (LPARAM)(s)
   9.114 +
   9.115 +#define GET_WT_CTXOVERLAP_HCTX(wp, lp)		((HCTX)wp)
   9.116 +#define GET_WT_CTXOVERLAP_STATUS(wp, lp)	((UINT)lp)
   9.117 +#define GET_WT_CTXOVERLAP_MPS(h, s)			\
   9.118 +		(WPARAM)(h), (LPARAM)(s)
   9.119 +
   9.120 +#define GET_WT_PROXIMITY_HCTX(wp, lp)		((HCTX)wp)
   9.121 +#define GET_WT_PROXIMITY_CTXPROX(wp, lp)	LOWORD(lp)
   9.122 +#define GET_WT_PROXIMITY_HARDPROX(wp, lp)	HIWORD(lp)
   9.123 +#define GET_WT_PROXIMITY_MPS(h, fc, fh)		\
   9.124 +		(WPARAM)(h), MAKELONG(fc, fh)
   9.125 +
   9.126 +#define GET_WT_INFOCHANGE_HMGR(wp, lp)		((HMGR)wp)
   9.127 +#define GET_WT_INFOCHANGE_CATEGORY(wp, lp)	LOWORD(lp)
   9.128 +#define GET_WT_INFOCHANGE_INDEX(wp, lp)		HIWORD(lp)
   9.129 +#define GET_WT_INFOCHANGE_MPS(h, c, i)		\
   9.130 +		(WPARAM)(h), MAKELONG(c, i)
   9.131 +
   9.132 +
   9.133 +#ifdef __cplusplus
   9.134 +}
   9.135 +#endif	/* __cplusplus */
   9.136 +
   9.137 +#endif /* #define _INC_WINTABX */
   9.138 +