Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

135 lines
5.5 KiB

  1. /* ------------------------------- wintabx.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 1991-1998 by LCS/Telegraphics.
  7. ------------------------------------------------------------------------------*/
  8. #ifndef _INC_WINTABX /* prevent multiple includes */
  9. #define _INC_WINTABX
  10. #ifdef __cplusplus
  11. extern "C" {
  12. #endif /* __cplusplus */
  13. /* prototype for wintabx.lib. */
  14. #define _UnlinkWinTab _UnlinkWintab
  15. #ifdef WIN32
  16. extern WINAPI _UnlinkWintab(void);
  17. #else
  18. extern FAR _UnlinkWintab(void);
  19. #endif
  20. /****** Wintab message crackers ***********************************************/
  21. #ifndef HANDLE_MSG
  22. #define HANDLE_MSG(hwnd, message, fn) \
  23. case (message): return HANDLE_##message((hwnd), (wParam), (lParam), (fn))
  24. #endif
  25. /* void Cls_OnWintabPacket(HWND hwnd, HCTX hCtx, UINT sn) */
  26. #define HANDLE_WT_PACKET(hwnd, wParam, lParam, fn) \
  27. ((fn)((hwnd), (HCTX)(lParam), (UINT)(wParam)), 0L)
  28. #define FORWARD__WT_PACKET(hwnd, bs, hCtx, sn, fn) \
  29. (void)(fn)((hwnd), _WT_PACKET(bs), (WPARAM)(UINT)(sn), (LPARAM)(HCTX)(hCtx))
  30. #define FORWARD_WT_PACKET(hwnd, hCtx, sn, fn) \
  31. FORWARD__WT_PACKET(hwnd, WT_DEFBASE, hCtx, sn, fn)
  32. /* void Cls_OnWintabCtxOpen(HWND hwnd, HCTX hCtx, UINT sf) */
  33. #define HANDLE_WT_CTXOPEN(hwnd, wParam, lParam, fn) \
  34. ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
  35. #define FORWARD__WT_CTXOPEN(hwnd, bs, hCtx, sf, fn) \
  36. (void)(fn)((hwnd), _WT_CTXOPEN(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
  37. #define FORWARD_WT_CTXOPEN(hwnd, hCtx, sf, fn) \
  38. FORWARD__WT_CTXOPEN(hwnd, WT_DEFBASE, hCtx, sf, fn)
  39. /* void Cls_OnWintabCtxClose(HWND hwnd, HCTX hCtx, UINT sf) */
  40. #define HANDLE_WT_CTXCLOSE(hwnd, wParam, lParam, fn) \
  41. ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
  42. #define FORWARD__WT_CTXCLOSE(hwnd, bs, hCtx, sf, fn) \
  43. (void)(fn)((hwnd), _WT_CTXCLOSE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
  44. #define FORWARD_WT_CTXCLOSE(hwnd, hCtx, sf, fn) \
  45. FORWARD__WT_CTXCLOSE(hwnd, WT_DEFBASE, hCtx, sf, fn)
  46. /* void Cls_OnWintabCtxUpdate(HWND hwnd, HCTX hCtx, UINT sf) */
  47. #define HANDLE_WT_CTXUPDATE(hwnd, wParam, lParam, fn) \
  48. ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
  49. #define FORWARD__WT_CTXUPDATE(hwnd, bs, hCtx, sf, fn) \
  50. (void)(fn)((hwnd), _WT_CTXUPDATE(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
  51. #define FORWARD_WT_CTXUPDATE(hwnd, hCtx, sf, fn) \
  52. FORWARD__WT_CTXUPDATE(hwnd, WT_DEFBASE, hCtx, sf, fn)
  53. /* void Cls_OnWintabCtxOverlap(HWND hwnd, HCTX hCtx, UINT sf) */
  54. #define HANDLE_WT_CTXOVERLAP(hwnd, wParam, lParam, fn) \
  55. ((fn)((hwnd), (HCTX)(wParam), (UINT)(lParam)), 0L)
  56. #define FORWARD__WT_CTXOVERLAP(hwnd, bs, hCtx, sf, fn) \
  57. (void)(fn)((hwnd), _WT_CTXOVERLAP(bs), (WPARAM)(HCTX)(hCtx), (LPARAM)(UINT)(sf))
  58. #define FORWARD_WT_CTXOVERLAP(hwnd, hCtx, sf, fn) \
  59. FORWARD__WT_CTXOVERLAP(hwnd, WT_DEFBASE, hCtx, sf, fn)
  60. /* void Cls_OnWintabProximity(HWND hwnd, HCTX hCtx, BOOL cp, BOOL hp) */
  61. #define HANDLE_WT_PROXIMITY(hwnd, wParam, lParam, fn) \
  62. ((fn)((hwnd), (HCTX)(wParam), (BOOL)LOWORD(lParam), (BOOL)HIWORD(lParam)), 0L)
  63. #define FORWARD__WT_PROXIMITY(hwnd, bs, hCtx, cp, hp, fn) \
  64. (void)(fn)((hwnd), _WT_PROXIMITY(bs), (WPARAM)(HCTX)(hCtx), MAKELPARAM((cp), (hp))
  65. #define FORWARD_WT_PROXIMITY(hwnd, hCtx, sf, fn) \
  66. FORWARD__WT_PROXIMITY(hwnd, WT_DEFBASE, hCtx, cp, hp, fn)
  67. /* void Cls_OnWintabInfoChange(HWND hwnd, HMGR hMgr, UINT c, UINT i) */
  68. #define HANDLE_WT_INFOCHANGE(hwnd, wParam, lParam, fn) \
  69. ((fn)((hwnd), (HMGR)(wParam), (UINT)LOWORD(lParam), (UINT)HIWORD(lParam)), 0L)
  70. #define FORWARD__WT_INFOCHANGE(hwnd, bs, hMgr, cp, hp, fn) \
  71. (void)(fn)((hwnd), _WT_INFOCHANGE(bs), (WPARAM)(HMGR)(hMgr), MAKELPARAM((c), (i))
  72. #define FORWARD_WT_INFOCHANGE(hwnd, hMgr, sf, fn) \
  73. FORWARD__WT_INFOCHANGE(hwnd, WT_DEFBASE, hMgr, cp, hp, fn)
  74. /****** Alternate porting layer macros ****************************************/
  75. #define GET_WT_PACKET_HCTX(wp, lp) ((HCTX)lp)
  76. #define GET_WT_PACKET_SERIAL(wp, lp) (wp)
  77. #define GET_WT_PACKET_MPS(h, s) \
  78. (s), (LPARAM)(h)
  79. #define GET_WT_CTXOPEN_HCTX(wp, lp) ((HCTX)wp)
  80. #define GET_WT_CTXOPEN_STATUS(wp, lp) ((UINT)lp)
  81. #define GET_WT_CTXOPEN_MPS(h, s) \
  82. (WPARAM)(h), (LPARAM)(s)
  83. #define GET_WT_CTXCLOSE_HCTX(wp, lp) ((HCTX)wp)
  84. #define GET_WT_CTXCLOSE_STATUS(wp, lp) ((UINT)lp)
  85. #define GET_WT_CTXCLOSE_MPS(h, s) \
  86. (WPARAM)(h), (LPARAM)(s)
  87. #define GET_WT_CTXUPDATE_HCTX(wp, lp) ((HCTX)wp)
  88. #define GET_WT_CTXUPDATE_STATUS(wp, lp) ((UINT)lp)
  89. #define GET_WT_CTXUPDATE_MPS(h, s) \
  90. (WPARAM)(h), (LPARAM)(s)
  91. #define GET_WT_CTXOVERLAP_HCTX(wp, lp) ((HCTX)wp)
  92. #define GET_WT_CTXOVERLAP_STATUS(wp, lp) ((UINT)lp)
  93. #define GET_WT_CTXOVERLAP_MPS(h, s) \
  94. (WPARAM)(h), (LPARAM)(s)
  95. #define GET_WT_PROXIMITY_HCTX(wp, lp) ((HCTX)wp)
  96. #define GET_WT_PROXIMITY_CTXPROX(wp, lp) LOWORD(lp)
  97. #define GET_WT_PROXIMITY_HARDPROX(wp, lp) HIWORD(lp)
  98. #define GET_WT_PROXIMITY_MPS(h, fc, fh) \
  99. (WPARAM)(h), MAKELONG(fc, fh)
  100. #define GET_WT_INFOCHANGE_HMGR(wp, lp) ((HMGR)wp)
  101. #define GET_WT_INFOCHANGE_CATEGORY(wp, lp) LOWORD(lp)
  102. #define GET_WT_INFOCHANGE_INDEX(wp, lp) HIWORD(lp)
  103. #define GET_WT_INFOCHANGE_MPS(h, c, i) \
  104. (WPARAM)(h), MAKELONG(c, i)
  105. #ifdef __cplusplus
  106. }
  107. #endif /* __cplusplus */
  108. #endif /* #define _INC_WINTABX */