123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- #pragma once
- #ifdef __cplusplus
- extern "C" {
- #endif /* __cplusplus */
- #ifndef PACKETNAME
-
- #define __PFX(x) x
- #define __IFX(x,y) x ## y
- #else
-
- #define __PFX(x) __PFX2(PACKETNAME,x)
- #define __PFX2(p,x) __PFX3(p,x)
- #define __PFX3(p,x) p ## x
- #define __IFX(x,y) __IFX2(x,PACKETNAME,y)
- #define __IFX2(x,i,y) __IFX3(x,i,y)
- #define __IFX3(x,i,y) x ## i ## y
- #endif
- #define __SFX2(x,s) __SFX3(x,s)
- #define __SFX3(x,s) x ## s
- #define __TAG __IFX(tag,PACKET)
- #define __TYPES __PFX(PACKET), * __IFX(P,PACKET), NEAR * __IFX(NP,PACKET), FAR * __IFX(LP,PACKET)
- #define __TAGE __IFX(tag,PACKETEXT)
- #define __TYPESE __PFX(PACKETEXT), * __IFX(P,PACKETEXT), NEAR * __IFX(NP,PACKETEXT), FAR * __IFX(LP,PACKETEXT)
- #define __DATA (__PFX(PACKETDATA))
- #define __MODE (__PFX(PACKETMODE))
- #define __EXT(x) __SFX2(__PFX(PACKET),x)
- typedef struct __TAG {
- #if (__DATA & PK_CONTEXT)
- HCTX pkContext;
- #endif
- #if (__DATA & PK_STATUS)
- UINT pkStatus;
- #endif
- #if (__DATA & PK_TIME)
- DWORD pkTime;
- #endif
- #if (__DATA & PK_CHANGED)
- WTPKT pkChanged;
- #endif
- #if (__DATA & PK_SERIAL_NUMBER)
- UINT pkSerialNumber;
- #endif
- #if (__DATA & PK_CURSOR)
- UINT pkCursor;
- #endif
- #if (__DATA & PK_BUTTONS)
- DWORD pkButtons;
- #endif
- #if (__DATA & PK_X)
- LONG pkX;
- #endif
- #if (__DATA & PK_Y)
- LONG pkY;
- #endif
- #if (__DATA & PK_Z)
- LONG pkZ;
- #endif
- #if (__DATA & PK_NORMAL_PRESSURE)
- #if (__MODE & PK_NORMAL_PRESSURE)
-
- int pkNormalPressure;
- #else
-
- UINT pkNormalPressure;
- #endif
- #endif
- #if (__DATA & PK_TANGENT_PRESSURE)
- #if (__MODE & PK_TANGENT_PRESSURE)
-
- int pkTangentPressure;
- #else
-
- UINT pkTangentPressure;
- #endif
- #endif
- #if (__DATA & PK_ORIENTATION)
- ORIENTATION pkOrientation;
- #endif
- #if (__DATA & PK_ROTATION)
- ROTATION pkRotation;
- #endif
- #ifndef NOWTEXTENSIONS
-
- #if (__EXT(FKEYS) == PKEXT_RELATIVE) || (__EXT(FKEYS) == PKEXT_ABSOLUTE)
- UINT pkFKeys;
- #endif
- #if (__EXT(TILT) == PKEXT_RELATIVE) || (__EXT(TILT) == PKEXT_ABSOLUTE)
- TILT pkTilt;
- #endif
- #endif
- } __TYPES;
- #ifndef NOWTEXTENSIONS
- typedef struct __TAGE {
- EXTENSIONBASE pkBase;
- #if (__EXT(EXPKEYS) == PKEXT_RELATIVE) || (__EXT(EXPKEYS) == PKEXT_ABSOLUTE)
- EXPKEYSDATA pkExpKeys;
- #endif
- #if (__EXT(TOUCHSTRIP) == PKEXT_RELATIVE) || (__EXT(TOUCHSTRIP) == PKEXT_ABSOLUTE)
- SLIDERDATA pkTouchStrip;
- #endif
- #if (__EXT(TOUCHRING) == PKEXT_RELATIVE) || (__EXT(TOUCHRING) == PKEXT_ABSOLUTE)
- SLIDERDATA pkTouchRing;
- #endif
- } __TYPESE;
- #endif
- #undef PACKETNAME
- #undef __TAG
- #undef __TAGE
- #undef __TAG2
- #undef __TYPES
- #undef __TYPESE
- #undef __TYPES2
- #undef __DATA
- #undef __MODE
- #undef __PFX
- #undef __PFX2
- #undef __PFX3
- #undef __IFX
- #undef __IFX2
- #undef __IFX3
- #undef __SFX2
- #undef __SFX3
- #ifdef __cplusplus
- }
- #endif /* __cplusplus */
|