This Technical Note describes public scrap types.
Changes since March 1991: Added information on Scrap Type $8003 (Resource Reference Scrap); added a cross-reference to HyperCard IIgs Technical Note #3.
The Apple IIgs Toolbox Reference lists only two known scrap types -- text ($0000) and pictures ($0001). Other assigned scrap types are documented in this Note. The format used to describe the scraps is similar to that used in File Type Notes, where the offsets, given in the form (+xxx), determine the offset from the beginning of the scrap handle.
The following describes the Sampled Sound scrap format. It consists of a ten-byte header followed by the sample data bytes. This format is identical to the sampled sound resource format.
The TextEdit Style Scrap format is the same as the TEFormat structure defined in Volume 3 of the Apple IIgs Toolbox Reference, which is also the same as the rStyleBlock resource format defined in the same volume.
The Icon scrap format is the same as the format for Finder Icon Data records, documented in detail in the File Type Note for File Type $CA, Finder Icon Files. If there is more than one Icon Data record in a scrap, they are concatenated together with no intervening space.
The Mask scrap format is exactly the same as the PICT scrap ($0001) format, except that the pixel image the picture draws contains only zeroes and ones. When drawn, this picture creates a mask. The mask has zeroes where the image can be seen through the mask, and ones where the mask does not allow the picture through. When pasting a Mask scrap, initialize the destination bitmap to zero and draw the picture.
You can create the mask image by using regular QuickDraw II calls (using ovals, rectangles, etc.) or you can create it independently and include it with PaintPixels or other pixel map manipulation routines.
The following describes the Color Table scrap format. The scrap contains color tables so that applications can keep custom colors with pictures copied to the clipboard. The scrap has the same format as the Apple Preferred Format picture PALETTES block:
The Resource Reference scrap is designed to allow resource editors to exchange resource data through an external scrap file using the Scrap Manager.
If the specified resource contains references to other resources (for example, an rWindParam1 resource with a title string, control list, control templates, etc.), all the referenced resources must be present in the resScrapPath file.
It is the responsibility of the application using this scrap to handle resource ID conflicts that might arise from a Paste operation. The application should not modify or destroy the resScrapPath file.
This and all of the other Apple II Technical Notes have been converted to HTML by Aaron Heiss as a public service to the Apple II community, with permission by Apple Computer, Inc. Any and all trademarks, registered and otherwise, are properties of their owners.