105b261ecSmrg
205b261ecSmrg#include "colormapst.h"
305b261ecSmrg
405b261ecSmrg#ifndef _MICMAP_H_
505b261ecSmrg#define _MICMAP_H_
605b261ecSmrg
76747b715Smrg#define GetInstalledmiColormap(s) \
86747b715Smrg    ((ColormapPtr) dixLookupPrivate(&(s)->devPrivates, micmapScrPrivateKey))
96747b715Smrg#define SetInstalledmiColormap(s,c) \
106747b715Smrg    (dixSetPrivate(&(s)->devPrivates, micmapScrPrivateKey, c))
116747b715Smrg
126747b715Smrgextern _X_EXPORT DevPrivateKeyRec micmapScrPrivateKeyRec;
1335c4bbdfSmrg
146747b715Smrg#define micmapScrPrivateKey (&micmapScrPrivateKeyRec)
1505b261ecSmrg
1635c4bbdfSmrgtypedef Bool (*miInitVisualsProcPtr) (VisualPtr *, DepthPtr *, int *, int *,
1735c4bbdfSmrg                                      int *, VisualID *, unsigned long, int,
1835c4bbdfSmrg                                      int);
1905b261ecSmrg
2035c4bbdfSmrgextern _X_EXPORT int miListInstalledColormaps(ScreenPtr pScreen,
2135c4bbdfSmrg                                              Colormap * pmaps);
226747b715Smrgextern _X_EXPORT void miInstallColormap(ColormapPtr pmap);
236747b715Smrgextern _X_EXPORT void miUninstallColormap(ColormapPtr pmap);
2405b261ecSmrg
2535c4bbdfSmrgextern _X_EXPORT void miResolveColor(unsigned short *, unsigned short *,
2635c4bbdfSmrg                                     unsigned short *, VisualPtr);
276747b715Smrgextern _X_EXPORT Bool miInitializeColormap(ColormapPtr);
2835c4bbdfSmrgextern _X_EXPORT int miExpandDirectColors(ColormapPtr, int, xColorItem *,
2935c4bbdfSmrg                                          xColorItem *);
306747b715Smrgextern _X_EXPORT Bool miCreateDefColormap(ScreenPtr);
316747b715Smrgextern _X_EXPORT void miClearVisualTypes(void);
326747b715Smrgextern _X_EXPORT Bool miSetVisualTypes(int, int, int, int);
336747b715Smrgextern _X_EXPORT Bool miSetPixmapDepths(void);
3435c4bbdfSmrgextern _X_EXPORT Bool miSetVisualTypesAndMasks(int depth, int visuals,
3535c4bbdfSmrg                                               int bitsPerRGB, int preferredCVC,
3635c4bbdfSmrg                                               Pixel redMask, Pixel greenMask,
3735c4bbdfSmrg                                               Pixel blueMask);
386747b715Smrgextern _X_EXPORT int miGetDefaultVisualMask(int);
3935c4bbdfSmrgextern _X_EXPORT Bool miInitVisuals(VisualPtr *, DepthPtr *, int *, int *,
4035c4bbdfSmrg                                    int *, VisualID *, unsigned long, int, int);
4105b261ecSmrg
4205b261ecSmrg#define MAX_PSEUDO_DEPTH	10
4305b261ecSmrg#define MIN_TRUE_DEPTH		6
4405b261ecSmrg
4505b261ecSmrg#define StaticGrayMask	(1 << StaticGray)
4605b261ecSmrg#define GrayScaleMask	(1 << GrayScale)
4705b261ecSmrg#define StaticColorMask	(1 << StaticColor)
4805b261ecSmrg#define PseudoColorMask	(1 << PseudoColor)
4905b261ecSmrg#define TrueColorMask	(1 << TrueColor)
5005b261ecSmrg#define DirectColorMask	(1 << DirectColor)
5135c4bbdfSmrg
5205b261ecSmrg#define ALL_VISUALS	(StaticGrayMask|\
5305b261ecSmrg			 GrayScaleMask|\
5405b261ecSmrg			 StaticColorMask|\
5505b261ecSmrg			 PseudoColorMask|\
5605b261ecSmrg			 TrueColorMask|\
5705b261ecSmrg			 DirectColorMask)
5805b261ecSmrg
5905b261ecSmrg#define LARGE_VISUALS	(TrueColorMask|\
6005b261ecSmrg			 DirectColorMask)
6105b261ecSmrg
6205b261ecSmrg#define SMALL_VISUALS	(StaticGrayMask|\
6305b261ecSmrg			 GrayScaleMask|\
6405b261ecSmrg			 StaticColorMask|\
6505b261ecSmrg			 PseudoColorMask)
6605b261ecSmrg
6735c4bbdfSmrg#endif                          /* _MICMAP_H_ */
68