b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.5 2001/12/14 19:59:53 dawes Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/*
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCopyright 1987, 1998 The Open Group
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncthe above copyright notice appear in all copies and that both that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynccopyright notice and this permission notice appear in supporting
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncThe above copyright notice and this permission notice shall be included in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncall copies or substantial portions of the Software.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncin this Software without prior written authorization from The Open Group.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync All Rights Reserved
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncPermission to use, copy, modify, and distribute this software and its
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncdocumentation for any purpose and without fee is hereby granted,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncprovided that the above copyright notice appear in all copies and that
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncboth that copyright notice and this permission notice appear in
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncsupporting documentation, and that the name of Digital not be
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncused in advertising or publicity pertaining to distribution of the
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncsoftware without specific, written prior permission.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncSOFTWARE.
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync*/
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* $Xorg: colormap.h,v 1.4 2001/02/09 02:05:14 xorgcvs Exp $ */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#ifndef CMAP_H
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define CMAP_H 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include <X11/Xproto.h>
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "screenint.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#include "window.h"
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* these follow X.h's AllocNone and AllocAll */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define CM_PSCREEN 2
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define CM_PWIN 3
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Passed internally in colormap.c */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define REDMAP 0
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define GREENMAP 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define BLUEMAP 2
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define PSEUDOMAP 3
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AllocPrivate (-1)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AllocTemporary (-2)
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define DynamicClass 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* Values for the flags field of a colormap. These should have 1 bit set
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync * and not overlap */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define IsDefault 1
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define AllAllocated 2
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#define BeingCreated 4
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef CARD32 Pixel;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _CMEntry *EntryPtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync/* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef struct _colorResource *colorResourcePtr;
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int CreateColormap(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Colormap /*mid*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ScreenPtr /*pScreen*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync VisualPtr /*pVisual*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr* /*ppcmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*alloc*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int FreeColormap(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XID /*mid*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int TellLostMap(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync WindowPtr /*pwin*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer /* Colormap *pmid */);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int TellGainedMap(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync WindowPtr /*pwin*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer /* Colormap *pmid */);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int CopyColormapAndFree(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Colormap /*mid*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pSrc*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int AllocColor(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned short* /*pred*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned short* /*pgreen*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync unsigned short* /*pblue*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pPix*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void FakeAllocColor(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xColorItem * /*item*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern void FakeFreeColor(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel /*pixel*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsynctypedef int (*ColorCompareProcPtr)(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync EntryPtr /*pent*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xrgb * /*prgb*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int FindColor(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync EntryPtr /*pentFirst*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*size*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xrgb* /*prgb*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pPixel*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*channel*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColorCompareProcPtr /*comp*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int QueryColors(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*count*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*ppixIn*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xrgb* /*prgbList*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int FreeClientPixels(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync pointer /*pcr*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync XID /*fakeid*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int AllocColorCells(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*colors*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*planes*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool /*contig*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*ppix*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*masks*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int AllocColorPlanes(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*colors*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*r*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*g*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*b*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Bool /*contig*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pixels*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*prmask*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pgmask*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pbmask*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int FreeColors(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*client*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*count*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel* /*pixels*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Pixel /*mask*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int StoreColors(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync ColormapPtr /*pmap*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync int /*count*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync xColorItem* /*defs*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsyncextern int IsMapInstalled(
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync Colormap /*map*/,
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync WindowPtr /*pWin*/);
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync
b8e299dddd091ae24e0c08c45d91b8f937bd14d2vboxsync#endif /* CMAP_H */