*/}}

wintab.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920
  1. /* -------------------------------- wintab.h -------------------------------- */
  2. /* Combined 16 & 32-bit version. */
  3. /*------------------------------------------------------------------------------
  4. The text and information contained in this file may be freely used,
  5. copied, or distributed without compensation or licensing restrictions.
  6. This file is Copyright (c) Wacom Company, Ltd. 2010 All Rights Reserved
  7. with portions copyright 1991-1998 by LCS/Telegraphics.
  8. ------------------------------------------------------------------------------*/
  9. #ifndef _INC_WINTAB /* prevent multiple includes */
  10. #define _INC_WINTAB
  11. #ifdef __cplusplus
  12. extern "C" {
  13. #endif /* __cplusplus */
  14. /* -------------------------------------------------------------------------- */
  15. /* Messages */
  16. #ifndef NOWTMESSAGES
  17. #define WT_DEFBASE 0x7FF0
  18. #define WT_MAXOFFSET 0xF
  19. #define _WT_PACKET(b) ((b)+0)
  20. #define _WT_CTXOPEN(b) ((b)+1)
  21. #define _WT_CTXCLOSE(b) ((b)+2)
  22. #define _WT_CTXUPDATE(b) ((b)+3)
  23. #define _WT_CTXOVERLAP(b) ((b)+4)
  24. #define _WT_PROXIMITY(b) ((b)+5)
  25. #define _WT_INFOCHANGE(b) ((b)+6)
  26. #define _WT_CSRCHANGE(b) ((b)+7) /* 1.1 */
  27. #define _WT_PACKETEXT(b) ((b)+8) /* 1.4 */
  28. #define _WT_MAX(b) ((b)+WT_MAXOFFSET)
  29. #define WT_PACKET _WT_PACKET(WT_DEFBASE)
  30. #define WT_CTXOPEN _WT_CTXOPEN(WT_DEFBASE)
  31. #define WT_CTXCLOSE _WT_CTXCLOSE(WT_DEFBASE)
  32. #define WT_CTXUPDATE _WT_CTXUPDATE(WT_DEFBASE)
  33. #define WT_CTXOVERLAP _WT_CTXOVERLAP(WT_DEFBASE)
  34. #define WT_PROXIMITY _WT_PROXIMITY(WT_DEFBASE)
  35. #define WT_INFOCHANGE _WT_INFOCHANGE(WT_DEFBASE)
  36. #define WT_CSRCHANGE _WT_CSRCHANGE(WT_DEFBASE) /* 1.1 */
  37. #define WT_PACKETEXT _WT_PACKETEXT(WT_DEFBASE) /* 1.4 */
  38. #define WT_MAX _WT_MAX(WT_DEFBASE)
  39. #endif
  40. /* -------------------------------------------------------------------------- */
  41. /* -------------------------------------------------------------------------- */
  42. /* Data Types */
  43. /* -------------------------------------------------------------------------- */
  44. /* COMMON DATA DEFS */
  45. DECLARE_HANDLE(HMGR); /* manager handle */
  46. DECLARE_HANDLE(HCTX); /* context handle */
  47. DECLARE_HANDLE(HWTHOOK); /* hook handle */
  48. typedef DWORD WTPKT; /* packet mask */
  49. #ifndef NOWTPKT
  50. /* WTPKT bits */
  51. #define PK_CONTEXT 0x0001 /* reporting context */
  52. #define PK_STATUS 0x0002 /* status bits */
  53. #define PK_TIME 0x0004 /* time stamp */
  54. #define PK_CHANGED 0x0008 /* change bit vector */
  55. #define PK_SERIAL_NUMBER 0x0010 /* packet serial number */
  56. #define PK_CURSOR 0x0020 /* reporting cursor */
  57. #define PK_BUTTONS 0x0040 /* button information */
  58. #define PK_X 0x0080 /* x axis */
  59. #define PK_Y 0x0100 /* y axis */
  60. #define PK_Z 0x0200 /* z axis */
  61. #define PK_NORMAL_PRESSURE 0x0400 /* normal or tip pressure */
  62. #define PK_TANGENT_PRESSURE 0x0800 /* tangential or barrel pressure */
  63. #define PK_ORIENTATION 0x1000 /* orientation info: tilts */
  64. #define PK_ROTATION 0x2000 /* rotation info; 1.1 */
  65. #endif
  66. typedef DWORD FIX32; /* fixed-point arithmetic type */
  67. #ifndef NOFIX32
  68. #define INT(x) HIWORD(x)
  69. #define FRAC(x) LOWORD(x)
  70. #define CASTFIX32(x) ((FIX32)((x)*65536L))
  71. #define ROUND(x) (INT(x) + (FRAC(x) > (WORD)0x8000))
  72. #define FIX_MUL(c, a, b) \
  73. (c = (((DWORD)FRAC(a) * FRAC(b)) >> 16) + \
  74. (DWORD)INT(a) * FRAC(b) + \
  75. (DWORD)INT(b) * FRAC(a) + \
  76. ((DWORD)INT(a) * INT(b) << 16))
  77. #ifdef _WINDLL
  78. #define FIX_DIV_SC static
  79. #else
  80. #define FIX_DIV_SC
  81. #endif
  82. #define FIX_DIV(c, a, b) \
  83. { \
  84. FIX_DIV_SC DWORD temp, rem, btemp; \
  85. \
  86. /* fraction done bytewise */ \
  87. temp = ((a / b) << 16); \
  88. rem = a % b; \
  89. btemp = b; \
  90. if (INT(btemp) < 256) { \
  91. rem <<= 8; \
  92. } \
  93. else { \
  94. btemp >>= 8; \
  95. } \
  96. temp += ((rem / btemp) << 8); \
  97. rem %= btemp; \
  98. rem <<= 8; \
  99. temp += rem / btemp; \
  100. c = temp; \
  101. }
  102. #endif
  103. /* -------------------------------------------------------------------------- */
  104. /* INFO DATA DEFS */
  105. #ifndef NOWTINFO
  106. #ifndef NOWTAXIS
  107. typedef struct tagAXIS {
  108. LONG axMin;
  109. LONG axMax;
  110. UINT axUnits;
  111. FIX32 axResolution;
  112. } AXIS, * PAXIS, NEAR* NPAXIS, FAR* LPAXIS;
  113. /* unit specifiers */
  114. #define TU_NONE 0
  115. #define TU_INCHES 1
  116. #define TU_CENTIMETERS 2
  117. #define TU_CIRCLE 3
  118. #endif
  119. #ifndef NOWTSYSBUTTONS
  120. /* system button assignment values */
  121. #define SBN_NONE 0x00
  122. #define SBN_LCLICK 0x01
  123. #define SBN_LDBLCLICK 0x02
  124. #define SBN_LDRAG 0x03
  125. #define SBN_RCLICK 0x04
  126. #define SBN_RDBLCLICK 0x05
  127. #define SBN_RDRAG 0x06
  128. #define SBN_MCLICK 0x07
  129. #define SBN_MDBLCLICK 0x08
  130. #define SBN_MDRAG 0x09
  131. /* for Pen Windows */
  132. #define SBN_PTCLICK 0x10
  133. #define SBN_PTDBLCLICK 0x20
  134. #define SBN_PTDRAG 0x30
  135. #define SBN_PNCLICK 0x40
  136. #define SBN_PNDBLCLICK 0x50
  137. #define SBN_PNDRAG 0x60
  138. #define SBN_P1CLICK 0x70
  139. #define SBN_P1DBLCLICK 0x80
  140. #define SBN_P1DRAG 0x90
  141. #define SBN_P2CLICK 0xA0
  142. #define SBN_P2DBLCLICK 0xB0
  143. #define SBN_P2DRAG 0xC0
  144. #define SBN_P3CLICK 0xD0
  145. #define SBN_P3DBLCLICK 0xE0
  146. #define SBN_P3DRAG 0xF0
  147. #endif
  148. #ifndef NOWTCAPABILITIES
  149. /* hardware capabilities */
  150. #define HWC_INTEGRATED 0x0001
  151. #define HWC_TOUCH 0x0002
  152. #define HWC_HARDPROX 0x0004
  153. #define HWC_PHYSID_CURSORS 0x0008 /* 1.1 */
  154. #endif
  155. #ifndef NOWTIFC
  156. #ifndef NOWTCURSORS
  157. /* cursor capabilities */
  158. #define CRC_MULTIMODE 0x0001 /* 1.1 */
  159. #define CRC_AGGREGATE 0x0002 /* 1.1 */
  160. #define CRC_INVERT 0x0004 /* 1.1 */
  161. #endif
  162. /* info categories */
  163. #define WTI_INTERFACE 1
  164. #define IFC_WINTABID 1
  165. #define IFC_SPECVERSION 2
  166. #define IFC_IMPLVERSION 3
  167. #define IFC_NDEVICES 4
  168. #define IFC_NCURSORS 5
  169. #define IFC_NCONTEXTS 6
  170. #define IFC_CTXOPTIONS 7
  171. #define IFC_CTXSAVESIZE 8
  172. #define IFC_NEXTENSIONS 9
  173. #define IFC_NMANAGERS 10
  174. #define IFC_MAX 10
  175. #endif
  176. #ifndef NOWTSTATUS
  177. #define WTI_STATUS 2
  178. #define STA_CONTEXTS 1
  179. #define STA_SYSCTXS 2
  180. #define STA_PKTRATE 3
  181. #define STA_PKTDATA 4
  182. #define STA_MANAGERS 5
  183. #define STA_SYSTEM 6
  184. #define STA_BUTTONUSE 7
  185. #define STA_SYSBTNUSE 8
  186. #define STA_MAX 8
  187. #endif
  188. #ifndef NOWTDEFCONTEXT
  189. #define WTI_DEFCONTEXT 3
  190. #define WTI_DEFSYSCTX 4
  191. #define WTI_DDCTXS 400 /* 1.1 */
  192. #define WTI_DSCTXS 500 /* 1.1 */
  193. #define CTX_NAME 1
  194. #define CTX_OPTIONS 2
  195. #define CTX_STATUS 3
  196. #define CTX_LOCKS 4
  197. #define CTX_MSGBASE 5
  198. #define CTX_DEVICE 6
  199. #define CTX_PKTRATE 7
  200. #define CTX_PKTDATA 8
  201. #define CTX_PKTMODE 9
  202. #define CTX_MOVEMASK 10
  203. #define CTX_BTNDNMASK 11
  204. #define CTX_BTNUPMASK 12
  205. #define CTX_INORGX 13
  206. #define CTX_INORGY 14
  207. #define CTX_INORGZ 15
  208. #define CTX_INEXTX 16
  209. #define CTX_INEXTY 17
  210. #define CTX_INEXTZ 18
  211. #define CTX_OUTORGX 19
  212. #define CTX_OUTORGY 20
  213. #define CTX_OUTORGZ 21
  214. #define CTX_OUTEXTX 22
  215. #define CTX_OUTEXTY 23
  216. #define CTX_OUTEXTZ 24
  217. #define CTX_SENSX 25
  218. #define CTX_SENSY 26
  219. #define CTX_SENSZ 27
  220. #define CTX_SYSMODE 28
  221. #define CTX_SYSORGX 29
  222. #define CTX_SYSORGY 30
  223. #define CTX_SYSEXTX 31
  224. #define CTX_SYSEXTY 32
  225. #define CTX_SYSSENSX 33
  226. #define CTX_SYSSENSY 34
  227. #define CTX_MAX 34
  228. #endif
  229. #ifndef NOWTDEVICES
  230. #define WTI_DEVICES 100
  231. #define DVC_NAME 1
  232. #define DVC_HARDWARE 2
  233. #define DVC_NCSRTYPES 3
  234. #define DVC_FIRSTCSR 4
  235. #define DVC_PKTRATE 5
  236. #define DVC_PKTDATA 6
  237. #define DVC_PKTMODE 7
  238. #define DVC_CSRDATA 8
  239. #define DVC_XMARGIN 9
  240. #define DVC_YMARGIN 10
  241. #define DVC_ZMARGIN 11
  242. #define DVC_X 12
  243. #define DVC_Y 13
  244. #define DVC_Z 14
  245. #define DVC_NPRESSURE 15
  246. #define DVC_TPRESSURE 16
  247. #define DVC_ORIENTATION 17
  248. #define DVC_ROTATION 18 /* 1.1 */
  249. #define DVC_PNPID 19 /* 1.1 */
  250. #define DVC_MAX 19
  251. #endif
  252. #ifndef NOWTCURSORS
  253. #define WTI_CURSORS 200
  254. #define CSR_NAME 1
  255. #define CSR_ACTIVE 2
  256. #define CSR_PKTDATA 3
  257. #define CSR_BUTTONS 4
  258. #define CSR_BUTTONBITS 5
  259. #define CSR_BTNNAMES 6
  260. #define CSR_BUTTONMAP 7
  261. #define CSR_SYSBTNMAP 8
  262. #define CSR_NPBUTTON 9
  263. #define CSR_NPBTNMARKS 10
  264. #define CSR_NPRESPONSE 11
  265. #define CSR_TPBUTTON 12
  266. #define CSR_TPBTNMARKS 13
  267. #define CSR_TPRESPONSE 14
  268. #define CSR_PHYSID 15 /* 1.1 */
  269. #define CSR_MODE 16 /* 1.1 */
  270. #define CSR_MINPKTDATA 17 /* 1.1 */
  271. #define CSR_MINBUTTONS 18 /* 1.1 */
  272. #define CSR_CAPABILITIES 19 /* 1.1 */
  273. #define CSR_TYPE 20 /* 1.2 */
  274. #define CSR_MAX 20
  275. #endif
  276. #ifndef NOWTEXTENSIONS
  277. #define WTI_EXTENSIONS 300
  278. #define EXT_NAME 1
  279. #define EXT_TAG 2
  280. #define EXT_MASK 3
  281. #define EXT_SIZE 4
  282. #define EXT_AXES 5
  283. #define EXT_DEFAULT 6
  284. #define EXT_DEFCONTEXT 7
  285. #define EXT_DEFSYSCTX 8
  286. #define EXT_CURSORS 9
  287. #define EXT_DEVICES 110 /* Allow 100 cursors */
  288. #define EXT_MAX 210 /* Allow 100 devices */
  289. #endif
  290. #endif
  291. /* -------------------------------------------------------------------------- */
  292. /* CONTEXT DATA DEFS */
  293. #define LCNAMELEN 40
  294. #define LC_NAMELEN 40
  295. #ifdef WIN32
  296. typedef struct tagLOGCONTEXTA {
  297. char lcName[LCNAMELEN];
  298. UINT lcOptions;
  299. UINT lcStatus;
  300. UINT lcLocks;
  301. UINT lcMsgBase;
  302. UINT lcDevice;
  303. UINT lcPktRate;
  304. WTPKT lcPktData;
  305. WTPKT lcPktMode;
  306. WTPKT lcMoveMask;
  307. DWORD lcBtnDnMask;
  308. DWORD lcBtnUpMask;
  309. LONG lcInOrgX;
  310. LONG lcInOrgY;
  311. LONG lcInOrgZ;
  312. LONG lcInExtX;
  313. LONG lcInExtY;
  314. LONG lcInExtZ;
  315. LONG lcOutOrgX;
  316. LONG lcOutOrgY;
  317. LONG lcOutOrgZ;
  318. LONG lcOutExtX;
  319. LONG lcOutExtY;
  320. LONG lcOutExtZ;
  321. FIX32 lcSensX;
  322. FIX32 lcSensY;
  323. FIX32 lcSensZ;
  324. BOOL lcSysMode;
  325. int lcSysOrgX;
  326. int lcSysOrgY;
  327. int lcSysExtX;
  328. int lcSysExtY;
  329. FIX32 lcSysSensX;
  330. FIX32 lcSysSensY;
  331. } LOGCONTEXTA, * PLOGCONTEXTA, NEAR* NPLOGCONTEXTA, FAR* LPLOGCONTEXTA;
  332. typedef struct tagLOGCONTEXTW {
  333. WCHAR lcName[LCNAMELEN];
  334. UINT lcOptions;
  335. UINT lcStatus;
  336. UINT lcLocks;
  337. UINT lcMsgBase;
  338. UINT lcDevice;
  339. UINT lcPktRate;
  340. WTPKT lcPktData;
  341. WTPKT lcPktMode;
  342. WTPKT lcMoveMask;
  343. DWORD lcBtnDnMask;
  344. DWORD lcBtnUpMask;
  345. LONG lcInOrgX;
  346. LONG lcInOrgY;
  347. LONG lcInOrgZ;
  348. LONG lcInExtX;
  349. LONG lcInExtY;
  350. LONG lcInExtZ;
  351. LONG lcOutOrgX;
  352. LONG lcOutOrgY;
  353. LONG lcOutOrgZ;
  354. LONG lcOutExtX;
  355. LONG lcOutExtY;
  356. LONG lcOutExtZ;
  357. FIX32 lcSensX;
  358. FIX32 lcSensY;
  359. FIX32 lcSensZ;
  360. BOOL lcSysMode;
  361. int lcSysOrgX;
  362. int lcSysOrgY;
  363. int lcSysExtX;
  364. int lcSysExtY;
  365. FIX32 lcSysSensX;
  366. FIX32 lcSysSensY;
  367. } LOGCONTEXTW, * PLOGCONTEXTW, NEAR* NPLOGCONTEXTW, FAR* LPLOGCONTEXTW;
  368. #ifdef UNICODE
  369. typedef LOGCONTEXTW LOGCONTEXT;
  370. typedef PLOGCONTEXTW PLOGCONTEXT;
  371. typedef NPLOGCONTEXTW NPLOGCONTEXT;
  372. typedef LPLOGCONTEXTW LPLOGCONTEXT;
  373. #else
  374. typedef LOGCONTEXTA LOGCONTEXT;
  375. typedef PLOGCONTEXTA PLOGCONTEXT;
  376. typedef NPLOGCONTEXTA NPLOGCONTEXT;
  377. typedef LPLOGCONTEXTA LPLOGCONTEXT;
  378. #endif /* UNICODE */
  379. #else /* WIN32 */
  380. typedef struct tagLOGCONTEXT {
  381. char lcName[LCNAMELEN];
  382. UINT lcOptions;
  383. UINT lcStatus;
  384. UINT lcLocks;
  385. UINT lcMsgBase;
  386. UINT lcDevice;
  387. UINT lcPktRate;
  388. WTPKT lcPktData;
  389. WTPKT lcPktMode;
  390. WTPKT lcMoveMask;
  391. DWORD lcBtnDnMask;
  392. DWORD lcBtnUpMask;
  393. LONG lcInOrgX;
  394. LONG lcInOrgY;
  395. LONG lcInOrgZ;
  396. LONG lcInExtX;
  397. LONG lcInExtY;
  398. LONG lcInExtZ;
  399. LONG lcOutOrgX;
  400. LONG lcOutOrgY;
  401. LONG lcOutOrgZ;
  402. LONG lcOutExtX;
  403. LONG lcOutExtY;
  404. LONG lcOutExtZ;
  405. FIX32 lcSensX;
  406. FIX32 lcSensY;
  407. FIX32 lcSensZ;
  408. BOOL lcSysMode;
  409. int lcSysOrgX;
  410. int lcSysOrgY;
  411. int lcSysExtX;
  412. int lcSysExtY;
  413. FIX32 lcSysSensX;
  414. FIX32 lcSysSensY;
  415. } LOGCONTEXT, * PLOGCONTEXT, NEAR* NPLOGCONTEXT, FAR* LPLOGCONTEXT;
  416. #endif /* WIN32 */
  417. /* context option values */
  418. #define CXO_SYSTEM 0x0001
  419. #define CXO_PEN 0x0002
  420. #define CXO_MESSAGES 0x0004
  421. #define CXO_MARGIN 0x8000
  422. #define CXO_MGNINSIDE 0x4000
  423. #define CXO_CSRMESSAGES 0x0008 /* 1.1 */
  424. /* context status values */
  425. #define CXS_DISABLED 0x0001
  426. #define CXS_OBSCURED 0x0002
  427. #define CXS_ONTOP 0x0004
  428. /* context lock values */
  429. #define CXL_INSIZE 0x0001
  430. #define CXL_INASPECT 0x0002
  431. #define CXL_SENSITIVITY 0x0004
  432. #define CXL_MARGIN 0x0008
  433. #define CXL_SYSOUT 0x0010
  434. /* -------------------------------------------------------------------------- */
  435. /* EVENT DATA DEFS */
  436. /* For packet structure definition, see pktdef.h */
  437. /* packet status values */
  438. #define TPS_PROXIMITY 0x0001
  439. #define TPS_QUEUE_ERR 0x0002
  440. #define TPS_MARGIN 0x0004
  441. #define TPS_GRAB 0x0008
  442. #define TPS_INVERT 0x0010 /* 1.1 */
  443. typedef struct tagORIENTATION {
  444. int orAzimuth;
  445. int orAltitude;
  446. int orTwist;
  447. } ORIENTATION, * PORIENTATION, NEAR* NPORIENTATION, FAR* LPORIENTATION;
  448. typedef struct tagROTATION { /* 1.1 */
  449. int roPitch;
  450. int roRoll;
  451. int roYaw;
  452. } ROTATION, * PROTATION, NEAR* NPROTATION, FAR* LPROTATION;
  453. // grandfather in obsolete member names.
  454. #define rotPitch roPitch
  455. #define rotRoll roRoll
  456. #define rotYaw roYaw
  457. /* relative buttons */
  458. #define TBN_NONE 0
  459. #define TBN_UP 1
  460. #define TBN_DOWN 2
  461. /* -------------------------------------------------------------------------- */
  462. /* DEVICE CONFIG CONSTANTS */
  463. #ifndef NOWTDEVCFG
  464. #define WTDC_NONE 0
  465. #define WTDC_CANCEL 1
  466. #define WTDC_OK 2
  467. #define WTDC_RESTART 3
  468. #endif
  469. /* -------------------------------------------------------------------------- */
  470. /* HOOK CONSTANTS */
  471. #ifndef NOWTHOOKS
  472. #define WTH_PLAYBACK 1
  473. #define WTH_RECORD 2
  474. #define WTHC_GETLPLPFN (-3)
  475. #define WTHC_LPLPFNNEXT (-2)
  476. #define WTHC_LPFNNEXT (-1)
  477. #define WTHC_ACTION 0
  478. #define WTHC_GETNEXT 1
  479. #define WTHC_SKIP 2
  480. #endif
  481. /* -------------------------------------------------------------------------- */
  482. /* PREFERENCE FUNCTION CONSTANTS */
  483. #ifndef NOWTPREF
  484. #define WTP_LPDEFAULT ((LPVOID)-1L)
  485. #define WTP_DWDEFAULT ((DWORD)-1L)
  486. #endif
  487. /* -------------------------------------------------------------------------- */
  488. /* EXTENSION TAGS AND CONSTANTS */
  489. #ifndef NOWTEXTENSIONS
  490. /* constants for use with pktdef.h */
  491. #define PKEXT_ABSOLUTE 1
  492. #define PKEXT_RELATIVE 2
  493. /* Extension tags. */
  494. #define WTX_OBT 0 /* Out of bounds tracking */
  495. #define WTX_FKEYS 1 /* Function keys */
  496. #define WTX_TILT 2 /* Raw Cartesian tilt; 1.1 */
  497. #define WTX_CSRMASK 3 /* select input by cursor type; 1.1 */
  498. #define WTX_XBTNMASK 4 /* Extended button mask; 1.1 */
  499. #define WTX_EXPKEYS 5 /* ExpressKeys; 1.3 - DEPRECATED: see WTX_EXPKEYS2 */
  500. #define WTX_TOUCHSTRIP 6 /* TouchStrips; 1.4 */
  501. #define WTX_TOUCHRING 7 /* TouchRings; 1.4 */
  502. #define WTX_EXPKEYS2 8 /* ExpressKeys; 1.4 */
  503. typedef struct tagXBTNMASK {
  504. BYTE xBtnDnMask[32];
  505. BYTE xBtnUpMask[32];
  506. } XBTNMASK;
  507. typedef struct tagTILT { /* 1.1 */
  508. int tiltX;
  509. int tiltY;
  510. } TILT;
  511. typedef struct tagEXTENSIONBASE { /* 1.4 */
  512. HCTX nContext;
  513. UINT nStatus;
  514. DWORD nTime;
  515. UINT nSerialNumber;
  516. } EXTENSIONBASE;
  517. typedef struct tagEXPKEYSDATA { /* 1.4 */
  518. BYTE nTablet;
  519. BYTE nControl;
  520. BYTE nLocation;
  521. BYTE nReserved;
  522. DWORD nState;
  523. } EXPKEYSDATA;
  524. typedef struct tagSLIDERDATA { /* 1.4 */
  525. BYTE nTablet;
  526. BYTE nControl;
  527. BYTE nMode;
  528. BYTE nReserved;
  529. DWORD nPosition;
  530. } SLIDERDATA;
  531. typedef struct tagEXTPROPERTY { /* 1.4 */
  532. BYTE version; // Structure version, 0 for now
  533. BYTE tabletIndex; // 0-based index for tablet
  534. BYTE controlIndex; // 0-based index for control
  535. BYTE functionIndex; // 0-based index for control's sub-function
  536. WORD propertyID; // property ID
  537. WORD reserved; // DWORD-alignment filler
  538. DWORD dataSize; // number of bytes in data[] buffer
  539. BYTE data[1]; // raw data
  540. } EXTPROPERTY;
  541. #define TABLET_PROPERTY_CONTROLCOUNT 0 // UINT32: number of physical controls on tablet
  542. #define TABLET_PROPERTY_FUNCCOUNT 1 // UINT32: number of functions of control
  543. #define TABLET_PROPERTY_AVAILABLE 2 // BOOL: control/mode is available for override
  544. #define TABLET_PROPERTY_MIN 3 // UINT32: minimum value
  545. #define TABLET_PROPERTY_MAX 4 // UINT32: maximum value
  546. #define TABLET_PROPERTY_OVERRIDE 5 // BOOL: control is overridden
  547. #define TABLET_PROPERTY_OVERRIDE_NAME 6 // UTF-8: Displayable name when control is overridden
  548. #define TABLET_PROPERTY_LOCATION 11 // UINT32: Physical location of control (see TABLET_LOC_*)
  549. #define TABLET_LOC_LEFT 0
  550. #define TABLET_LOC_RIGHT 1
  551. #define TABLET_LOC_TOP 2
  552. #define TABLET_LOC_BOTTOM 3
  553. #define TABLET_LOC_TRANSDUCER 4
  554. #endif
  555. /* -------------------------------------------------------------------------- */
  556. /* -------------------------------------------------------------------------- */
  557. /* Functions */
  558. #ifndef API
  559. #ifndef WINAPI
  560. #define API FAR PASCAL
  561. #else
  562. #define API WINAPI
  563. #endif
  564. #endif
  565. #ifndef NOWTCALLBACKS
  566. #ifndef CALLBACK
  567. #define CALLBACK FAR PASCAL
  568. #endif
  569. #ifndef NOWTMANAGERFXNS
  570. /* callback function types */
  571. typedef BOOL(WINAPI* WTENUMPROC)(HCTX, LPARAM); /* changed CALLBACK->WINAPI, 1.1 */
  572. typedef BOOL(WINAPI* WTCONFIGPROC)(HCTX, HWND);
  573. typedef LRESULT(WINAPI* WTHOOKPROC)(int, WPARAM, LPARAM);
  574. typedef WTHOOKPROC FAR* LPWTHOOKPROC;
  575. #endif
  576. #endif
  577. #ifndef NOWTFUNCTIONS
  578. #ifndef NOWTBASICFXNS
  579. /* BASIC FUNCTIONS */
  580. #ifdef WIN32
  581. UINT API WTInfoA(UINT, UINT, LPVOID);
  582. #define ORD_WTInfoA 20
  583. UINT API WTInfoW(UINT, UINT, LPVOID);
  584. #define ORD_WTInfoW 1020
  585. #ifdef UNICODE
  586. #define WTInfo WTInfoW
  587. #define ORD_WTInfo ORD_WTInfoW
  588. #else
  589. #define WTInfo WTInfoA
  590. #define ORD_WTInfo ORD_WTInfoA
  591. #endif /* !UNICODE */
  592. #else
  593. UINT API WTInfo(UINT, UINT, LPVOID);
  594. #define ORD_WTInfo 20
  595. #endif
  596. #ifdef WIN32
  597. HCTX API WTOpenA(HWND, LPLOGCONTEXTA, BOOL);
  598. #define ORD_WTOpenA 21
  599. HCTX API WTOpenW(HWND, LPLOGCONTEXTW, BOOL);
  600. #define ORD_WTOpenW 1021
  601. #ifdef UNICODE
  602. #define WTOpen WTOpenW
  603. #define ORD_WTOpen ORD_WTOpenW
  604. #else
  605. #define WTOpen WTOpenA
  606. #define ORD_WTOpen ORD_WTOpenA
  607. #endif /* !UNICODE */
  608. #else
  609. HCTX API WTOpen(HWND, LPLOGCONTEXT, BOOL);
  610. #define ORD_WTOpen 21
  611. #endif
  612. BOOL API WTClose(HCTX);
  613. #define ORD_WTClose 22
  614. int API WTPacketsGet(HCTX, int, LPVOID);
  615. #define ORD_WTPacketsGet 23
  616. BOOL API WTPacket(HCTX, UINT, LPVOID);
  617. #define ORD_WTPacket 24
  618. #endif
  619. #ifndef NOWTVISIBILITYFXNS
  620. /* VISIBILITY FUNCTIONS */
  621. BOOL API WTEnable(HCTX, BOOL);
  622. #define ORD_WTEnable 40
  623. BOOL API WTOverlap(HCTX, BOOL);
  624. #define ORD_WTOverlap 41
  625. #endif
  626. #ifndef NOWTCTXEDITFXNS
  627. /* CONTEXT EDITING FUNCTIONS */
  628. BOOL API WTConfig(HCTX, HWND);
  629. #define ORD_WTConfig 60
  630. #ifdef WIN32
  631. BOOL API WTGetA(HCTX, LPLOGCONTEXTA);
  632. #define ORD_WTGetA 61
  633. BOOL API WTGetW(HCTX, LPLOGCONTEXTW);
  634. #define ORD_WTGetW 1061
  635. #ifdef UNICODE
  636. #define WTGet WTGetW
  637. #define ORD_WTGet ORD_WTGetW
  638. #else
  639. #define WTGet WTGetA
  640. #define ORD_WTGet ORD_WTGetA
  641. #endif /* !UNICODE */
  642. #else
  643. BOOL API WTGet(HCTX, LPLOGCONTEXT);
  644. #define ORD_WTGet 61
  645. #endif
  646. #ifdef WIN32
  647. BOOL API WTSetA(HCTX, LPLOGCONTEXTA);
  648. #define ORD_WTSetA 62
  649. BOOL API WTSetW(HCTX, LPLOGCONTEXTW);
  650. #define ORD_WTSetW 1062
  651. #ifdef UNICODE
  652. #define WTSet WTSetW
  653. #define ORD_WTSet ORD_WTSetW
  654. #else
  655. #define WTSet WTSetA
  656. #define ORD_WTSet ORD_WTSetA
  657. #endif /* !UNICODE */
  658. #else
  659. BOOL API WTSet(HCTX, LPLOGCONTEXT);
  660. #define ORD_WTSet 62
  661. #endif
  662. BOOL API WTExtGet(HCTX, UINT, LPVOID);
  663. #define ORD_WTExtGet 63
  664. BOOL API WTExtSet(HCTX, UINT, LPVOID);
  665. #define ORD_WTExtSet 64
  666. BOOL API WTSave(HCTX, LPVOID);
  667. #define ORD_WTSave 65
  668. HCTX API WTRestore(HWND, LPVOID, BOOL);
  669. #define ORD_WTRestore 66
  670. #endif
  671. #ifndef NOWTQUEUEFXNS
  672. /* ADVANCED PACKET AND QUEUE FUNCTIONS */
  673. int API WTPacketsPeek(HCTX, int, LPVOID);
  674. #define ORD_WTPacketsPeek 80
  675. int API WTDataGet(HCTX, UINT, UINT, int, LPVOID, LPINT);
  676. #define ORD_WTDataGet 81
  677. int API WTDataPeek(HCTX, UINT, UINT, int, LPVOID, LPINT);
  678. #define ORD_WTDataPeek 82
  679. #ifndef WIN32
  680. /* OBSOLETE IN WIN32! */
  681. DWORD API WTQueuePackets(HCTX);
  682. #define ORD_WTQueuePackets 83
  683. #endif
  684. int API WTQueueSizeGet(HCTX);
  685. #define ORD_WTQueueSizeGet 84
  686. BOOL API WTQueueSizeSet(HCTX, int);
  687. #define ORD_WTQueueSizeSet 85
  688. #endif
  689. #ifndef NOWTHMGRFXNS
  690. /* MANAGER HANDLE FUNCTIONS */
  691. HMGR API WTMgrOpen(HWND, UINT);
  692. #define ORD_WTMgrOpen 100
  693. BOOL API WTMgrClose(HMGR);
  694. #define ORD_WTMgrClose 101
  695. #endif
  696. #ifndef NOWTMGRCTXFXNS
  697. /* MANAGER CONTEXT FUNCTIONS */
  698. BOOL API WTMgrContextEnum(HMGR, WTENUMPROC, LPARAM);
  699. #define ORD_WTMgrContextEnum 120
  700. HWND API WTMgrContextOwner(HMGR, HCTX);
  701. #define ORD_WTMgrContextOwner 121
  702. HCTX API WTMgrDefContext(HMGR, BOOL);
  703. #define ORD_WTMgrDefContext 122
  704. HCTX API WTMgrDefContextEx(HMGR, UINT, BOOL); /* 1.1 */
  705. #define ORD_WTMgrDefContextEx 206
  706. #endif
  707. #ifndef NOWTMGRCONFIGFXNS
  708. /* MANAGER CONFIG BOX FUNCTIONS */
  709. UINT API WTMgrDeviceConfig(HMGR, UINT, HWND);
  710. #define ORD_WTMgrDeviceConfig 140
  711. #ifndef WIN32
  712. /* OBSOLETE IN WIN32! */
  713. BOOL API WTMgrConfigReplace(HMGR, BOOL, WTCONFIGPROC);
  714. #define ORD_WTMgrConfigReplace 141
  715. #endif
  716. #endif
  717. #ifndef NOWTMGRHOOKFXNS
  718. /* MANAGER PACKET HOOK FUNCTIONS */
  719. #ifndef WIN32
  720. /* OBSOLETE IN WIN32! */
  721. WTHOOKPROC API WTMgrPacketHook(HMGR, BOOL, int, WTHOOKPROC);
  722. #define ORD_WTMgrPacketHook 160
  723. LRESULT API WTMgrPacketHookDefProc(int, WPARAM, LPARAM, LPWTHOOKPROC);
  724. #define ORD_WTMgrPacketHookDefProc 161
  725. #endif
  726. #endif
  727. #ifndef NOWTMGRPREFFXNS
  728. /* MANAGER PREFERENCE DATA FUNCTIONS */
  729. BOOL API WTMgrExt(HMGR, UINT, LPVOID);
  730. #define ORD_WTMgrExt 180
  731. BOOL API WTMgrCsrEnable(HMGR, UINT, BOOL);
  732. #define ORD_WTMgrCsrEnable 181
  733. BOOL API WTMgrCsrButtonMap(HMGR, UINT, LPBYTE, LPBYTE);
  734. #define ORD_WTMgrCsrButtonMap 182
  735. BOOL API WTMgrCsrPressureBtnMarks(HMGR, UINT, DWORD, DWORD);
  736. #define ORD_WTMgrCsrPressureBtnMarks 183
  737. BOOL API WTMgrCsrPressureResponse(HMGR, UINT, UINT FAR*, UINT FAR*);
  738. #define ORD_WTMgrCsrPressureResponse 184
  739. BOOL API WTMgrCsrExt(HMGR, UINT, UINT, LPVOID);
  740. #define ORD_WTMgrCsrExt 185
  741. #endif
  742. /* Win32 replacements for non-portable functions. */
  743. #ifndef NOWTQUEUEFXNS
  744. /* ADVANCED PACKET AND QUEUE FUNCTIONS */
  745. BOOL API WTQueuePacketsEx(HCTX, UINT FAR*, UINT FAR*);
  746. #define ORD_WTQueuePacketsEx 200
  747. #endif
  748. #ifndef NOWTMGRCONFIGFXNS
  749. /* MANAGER CONFIG BOX FUNCTIONS */
  750. #ifdef WIN32
  751. BOOL API WTMgrConfigReplaceExA(HMGR, BOOL, LPSTR, LPSTR);
  752. #define ORD_WTMgrConfigReplaceExA 202
  753. BOOL API WTMgrConfigReplaceExW(HMGR, BOOL, LPWSTR, LPSTR);
  754. #define ORD_WTMgrConfigReplaceExW 1202
  755. #ifdef UNICODE
  756. #define WTMgrConfigReplaceEx WTMgrConfigReplaceExW
  757. #define ORD_WTMgrConfigReplaceEx ORD_WTMgrConfigReplaceExW
  758. #else
  759. #define WTMgrConfigReplaceEx WTMgrConfigReplaceExA
  760. #define ORD_WTMgrConfigReplaceEx ORD_WTMgrConfigReplaceExA
  761. #endif /* !UNICODE */
  762. #else
  763. BOOL API WTMgrConfigReplaceEx(HMGR, BOOL, LPSTR, LPSTR);
  764. #define ORD_WTMgrConfigReplaceEx 202
  765. #endif
  766. #endif
  767. #ifndef NOWTMGRHOOKFXNS
  768. /* MANAGER PACKET HOOK FUNCTIONS */
  769. #ifdef WIN32
  770. HWTHOOK API WTMgrPacketHookExA(HMGR, int, LPSTR, LPSTR);
  771. #define ORD_WTMgrPacketHookExA 203
  772. HWTHOOK API WTMgrPacketHookExW(HMGR, int, LPWSTR, LPSTR);
  773. #define ORD_WTMgrPacketHookExW 1203
  774. #ifdef UNICODE
  775. #define WTMgrPacketHookEx WTMgrPacketHookExW
  776. #define ORD_WTMgrPacketHookEx ORD_WTMgrPacketHookExW
  777. #else
  778. #define WTMgrPacketHookEx WTMgrPacketHookExA
  779. #define ORD_WTMgrPacketHookEx ORD_WTMgrPacketHookExA
  780. #endif /* !UNICODE */
  781. #else
  782. HWTHOOK API WTMgrPacketHookEx(HMGR, int, LPSTR, LPSTR);
  783. #define ORD_WTMgrPacketHookEx 203
  784. #endif
  785. BOOL API WTMgrPacketUnhook(HWTHOOK);
  786. #define ORD_WTMgrPacketUnhook 204
  787. LRESULT API WTMgrPacketHookNext(HWTHOOK, int, WPARAM, LPARAM);
  788. #define ORD_WTMgrPacketHookNext 205
  789. #endif
  790. #ifndef NOWTMGRPREFFXNS
  791. /* MANAGER PREFERENCE DATA FUNCTIONS */
  792. BOOL API WTMgrCsrPressureBtnMarksEx(HMGR, UINT, UINT FAR*, UINT FAR*);
  793. #define ORD_WTMgrCsrPressureBtnMarksEx 201
  794. #endif
  795. #endif
  796. #ifdef __cplusplus
  797. }
  798. #endif /* __cplusplus */
  799. #endif /* #define _INC_WINTAB */