|
|
1.1 root 1: /************************************************************
2: Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
3:
4: All Rights Reserved
5:
6: Permission to use, copy, modify, and distribute this
7: software and its documentation for any purpose and without
8: fee is hereby granted, provided that the above copyright no-
9: tice appear in all copies and that both that copyright no-
10: tice and this permission notice appear in supporting docu-
11: mentation, and that the names of Sun or MIT not be used in
12: advertising or publicity pertaining to distribution of the
13: software without specific prior written permission. Sun and
14: M.I.T. make no representations about the suitability of this
15: software for any purpose. It is provided "as is" without any
16: express or implied warranty.
17:
18: SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
19: INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
20: NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI-
21: ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
22: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
23: PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
24: OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH
25: THE USE OR PERFORMANCE OF THIS SOFTWARE.
26:
27: ********************************************************/
28:
29:
30: #include "X.h"
31: #include "scrnintstr.h"
32: #include "colormap.h"
33: #include "colormapst.h"
34: #include "resource.h"
35:
36: int
37: cfbListInstalledColormaps(pScreen, pmaps)
38: ScreenPtr pScreen;
39: Colormap *pmaps;
40: {
41: *pmaps = pScreen->defColormap;
42: return (1);
43: }
44:
45: #ifdef STATIC_COLOR
46: void
47: cfbResolveStaticColor(pred, pgreen, pblue, pVisual)
48: unsigned short *pred, *pgreen, *pblue;
49: VisualPtr pVisual;
50: {
51: /* XXX - this works for the StaticColor visual ONLY */
52: *pred &= 0xe000;
53: *pgreen &= 0xe000;
54: *pblue &= 0xc000;
55: }
56: #endif
57:
58: ColormapPtr
59: cfbGetStaticColormap(pVisual)
60: VisualPtr pVisual;
61: {
62: return (
63: (ColormapPtr)
64: LookupID(screenInfo.screen[pVisual->screen].defColormap,
65: RT_COLORMAP, RC_CORE)
66: );
67: }
68:
69: void
70: cfbInitialize332Colormap(pmap)
71: ColormapPtr pmap;
72: {
73: int i;
74:
75: for(i = 0; i < pmap->pVisual->ColormapEntries; i++)
76: {
77: /* XXX - assume 256 for now */
78: pmap->red[i].co.local.red = (i & 0x7) << 13;
79: pmap->red[i].co.local.green = (i & 0x38) << 10;
80: pmap->red[i].co.local.blue = (i & 0xc0) << 8;
81: }
82: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.