Mercurial > sdl-ios-xcode
comparison src/video/win32/wactab/wintabx.h @ 2724:0e2b65f32298
Added Wacom API headers.
FIXME: Dynamically load the Wacom API functions from wintab32.dll
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 26 Aug 2008 05:26:28 +0000 |
parents | |
children | f23ebf1ddac4 |
comparison
equal
deleted
inserted
replaced
2723:911db724ea24 | 2724:0e2b65f32298 |
---|---|
1 /* ------------------------------- wintabx.h -------------------------------- */ | |
2 /* Combined 16 & 32-bit version. */ | |
3 | |
4 | |
5 /*------------------------------------------------------------------------------ | |
6 The text and information contained in this file may be freely used, | |
7 copied, or distributed without compensation or licensing restrictions. | |
8 | |
9 This file is copyright 1991-1998 by LCS/Telegraphics. | |
10 ------------------------------------------------------------------------------*/ | |
11 | |
12 #ifndef _INC_WINTABX /* prevent multiple includes */ | |
13 #define _INC_WINTABX | |
14 | |
15 #ifdef __cplusplus | |
16 extern "C" { | |
17 #endif /* __cplusplus */ | |
18 | |
19 /* prototype for wintabx.lib. */ | |
20 #define _UnlinkWinTab _UnlinkWintab | |
21 #ifdef WIN32 | |
22 extern WINAPI _UnlinkWintab(void); | |
23 #else | |
24 extern FAR _UnlinkWintab(void); | |
25 #endif | |
26 | |
27 /****** Wintab message crackers ***********************************************/ | |
28 | |
29 #ifndef HANDLE_MSG | |
30 #define HANDLE_MSG(hwnd, message, fn) \ | |
31 case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn)) | |
32 #endif | |
33 | |
34 /* void Cls_OnWintabPacket(HWND hwnd, HCTX hCtx, UINT sn) */ | |
35 #define HANDLE_WT_PACKET(hwnd, wParam, lParam, fn) \ | |
36 ((fn)((hwnd), (HCTX)(lParam), (UINT)(wParam)), 0L) | |
37 #define FORWARD__WT_PACKET(hwnd, bs, hCtx, sn, fn) \ | |
38 (void)(fn)((hwnd), _WT_PACKET(bs), (WPARAM)(UINT)(sn), (LPARAM)(HCTX)(hCtx)) | |
39 #define FORWARD_WT_PACKET(hwnd, hCtx, sn, fn) \ | |
40 FORWARD__WT_PACKET(hwnd, WT_DEFBASE, hCtx, sn, fn) | |
41 | |
42 /* void Cls_OnWintabCtxOpen(HWND hwnd, HCTX hCtx, UINT sf) */ | |
43 #define HANDLE_WT_CTXOPEN(hwnd, wParam, lParam, fn) \ | |
44 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L) | |
45 #define FORWARD__WT_CTXOPEN(hwnd, bs, hCtx, sf, fn) \ | |
46 (void)(fn)((hwnd), _WT_CTXOPEN(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf)) | |
47 #define FORWARD_WT_CTXOPEN(hwnd, hCtx, sf, fn) \ | |
48 FORWARD__WT_CTXOPEN(hwnd, WT_DEFBASE, hCtx, sf, fn) | |
49 | |
50 /* void Cls_OnWintabCtxClose(HWND hwnd, HCTX hCtx, UINT sf) */ | |
51 #define HANDLE_WT_CTXCLOSE(hwnd, wParam, lParam, fn) \ | |
52 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L) | |
53 #define FORWARD__WT_CTXCLOSE(hwnd, bs, hCtx, sf, fn) \ | |
54 (void)(fn)((hwnd), _WT_CTXCLOSE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf)) | |
55 #define FORWARD_WT_CTXCLOSE(hwnd, hCtx, sf, fn) \ | |
56 FORWARD__WT_CTXCLOSE(hwnd, WT_DEFBASE, hCtx, sf, fn) | |
57 | |
58 /* void Cls_OnWintabCtxUpdate(HWND hwnd, HCTX hCtx, UINT sf) */ | |
59 #define HANDLE_WT_CTXUPDATE(hwnd, wParam, lParam, fn) \ | |
60 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L) | |
61 #define FORWARD__WT_CTXUPDATE(hwnd, bs, hCtx, sf, fn) \ | |
62 (void)(fn)((hwnd), _WT_CTXUPDATE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf)) | |
63 #define FORWARD_WT_CTXUPDATE(hwnd, hCtx, sf, fn) \ | |
64 FORWARD__WT_CTXUPDATE(hwnd, WT_DEFBASE, hCtx, sf, fn) | |
65 | |
66 /* void Cls_OnWintabCtxOverlap(HWND hwnd, HCTX hCtx, UINT sf) */ | |
67 #define HANDLE_WT_CTXOVERLAP(hwnd, wParam, lParam, fn) \ | |
68 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L) | |
69 #define FORWARD__WT_CTXOVERLAP(hwnd, bs, hCtx, sf, fn) \ | |
70 (void)(fn)((hwnd), _WT_CTXOVERLAP(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf)) | |
71 #define FORWARD_WT_CTXOVERLAP(hwnd, hCtx, sf, fn) \ | |
72 FORWARD__WT_CTXOVERLAP(hwnd, WT_DEFBASE, hCtx, sf, fn) | |
73 | |
74 /* void Cls_OnWintabProximity(HWND hwnd, HCTX hCtx, BOOL cp, BOOL hp) */ | |
75 #define HANDLE_WT_PROXIMITY(hwnd, wParam, lParam, fn) \ | |
76 ((fn)((hwnd), (HCTX)(wParam), (BOOL)LOWORD(lParam), (BOOL)HIWORD(lParam)), 0L) | |
77 #define FORWARD__WT_PROXIMITY(hwnd, bs, hCtx, cp, hp, fn) \ | |
78 (void)(fn)((hwnd), _WT_PROXIMITY(bs), (WPARAM)(HCTX)(hCtx), MAKELPARAM((cp), (hp)) | |
79 #define FORWARD_WT_PROXIMITY(hwnd, hCtx, sf, fn) \ | |
80 FORWARD__WT_PROXIMITY(hwnd, WT_DEFBASE, hCtx, cp, hp, fn) | |
81 | |
82 /* void Cls_OnWintabInfoChange(HWND hwnd, HMGR hMgr, UINT c, UINT i) */ | |
83 #define HANDLE_WT_INFOCHANGE(hwnd, wParam, lParam, fn) \ | |
84 ((fn)((hwnd), (HMGR)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L) | |
85 #define FORWARD__WT_INFOCHANGE(hwnd, bs, hMgr, cp, hp, fn) \ | |
86 (void)(fn)((hwnd), _WT_INFOCHANGE(bs), (WPARAM)(HMGR)(hMgr), MAKELPARAM((c), (i)) | |
87 #define FORWARD_WT_INFOCHANGE(hwnd, hMgr, sf, fn) \ | |
88 FORWARD__WT_INFOCHANGE(hwnd, WT_DEFBASE, hMgr, cp, hp, fn) | |
89 | |
90 /****** Alternate porting layer macros ****************************************/ | |
91 | |
92 #define GET_WT_PACKET_HCTX(wp, lp) ((HCTX)lp) | |
93 #define GET_WT_PACKET_SERIAL(wp, lp) (wp) | |
94 #define GET_WT_PACKET_MPS(h, s) \ | |
95 (s), (LPARAM)(h) | |
96 | |
97 #define GET_WT_CTXOPEN_HCTX(wp, lp) ((HCTX)wp) | |
98 #define GET_WT_CTXOPEN_STATUS(wp, lp) ((UINT)lp) | |
99 #define GET_WT_CTXOPEN_MPS(h, s) \ | |
100 (WPARAM)(h), (LPARAM)(s) | |
101 | |
102 #define GET_WT_CTXCLOSE_HCTX(wp, lp) ((HCTX)wp) | |
103 #define GET_WT_CTXCLOSE_STATUS(wp, lp) ((UINT)lp) | |
104 #define GET_WT_CTXCLOSE_MPS(h, s) \ | |
105 (WPARAM)(h), (LPARAM)(s) | |
106 | |
107 #define GET_WT_CTXUPDATE_HCTX(wp, lp) ((HCTX)wp) | |
108 #define GET_WT_CTXUPDATE_STATUS(wp, lp) ((UINT)lp) | |
109 #define GET_WT_CTXUPDATE_MPS(h, s) \ | |
110 (WPARAM)(h), (LPARAM)(s) | |
111 | |
112 #define GET_WT_CTXOVERLAP_HCTX(wp, lp) ((HCTX)wp) | |
113 #define GET_WT_CTXOVERLAP_STATUS(wp, lp) ((UINT)lp) | |
114 #define GET_WT_CTXOVERLAP_MPS(h, s) \ | |
115 (WPARAM)(h), (LPARAM)(s) | |
116 | |
117 #define GET_WT_PROXIMITY_HCTX(wp, lp) ((HCTX)wp) | |
118 #define GET_WT_PROXIMITY_CTXPROX(wp, lp) LOWORD(lp) | |
119 #define GET_WT_PROXIMITY_HARDPROX(wp, lp) HIWORD(lp) | |
120 #define GET_WT_PROXIMITY_MPS(h, fc, fh) \ | |
121 (WPARAM)(h), MAKELONG(fc, fh) | |
122 | |
123 #define GET_WT_INFOCHANGE_HMGR(wp, lp) ((HMGR)wp) | |
124 #define GET_WT_INFOCHANGE_CATEGORY(wp, lp) LOWORD(lp) | |
125 #define GET_WT_INFOCHANGE_INDEX(wp, lp) HIWORD(lp) | |
126 #define GET_WT_INFOCHANGE_MPS(h, c, i) \ | |
127 (WPARAM)(h), MAKELONG(c, i) | |
128 | |
129 | |
130 #ifdef __cplusplus | |
131 } | |
132 #endif /* __cplusplus */ | |
133 | |
134 #endif /* #define _INC_WINTABX */ | |
135 |