home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 October: Mac OS SDK / Dev.CD Oct 96 SDK / Dev.CD Oct 96 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Getting Started / CodeWarrior Development / Installation & Build Guide < prev   
Encoding:
Text File  |  1996-08-16  |  17.9 KB  |  231 lines  |  [ttro/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                     
  5. Installation and Build Guide for CodeWarrior
  6. ODF Release 1 Update 2                                                                                                                                             
  7.  
  8. This document provides installation instructions for using ODF with Metrowerks CodeWarrior and also gives instructions for creating new parts and building them with CodeWarrior.
  9.  
  10.  
  11. Table of Contents
  12. -------------------------
  13. • Using the ODF Installer
  14. • Installing ODF Manually
  15. • Installing Cyberdog Support
  16. • Creating a New Part
  17.    • Using PartMaker
  18.    • Adding New Files to Your Project
  19.    • Updating Your NMAP Resources
  20. • Building Your Part
  21. • Running Your Part
  22. • Building ODF
  23.  
  24.  
  25. Using the ODF Installer
  26.  
  27. Run the ODF Installer located in this folder ('Install ODF (CW)') and follow the instructions to install ODF for use with the CodeWarrior development environment.  This installer allows you to choose whether you want to install support for either PowerPC or 68K part development and also allows you to specify where you want ODF installed. 
  28.  
  29. Note that the installer must be run from the CD.
  30.  
  31. After running the installer, read the sections later in this document for instructions on how to create a part, build, and run it. 
  32.  
  33.  
  34. Installing ODF Manually
  35.  
  36. For the most part, installing ODF is simply a matter of copying the ODF source and tools to your local hard drive. However, since ODF supports several different compilers, there are some files that you don't need to copy if you are doing all of your development with CodeWarrior. 
  37.  
  38. The basic steps you need to follow when installing ODF for CodeWarrior are as shown in the following list. These steps are explained in more detail below.
  39.  
  40.    1) Copy the ODFDev folder to your local hard drive.
  41.    2) Copy the CodeWarrior plugin tools to your CodeWarrior Plugins folder.
  42.    3) Copy the stationery files for the ODF example parts to your Stationery folder. (optional)
  43.    4) Copy any desired reference materials to your local hard drive. (optional)
  44.    5) Make an alias to the ODF library (debug build, PPC or 68K) and copy it into your Editors folder.
  45.    6) Copy the ODF sample parts. (optional)
  46.  
  47. 1) Copy the ODFDev folder to your local hard drive.
  48. You can copy the ODFDev folder in its entirety to your local hard drive. This folder contains the ODF source code and the source code for ODF's example parts. The ODFDev:ODF subfolder also contains configurations and project setups for building the ODF libraries. 
  49.  
  50. Once you’ve copied ODFDev, you can throw away folders for other environments. Inside the ODF folder, you can throw away the RB (Symantec), MC (MPW PPC), and SC (MPW 68K) folders. You only need to keep the CW (CodeWarrior) and SL (Shared Library) folders. The same is true for all the example projects.
  51.  
  52. The following table indicates, for each folder, which compiler is used, and the resulting binary. Notice that the 68K ODF Shared Library is currently built with the Symantec 68K compiler and the PPC ODF Shared Library is always built with CodeWarrior.
  53.  
  54. Folder                                             Compiler Used                           ODF Folder                                                                                                                                         Sample Folders
  55.  
  56. CWPPCDebug              CodeWarrior                PPC Debug ODF Static Libraries                    PPC Debug Part Editor
  57. CWPPCRelease            CodeWarrior                PPC Release ODF Static Libraries            PPC Release Part Editor
  58. MCPPCDebug                    MrC                                                PPC Debug ODF Static Libraries                    PPC Debug Part Editor
  59. MCPPCRelease            MrC               PPC Release ODF Static Libraries         PPC Release Part Editor
  60. RBPPCDebug           Rainbow              PPC Debug ODF Static Libraries              PPC Debug Part Editor
  61. RBPPCRelease   Rainbow              PPC Release ODF Static Libraries         PPC Release Part Editor
  62.  
  63. CW68KDebug        CodeWarrior          68K Debug ODF Static Libraries           68K Debug Part Editor
  64. CW68KRelease      CodeWarrior          68K Release ODF Static Libraries         68K Release Part Editor
  65. SC68KDebug        Symantec 68K         68K Debug ODF Static Libraries           68K Debug Part Editor
  66. SC68KRelease      Symantec 68K         68K Release ODF Static Libraries         68K Release Part Editor
  67.  
  68. SLPPCDebug     CodeWarrior          PPC Debug ODF Shared Library                n/a
  69. SLPPCRelease   CodeWarrior          PPC Release ODF Shared Library                 n/a
  70. SL68KDebug        Symantec 68K         68K Debug ODF Shared Library                n/a
  71. SL68KRelease   Symantec 68K         68K Release ODF Shared Library           n/a
  72.  
  73.  
  74. The following table indicates which folders are necessary for each supported compiler. 
  75.  
  76. Folder                        CW/PPC           CW/68K            Symantec68K            MrC             Rainbow
  77.  
  78. CWPPCDebug         Y              N                 N               N             N        
  79. CWPPCRelease       Y              N                 N               N             N
  80. MCPPCDebug            N              N                 N               Y             N
  81. MCPPCRelease          N              N                 N               Y             N    
  82. RBPPCDebug            N              N                 N               N             Y    
  83. RBPPCRelease       N              N                 N               N             Y    
  84.  
  85. CW68KDebug            N              Y                 N               N             N    
  86. CW68kRelease          N              Y                 N               N             N    
  87. SC68KDebug            N              N                 Y               N             N    
  88. SC68KRelease       N              N                 Y               N             N    
  89.  
  90. SL68KDebug         N              Y                 Y               N             N    
  91. SL68KRelease          N              Y                 Y               N             N    
  92. SLPPCDebug            Y              N                 N               Y             Y    
  93. SLPPCRelease          Y              N                 N               Y             Y    
  94.  
  95.  
  96. 2) Copy the CodeWarrior plugin tools to your CodeWarrior Plugins folder.
  97. In order to compile ODF resource files (.fr extension) and IDL files (.idl extension) using CodeWarrior, you must install the ODFRC and SOMobjects™ TS plugin tools. These tools are located in the 'CodeWarrior Plugins:Compilers' folder.  Copy all of the files in this folder to the 'CodeWarrior Plugins:Compilers' folder in your CodeWarrior development environment.
  98.  
  99. 3) Copy the stationery files for the ODF example parts to your Stationery folder. (optional)
  100. If you want to run the ODF sample parts, you will need to copy the stationery files for these parts into your Stationery folder. The stationery files are located in the 'ODF Sample Parts:Stationery' folder. 
  101.  
  102. 4) Copy any desired reference materials to your local hard drive. (optional)
  103. ODF comes with several documents and tools, such as the ODF Class Reference and MacBrowse, that can make it easier to navigate through the ODF code. You can copy any of these to your local hard drive.
  104.  
  105. The 'Documentation' folder contains the ODF Class Reference, which is a QuickView database that allows you to quickly search for the documentation for a particular class or method. Make sure that the QuickView application and the ODF Class Reference document are in the same folder when you launch the application. 
  106.  
  107. The 'Tools & Goodies:MacBrowse' folder contains the MacBrowse application that enables you to browse the ODF source code directly.  It also contains a subfolder with the MacParse tool, which you can use to create parsed files for use with MacBrowse.
  108.  
  109. The 'Tools & Goodies:Object Master™' folder contains an empty ObjectMaster project, which you can use to create a browsable set of the ODF source code.
  110.  
  111. 5) Make an alias to the ODF library.
  112. To make debugging with ODF easier, you need to make an alias to the debug version of the ODF shared library and put the alias into your Editors folder. If your ODF environment is on a different volume than your system folder, you can create an Editors folder at the root level of your development hard drive and put the alias there. (OpenDoc does not allow you to put aliases to files on different volumes in the Editors folder.)
  113.  
  114. Note: The ODFLibrary (or an alias to it) must be located in your Editors folder. Part editors that were built with ODF require the existence of this library and will not run without it.
  115.  
  116. The debug version of the ODF shared library (ODFLibrary) is already built and is located in the 'ODFDev:ODF:SLPPCDebug:Bin:' folder for PPC and in the 'ODFDev:ODF:SL68KDebug:Bin:' for 68K. 
  117.  
  118. For convenience, you can also make an alias to the symbol files for the ODFLibrary (ODFLibrary.xSYM) and put it on your desktop. When you want to load the symbol file into the CodeWarrior debugger, you can double-click on the alias.
  119.  
  120. IMPORTANT: Make sure that the release version of the ODFLibrary or any of the ODF sample parts are not installed on your machine while you are attempting to trace through either the ODFLibrary or sample parts. The chances are good that you will not get the right library. OpenDoc searches for the first part editor and library that matches its search parameters. The release version of the ODF libraries and samples are simply optimized versions that do not have internal debugging information, such as Macsbug symbols or assertions.
  121.  
  122. 6) Copy the ODF Sample Parts. (optional)
  123. Copy the ODF sample parts from the 'ODF Sample Parts' folder to your Editors folder.
  124.  
  125.  
  126. Installing Cyberdog Support
  127.  
  128. ODF provides some preliminary Cyberdog support in the 'ODF & Cyberdog' folder. This support has not been fully integrated into ODF yet, so it's currently provided in a separate folder. If you want to support Cyberdog in your sample parts, you need to install this code into your ODFDev folder as follows:
  129.  
  130.    1) Copy the FWCyber folder to your ODFDev folder.
  131.    2) Copy the ODF CyberStarter  example to your ODFDev folder. (optional)
  132.    3) Install Cyberdog headers and stub libraries. (Not Provided)
  133.  
  134.  
  135. 1) Copy the "ODFCyberLibrary" folder to your ODFDev folder.
  136. Copy this folder to the root level of your ODFDev folder. 
  137.  
  138. 2) Copy the CyberStarter examples to your ODFDev folder. (optional)
  139. If you want to build the Cyberdog samples, then you should also copy the CyberStarter sample part from the "ODF & Cyberdog" folder to the root level of your ODFDev folder. 
  140.  
  141. 3) Install the Cyberdog headers and stub library into CodeWarrior’s Headers folder. (Not Provided)
  142. You need to install the Cyberdog headers and stub library into the CodeWarrior's headers folder.
  143.  
  144.  
  145. Creating a New Part
  146.  
  147. Whenever you want to create a new part, use PartMaker to generate your initial project. PartMaker is located in the PartMaker folder and contains five templates: two for creating a non-embedding part based on the ODFHello and ODFNothing examples, and three for creating an embedding part based on ODFContainer, ODFEmbed, and ODFTable. 
  148.  
  149.    1) Use PartMaker to generate a new project.
  150.    2) Add any new files to your project.
  151.    3) Update your Binding resources.
  152.  
  153. Note: Any parts you make must be created in the ODFDev folder. This is because the CodeWarrior projects generated by PartMaker contain relative paths (in the Access Paths Preferences panel) to ODF header files. If your project is not located in ODFDev, these access paths will be wrong. The build scripts assume your project is in this location.
  154.  
  155.  
  156. Using PartMaker
  157.  
  158. ATTENTION: you must use the PartMaker 4.4.1 provided in the PartMaker folder. Earlier version of PartMaker will not work correctly with the ODF Release 1 templates.
  159.  
  160. Simply double-click one of the PartMaker templates, and PartMaker will prompt you for information about your new part. Specify the name of your new part and your company name and click on the "Create Part" button. PartMaker will prompt you for the name and location of your new project folder (Save File As:) and then create the project files.
  161.  
  162. Once you create your part, you should not change the part or company name. PartMaker uses this information in the source code to uniquely identify your part to OpenDoc. If you need to change the name of the part, use PartMaker again to create a new part and copy any new material you had written to the new project.
  163.  
  164. Once you have your new project (and before you add any new material to the part), open the project in CodeWarrior and build the part. This step allows you to verify that the part was generated correctly and does run. It also allows you to make an alias to the resulting part editor and add it to your Editors folder. See the section Building Your Part, later in this file, for more information on building your part editor.
  165.  
  166.  
  167. Adding New Files to Your Project
  168.  
  169. Once you have a new project, you can add new source files to this project just as you would for any CodeWarrior project. In addition, using the CodeWarrior plugins provided with ODF, you can use CodeWarrior to compile ODF resource files (.fr extension) and IDL files (.idl extension).  
  170.  
  171.  
  172. Adding ODF Resource Files
  173.  
  174. ODF resource files are normal text files that have an .fr extension. The ODFRC plugin compiles these files into resources, which then get linked into your part editor. 
  175.  
  176. Using AppMaker for Visual Editing of Views: See the AppMaker folder inside "Tools & Goodies" for a demo version of  Bowers Development's AppMaker and information on how to use it with PartMaker to create your part's interface.
  177.  
  178.  
  179. Adding IDL Files
  180.  
  181. The only time you should add IDL files is if your part defines an extension. You should NEVER modify ODF's IDL files, or the IDL files that were generated by PartMaker; use C++ to modify the functionality of your part instead. If you are creating an extension for your part, you can do the following to compile your IDL files:
  182.  
  183.    1) Add the IDL file(s) to your CodeWarrior project.
  184.    2) Compile each IDL file individually by selecting the file and pressing Command-K.
  185.    3) Add the SOM-generated .cpp file(s) to your CodeWarrior project.
  186.  
  187. In order to compile IDL files, you have to have ToolServer set up for your CodeWarrior environment. The SOMobjects™ TS plugin is not a stand-alone compiler, but only coordinates the interactions between CodeWarrior and ToolServer to compile your IDL files. 
  188.  
  189. Make sure you have ToolServer installed for your CodeWarrior environment. You must also make sure that you have installed the SOM headers and tools in your ToolServer environment.
  190.  
  191.  
  192. Updating Your 'nmap' Resources
  193.  
  194. Whenever you create a new part, PartMaker creates a set of 'nmap' resources for your part. However, because the content of your part is likely to be different than the default content of the PartMaker part, you must change these resources to reflect your part's content. See the 'nmap', Icon, & Part Signature  document in the "Documentation:Development Notes:" folder for more information on how to do this.
  195.  
  196.  
  197. Building Your Part
  198.  
  199. For development, you will want to use the CodeWarrior project that supports debugging. In your project folder, you will find a folder for each of the possible project configurations. To build a debug version of your part for PowerPC, open the project file in the CWPPCDebug folder and choose Make from the Project menu. To build a debug version of your part for 68K, open the project file in the CW68KDebug folder and choose Make. You can build release versions of your part by building the project in the corresponding Release folder. 
  200.  
  201. After CodeWarrior builds your part, make an alias to your part editor and put the alias in your Editors folder. If you do this, you will not have to copy your part to the Editors folder each time you recompile. The alias will automatically lead OpenDoc to the updated part editor file. 
  202.  
  203. Note: Remember that you also have to have the ODFLibrary (or an alias to it) in your Editors folder as well. ODF parts will not run without this library being present. 
  204.  
  205.  
  206. Running Your Part
  207.  
  208. To run your part, you need to first create a stationery file for your part editor. You do this by dropping your part editor onto the OpenDoc launcher located inside your system Extensions folder. OpenDoc creates a new stationery file for your part and puts it into your Stationery folder. 
  209.  
  210. To debug your part, open the symbol file for your part in the MW debugger. You may also want to open the symbol file for the ODFLibrary in the debugger as well. You can set breakpoints and the debugger will automatically target your part when it hits the breakpoints.
  211.  
  212. Double click your part's stationery file to launch your part in a new document. Or, drag your part’s stationery into a containing part (such as ODFDraw) to launch it as an embedded part.
  213.  
  214. When you ship your part, include the (release) ODFLibrary with it. Users can copy this library into their Exensions folder; users should copy your part editor into their Editors folder. The use of aliases is only for developers to alleviate the need to copy the part editor to the Editors folder after each compile.
  215.  
  216. Debugging Note: You should be using the MW Debug/MacOS version 1.4.1 or later.
  217.  
  218.  
  219. Building ODF
  220.  
  221. Although ODF is supplied pre-built, you should rebuild it once anyway to create symbol files which are correct for your hard drive. Symbol files contain full paths, and correct ones will make your debugging easier.
  222.  
  223. To rebuild ODF, run the ODF Builder (CW) application, located in the ODFDev folder. By default it will rebuild debug and release PPC of ODF and all the examples. You can make it also rebuild 68K projects, or not rebuild the examples. 
  224.  
  225. There is another situation where you will need to rebuild ODF: to use CW’s exception handling and Runtime Type Information (RTTI). ODF is set up to use its “emulated” exception handling mechanism and RTTI. This ODF emulated exception mechanism is slower than compiler-generated code, but the CW exceptions cost you around a 10% increase in code size, which we consider unacceptable. If you have code which is speed-critical and are entering try blocks often, try using native exceptions. To use them you need to set the "Enable C++ Exceptions" and "Enable RTTI" checkboxes in the CW project preferences for your part. You also need to rebuild ODF with this same setting. The "Use CW Exceptions & RTTI…" menu item in the ODF Builder will do this step for you. See the "ODF vs Native Exceptions" document for more details.
  226.  
  227. Remember, you are only rebuilding the ODFLibrary for debugging convenience (to make the MW debugger not ask you where ODF files are located). When you ship your part, you must include the ODFLibrary from the CD, not the one you were building.
  228.  
  229.  
  230. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  231. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.