]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/colormap.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / programs / Xserver / include / colormap.h
1 /*
2
3 Copyright (c) 1987  X Consortium
4
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:
11
12 The above copyright notice and this permission notice shall be included in
13 all copies or substantial portions of the Software.
14
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.
21
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.
25
26
27 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
28
29                         All Rights Reserved
30
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.  
38
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
45 SOFTWARE.
46
47 */
48 /* $XConsortium: colormap.h,v 1.28 94/04/17 20:25:32 dpw Exp $ */
49
50
51
52
53 /* $XFree86: xc/programs/Xserver/include/colormap.h,v 1.2 1997/01/14 22:22:38 dawes Exp $ */
54 #ifndef CMAP_H
55 #define CMAP_H 1
56
57 #include "X11/Xproto.h"
58 #include "screenint.h"
59 #include "window.h"
60
61 /* these follow X.h's AllocNone and AllocAll */
62 #define CM_PSCREEN 2
63 #define CM_PWIN    3
64 /* Passed internally in colormap.c */
65 #define REDMAP 0
66 #define GREENMAP 1
67 #define BLUEMAP 2
68 #define PSEUDOMAP 3
69 #define AllocPrivate (-1)
70 #define AllocTemporary (-2)
71 #define DynamicClass  1
72
73 /* Values for the flags field of a colormap. These should have 1 bit set
74  * and not overlap */
75 #define IsDefault 1
76 #define AllAllocated 2
77 #define BeingCreated 4
78
79
80 typedef CARD32 Pixel;
81 typedef struct _CMEntry *EntryPtr;
82 /* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
83 typedef struct _colorResource *colorResourcePtr;
84
85 extern int CreateColormap(
86 #if NeedFunctionPrototypes
87     Colormap /*mid*/,
88     ScreenPtr /*pScreen*/,
89     VisualPtr /*pVisual*/,
90     ColormapPtr* /*ppcmap*/,
91     int /*alloc*/,
92     int /*client*/
93 #endif
94 );
95
96 extern int FreeColormap(
97 #if NeedFunctionPrototypes
98     pointer /*pmap*/,
99     XID /*mid*/
100 #endif
101 );
102
103 extern int TellLostMap(
104 #if NeedFunctionPrototypes
105     WindowPtr /*pwin*/,
106     pointer /* Colormap *pmid */
107 #endif
108 );
109
110 extern int TellGainedMap(
111 #if NeedFunctionPrototypes
112     WindowPtr /*pwin*/,
113     pointer /* Colormap *pmid */
114 #endif
115 );
116
117 extern int CopyColormapAndFree(
118 #if NeedFunctionPrototypes
119     Colormap /*mid*/,
120     ColormapPtr /*pSrc*/,
121     int /*client*/
122 #endif
123 );
124
125 extern int AllocColor(
126 #if NeedFunctionPrototypes
127     ColormapPtr /*pmap*/,
128     unsigned short* /*pred*/,
129     unsigned short* /*pgreen*/,
130     unsigned short* /*pblue*/,
131     Pixel* /*pPix*/,
132     int /*client*/
133 #endif
134 );
135
136 extern void FakeAllocColor(
137 #if NeedFunctionPrototypes
138     ColormapPtr /*pmap*/,
139     xColorItem * /*item*/
140 #endif
141 );
142
143 extern void FakeFreeColor(
144 #if NeedFunctionPrototypes
145     ColormapPtr /*pmap*/,
146     Pixel /*pixel*/
147 #endif
148 );
149
150 typedef int (*ColorCompareProcPtr)(
151 #if NeedNestedPrototypes
152     EntryPtr /*pent*/,
153     xrgb * /*prgb*/
154 #endif
155 );
156
157 extern int FindColor(
158 #if NeedFunctionPrototypes
159     ColormapPtr /*pmap*/,
160     EntryPtr /*pentFirst*/,
161     int /*size*/,
162     xrgb* /*prgb*/,
163     Pixel* /*pPixel*/,
164     int /*channel*/,
165     int /*client*/,
166     ColorCompareProcPtr /*comp*/
167 #endif
168 );
169
170 extern int QueryColors(
171 #if NeedFunctionPrototypes
172     ColormapPtr /*pmap*/,
173     int /*count*/,
174     Pixel* /*ppixIn*/,
175     xrgb* /*prgbList*/
176 #endif
177 );
178
179 extern int FreeClientPixels(
180 #if NeedFunctionPrototypes
181     pointer /*pcr*/,
182     XID /*fakeid*/
183 #endif
184 );
185
186 extern int AllocColorCells(
187 #if NeedFunctionPrototypes
188     int /*client*/,
189     ColormapPtr /*pmap*/,
190     int /*colors*/,
191     int /*planes*/,
192     Bool /*contig*/,
193     Pixel* /*ppix*/,
194     Pixel* /*masks*/
195 #endif
196 );
197
198 extern int AllocColorPlanes(
199 #if NeedFunctionPrototypes
200     int /*client*/,
201     ColormapPtr /*pmap*/,
202     int /*colors*/,
203     int /*r*/,
204     int /*g*/,
205     int /*b*/,
206     Bool /*contig*/,
207     Pixel* /*pixels*/,
208     Pixel* /*prmask*/,
209     Pixel* /*pgmask*/,
210     Pixel* /*pbmask*/
211 #endif
212 );
213
214 extern int FreeColors(
215 #if NeedFunctionPrototypes
216     ColormapPtr /*pmap*/,
217     int /*client*/,
218     int /*count*/,
219     Pixel* /*pixels*/,
220     Pixel /*mask*/
221 #endif
222 );
223
224 extern int StoreColors(
225 #if NeedFunctionPrototypes
226     ColormapPtr /*pmap*/,
227     int /*count*/,
228     xColorItem* /*defs*/
229 #endif
230 );
231
232 extern int IsMapInstalled(
233 #if NeedFunctionPrototypes
234     Colormap /*map*/,
235     WindowPtr /*pWin*/
236 #endif
237 );
238
239 #endif /* CMAP_H */