b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/*
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Copyright 2002-2004 Red Hat Inc., Durham, North Carolina.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * All Rights Reserved.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Permission is hereby granted, free of charge, to any person obtaining
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * a copy of this software and associated documentation files (the
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * "Software"), to deal in the Software without restriction, including
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * without limitation on the rights to use, copy, modify, merge,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * publish, distribute, sublicense, and/or sell copies of the Software,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * and to permit persons to whom the Software is furnished to do so,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * subject to the following conditions:
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * The above copyright notice and this permission notice (including the
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * next paragraph) shall be included in all copies or substantial
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * portions of the Software.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * NON-INFRINGEMENT. IN NO EVENT SHALL RED HAT AND/OR THEIR SUPPLIERS
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * SOFTWARE.
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/*
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Authors:
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Kevin E. Martin <kem@redhat.com>
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync *
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/** \file
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync * Header file for colormap support. \see dmxcmap.c. */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#ifndef DMXCMAP_H
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define DMXCMAP_H
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#include "colormapst.h"
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/** Colormap private area. */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsynctypedef struct _dmxColormapPriv {
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync Colormap cmap;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync} dmxColormapPrivRec, *dmxColormapPrivPtr;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern Bool dmxCreateColormap(ColormapPtr pColormap);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern void dmxDestroyColormap(ColormapPtr pColormap);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern void dmxInstallColormap(ColormapPtr pColormap);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern void dmxStoreColors(ColormapPtr pColormap, int ndef, xColorItem *pdef);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern Bool dmxCreateDefColormap(ScreenPtr pScreen);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern Bool dmxBECreateColormap(ColormapPtr pColormap);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern Bool dmxBEFreeColormap(ColormapPtr pColormap);
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/** Private index. \see dmxcmap.c \see dmxscrinit.c \see dmxwindow.c */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsyncextern DevPrivateKey dmxColormapPrivateKey;
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/** Set colormap private structure. */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define DMX_SET_COLORMAP_PRIV(_pCMap, _pCMapPriv) \
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync dixSetPrivate(&(_pCMap)->devPrivates, dmxColormapPrivateKey, _pCMapPriv)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync/** Get colormap private structure. */
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#define DMX_GET_COLORMAP_PRIV(_pCMap) (dmxColormapPrivPtr) \
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync dixLookupPrivate(&(_pCMap)->devPrivates, dmxColormapPrivateKey)
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync
b9a21c3c91c47e090316e28d759194e46628ed49vboxsync#endif /* DMXCMAP_H */