~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to cfb/cfbcmap.c

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $Xorg: cfbcmap.c,v 1.3 2000/08/17 19:48:13 cpqbld Exp $ */
 
2
/************************************************************
 
3
Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
 
4
 
 
5
                    All Rights Reserved
 
6
 
 
7
Permission  to  use,  copy,  modify,  and  distribute   this
 
8
software  and  its documentation for any purpose and without
 
9
fee is hereby granted, provided that the above copyright no-
 
10
tice  appear  in all copies and that both that copyright no-
 
11
tice and this permission notice appear in  supporting  docu-
 
12
mentation,  and  that the names of Sun or The Open Group
 
13
not be used in advertising or publicity pertaining to 
 
14
distribution  of  the software  without specific prior 
 
15
written permission. Sun and The Open Group make no 
 
16
representations about the suitability of this software for 
 
17
any purpose. It is provided "as is" without any express or 
 
18
implied warranty.
 
19
 
 
20
SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
 
21
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
 
22
NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
 
23
ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
24
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
 
25
PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
 
26
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
 
27
THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
28
 
 
29
********************************************************/
 
30
/* $XFree86: xc/programs/Xserver/cfb/cfbcmap.c,v 3.12 2000/02/12 03:39:23 dawes Exp $ */
 
31
 
 
32
 
 
33
#ifdef HAVE_DIX_CONFIG_H
 
34
#include <dix-config.h>
 
35
#endif
 
36
 
 
37
#include <X11/X.h>
 
38
#include <X11/Xproto.h>
 
39
#include "scrnintstr.h"
 
40
#include "colormapst.h"
 
41
#include "resource.h"
 
42
#include "micmap.h"
 
43
#include "cfb.h"
 
44
 
 
45
int
 
46
cfbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps)
 
47
{
 
48
    return miListInstalledColormaps(pScreen, pmaps);
 
49
}
 
50
 
 
51
void
 
52
cfbInstallColormap(ColormapPtr pmap)
 
53
{
 
54
    miInstallColormap(pmap);
 
55
}
 
56
 
 
57
void
 
58
cfbUninstallColormap(ColormapPtr pmap)
 
59
{
 
60
    miUninstallColormap(pmap);
 
61
}
 
62
 
 
63
void
 
64
cfbResolveColor(unsigned short *pred, 
 
65
                unsigned short *pgreen,
 
66
                unsigned short *pblue,
 
67
                VisualPtr       pVisual)
 
68
{
 
69
    miResolveColor(pred, pgreen, pblue, pVisual);
 
70
}
 
71
 
 
72
Bool
 
73
cfbInitializeColormap(ColormapPtr pmap)
 
74
{
 
75
    return miInitializeColormap(pmap);
 
76
}
 
77
 
 
78
int
 
79
cfbExpandDirectColors (ColormapPtr pmap, int ndef, 
 
80
                       xColorItem *indefs, xColorItem *outdefs)
 
81
{
 
82
    return miExpandDirectColors(pmap, ndef, indefs, outdefs);
 
83
}
 
84
 
 
85
Bool
 
86
cfbCreateDefColormap(ScreenPtr pScreen)
 
87
{
 
88
    return miCreateDefColormap(pScreen);
 
89
}
 
90
 
 
91
void
 
92
cfbClearVisualTypes(void)
 
93
{
 
94
    miClearVisualTypes();
 
95
}
 
96
 
 
97
Bool
 
98
cfbSetVisualTypes (int depth, int visuals, int bitsPerRGB)
 
99
{
 
100
    return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
 
101
}
 
102
 
 
103
/*
 
104
 * Given a list of formats for a screen, create a list
 
105
 * of visuals and depths for the screen which coorespond to
 
106
 * the set which can be used with this version of cfb.
 
107
 */
 
108
 
 
109
Bool
 
110
cfbInitVisuals (VisualPtr   *visualp,
 
111
                DepthPtr    *depthp,
 
112
                int         *nvisualp,
 
113
                int         *ndepthp,
 
114
                int         *rootDepthp,
 
115
                VisualID    *defaultVisp,
 
116
                unsigned long   sizes,
 
117
                int         bitsPerRGB)
 
118
{
 
119
    return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
 
120
                         defaultVisp, sizes, bitsPerRGB, -1);
 
121
}