Imported Upstream version 1.15.1
[deb_xorg-server.git] / fb / fbcmap_mi.c
CommitLineData
a09e091a
JB
1/*
2 * Copyright (c) 1987, Oracle and/or its affiliates. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
13 * 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
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23
24/**
25 * This version of fbcmap.c is implemented in terms of mi functions.
26 * These functions used to be in fbcmap.c and depended upon the symbol
27 * XFree86Server being defined.
28 */
29
30#ifdef HAVE_DIX_CONFIG_H
31#include <dix-config.h>
32#endif
33
34#include <X11/X.h>
35#include "fb.h"
36#include "micmap.h"
37
38int
39fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps)
40{
41 return miListInstalledColormaps(pScreen, pmaps);
42}
43
44void
45fbInstallColormap(ColormapPtr pmap)
46{
47 miInstallColormap(pmap);
48}
49
50void
51fbUninstallColormap(ColormapPtr pmap)
52{
53 miUninstallColormap(pmap);
54}
55
56void
57fbResolveColor(unsigned short *pred,
58 unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual)
59{
60 miResolveColor(pred, pgreen, pblue, pVisual);
61}
62
63Bool
64fbInitializeColormap(ColormapPtr pmap)
65{
66 return miInitializeColormap(pmap);
67}
68
69int
70fbExpandDirectColors(ColormapPtr pmap,
71 int ndef, xColorItem * indefs, xColorItem * outdefs)
72{
73 return miExpandDirectColors(pmap, ndef, indefs, outdefs);
74}
75
76Bool
77fbCreateDefColormap(ScreenPtr pScreen)
78{
79 return miCreateDefColormap(pScreen);
80}
81
82void
83fbClearVisualTypes(void)
84{
85 miClearVisualTypes();
86}
87
88Bool
89fbSetVisualTypes(int depth, int visuals, int bitsPerRGB)
90{
91 return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
92}
93
94Bool
95fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
96 Pixel redMask, Pixel greenMask, Pixel blueMask)
97{
98 return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1,
99 redMask, greenMask, blueMask);
100}
101
102/*
103 * Given a list of formats for a screen, create a list
104 * of visuals and depths for the screen which coorespond to
105 * the set which can be used with this version of fb.
106 */
107Bool
108fbInitVisuals(VisualPtr * visualp,
109 DepthPtr * depthp,
110 int *nvisualp,
111 int *ndepthp,
112 int *rootDepthp,
113 VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB)
114{
115 return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
116 defaultVisp, sizes, bitsPerRGB, -1);
117}