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: Advanced Color Imaging Reference /
Chapter 5 - Color Manager Reference /
Color Manager Functions / Managing Color Tables


RestoreEntries

Sets a selection of color table entries.

pascal void RestoreEntries (
CTabHandle srcTable, 
CTabHandle dstTable,
ReqListRec *selection);
srcTable
The color table containing entries to be restored.
dstTable
The color table in which to restore the entries.
selection
A pointer to a list of entries to be restored, as indicated not by a range of indexes, but by a request list structure. See ReqListRec data structure (page 5-5)
DISCUSSION
The RestoreEntries function sets a selection of color table entries from the srcTable parameter into the dstTable parameter, but doesn't rebuild the inverse table. You use the selection parameter, a ReqListRec data structure (page 5-5), to enumerate entries from the dstTable parameter. The values specified by the selection parameter are offsets into the srcTable data structure, not the contents of the ColorSpec.value field.

If a request is beyond the end of the destination color table, RestoreEntries sets that position in the requestList data structure to colReqErr, and returns an error. RestoreEntries assumes that the color table specified by the srcTable parameter and the request list specified by the selection parameter have the same number of entries.

If dstTbl is NULL, or points to the current GDevice data structure's color table, RestoreEntries changes the device's color table and the hardware CLUT to these new colors. RestoreEntries does not change the color table's seed, so no invalidation occurs (which may cause RGBForeColor to act strangely). RestoreEntries ignores protection and reservation of color table entries.

SPECIAL CONSIDERATIONS
You generally should use the Palette Manager to give your application its own set of colors; use of RestoreEntries should be limited to special-purpose applications. RestoreEntries allows you to change a color table without changing its ctSeed field. You can execute the application code and then use RestoreEntries to put the original colors back in. However, in some cases things in the background may appear in the wrong colors, since they were never redrawn. To void this, your application must build its own new inverse table and redraw the background. If you then use RestoreEntries, you should call the CTabChanged function to clean up correctly.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996