fbcmap_mi.c revision 4642e01f
1/************************************************************ 2Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA. 3 4 All Rights Reserved 5 6Permission to use, copy, modify, and distribute this 7software and its documentation for any purpose and without 8fee is hereby granted, provided that the above copyright no- 9tice appear in all copies and that both that copyright no- 10tice and this permission notice appear in supporting docu- 11mentation, and that the names of Sun or X Consortium 12not be used in advertising or publicity pertaining to 13distribution of the software without specific prior 14written permission. Sun and X Consortium make no 15representations about the suitability of this software for 16any purpose. It is provided "as is" without any express or 17implied warranty. 18 19SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, 20INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT- 21NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE LI- 22ABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 23ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 24PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 25OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH 26THE USE OR PERFORMANCE OF THIS SOFTWARE. 27 28********************************************************/ 29 30 31/** 32 * This version of fbcmap.c is implemented in terms of mi functions. 33 * These functions used to be in fbcmap.c and depended upon the symbol 34 * XFree86Server being defined. 35 */ 36 37 38#ifdef HAVE_DIX_CONFIG_H 39#include <dix-config.h> 40#endif 41 42#include <X11/X.h> 43#include "fb.h" 44#include "micmap.h" 45 46int 47fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) 48{ 49 return miListInstalledColormaps(pScreen, pmaps); 50} 51 52void 53fbInstallColormap(ColormapPtr pmap) 54{ 55 miInstallColormap(pmap); 56} 57 58void 59fbUninstallColormap(ColormapPtr pmap) 60{ 61 miUninstallColormap(pmap); 62} 63 64void 65fbResolveColor(unsigned short *pred, 66 unsigned short *pgreen, 67 unsigned short *pblue, 68 VisualPtr pVisual) 69{ 70 miResolveColor(pred, pgreen, pblue, pVisual); 71} 72 73Bool 74fbInitializeColormap(ColormapPtr pmap) 75{ 76 return miInitializeColormap(pmap); 77} 78 79int 80fbExpandDirectColors (ColormapPtr pmap, 81 int ndef, 82 xColorItem *indefs, 83 xColorItem *outdefs) 84{ 85 return miExpandDirectColors(pmap, ndef, indefs, outdefs); 86} 87 88Bool 89fbCreateDefColormap(ScreenPtr pScreen) 90{ 91 return miCreateDefColormap(pScreen); 92} 93 94void 95fbClearVisualTypes(void) 96{ 97 miClearVisualTypes(); 98} 99 100Bool 101fbSetVisualTypes (int depth, int visuals, int bitsPerRGB) 102{ 103 return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); 104} 105 106Bool 107fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB, 108 Pixel redMask, Pixel greenMask, Pixel blueMask) 109{ 110 return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1, 111 redMask, greenMask, blueMask); 112} 113 114/* 115 * Given a list of formats for a screen, create a list 116 * of visuals and depths for the screen which coorespond to 117 * the set which can be used with this version of fb. 118 */ 119Bool 120fbInitVisuals (VisualPtr *visualp, 121 DepthPtr *depthp, 122 int *nvisualp, 123 int *ndepthp, 124 int *rootDepthp, 125 VisualID *defaultVisp, 126 unsigned long sizes, 127 int bitsPerRGB) 128{ 129 return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, 130 defaultVisp, sizes, bitsPerRGB, -1); 131} 132