Some notes on creating Macintosh RTF translators using the RTF Tools distribution under THINK C (6.0.1). ------------------------------------------------------ MACINTOSH PROJECT DOCUMENT NOTES - Under Options/THINK C.../Prefix, use the following: #include #define VARARGS #define SYSV - Under Options/THINK C.../Language Settings, select THINK C extensions. - Set the application signature to match what the 'BNDL' resource says. (See below under project resource template notes.) - Set the following 'SIZE' flags: - Background Null Events - HighLevelEvent-Aware - Accept Remote HighLevelEvents - If your translator prints floating point numbers, the project should include the ANSI library instead of the ANSI-small library since the latter doesn't include floating-point support. MACINTOSH PROJECT RESOURCE TEMPLATE The Macintosh translator wrapper uses several resources. If you build a new translator, you can copy Proto.rsrc as a basis for your project's resource file. Its contents are listed below. Those resources which should be modified are so indicated. Some resources are optional. 'acur' 128 (Optional) Animated cursor resource. If present, this is used together with the 'CURS' resources referenced in it to animate the cursor during file translations. The translators in the distribution use a spinning beachball. 'ALRT' 1000 The "About" alert. 1001 General message alert. 1002 Alert for asking whether a quit should really be done if there are documents still pending in the queue. 'BNDL' 128 Modify your application's signature. The 'BNDL' resource in Proto.rsrc designates a signature of 'rPrt' (RTF prototype). You should change the signature. The signature should also be set to match in your project document. 'cicn' 128 Used in 'ALRT' 1000. Should look like your application's Finder icon in 'ICN#' 128 and 'icl8' 128. Create the Finder icons first, then copy the color and B/W versions to 'cicn' 128 'CURS' xxxx (Optional) If the 'acur' resource is present, the 'CURS' resources named by it must be present as well. 'DITL' 1000 'ALRT' 1000 items. You should modify the "Freely redistributable" and authorship items. 1001 'ALRT' 1001 items. 1002 'ALRT' 1002 items. 'FREF' 128 'APPL' file reference. 129 'TEXT' file reference. 'icl4', 'icl8', 'ICN#', 'ics#', 'ics4', ics8' 128 Icon family for your application's icon. Modify all of these. 'MENU' 1000 File menu. 1001 Edit menu. 'rPrt' 0 Signature resource. You should modify this to reflect the signature you choose for your application. Note: you can change the name of this resource easily in ResEdit by editing the 'BNDL' resource. ('rPrt' = RTF prototype.) 'STR ' 1000 "What this application does" description. It's used in the About alert. Modify to describe what your translator translates to. 'TEXT' 1000 (Optional) Help text resource. If present, a"Help" item appears in the Apple menu. Selecting it displays awindow the text of this resource as its contents. It should be edited appropriately for your application. 'vers' 1, 2 (Optional) Version resources. Modify both of them. 'WIND' 1000 Status window. 1001 Log window. You can change the size and/or location if you want a different default log window size and/or location. 1002 Help window. You can change the size and/or location if you want a different default help window size and/or location. MISCELLANEOUS rtf2troff.h: This uses bcopy(), which is redefined in terms of memcpy() if SYSV is defined. But under THINK C, must also make sure that the third argument is 4 bytes long, or the copy gets a bad argument. Thus bcopy() is defined differently when THINK_C is defined than when not.