Mac OS 9
Palettes.h File Reference

Palette Manager Interfaces. More...

#include <Quickdraw.h>

Go to the source code of this file.

Data Structures

struct  ColorInfo
 
struct  Palette
 

Typedefs

typedef struct ColorInfo ColorInfo
 
typedef ColorInfoColorInfoPtr
 
typedef ColorInfoPtrColorInfoHandle
 
typedef struct Palette Palette
 
typedef PalettePalettePtr
 
typedef PalettePtrPaletteHandle
 

Enumerations

enum  {
  pmCourteous = 0 , pmDithered = 0x0001 , pmTolerant , pmAnimated ,
  pmExplicit , pmWhite = 0x0010 , pmBlack = 0x0020 , pmInhibitG2 = 0x0100 ,
  pmInhibitC2 = 0x0200 , pmInhibitG4 = 0x0400 , pmInhibitC4 = 0x0800 , pmInhibitG8 = 0x1000 ,
  pmInhibitC8 = 0x2000 , pmNoUpdates = 0x8000 , pmBkUpdates = 0xA000 , pmFgUpdates = 0xC000 ,
  pmAllUpdates = 0xE000
}
 

Functions

void InitPalettes (void)
 
PaletteHandle NewPalette (short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
 
PaletteHandle GetNewPalette (short PaletteID)
 
void DisposePalette (PaletteHandle srcPalette)
 
void ActivatePalette (WindowRef srcWindow)
 
void SetPalette (WindowRef dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
 
void NSetPalette (WindowRef dstWindow, PaletteHandle srcPalette, short nCUpdates)
 
PaletteHandle GetPalette (WindowRef srcWindow)
 
void CopyPalette (PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
 
void PmForeColor (short dstEntry)
 
void PmBackColor (short dstEntry)
 
void AnimateEntry (WindowRef dstWindow, short dstEntry, const RGBColor *srcRGB)
 
void MacAnimatePalette (WindowRef dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
 
void GetEntryColor (PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
 
void SetEntryColor (PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
 
void GetEntryUsage (PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
 
void SetEntryUsage (PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
 
void CTab2Palette (CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
 
void Palette2CTab (PaletteHandle srcPalette, CTabHandle dstCTab)
 
long Entry2Index (short entry)
 
void RestoreDeviceClut (GDHandle gd)
 
void MacResizePalette (PaletteHandle p, short size)
 
void SaveFore (ColorSpec *c)
 
void SaveBack (ColorSpec *c)
 
void RestoreFore (const ColorSpec *c)
 
void RestoreBack (const ColorSpec *c)
 
OSErr SetDepth (GDHandle gd, short depth, short whichFlags, short flags)
 
short HasDepth (GDHandle gd, short depth, short whichFlags, short flags)
 
short PMgrVersion (void)
 
void SetPaletteUpdates (PaletteHandle p, short updates)
 
short GetPaletteUpdates (PaletteHandle p)
 
Boolean GetGray (GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
 

Detailed Description

Palette Manager Interfaces.

Introduced In: Mac OS 8
Avaliable From: Universal Interfaces 3.4.1
Copyright: © 1987-2001 by Apple Computer, Inc., all rights reserved

For bug reports, consult the following page on the World Wide Web:

http://developer.apple.com/bugreporter/

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
pmDithered 

Record use of color on each device touched.

pmAnimated 

render ciRGB if ciTolerance is exceeded by best match.

pmExplicit 

reserve an index on each device touched and render ciRGB.

pmWhite 

no reserve, no render, no record; stuff index into port.

pmNoUpdates 

NSetPalette Update Constants

pmBkUpdates 

no updates

pmFgUpdates 

background updates only

pmAllUpdates 

foreground updates only

Function Documentation

◆ ActivatePalette()

void ActivatePalette ( WindowRef  srcWindow)

ActivatePalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ AnimateEntry()

void AnimateEntry ( WindowRef  dstWindow,
short  dstEntry,
const RGBColor srcRGB 
)

AnimateEntry()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CopyPalette()

void CopyPalette ( PaletteHandle  srcPalette,
PaletteHandle  dstPalette,
short  srcEntry,
short  dstEntry,
short  dstLength 
)

CopyPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ CTab2Palette()

void CTab2Palette ( CTabHandle  srcCTab,
PaletteHandle  dstPalette,
short  srcUsage,
short  srcTolerance 
)

CTab2Palette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ DisposePalette()

void DisposePalette ( PaletteHandle  srcPalette)

DisposePalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ Entry2Index()

long Entry2Index ( short  entry)
\brief Return the index for an entry in current palette

<pre>Given an entry number, Entry2Index returns the index for that entry in

the current grafPort 's palette on the current device.

Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetEntryColor()

void GetEntryColor ( PaletteHandle  srcPalette,
short  srcEntry,
RGBColor dstRGB 
)
\brief Access a palette entry from an application

<pre>GetEntryColor lets your application open up a particular color in a source

palette so the SetEntryColor procedure can use it to make a change to a window color. srcPalette is the palette with colors you can use for making a change. srcEntry is the particular color you've chosen to substitute for the old color. destRGB is the specified RGB value of the old color about to be changed. Returns: none

Note
 GetEntryColor does the preparation work in making a new color available.
Later, SetEntryColor can come along and make the change.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetEntryUsage()

void GetEntryUsage ( PaletteHandle  srcPalette,
short  srcEntry,
short *  dstUsage,
short *  dstTolerance 
)
\brief Access the usage and tolerance fields of one palette color

<pre>GetEntryUsage lets your application open up a target color so it can be modified

by SetEntryUsage . srcPalette is the palette containing the color values you want to copy. srcEntry is the particular color whose values you want. destUsage is pmCourteous , pmExplicit , pmTolerant , or pmAnimated destTolerance is the tolerance level of the color about to be changed. Returns: none

Note
 GetEntryUsage does the preparation work in making new color qualities
available. Later, SetEntryUsage can come along and make the change.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetGray()

Boolean GetGray ( GDHandle  device,
const RGBColor backGround,
RGBColor foreGround 
)

GetGray()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetNewPalette()

PaletteHandle GetNewPalette ( short  PaletteID)

GetNewPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetPalette()

PaletteHandle GetPalette ( WindowRef  srcWindow)

GetPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ GetPaletteUpdates()

short GetPaletteUpdates ( PaletteHandle  p)
\brief GetPaletteUpdates Return the update attribute of a palette

<pre>The GetPaletteUpdates function returns the update attribute of a palette.

pis the palette being queried Returns: one of the update attributes described for the NSetPalette procedure

Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ HasDepth()

short HasDepth ( GDHandle  gd,
short  depth,
short  whichFlags,
short  flags 
)

HasDepth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ InitPalettes()

void InitPalettes ( void  )

InitPalettes()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ MacAnimatePalette()

void MacAnimatePalette ( WindowRef  dstWindow,
CTabHandle  srcCTab,
short  srcIndex,
short  dstEntry,
short  dstLength 
)

[Mac]AnimatePalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ MacResizePalette()

void MacResizePalette ( PaletteHandle  p,
short  size 
)

[Mac]ResizePalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NewPalette()

PaletteHandle NewPalette ( short  entries,
CTabHandle  srcColors,
short  srcUsage,
short  srcTolerance 
)

NewPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ NSetPalette()

void NSetPalette ( WindowRef  dstWindow,
PaletteHandle  srcPalette,
short  nCUpdates 
)

NSetPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ Palette2CTab()

void Palette2CTab ( PaletteHandle  srcPalette,
CTabHandle  dstCTab 
)

Palette2CTab()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ PmBackColor()

void PmBackColor ( short  dstEntry)

PmBackColor()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ PmForeColor()

void PmForeColor ( short  dstEntry)

PmForeColor()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ PMgrVersion()

short PMgrVersion ( void  )
\brief Get version of the Palette Manager

<pre>The PMgrVersion function returns an integer specifying the version

number of the currently executing Palette Manager . Returned values may be as follows. Value Description 0x0202 System 7.0 or later 0x0201 System 6.0.5 0x0200 Original 32-Bit QuickDraw system extension

Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ RestoreBack()

void RestoreBack ( const ColorSpec c)

RestoreBack()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ RestoreDeviceClut()

void RestoreDeviceClut ( GDHandle  gd)

RestoreDeviceClut()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ RestoreFore()

void RestoreFore ( const ColorSpec c)

RestoreFore()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SaveBack()

void SaveBack ( ColorSpec c)

SaveBack()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SaveFore()

void SaveFore ( ColorSpec c)

SaveFore()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetDepth()

OSErr SetDepth ( GDHandle  gd,
short  depth,
short  whichFlags,
short  flags 
)

SetDepth()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetEntryColor()

void SetEntryColor ( PaletteHandle  dstPalette,
short  dstEntry,
const RGBColor srcRGB 
)
\brief Change the color of a palette entry from an application

<pre>SetEntryColor lets your application change an individual target color in a

destination palette. destPalette is the palette containing the color you want to change. destEntry is the particular color you've targeted for change. srcRGB is the specific RGB value of the new color about to be switched in for the old. Returns: none

Note
 SetEntryColor marks a change in a color palette from old to new color. As
yet, however, no visible change occurs in the color environment. That event
takes place at the next ActivatePalette call. The change comes quickly, though,
since a changed entry is marked as such and a palette update occurs even when
no other changes that would normally precipitate a color environment change
have taken place.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetEntryUsage()

void SetEntryUsage ( PaletteHandle  dstPalette,
short  dstEntry,
short  srcUsage,
short  srcTolerance 
)
\brief Change the usage and tolerance of a palette entry

<pre>SetEntryUsage lets your application alter a single palette entry's color usage

and tolerance. destPalette is the palette containing the color you want to change. destEntry is the particular color you've targeted for change. srcUsage is pmCourteous , pmExplicit , pmTolerant or pmAnimated . srcTolerance specification for tolerance level in new palette entry. Returns: none

Note
 SetEntryUsage marks a change in a color palette entry from old to new usage
and tolerance. As yet, however, no visible change occurs in the color
environment. That event takes place at the next ActivatePalette call. The
change comes quickly, though, since a changed entry is marked as such and a
palette update occurs even when no other changes that would normally
precipitate a color environment change have taken place. Use this routine after
creating a new palette with NewPalette or modifying one with CTab2Palette
where the usage and tolerance fields carry the same value if you want to
customize your palette.
Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetPalette()

void SetPalette ( WindowRef  dstWindow,
PaletteHandle  srcPalette,
Boolean  cUpdates 
)

SetPalette()

Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later

◆ SetPaletteUpdates()

void SetPaletteUpdates ( PaletteHandle  p,
short  updates 
)
\brief SetPaletteUpdates Set the update attribute of a palette

<pre>The SetPaletteUpdates procedure sets the update attribute of a palette.

pis the palette being updated updatesone of the update attributes described for the NSetPalette procedure. Returns: none

Copyright: THINK Reference © 1991-1992 Symantec Corporation
Non-Carbon CFM: in InterfaceLib 7.1 and later
Carbon Lib: in CarbonLib 1.0 and later
Mac OS X: in version 10.0 and later