pktdef.h revision b955672b950093ff7416d1269dd4d3b69983bd8f
* This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice * other than GPL or LGPL is available it will apply instead, Sun elects to use only * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where * a choice of LGPL license versions is made available with the language indicating * that LGPLv2 or any later version may be used, or where a choice of which version * of the LGPL is applied is otherwise unspecified. /*********************************************************************** * 2. if using just one packet format: * a. Define PACKETDATA and PACKETMODE as or'ed combinations of WTPKT bits * (use the PK_* identifiers). * c. The generated structure typedef will be called PACKET. Use PACKETDATA * and PACKETMODE to fill in the LOGCONTEXT structure. * 3. If using multiple packet formats, for each one: * a. Define PACKETNAME. Its text value will be a prefix for this packet's * b. Define <PACKETNAME>PACKETDATA and <PACKETNAME>PACKETMODE similar to * d. The generated structure typedef will be called * <PACKETNAME>PACKET. Compare with 2.c. above and example #2 below. * 4. If using extension packet data, do the following additional steps * a. Before including pktdef.h, define <PACKETNAME>PACKET<EXTENSION> * as either PKEXT_ABSOLUTE or PKEXT_RELATIVE. * b. The generated structure typedef will contain a field for the * c. Scan the WTI_EXTENSION categories to find the extension's * d. OR the packet mask bit with <PACKETNAME>PACKETDATA and use the * result in the lcPktData field of the LOGCONTEXT structure. * e. If <PACKETNAME>PACKET<EXTENSION> was PKEXT_RELATIVE, OR the * packet mask bit with <PACKETNAME>PACKETMODE and use the result * in the lcPktMode field of the LOGCONTEXT structure. * Example #1. -- single packet format * #define PACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/ * #define PACKETMODE PK_BUTTONS /@ buttons relative mode @/ * lc.lcPktData = PACKETDATA; * lc.lcPktMode = PACKETMODE; * Example #2. -- multiple formats * #define MOEPACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/ * #define MOEPACKETMODE PK_BUTTONS /@ buttons relative mode @/ * #define PACKETNAME LARRY * #define LARRYPACKETDATA PK_Y | PK_Z | PK_BUTTONS /@ y, z, buttons @/ * #define LARRYPACKETMODE PK_BUTTONS /@ buttons relative mode @/ * #define PACKETNAME CURLY * #define CURLYPACKETDATA PK_X | PK_Z | PK_BUTTONS /@ x, z, buttons @/ * #define CURLYPACKETMODE PK_BUTTONS /@ buttons relative mode @/ * lcMOE.lcPktData = MOEPACKETDATA; * lcMOE.lcPktMode = MOEPACKETMODE; * lcLARRY.lcPktData = LARRYPACKETDATA; * lcLARRY.lcPktMode = LARRYPACKETMODE; * lcCURLY.lcPktData = CURLYPACKETDATA; * lcCURLY.lcPktMode = CURLYPACKETMODE; * Example #3. -- extension packet data "XFOO". * #define PACKETDATA PK_X | PK_Y | PK_BUTTONS /@ x, y, buttons @/ * #define PACKETMODE PK_BUTTONS /@ buttons relative mode @/ * #define PACKETXFOO PKEXT_ABSOLUTE /@ XFOO absolute mode @/ * UINT ScanExts(UINT wTag) * /@ scan for wTag's info category. @/ * for (i = 0; WTInfo(WTI_EXTENSIONS + i, EXT_TAG, &wScanTag); i++) { * if (wTag == wScanTag) { * /@ return category offset from WTI_EXTENSIONS. @/ * /@ return error code. @/ * lc.lcPktData = PACKETDATA; * lc.lcPktMode = PACKETMODE; * categoryXFOO = ScanExts(WTX_XFOO); * WTInfo(WTI_EXTENSIONS + categoryXFOO, EXT_MASK, &maskXFOO); * lc.lcPktData |= maskXFOO; * #if PACKETXFOO == PKEXT_RELATIVE * lc.lcPktMode |= maskXFOO; * WTOpen(hWnd, &lc, TRUE); #
endif /* defined(__cplusplus) *//* if no packet name prefix */ #
define __IFX(x,y) x ## y
/* add prefixes and infixes to packet format names */ #
define __IFX3(x,i,y) x ## i ## y
/* extensions begin here. */ #
endif /* defined(__cplusplus) */#
endif /* defined(__WINE_PKTDEF_H */