![]() |
ScrapStuff |
Header: Scrap.h |
When you call the InfoScrap function, the Scrap Manager uses the scrap information structure defined by the ScrapStuff data type to return information about the scrap.
struct ScrapStuff { SInt32 scrapSize; Handle scrapHandle; SInt16 scrapCount; SInt16 scrapState; StringPtr scrapName; }; typedef ScrapStuff PScrapStuff;
The size of the scrap in bytes.
A handle to the scrap if it is in memory; otherwise, this field is NULL.
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 structure for a resume event. If this bit is set, the contents of the scrap have changed and your application should take the appropriate actions.
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 hasnt been initialized.
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.
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.
© 2000 Apple Computer, Inc. (Last Updated 7/17/2000)