Appendix B Creating Wrapped Classes
1) #pragma once goes in the generated .h file as follows:
#ifdef macintosh
#pragma once
#endif // macintosh
2) The three random code blocks (notice, source, and header) go in the code in the following template:
#ifdef macintosh
macSection
#else // macintosh
normalSection
#endif // macintosh
The wrap script writes normalSection in the .wrp file, and treats macSection the same, with the include statements corrected for the Macintosh. This correction involves dropping all directory specifications in the lines of the include statement, except for those of the Rogue Wave(TM) class library. For example:
#include <utils/UTtypes.h> becomes #include <UTtypes.h>
#include <UTtypes.h> remains #include <UTtypes.h>
#include <rw/cstring.h> remains #include <rw/cstring.h>
3) The wrap script adds #pragma segment commands to the generated .cc file. The default segment for all methods in the file is the same as the name of the wrapped class. The wrapper adds the following to the top of each generated .cc file (with the correct name substituted for XFbuttonRO).
#ifdef macintosh
#pragma segment XFbuttonRO
#endif // macintosh
To handle future optimization on the Macintosh, you can specify a segment for each method by preceding the signature with the desired name enclosed in square brackets. For example:
[yourSegmentNameHere] UThandle requestContainer(UThandle hParent)
Note that the segment names set this way have effect only for that particular method.
$(TOOLS_DIR)/wrap $(WRAPFLAGS) XFbuttonRO.wrp $(WRAP_H_DIR) $(WRAP_CC_DIR)causes the wrapper to generate:
$(WRAP_H_DIR)/XFbuttonRO.h $(WRAP_CC_DIR)/XFbuttonRO.ccThe wrapper exits with zero status if it completes successfully, and with a non-zero status if there is a problem. The remaining sections cover the legal flags for the wrap script: +depend, -l, -mac, and +Wdirectory.
./XFbuttonRO.cc: ../../generic/src/ActivityManagerRO.wrp ./XFbuttonRO.cc: ../../generic/src/AttributeManagerRO.wrp ./XFbuttonRO.cc: ./XFwidgetRO.wrp ./XFbuttonRO.cc: ./XFcontainableRO.wrp ./XFbuttonRO.cc: ./XFsimpleRO.wrp ./XFbuttonRO.cc: ./XFfontableRO.wrp ./XFbuttonRO.cc: ./XFlabelRO.wrp ./XFbuttonRO.cc: XFbuttonRO.wrp
Generated with Harlequin WebMaker