BuildCubeE/MPW-3.2.3/Interfaces/CIncludes/Palettes.h

148 lines
4.5 KiB
C
Raw Normal View History

2018-11-16 01:50:16 +00:00
/************************************************************
2019-01-13 07:57:32 +00:00
Created: Tuesday, January 8, 1991 at 9:43 AM
Palettes.h
C Interface to the Macintosh Libraries
2018-11-16 01:50:16 +00:00
2019-01-13 07:57:32 +00:00
Copyright Apple Computer, Inc. 1987-1990
All rights reserved
2018-11-16 01:50:16 +00:00
************************************************************/
#ifndef __PALETTES__
#define __PALETTES__
#ifndef __QUICKDRAW__
#include <Quickdraw.h>
#endif
#ifndef __WINDOWS__
#include <Windows.h>
#endif
enum {
2019-01-13 07:57:32 +00:00
pmCourteous = 0, /*Record use of color on each device touched.*/
pmTolerant = 0x0002, /*render ciRGB if ciTolerance is exceeded by best match.*/
pmAnimated = 0x0004, /*reserve an index on each device touched and render ciRGB.*/
pmExplicit = 0x0008, /*no reserve, no render, no record; stuff index into port.*/
2018-11-16 01:50:16 +00:00
2019-01-13 07:57:32 +00:00
pmWhite = 0x0010,
pmBlack = 0x0020,
2018-11-16 01:50:16 +00:00
2019-01-13 07:57:32 +00:00
pmInhibitG2 = 0x0100,
pmInhibitC2 = 0x0200,
pmInhibitG4 = 0x0400,
pmInhibitC4 = 0x0800,
pmInhibitG8 = 0x1000,
pmInhibitC8 = 0x2000,
2018-11-16 01:50:16 +00:00
/* NSetPalette Update Constants */
2019-01-13 07:57:32 +00:00
pmNoUpdates = 0x8000, /*no updates*/
pmBkUpdates = 0xA000, /*background updates only*/
pmFgUpdates = 0xC000, /*foreground updates only*/
pmAllUpdates = 0xE000 /*all updates*/
2018-11-16 01:50:16 +00:00
};
struct ColorInfo {
2019-01-13 07:57:32 +00:00
RGBColor ciRGB; /*true RGB values*/
short ciUsage; /*color usage*/
short ciTolerance; /*tolerance value*/
short ciDataFields[3]; /*private fields*/
2018-11-16 01:50:16 +00:00
};
typedef struct ColorInfo ColorInfo;
struct Palette {
2019-01-13 07:57:32 +00:00
short pmEntries; /*entries in pmTable*/
short pmDataFields[7]; /*private fields*/
ColorInfo pmInfo[1];
2018-11-16 01:50:16 +00:00
};
typedef struct Palette Palette;
typedef Palette *PalettePtr, **PaletteHandle;
#ifdef __cplusplus
extern "C" {
#endif
pascal void InitPalettes(void)
2019-01-13 07:57:32 +00:00
= 0xAA90;
2018-11-16 01:50:16 +00:00
pascal PaletteHandle NewPalette(short entries,CTabHandle srcColors,short srcUsage,
2019-01-13 07:57:32 +00:00
short srcTolerance)
= 0xAA91;
2018-11-16 01:50:16 +00:00
pascal PaletteHandle GetNewPalette(short PaletteID)
2019-01-13 07:57:32 +00:00
= 0xAA92;
2018-11-16 01:50:16 +00:00
pascal void DisposePalette(PaletteHandle srcPalette)
2019-01-13 07:57:32 +00:00
= 0xAA93;
2018-11-16 01:50:16 +00:00
pascal void ActivatePalette(WindowPtr srcWindow)
2019-01-13 07:57:32 +00:00
= 0xAA94;
2018-11-16 01:50:16 +00:00
pascal void SetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,Boolean cUpdates)
2019-01-13 07:57:32 +00:00
= 0xAA95;
2018-11-16 01:50:16 +00:00
pascal void NSetPalette(WindowPtr dstWindow,PaletteHandle srcPalette,short nCUpdates)
2019-01-13 07:57:32 +00:00
= 0xAA95;
2018-11-16 01:50:16 +00:00
pascal PaletteHandle GetPalette(WindowPtr srcWindow)
2019-01-13 07:57:32 +00:00
= 0xAA96;
2018-11-16 01:50:16 +00:00
pascal void CopyPalette(PaletteHandle srcPalette,PaletteHandle dstPalette,
2019-01-13 07:57:32 +00:00
short srcEntry,short dstEntry,short dstLength)
= 0xAAA1;
2018-11-16 01:50:16 +00:00
pascal void PmForeColor(short dstEntry)
2019-01-13 07:57:32 +00:00
= 0xAA97;
2018-11-16 01:50:16 +00:00
pascal void PmBackColor(short dstEntry)
2019-01-13 07:57:32 +00:00
= 0xAA98;
2018-11-16 01:50:16 +00:00
pascal void AnimateEntry(WindowPtr dstWindow,short dstEntry,const RGBColor *srcRGB)
2019-01-13 07:57:32 +00:00
= 0xAA99;
2018-11-16 01:50:16 +00:00
pascal void AnimatePalette(WindowPtr dstWindow,CTabHandle srcCTab,short srcIndex,
2019-01-13 07:57:32 +00:00
short dstEntry,short dstLength)
= 0xAA9A;
2018-11-16 01:50:16 +00:00
pascal void GetEntryColor(PaletteHandle srcPalette,short srcEntry,RGBColor *dstRGB)
2019-01-13 07:57:32 +00:00
= 0xAA9B;
2018-11-16 01:50:16 +00:00
pascal void SetEntryColor(PaletteHandle dstPalette,short dstEntry,const RGBColor *srcRGB)
2019-01-13 07:57:32 +00:00
= 0xAA9C;
2018-11-16 01:50:16 +00:00
pascal void GetEntryUsage(PaletteHandle srcPalette,short srcEntry,short *dstUsage,
2019-01-13 07:57:32 +00:00
short *dstTolerance)
= 0xAA9D;
2018-11-16 01:50:16 +00:00
pascal void SetEntryUsage(PaletteHandle dstPalette,short dstEntry,short srcUsage,
2019-01-13 07:57:32 +00:00
short srcTolerance)
= 0xAA9E;
2018-11-16 01:50:16 +00:00
pascal void CTab2Palette(CTabHandle srcCTab,PaletteHandle dstPalette,short srcUsage,
2019-01-13 07:57:32 +00:00
short srcTolerance)
= 0xAA9F;
2018-11-16 01:50:16 +00:00
pascal void Palette2CTab(PaletteHandle srcPalette,CTabHandle dstCTab)
2019-01-13 07:57:32 +00:00
= 0xAAA0;
2018-11-16 01:50:16 +00:00
pascal long Entry2Index(short entry)
2019-01-13 07:57:32 +00:00
= {0x7000,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void RestoreDeviceClut(GDHandle gd)
2019-01-13 07:57:32 +00:00
= {0x7002,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void ResizePalette(PaletteHandle p,short size)
2019-01-13 07:57:32 +00:00
= {0x7003,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void SaveFore(ColorSpec *c)
2019-01-13 07:57:32 +00:00
= {0x303C,0x040D,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void SaveBack(ColorSpec *c)
2019-01-13 07:57:32 +00:00
= {0x303C,0x040E,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void RestoreFore(const ColorSpec *c)
2019-01-13 07:57:32 +00:00
= {0x303C,0x040F,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void RestoreBack(const ColorSpec *c)
2019-01-13 07:57:32 +00:00
= {0x303C,0x0410,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal OSErr SetDepth(GDHandle gd,short depth,short whichFlags,short flags)
2019-01-13 07:57:32 +00:00
= {0x303C,0x0A13,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal short HasDepth(GDHandle gd,short depth,short whichFlags,short flags)
2019-01-13 07:57:32 +00:00
= {0x303C,0x0A14,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal short PMgrVersion(void)
2019-01-13 07:57:32 +00:00
= {0x7015,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal void SetPaletteUpdates(PaletteHandle p,short updates)
2019-01-13 07:57:32 +00:00
= {0x303C,0x0616,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal short GetPaletteUpdates(PaletteHandle p)
2019-01-13 07:57:32 +00:00
= {0x303C,0x0417,0xAAA2};
2018-11-16 01:50:16 +00:00
pascal Boolean GetGray(GDHandle device,const RGBColor *backGround,RGBColor *foreGround)
2019-01-13 07:57:32 +00:00
= {0x303C,0x1219,0xAAA2};
2018-11-16 01:50:16 +00:00
#ifdef __cplusplus
}
#endif
#endif