Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: More Macintosh Toolbox /
Chapter 2 - Scrap Manager / Scrap Manager Reference
Data Structures


The Scrap Information Record

The Scrap Manager returns information about the scrap in a scrap information record. The scrap information record is defined by the ScrapStuff data type.

TYPE 
   ScrapStuff =                  {scrap information record}
   RECORD
      scrapSize:     LongInt;    {size (in bytes) of scrap}
      scrapHandle:   Handle;     {handle to scrap}
      scrapCount:    Integer;    {indicates whether the contents }
                                 { of the scrap have changed}
      scrapState:    Integer;    {indicates state and location }
                                 { of scrap}
      scrapName:     StringPtr;  {filename of the scrap}
   END;
   PScrapStuff = ^ScrapStuff;    {pointer to scrap info record}
Field Description
scrapSize
The size of the scrap in bytes.
scrapHandle
A handle to the scrap if it's in memory; otherwise, this field is NIL.
scrapCount
A number that changes each time your application (or another application) calls the ZeroScrap function. When your application receives a suspend event, it should copy any data from its private scrap to the scrap and it can save the value of the scrapCount field. Upon receiving a resume event, your application can use the InfoScrap function to examine the current value of the scrapCount field. If the value in the scrapCount field is different from the previous value, the contents of the scrap have changed and your application should copy the data from the scrap to its private scrap.
Alternatively, rather than saving and examining the value of the scrapCount field, your application can check the convertClipboardFlag bit of the event record for a resume event. If this bit is set, the contents of the scrap have changed and your application should take the appropriate actions.
scrapState
The location and state of the scrap. This field is positive if the scrap data is in memory, 0 if the scrap data is on the disk, or negative if the scrap hasn't been initialized.
Note
In unusual circumstances the value of scrapState might be 0 when the scrap is actually in memory. This can occur if the user deletes the scrap file on disk and then performs a cut or copy operation.
scrapName
The filename of the scrap when the scrap is stored on disk. Usually the scrap file is named "Clipboard". The scrap file is always stored on the startup volume.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996