fbcmap_mi.c revision 706f2543
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 31#ifdef HAVE_DIX_CONFIG_H 32#include <dix-config.h> 33#endif 34 35#include <X11/X.h> 36#include "fb.h" 37#include "micmap.h" 38 39int 40fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps) 41{ 42 return miListInstalledColormaps(pScreen, pmaps); 43} 44 45void 46fbInstallColormap(ColormapPtr pmap) 47{ 48 miInstallColormap(pmap); 49} 50 51void 52fbUninstallColormap(ColormapPtr pmap) 53{ 54 miUninstallColormap(pmap); 55} 56 57void 58fbResolveColor(unsigned short *pred, 59 unsigned short *pgreen, 60 unsigned short *pblue, 61 VisualPtr pVisual) 62{ 63 miResolveColor(pred, pgreen, pblue, pVisual); 64} 65 66Bool 67fbInitializeColormap(ColormapPtr pmap) 68{ 69 return miInitializeColormap(pmap); 70} 71 72int 73fbExpandDirectColors (ColormapPtr pmap, 74 int ndef, 75 xColorItem *indefs, 76 xColorItem *outdefs) 77{ 78 return miExpandDirectColors(pmap, ndef, indefs, outdefs); 79} 80 81Bool 82fbCreateDefColormap(ScreenPtr pScreen) 83{ 84 return miCreateDefColormap(pScreen); 85} 86 87void 88fbClearVisualTypes(void) 89{ 90 miClearVisualTypes(); 91} 92 93Bool 94fbSetVisualTypes (int depth, int visuals, int bitsPerRGB) 95{ 96 return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); 97} 98 99Bool 100fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB, 101 Pixel redMask, Pixel greenMask, Pixel blueMask) 102{ 103 return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1, 104 redMask, greenMask, blueMask); 105} 106 107/* 108 * Given a list of formats for a screen, create a list 109 * of visuals and depths for the screen which coorespond to 110 * the set which can be used with this version of fb. 111 */ 112Bool 113fbInitVisuals (VisualPtr *visualp, 114 DepthPtr *depthp, 115 int *nvisualp, 116 int *ndepthp, 117 int *rootDepthp, 118 VisualID *defaultVisp, 119 unsigned long sizes, 120 int bitsPerRGB) 121{ 122 return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, 123 defaultVisp, sizes, bitsPerRGB, -1); 124} 125