po: Update French translation.
[wine/multimedia.git] / include / wintabx.h
blobd5531cb17eedc38069118b62061d1f0d0451f2fb
1 /*
2 * Copyright (C) 1991-1998 by LCS/Telegraphics
3 * Copyright (C) 2002 Patrik Stridvall
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #ifndef __WINE_WINTABX_H
21 #define __WINE_WINTABX_H
23 #ifdef __cplusplus
24 extern "C" {
25 #endif /* defined(__cplusplus) */
27 /***********************************************************************
28 * Wintab message crackers
31 #ifndef HANDLE_MSG
32 # define HANDLE_MSG(hwnd, message, fn) \
33 case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
34 #endif
36 /* void Cls_OnWintabPacket(HWND hwnd, HCTX hCtx, UINT sn) */
37 #define HANDLE_WT_PACKET(hwnd, wParam, lParam, fn) \
38 ((fn)((hwnd), (HCTX)(lParam), (UINT)(wParam)), 0L)
39 #define FORWARD__WT_PACKET(hwnd, bs, hCtx, sn, fn) \
40 (void)(fn)((hwnd), _WT_PACKET(bs), (WPARAM)(UINT)(sn), (LPARAM)(HCTX)(hCtx))
41 #define FORWARD_WT_PACKET(hwnd, hCtx, sn, fn) \
42 FORWARD__WT_PACKET(hwnd, WT_DEFBASE, hCtx, sn, fn)
44 /* void Cls_OnWintabCtxOpen(HWND hwnd, HCTX hCtx, UINT sf) */
45 #define HANDLE_WT_CTXOPEN(hwnd, wParam, lParam, fn) \
46 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
47 #define FORWARD__WT_CTXOPEN(hwnd, bs, hCtx, sf, fn) \
48 (void)(fn)((hwnd), _WT_CTXOPEN(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
49 #define FORWARD_WT_CTXOPEN(hwnd, hCtx, sf, fn) \
50 FORWARD__WT_CTXOPEN(hwnd, WT_DEFBASE, hCtx, sf, fn)
52 /* void Cls_OnWintabCtxClose(HWND hwnd, HCTX hCtx, UINT sf) */
53 #define HANDLE_WT_CTXCLOSE(hwnd, wParam, lParam, fn) \
54 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
55 #define FORWARD__WT_CTXCLOSE(hwnd, bs, hCtx, sf, fn) \
56 (void)(fn)((hwnd), _WT_CTXCLOSE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
57 #define FORWARD_WT_CTXCLOSE(hwnd, hCtx, sf, fn) \
58 FORWARD__WT_CTXCLOSE(hwnd, WT_DEFBASE, hCtx, sf, fn)
60 /* void Cls_OnWintabCtxUpdate(HWND hwnd, HCTX hCtx, UINT sf) */
61 #define HANDLE_WT_CTXUPDATE(hwnd, wParam, lParam, fn) \
62 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
63 #define FORWARD__WT_CTXUPDATE(hwnd, bs, hCtx, sf, fn) \
64 (void)(fn)((hwnd), _WT_CTXUPDATE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
65 #define FORWARD_WT_CTXUPDATE(hwnd, hCtx, sf, fn) \
66 FORWARD__WT_CTXUPDATE(hwnd, WT_DEFBASE, hCtx, sf, fn)
68 /* void Cls_OnWintabCtxOverlap(HWND hwnd, HCTX hCtx, UINT sf) */
69 #define HANDLE_WT_CTXOVERLAP(hwnd, wParam, lParam, fn) \
70 ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
71 #define FORWARD__WT_CTXOVERLAP(hwnd, bs, hCtx, sf, fn) \
72 (void)(fn)((hwnd), _WT_CTXOVERLAP(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
73 #define FORWARD_WT_CTXOVERLAP(hwnd, hCtx, sf, fn) \
74 FORWARD__WT_CTXOVERLAP(hwnd, WT_DEFBASE, hCtx, sf, fn)
76 /* void Cls_OnWintabProximity(HWND hwnd, HCTX hCtx, BOOL cp, BOOL hp) */
77 #define HANDLE_WT_PROXIMITY(hwnd, wParam, lParam, fn) \
78 ((fn)((hwnd), (HCTX)(wParam), (BOOL)LOWORD(lParam), (BOOL)HIWORD(lParam)), 0L)
79 #define FORWARD__WT_PROXIMITY(hwnd, bs, hCtx, cp, hp, fn) \
80 (void)(fn)((hwnd), _WT_PROXIMITY(bs), (WPARAM)(HCTX)(hCtx), MAKELPARAM((cp), (hp))
81 #define FORWARD_WT_PROXIMITY(hwnd, hCtx, sf, fn) \
82 FORWARD__WT_PROXIMITY(hwnd, WT_DEFBASE, hCtx, cp, hp, fn)
84 /* void Cls_OnWintabInfoChange(HWND hwnd, HMGR hMgr, UINT c, UINT i) */
85 #define HANDLE_WT_INFOCHANGE(hwnd, wParam, lParam, fn) \
86 ((fn)((hwnd), (HMGR)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
87 #define FORWARD__WT_INFOCHANGE(hwnd, bs, hMgr, cp, hp, fn) \
88 (void)(fn)((hwnd), _WT_INFOCHANGE(bs), (WPARAM)(HMGR)(hMgr), MAKELPARAM((c), (i))
89 #define FORWARD_WT_INFOCHANGE(hwnd, hMgr, sf, fn) \
90 FORWARD__WT_INFOCHANGE(hwnd, WT_DEFBASE, hMgr, cp, hp, fn)
92 /***********************************************************************
93 * Alternate porting layer macros
96 #define GET_WT_PACKET_HCTX(wp, lp) ((HCTX)lp)
97 #define GET_WT_PACKET_SERIAL(wp, lp) (wp)
98 #define GET_WT_PACKET_MPS(h, s) (s), (LPARAM)(h)
100 #define GET_WT_CTXOPEN_HCTX(wp, lp) ((HCTX)wp)
101 #define GET_WT_CTXOPEN_STATUS(wp, lp) ((UINT)lp)
102 #define GET_WT_CTXOPEN_MPS(h, s) (WPARAM)(h), (LPARAM)(s)
104 #define GET_WT_CTXCLOSE_HCTX(wp, lp) ((HCTX)wp)
105 #define GET_WT_CTXCLOSE_STATUS(wp, lp) ((UINT)lp)
106 #define GET_WT_CTXCLOSE_MPS(h, s) (WPARAM)(h), (LPARAM)(s)
108 #define GET_WT_CTXUPDATE_HCTX(wp, lp) ((HCTX)wp)
109 #define GET_WT_CTXUPDATE_STATUS(wp, lp) ((UINT)lp)
110 #define GET_WT_CTXUPDATE_MPS(h, s) (WPARAM)(h), (LPARAM)(s)
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) (WPARAM)(h), (LPARAM)(s)
116 #define GET_WT_PROXIMITY_HCTX(wp, lp) ((HCTX)wp)
117 #define GET_WT_PROXIMITY_CTXPROX(wp, lp) LOWORD(lp)
118 #define GET_WT_PROXIMITY_HARDPROX(wp, lp) HIWORD(lp)
119 #define GET_WT_PROXIMITY_MPS(h, fc, fh) (WPARAM)(h), MAKELONG(fc, fh)
121 #define GET_WT_INFOCHANGE_HMGR(wp, lp) ((HMGR)wp)
122 #define GET_WT_INFOCHANGE_CATEGORY(wp, lp) LOWORD(lp)
123 #define GET_WT_INFOCHANGE_INDEX(wp, lp) HIWORD(lp)
124 #define GET_WT_INFOCHANGE_MPS(h, c, i) (WPARAM)(h), MAKELONG(c, i)
126 #ifdef __cplusplus
127 } /* extern "C" */
128 #endif /* defined(__cplusplus) */
130 #endif /* defined(__WINE_WINTABX_H */