To help make porting packages from Magic Cap 1.x to Rosemary easier, the SDK includes a set of conversion scripts that automates many of the necessary changes. This document takes you through the steps you should follow to get a Magic Cap 1.x package up and running on Rosemary.
The Class Changes document set is a list of raw changes to all Magic Cap classes, listing new and obsolete classes, fields, attributes, inheritance chains and methods. Many of these classes contains a section titled "background information", which is a list of links into the Release Notes document set.
The Release Notes document set provides more of a high level overview of the changes to Magic Cap. Each of the sections in the Release Notes discusses a particular area of Magic Cap, and provides a conceptual background for the changes in each area. Each section ends with a list of classes that are affected by the changes discussed in that section. Each class is linked to its list of changes in the Class Changes documents so you can see exactly what is different in each class.
On MPW:
simply choose the Convert Package To Rosemary menu item from the Utils menu. This command works on the current directory, so be sure you have made your package directory the current directory. You can also start the conversion scripts from the MPW Worksheet by typing the command
"{MagicDevConversionScripts}UpdatePackageToRosemary" packageDirectory
where packageDirectory is the full pathname to the directory containing the package you want to update. The pathname must be terminated with a colon (:).
On Developer Studio:
simply change directory to the directory where the package to be converted exists, and type the command
Convert2Rosemary
The conversion script will make a copy of your package source files before modifying them. The scripts determine which conversions will need to be performed on your package. This allows additional conversion scripts to be added in the future, allowing incremental automated conversions as work on Rosemary progresses. The automated conversion process will take several minutes to execute.
The conversion scripts will scan C source and header files for indexical declarations and create a new class definition file that declares your package indexicals. The root list entries in your software package object will be removed, and new indexical initialization statements will be generated for your package indexicals.
Note: Because indexicals are referenced symbolically, all package indexicals must have a corresponding name. The conversion scripts will warn you when an unnamed indexical is encountered.
System defined package indexicals no longer exist in Rosemary. The conversion scripts will take these root list entries and either make them into fields of the new SoftwarePackageContents object, or delete references that were never required.
Note: The scripts do not convert view chains with no superview. Examples of such view chains are chains referenced from a ViewChainList object, or from a SceneAdditions object. In these cases, where a view chain starts from a non-viewable object, you will need to create an ObjectList that lists the members of the view chain, then refer to this list from the original non-viewable object that referenced the view chain.
An object tag is now an alphanumeric identifier instead of a numeric identifier. The conversion scripts will change all numeric identifier in your object definitin files to alphanumeric tags be prepending the string "unnamed" to the numeric tag.
Note: If your source code accesses the fields of package classes, or calls package class methods, you will need to include the header files that are created by the class compiler for these classes. The class compiler creates a ".xh" and ".xph" file for each package class definition file. Every source file that uses a class from one of these class definition files should include the .xh and .xph header files for that class definition file. These include statements replace the old #include "Package.h" statement that normally appears in every source file. Similarly, if you have package classes that inherit from packages classes defined in another class definition file, you'll need to add a read statement for the superclass's class definition file. (We'll make conversion scripts for these soon.)
The length of extra data lists are encoded in a special word at the start of the extra data section of list objects, making the explicit length field of list objects obsolete. The object compiler considers the specification of a length field to be a syntax error. The conversion scripts will remove the length field of all instances of classes that inherit from class FixedList.
List view column data is no longer kept in the extra data of the parent list view object. The column offsets, flags and keys are stored in separate list objects, which are referenced from new fields in GridView subclasses. The conversion scripts will gather the column information from the extra data of list view objects and separate them out into the individual object lists.
The actionData field of class LocalRuleAction has been replaced by two new fields so that Magic Cap can separate operation numbers from other integer data. The conversion scripts will replace the actionData field with these two new fields and fill in the appropriate field based on the rule action type.
Some fields have been renamed. The conversion scripts will update the old field names to the new names.
Magic Cap 1.x used flags fields in objects to compactly store various boolean attributes. Because the object compiler can compact these values, many flags fields have been split into individual boolean fields, making it easier to set particular attributes of various objects. Classes which use flags fields to store non-Boolean information still contains flags fields. The conversion scripts will split flags fields into individual boolean fields, maintaining the value of the boolean attribute.
Note: Some flag bits have always been reserved or undefined. The conversion script will issue a warning if it encounters a set bit that corresponds to one of these flag bits.
Classes whose instances are shared inherit from class HasDigest to get a checksum field so that identical objects can be found. The new shared object framework in Rosemary obsoletes this class and field. The conversion scripts will remove the checksum field from instances of class Image, MIDISong, ShapeType and Sound.
Note: The conversion scripts do not remove explicit declarations of class, operation or intrinsic numbers from class definition files. You'll need to remove these lines manually.
The empty main() function is no longer required by the linker in Rosemary packages. The conversion scripts will remove this function from source files.
Here are examples of messages that this script generates:
EndRead( iTrios ) #------------------------------------------------------ File "cap:Desktop Folder:OfficialSamples:TicTacToe:TicTacToe.c"; Line 184 The new interface for EndRead is: This method is obsolete. Use either EndReadFields() or EndReadExtra() instead. #------------------------------------------------------ TextToString(text, str) #------------------------------------------------------ File "cap:Desktop Folder:OfficialSamples:TicTacToe:TicTacToe.c"; Line 328 The new interface for TextToString is: This method is obsolete. Use text manipulation calls directly if possible. #------------------------------------------------------ HideFingerprint(TouchInput_) #------------------------------------------------------ File "cap:Desktop Folder:OfficialSamples:TicTacToe:TicTacToe.c"; Line 439 The new interface for HideFingerprint is: HideFingerprint(); HideFingerprint is now an intrinsic, and no longer needs a <self> parameter. #------------------------------------------------------ SetUpParameters(¶ms.header, 1) #------------------------------------------------------ File "cap:Desktop Folder:OfficialSamples:TicTacToe:TicTacToe.c"; Line 621 The new interface for SetUpParameters is: This method is obsolete. #------------------------------------------------------ MakeUsable(self, TTTFields.squares) #------------------------------------------------------ File "cap:Desktop Folder:OfficialSamples:TicTacToe:TicTacToe.c"; Line 626 The new interface for MakeUsable is: This method is obsolete. Use MakeUsableReference() instead. #------------------------------------------------------