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