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


ReserveEntry

Reserves or removes reservation from an entry in the current GDevice data structure's color table.

pascal void ReserveEntry (
short index, 
Boolean reserve);
index
The index to the entry.
reserve
A Boolean value: true to reserve the entry, false to remove the reservation.
DISCUSSION
The ReserveEntry function reserves or removes the reservation of an entry in the current color table, depending on the value of the reserve parameter. A reserved entry cannot be matched by another application's search function, and Color2Index (or other functions that depend on it such as RGBForeColor, RGBBackColor, and SetCPixel) never return that entry to another client. You could use this function to selectively protect a color for color table animation.

The ReserveEntry function copies the low byte of the gdID field of the current GDevice data structure into the low byte of the ColorSpec.value field of the color table when reserving an entry, and leaves the high byte alone. ReserveEntry acts like selective protection and does not allow any changes if the current gdID field is different than the one in the ColorSpec.value field of the reserved entry. If a requested match is already reserved, ReserveEntry returns a protection error. It can remove reservation from any entry.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996