home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Developer Kit / QuickTime 2.0 Developer Kit.iso / mac / MAC / Programming Stuff / Interfaces / CIncludes / Palettes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-11  |  5.7 KB  |  164 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Palettes.h
  3.  
  4.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  5.                  All rights reserved.
  6.  
  7.      Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8.  
  9.      Bugs?:        If you find a problem with this file, send the file and version
  10.                  information (from above) and the problem description to:
  11.  
  12.                      Internet:    apple.bugs@applelink.apple.com
  13.                      AppleLink:    APPLE.BUGS
  14.  
  15. */
  16.  
  17. #ifndef __PALETTES__
  18. #define __PALETTES__
  19.  
  20.  
  21. #ifndef __QUICKDRAW__
  22. #include <Quickdraw.h>
  23. #endif
  24. /*    #include <Types.h>                                            */
  25. /*        #include <ConditionalMacros.h>                            */
  26. /*    #include <MixedMode.h>                                        */
  27. /*    #include <QuickdrawText.h>                                    */
  28.  
  29. #ifndef __WINDOWS__
  30. #include <Windows.h>
  31. #endif
  32. /*    #include <Memory.h>                                            */
  33. /*    #include <Events.h>                                            */
  34. /*        #include <OSUtils.h>                                    */
  35. /*    #include <Controls.h>                                        */
  36. /*        #include <Menus.h>                                        */
  37.  
  38. #ifdef __cplusplus
  39. extern "C" {
  40. #endif
  41.  
  42. #if GENERATINGPOWERPC
  43. #pragma options align=mac68k
  44. #endif
  45.  
  46. #ifdef __CFM68K__
  47. #pragma lib_export on
  48. #endif
  49.  
  50.  
  51. enum {
  52.     pmCourteous                    = 0,                            /*Record use of color on each device touched.*/
  53.     pmTolerant                    = 0x0002,                        /*render ciRGB if ciTolerance is exceeded by best match.*/
  54.     pmAnimated                    = 0x0004,                        /*reserve an index on each device touched and render ciRGB.*/
  55.     pmExplicit                    = 0x0008,                        /*no reserve, no render, no record; stuff index into port.*/
  56.     pmWhite                        = 0x0010,
  57.     pmBlack                        = 0x0020,
  58.     pmInhibitG2                    = 0x0100,
  59.     pmInhibitC2                    = 0x0200,
  60.     pmInhibitG4                    = 0x0400,
  61.     pmInhibitC4                    = 0x0800,
  62.     pmInhibitG8                    = 0x1000,
  63.     pmInhibitC8                    = 0x2000,
  64. /* NSetPalette Update Constants */
  65.     pmNoUpdates                    = 0x8000,                        /*no updates*/
  66.     pmBkUpdates                    = 0xA000,                        /*background updates only*/
  67.     pmFgUpdates                    = 0xC000,                        /*foreground updates only*/
  68.     pmAllUpdates                = 0xE000                        /*all updates*/
  69. };
  70.  
  71. struct ColorInfo {
  72.     RGBColor                        ciRGB;                        /*true RGB values*/
  73.     short                            ciUsage;                    /*color usage*/
  74.     short                            ciTolerance;                /*tolerance value*/
  75.     short                            ciDataFields[3];            /*private fields*/
  76. };
  77. typedef struct ColorInfo ColorInfo;
  78.  
  79. struct Palette {
  80.     short                            pmEntries;                    /*entries in pmTable*/
  81.     short                            pmDataFields[7];            /*private fields*/
  82.     ColorInfo                        pmInfo[1];
  83. };
  84. typedef struct Palette Palette, *PalettePtr, **PaletteHandle;
  85.  
  86. extern pascal void InitPalettes(void)
  87.  ONEWORDINLINE(0xAA90);
  88. extern pascal PaletteHandle NewPalette(short entries, CTabHandle srcColors, short srcUsage, short srcTolerance)
  89.  ONEWORDINLINE(0xAA91);
  90. extern pascal PaletteHandle GetNewPalette(short PaletteID)
  91.  ONEWORDINLINE(0xAA92);
  92. extern pascal void DisposePalette(PaletteHandle srcPalette)
  93.  ONEWORDINLINE(0xAA93);
  94. extern pascal void ActivatePalette(WindowPtr srcWindow)
  95.  ONEWORDINLINE(0xAA94);
  96. extern pascal void SetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, Boolean cUpdates)
  97.  ONEWORDINLINE(0xAA95);
  98. extern pascal void NSetPalette(WindowPtr dstWindow, PaletteHandle srcPalette, short nCUpdates)
  99.  ONEWORDINLINE(0xAA95);
  100. extern pascal PaletteHandle GetPalette(WindowPtr srcWindow)
  101.  ONEWORDINLINE(0xAA96);
  102. extern pascal void CopyPalette(PaletteHandle srcPalette, PaletteHandle dstPalette, short srcEntry, short dstEntry, short dstLength)
  103.  ONEWORDINLINE(0xAAA1);
  104. extern pascal void PmForeColor(short dstEntry)
  105.  ONEWORDINLINE(0xAA97);
  106. extern pascal void PmBackColor(short dstEntry)
  107.  ONEWORDINLINE(0xAA98);
  108. extern pascal void AnimateEntry(WindowPtr dstWindow, short dstEntry, const RGBColor *srcRGB)
  109.  ONEWORDINLINE(0xAA99);
  110. extern pascal void AnimatePalette(WindowPtr dstWindow, CTabHandle srcCTab, short srcIndex, short dstEntry, short dstLength)
  111.  ONEWORDINLINE(0xAA9A);
  112. extern pascal void GetEntryColor(PaletteHandle srcPalette, short srcEntry, RGBColor *dstRGB)
  113.  ONEWORDINLINE(0xAA9B);
  114. extern pascal void SetEntryColor(PaletteHandle dstPalette, short dstEntry, const RGBColor *srcRGB)
  115.  ONEWORDINLINE(0xAA9C);
  116. extern pascal void GetEntryUsage(PaletteHandle srcPalette, short srcEntry, short *dstUsage, short *dstTolerance)
  117.  ONEWORDINLINE(0xAA9D);
  118. extern pascal void SetEntryUsage(PaletteHandle dstPalette, short dstEntry, short srcUsage, short srcTolerance)
  119.  ONEWORDINLINE(0xAA9E);
  120. extern pascal void CTab2Palette(CTabHandle srcCTab, PaletteHandle dstPalette, short srcUsage, short srcTolerance)
  121.  ONEWORDINLINE(0xAA9F);
  122. extern pascal void Palette2CTab(PaletteHandle srcPalette, CTabHandle dstCTab)
  123.  ONEWORDINLINE(0xAAA0);
  124. extern pascal long Entry2Index(short entry)
  125.  TWOWORDINLINE(0x7000, 0xAAA2);
  126. extern pascal void RestoreDeviceClut(GDHandle gd)
  127.  TWOWORDINLINE(0x7002, 0xAAA2);
  128. extern pascal void ResizePalette(PaletteHandle p, short size)
  129.  TWOWORDINLINE(0x7003, 0xAAA2);
  130. extern pascal void SaveFore(ColorSpec *c)
  131.  THREEWORDINLINE(0x303C, 0x040D, 0xAAA2);
  132. extern pascal void SaveBack(ColorSpec *c)
  133.  THREEWORDINLINE(0x303C, 0x040E, 0xAAA2);
  134. extern pascal void RestoreFore(const ColorSpec *c)
  135.  THREEWORDINLINE(0x303C, 0x040F, 0xAAA2);
  136. extern pascal void RestoreBack(const ColorSpec *c)
  137.  THREEWORDINLINE(0x303C, 0x0410, 0xAAA2);
  138. extern pascal OSErr SetDepth(GDHandle gd, short depth, short whichFlags, short flags)
  139.  THREEWORDINLINE(0x303C, 0x0A13, 0xAAA2);
  140. extern pascal short HasDepth(GDHandle gd, short depth, short whichFlags, short flags)
  141.  THREEWORDINLINE(0x303C, 0x0A14, 0xAAA2);
  142. extern pascal short PMgrVersion(void)
  143.  TWOWORDINLINE(0x7015, 0xAAA2);
  144. extern pascal void SetPaletteUpdates(PaletteHandle p, short updates)
  145.  THREEWORDINLINE(0x303C, 0x0616, 0xAAA2);
  146. extern pascal short GetPaletteUpdates(PaletteHandle p)
  147.  THREEWORDINLINE(0x303C, 0x0417, 0xAAA2);
  148. extern pascal Boolean GetGray(GDHandle device, const RGBColor *backGround, RGBColor *foreGround)
  149.  THREEWORDINLINE(0x303C, 0x0C19, 0xAAA2);
  150.  
  151. #ifdef __CFM68K__
  152. #pragma lib_export off
  153. #endif
  154.  
  155. #if GENERATINGPOWERPC
  156. #pragma options align=reset
  157. #endif
  158.  
  159. #ifdef __cplusplus
  160. }
  161. #endif
  162.  
  163. #endif /* __PALETTES__ */
  164.