![]() |
Resource Attribute Constants |
Header: Resources.h |
enum { resSysHeap = 64, resPurgeable = 32, resLocked = 16, resProtected = 8, resPreload = 4, resChanged = 2, mapReadOnly = 128, mapCompact = 64, mapChanged = 32 };
This attribute indicates whether the resource is read into the system heap (resSysHeap attribute is set to 1) or your applications heap (resSysHeap attribute is set to 0).
If you are setting your resources attributes with SetResAttrs, you should set this bit to 0 for your applications resources. Note that if you do set the resSysHeap attribute to 1 and the resource is too large for the system heap, the bit is cleared and the resource is read into the application heap.
If this attribute is set to 1, the resource is purgeable; if its 0, the resource is nonpurgeable. However, do not use SetResAttrs to make a purgeable resource nonpurgeable.
Because a locked resource is nonrelocatable and nonpurgeable, the resLocked attribute overrides the resPurgeable attribute.
If this attribute is 1, the resource is nonpurgeable regardless of whether resPurgeable is set. If its 0, the resource is purgeable or nonpurgeable depending on the value of the resPurgeable attribute.
If this attribute is set to 1, your application cant use Resource Manager functions to change the resource ID or resource name, modify the resource contents, or remove the resource from its resource fork. However, you can use the SetResAttrs function to remove this protection. Note that this attribute change takes effect immediately.
If this attribute is set to 1, the Resource Manager reads the resources resource data into memory immediately after opening its resource fork. You can use this setting to make multiple resources available for your application as soon as possible, rather than reading each one into memory individually. If both the resPreload attribute and the resLocked attribute are set, the Resource Manager loads the resource as low in the heap as possible.
If this attribute is set to 1, the resource has been changed; if its 0, the resource hasnt been changed. This attribute is used only while the resource map is in memory. The resChanged attribute must be 0 in the resource fork on disk.
Do not use SetResAttrs to set the resChanged attribute. Be sure the attrs parameter passed to SetResAttrs doesnt change the current setting of this attribute. To set the resChanged attribute, call the ChangedResource function.
The SetResAttrs and GetResAttrs functions use these constants to refer to each attribute.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)