]> git.sesse.net Git - rdpsrv/blob - Xserver/programs/Xserver/include/colormapst.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / programs / Xserver / include / colormapst.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: colormapst.h /main/4 1996/06/17 10:54:31 mor $ */
49 #ifndef CMAPSTRUCT_H
50 #define CMAPSTRUCT_H 1
51
52 #include "colormap.h"
53 #include "screenint.h"
54
55 /* Shared color -- the color is used by AllocColorPlanes */
56 typedef struct
57 {
58     unsigned short color;
59     short  refcnt;
60 } SHAREDCOLOR;
61
62 /* LOCO -- a local color for a PseudoColor cell. DirectColor maps always
63  * use the first value (called red) in the structure.  What channel they
64  * are really talking about depends on which map they are in. */
65 typedef struct
66 {
67     unsigned short      red, green, blue;
68 } LOCO;
69
70 /* SHCO -- a shared color for a PseudoColor cell. Used with AllocColorPlanes.
71  * DirectColor maps always use the first value (called red) in the structure.
72  * What channel they are really talking about depends on which map they
73  * are in. */
74 typedef struct 
75 {
76     SHAREDCOLOR *red, *green, *blue;
77 } SHCO;
78
79
80 /* color map entry */
81 typedef struct _CMEntry
82 {
83     union
84     {
85         LOCO    local;
86         SHCO    shco;
87     } co;
88     short       refcnt;
89     Bool        fShared;
90 } Entry;
91
92 /* COLORMAPs can be used for either Direct or Pseudo color.  PseudoColor
93  * only needs one cell table, we arbitrarily pick red.  We keep track
94  * of that table with freeRed, numPixelsRed, and clientPixelsRed */
95
96 typedef struct _ColormapRec
97 {
98     VisualPtr   pVisual;
99 #if defined(__cplusplus) || defined(c_plusplus)
100     short       c_class;
101 #else
102     short       class;          /* PseudoColor or DirectColor */
103 #endif
104     long        mid;            /* client's name for colormap */
105     ScreenPtr   pScreen;        /* screen map is associated with */
106     short       flags;          /* 1 = IsDefault
107                                  * 2 = AllAllocated */
108     int         freeRed;
109     int         freeGreen;
110     int         freeBlue;
111     int         *numPixelsRed;  
112     int         *numPixelsGreen;        
113     int         *numPixelsBlue; 
114     Pixel       **clientPixelsRed;
115     Pixel       **clientPixelsGreen;
116     Pixel       **clientPixelsBlue;
117     Entry       *red;
118     Entry       *green;
119     Entry       *blue;
120     pointer     devPriv;
121     DevUnion    *devPrivates;   /* dynamic devPrivates added after devPriv
122                                    already existed - must keep devPriv */
123 } ColormapRec;
124               
125 #endif /* COLORMAP_H */