xref: /386bsd/usr/X386/lib/Server/include/colormap.h (revision a2142627)
1 /*
2 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
3 and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
4 
5                         All Rights Reserved
6 
7 Permission to use, copy, modify, and distribute this software and its
8 documentation for any purpose and without fee is hereby granted,
9 provided that the above copyright notice appear in all copies and that
10 both that copyright notice and this permission notice appear in
11 supporting documentation, and that the names of Digital or MIT not be
12 used in advertising or publicity pertaining to distribution of the
13 software without specific, written prior permission.
14 
15 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
16 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
17 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
18 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
19 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
20 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
21 SOFTWARE.
22 
23 */
24 /* $XConsortium: colormap.h,v 1.22 90/01/13 17:30:13 rws Exp $ */
25 #ifndef CMAP_H
26 #define CMAP_H 1
27 
28 /* these follow X.h's AllocNone and AllocAll */
29 #define CM_PSCREEN 2
30 #define CM_PWIN	   3
31 /* Passed internally in colormap.c */
32 #define REDMAP 0
33 #define GREENMAP 1
34 #define BLUEMAP 2
35 #define PSEUDOMAP 3
36 #define AllocPrivate (-1)
37 #define AllocTemporary (-2)
38 #define DynamicClass  1
39 
40 #ifdef notdef
41 /* Gets the color from a cell as an Rvalue */
42 #define RRED(cell) (((cell)->fShared) ? ((cell)->co.shco.red->color): \
43 		    ((cell)->co.local.red))
44 #define RGREEN(cell) (((cell)->fShared) ? ((cell)->co.shco.green->color): \
45 		    ((cell)->co.local.green))
46 #define RBLUE(cell) (((cell)->fShared) ? ((cell)->co.shco.blue->color): \
47 		    ((cell)->co.local.blue))
48 
49 /* Gets the color from a cell as an L value */
50 #define LRED(cell) (((cell)->fShared) ? (&((cell)->co.shco.red->color)) : \
51 		    (&((cell)->co.local.red)))
52 #define LGREEN(cell) (((cell)->fShared) ? (&((cell)->co.shco.green->color)) : \
53 		    (&((cell)->co.local.green)))
54 #define LBLUE(cell) (((cell)->fShared) ? (&((cell)->co.shco.blue->color)) : \
55 		    (&((cell)->co.local.blue)))
56 #endif
57 
58 /* Values for the flags field of a colormap. These should have 1 bit set
59  * and not overlap */
60 #define IsDefault 1
61 #define AllAllocated 2
62 #define BeingCreated 4
63 
64 
65 typedef unsigned long	Pixel;
66 typedef struct _CMEntry *EntryPtr;
67 typedef struct _ColormapRec *ColormapPtr;
68 
69 extern int CreateColormap();
70 extern int FindColor();
71 extern int FreeColormap();
72 extern int TellLostMap();
73 extern int TellGainedMap();
74 extern int IsMapInstalled();
75 extern void UninstallColormap();
76 
77 #endif /* CMAP_H */
78