Rosemary implements garbage collection of objects. Rosemary will invoke garbage collection to find orphaned objects during object allocation. This was not done in Magic Cap 1.x.Created a new intrinsic, NewLockedBufferWithoutReferences() which creates a buffer that will contain no object references. These are ignored by the garbage collector.
The Init() method of Cache no longer takes parameters.
Created the new mixin class AutoPurgeable. This is the class from which all classes that have transient objects that can be purged when memory is low should inherit. It defines the operation Purge(), which was formerly defined by Object, and PurgeableOwner(), which was formerly defined independently by various classes.
Created the new mixin class AutoPurgeableOwner. This is the class that manages AutoPurgeable objects. If defines the operation Purging(), which is called on the purgeable object owner to notify it that an object is being auto-purged. This method returns a boolean value that states whether or not the object can be purged.
The Image class no longer inherits from from SingleLinkable and Linkable, which no longer exist. The functionality that Image required from these classes is now implemented in the Image class so that these classes could be removed. Renamed the FirstLink() and LastLink() methods to FirstImage() and LastImage(). Renamed the next and previous fields and the corresponding attributes to nextImage and previousImage. These fields are both strong fields. Previously, one was strong and one was weak.Renamed Image_At to Image_ImageAt to keep consistent with the other operation names.
Image chains are fully shared; calling Destroy() on any image in a chain is equivalent to calling Destroy() on the first image in the chain. For image chains that are linked directly, destroying one image destroys the entire chain. For image chains that are linked via indexical, destroying one image does not destroy the entire chain.
The resolution of a PixelMap is now cached in two new fields of PixelMap objects, portResHRound and portResVRound. Because of this, you should no longer directly set the value of the portRes field. Call SetPortRes() instead.
The stricter type checking requirements of the new runtime necessitated an additional parameter to PixelMap_AllocAlignedPixels and AllocPixels(). The newPixels parameter was being used to pass in either a pixel map or the class of pixel map that should be created. newPixels now refers to a pixel map only and added the newPixelsClass parameter to specify a class. Values should not be passed in both parameters simultaneously. In other words, if newPixels contains an ObjectID parameter, newPixelsClass should be nilClass. If newPixelsClass contains a class number, newPixels should be nilObject.
Erasing scribbles is vastly improved in Rosemary. It's much faster and actually erases! Added method Erase_StartErasing which is called when the eraser is dragged. This creates a list of the currently displayed scribbles for the eraser to track. Added Scribble_EraseRegion which does proper tracking and clipping of scribbles. A side effect of this new method is that you may erase scribbles that are underneath another viewable: if you have a scribble which is obscured by a bitmap, and you drag the eraser across the bitmap, hitting the scribble underneath it, that scribble will be erased.
The eraser now interpolates movement. If the eraser is moved so quickly that samples are larger than the diameter of the eraser, Eraser_SetOrigin will linearly interpolate between the previous sample and the current sample.
Magic Cap 1.5 introduced the classes IndirectPixelMap and IndirectPixels to support flipped screens and hosted environments. Rosemary refines this model slightly further. Renamed the class FlippedPixelMap to UpsideDownPixelMap. This allowed the addition of a new FlippedPixelMap class. The difference is that UpsideDownPixelMap flips scanlines and reverses pixels within a scanline, while FlippedPixelMap simply flips scanlines without reversing the pixels. Renamed the operation CopyAndFlipBox() to CopyBoxUpsideDown() for parallelism.
The operation ScanConvertible_QuickClip has been removed because it's the same as TrimBounds().
The word "hilite" is a leftover of days when compilers would only recognize idenitifiers of a certain length. Those days are long gone. All occurences of "hilite" in Magic Cap have been changed into the more proper "highlight". Canvas_HiliteBox has been renamed Canvas_HighlightBox.
Fixed a lot of areas that were modifying memory when something was locked. Among these, fixed the operations BeginReadRaster() and EndReadRaster() so they no longer keep the pixels locked the entire time. Disabled the use of ScanConvert2() which created a path while the pixels were already locked down.
Work has been started on providing a concept of a current canvas and current clipping path in Magic Cap. Once this is more pervasive, it will no longer be necessary to pass a canvas and clip around everywhere as parameters.
Class Canvas implements a new operation, IntersectCurrentClip() which sets the clipping area of the canvas to be the intersection of the current clip area with the specified path. A supplemental routine, IntersectCurrentClipBox(), which sets takes a box instead of a path.
Path objects returned by Magic Cap are now ephemeral objects. This changes some of the semantics of the way paths are used, copied or passed as parameters. Viewable_ContentPath and Viewable_BoundsPath now return paths instead of taking paths as parameters. Path_CopyPath now returns a new path which is an ephemeral copy of the self parameter instead of transferring the contents of one path to another existing path.
NewPath() has been renamed NewEmptyPath().
Removed the method Path_DestroyPath. This method was simply calling Destroy() for non-ephemeral Path objects, and just returning otherwise. You should call Destroy() directly on non-ephemeral Path objects.
Created a new subclass of Pixels, NonRelocatablePixels, which stores pixel data in a transient buffer instead of the extra data portion of the object. Added the operation Pixels_ResizePixelBuffer that should be used to resize the pixel buffer instead of calling SetExtraSize() explicitly. NonRelocatablePixels overrides this method to resize the transient buffer that holds its pixel data.
All canvases used for printing are now created in transient memory.
The flags field of class Scribble, imageFlags field of class Image, and shapeFlags field of class ShapeType have been split into individual Boolean attributes.
Pixel maps must be long word aligned, that is, the number of bytes in a row of a pixel map must be a multiple of four.