1706f2543Smrg
2706f2543Smrg#include "colormapst.h"
3706f2543Smrg
4706f2543Smrg#ifndef _MICMAP_H_
5706f2543Smrg#define _MICMAP_H_
6706f2543Smrg
7706f2543Smrg#define GetInstalledmiColormap(s) \
8706f2543Smrg    ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, micmapScrPrivateKey))
9706f2543Smrg#define SetInstalledmiColormap(s,c) \
10706f2543Smrg    (dixSetPrivate(&(s)->devPrivates, micmapScrPrivateKey, c))
11706f2543Smrg
12706f2543Smrgextern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec;
13706f2543Smrg#define micmapScrPrivateKey (&micmapScrPrivateKeyRec)
14706f2543Smrg
15706f2543Smrgtypedef Bool (* miInitVisualsProcPtr)(VisualPtr *, DepthPtr *, int *, int *,
16706f2543Smrg					int *, VisualID *, unsigned long, int,
17706f2543Smrg					int);
18706f2543Smrg
19706f2543Smrgextern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
20706f2543Smrgextern _X_EXPORT void miInstallColormap(ColormapPtr pmap);
21706f2543Smrgextern _X_EXPORT void miUninstallColormap(ColormapPtr pmap);
22706f2543Smrg
23706f2543Smrgextern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *, unsigned short *,
24706f2543Smrg			VisualPtr);
25706f2543Smrgextern _X_EXPORT Bool miInitializeColormap(ColormapPtr);
26706f2543Smrgextern _X_EXPORT int miExpandDirectColors(ColormapPtr, int, xColorItem *, xColorItem *);
27706f2543Smrgextern _X_EXPORT Bool miCreateDefColormap(ScreenPtr);
28706f2543Smrgextern _X_EXPORT void miClearVisualTypes(void);
29706f2543Smrgextern _X_EXPORT Bool miSetVisualTypes(int, int, int, int);
30706f2543Smrgextern _X_EXPORT Bool miSetPixmapDepths(void);
31706f2543Smrgextern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
32706f2543Smrg			      int preferredCVC,
33706f2543Smrg			      Pixel redMask, Pixel greenMask, Pixel blueMask);
34706f2543Smrgextern _X_EXPORT int miGetDefaultVisualMask(int);
35706f2543Smrgextern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *, int *, VisualID *,
36706f2543Smrg			unsigned long, int, int);
37706f2543Smrg
38706f2543Smrg#define MAX_PSEUDO_DEPTH	10
39706f2543Smrg#define MIN_TRUE_DEPTH		6
40706f2543Smrg
41706f2543Smrg#define StaticGrayMask	(1 << StaticGray)
42706f2543Smrg#define GrayScaleMask	(1 << GrayScale)
43706f2543Smrg#define StaticColorMask	(1 << StaticColor)
44706f2543Smrg#define PseudoColorMask	(1 << PseudoColor)
45706f2543Smrg#define TrueColorMask	(1 << TrueColor)
46706f2543Smrg#define DirectColorMask	(1 << DirectColor)
47706f2543Smrg
48706f2543Smrg#define ALL_VISUALS	(StaticGrayMask|\
49706f2543Smrg			 GrayScaleMask|\
50706f2543Smrg			 StaticColorMask|\
51706f2543Smrg			 PseudoColorMask|\
52706f2543Smrg			 TrueColorMask|\
53706f2543Smrg			 DirectColorMask)
54706f2543Smrg
55706f2543Smrg#define LARGE_VISUALS	(TrueColorMask|\
56706f2543Smrg			 DirectColorMask)
57706f2543Smrg
58706f2543Smrg#define SMALL_VISUALS	(StaticGrayMask|\
59706f2543Smrg			 GrayScaleMask|\
60706f2543Smrg			 StaticColorMask|\
61706f2543Smrg			 PseudoColorMask)
62706f2543Smrg
63706f2543Smrg#endif /* _MICMAP_H_ */
64