3 Copyright (c) 1987 X Consortium
5 Permission is hereby granted, free of charge, to any person obtaining a copy
6 of this software and associated documentation files (the "Software"), to deal
7 in the Software without restriction, including without limitation the rights
8 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 copies of the Software, and to permit persons to whom the Software is
10 furnished to do so, subject to the following conditions:
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
15 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 Except as contained in this notice, the name of the X Consortium shall not be
23 used in advertising or otherwise to promote the sale, use or other dealings
24 in this Software without prior written authorization from the X Consortium.
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
31 Permission to use, copy, modify, and distribute this software and its
32 documentation for any purpose and without fee is hereby granted,
33 provided that the above copyright notice appear in all copies and that
34 both that copyright notice and this permission notice appear in
35 supporting documentation, and that the name of Digital not be
36 used in advertising or publicity pertaining to distribution of the
37 software without specific, written prior permission.
39 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
40 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
41 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
42 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
43 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
44 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
48 /* $XConsortium: colormap.h,v 1.28 94/04/17 20:25:32 dpw Exp $ */
53 /* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.2 1997/01/14 22:22:38 dawes Exp $ */
57 #include "X11/Xproto.h"
58 #include "screenint.h"
61 /* these follow X.h's AllocNone and AllocAll */
64 /* Passed internally in colormap.c */
69 #define AllocPrivate (-1)
70 #define AllocTemporary (-2)
71 #define DynamicClass 1
73 /* Values for the flags field of a colormap. These should have 1 bit set
76 #define AllAllocated 2
77 #define BeingCreated 4
81 typedef struct _CMEntry *EntryPtr;
82 /* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
83 typedef struct _colorResource *colorResourcePtr;
85 extern int CreateColormap(
86 #if NeedFunctionPrototypes
88 ScreenPtr /*pScreen*/,
89 VisualPtr /*pVisual*/,
90 ColormapPtr* /*ppcmap*/,
96 extern int FreeColormap(
97 #if NeedFunctionPrototypes
103 extern int TellLostMap(
104 #if NeedFunctionPrototypes
106 pointer /* Colormap *pmid */
110 extern int TellGainedMap(
111 #if NeedFunctionPrototypes
113 pointer /* Colormap *pmid */
117 extern int CopyColormapAndFree(
118 #if NeedFunctionPrototypes
120 ColormapPtr /*pSrc*/,
125 extern int AllocColor(
126 #if NeedFunctionPrototypes
127 ColormapPtr /*pmap*/,
128 unsigned short* /*pred*/,
129 unsigned short* /*pgreen*/,
130 unsigned short* /*pblue*/,
136 extern void FakeAllocColor(
137 #if NeedFunctionPrototypes
138 ColormapPtr /*pmap*/,
139 xColorItem * /*item*/
143 extern void FakeFreeColor(
144 #if NeedFunctionPrototypes
145 ColormapPtr /*pmap*/,
150 typedef int (*ColorCompareProcPtr)(
151 #if NeedNestedPrototypes
157 extern int FindColor(
158 #if NeedFunctionPrototypes
159 ColormapPtr /*pmap*/,
160 EntryPtr /*pentFirst*/,
166 ColorCompareProcPtr /*comp*/
170 extern int QueryColors(
171 #if NeedFunctionPrototypes
172 ColormapPtr /*pmap*/,
179 extern int FreeClientPixels(
180 #if NeedFunctionPrototypes
186 extern int AllocColorCells(
187 #if NeedFunctionPrototypes
189 ColormapPtr /*pmap*/,
198 extern int AllocColorPlanes(
199 #if NeedFunctionPrototypes
201 ColormapPtr /*pmap*/,
214 extern int FreeColors(
215 #if NeedFunctionPrototypes
216 ColormapPtr /*pmap*/,
224 extern int StoreColors(
225 #if NeedFunctionPrototypes
226 ColormapPtr /*pmap*/,
232 extern int IsMapInstalled(
233 #if NeedFunctionPrototypes