fbcmap_mi.c revision 35c4bbdf
16747b715Smrg/* 29ace9065Smrg * Copyright (c) 1987, Oracle and/or its affiliates. All rights reserved. 36747b715Smrg * 46747b715Smrg * Permission is hereby granted, free of charge, to any person obtaining a 56747b715Smrg * copy of this software and associated documentation files (the "Software"), 66747b715Smrg * to deal in the Software without restriction, including without limitation 76747b715Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense, 86747b715Smrg * and/or sell copies of the Software, and to permit persons to whom the 96747b715Smrg * Software is furnished to do so, subject to the following conditions: 106747b715Smrg * 116747b715Smrg * The above copyright notice and this permission notice (including the next 126747b715Smrg * paragraph) shall be included in all copies or substantial portions of the 136747b715Smrg * Software. 146747b715Smrg * 156747b715Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 166747b715Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 176747b715Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 186747b715Smrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 196747b715Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 206747b715Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 216747b715Smrg * DEALINGS IN THE SOFTWARE. 226747b715Smrg */ 2305b261ecSmrg 2405b261ecSmrg/** 2505b261ecSmrg * This version of fbcmap.c is implemented in terms of mi functions. 2605b261ecSmrg * These functions used to be in fbcmap.c and depended upon the symbol 2705b261ecSmrg * XFree86Server being defined. 2805b261ecSmrg */ 2905b261ecSmrg 3005b261ecSmrg#ifdef HAVE_DIX_CONFIG_H 3105b261ecSmrg#include <dix-config.h> 3205b261ecSmrg#endif 3305b261ecSmrg 3405b261ecSmrg#include <X11/X.h> 3505b261ecSmrg#include "fb.h" 3605b261ecSmrg#include "micmap.h" 3705b261ecSmrg 3805b261ecSmrgint 3935c4bbdfSmrgfbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps) 4005b261ecSmrg{ 4105b261ecSmrg return miListInstalledColormaps(pScreen, pmaps); 4205b261ecSmrg} 4305b261ecSmrg 4405b261ecSmrgvoid 4505b261ecSmrgfbInstallColormap(ColormapPtr pmap) 4605b261ecSmrg{ 4705b261ecSmrg miInstallColormap(pmap); 4805b261ecSmrg} 4905b261ecSmrg 5005b261ecSmrgvoid 5105b261ecSmrgfbUninstallColormap(ColormapPtr pmap) 5205b261ecSmrg{ 5305b261ecSmrg miUninstallColormap(pmap); 5405b261ecSmrg} 5505b261ecSmrg 5605b261ecSmrgvoid 5735c4bbdfSmrgfbResolveColor(unsigned short *pred, 5835c4bbdfSmrg unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual) 5905b261ecSmrg{ 6005b261ecSmrg miResolveColor(pred, pgreen, pblue, pVisual); 6105b261ecSmrg} 6205b261ecSmrg 6305b261ecSmrgBool 6405b261ecSmrgfbInitializeColormap(ColormapPtr pmap) 6505b261ecSmrg{ 6605b261ecSmrg return miInitializeColormap(pmap); 6705b261ecSmrg} 6805b261ecSmrg 6905b261ecSmrgint 7035c4bbdfSmrgfbExpandDirectColors(ColormapPtr pmap, 7135c4bbdfSmrg int ndef, xColorItem * indefs, xColorItem * outdefs) 7205b261ecSmrg{ 7305b261ecSmrg return miExpandDirectColors(pmap, ndef, indefs, outdefs); 7405b261ecSmrg} 7505b261ecSmrg 7605b261ecSmrgBool 7705b261ecSmrgfbCreateDefColormap(ScreenPtr pScreen) 7805b261ecSmrg{ 7905b261ecSmrg return miCreateDefColormap(pScreen); 8005b261ecSmrg} 8105b261ecSmrg 8205b261ecSmrgvoid 8305b261ecSmrgfbClearVisualTypes(void) 8405b261ecSmrg{ 8505b261ecSmrg miClearVisualTypes(); 8605b261ecSmrg} 8705b261ecSmrg 8805b261ecSmrgBool 8935c4bbdfSmrgfbSetVisualTypes(int depth, int visuals, int bitsPerRGB) 9005b261ecSmrg{ 9105b261ecSmrg return miSetVisualTypes(depth, visuals, bitsPerRGB, -1); 9205b261ecSmrg} 9305b261ecSmrg 944642e01fSmrgBool 9535c4bbdfSmrgfbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB, 9635c4bbdfSmrg Pixel redMask, Pixel greenMask, Pixel blueMask) 974642e01fSmrg{ 984642e01fSmrg return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1, 994642e01fSmrg redMask, greenMask, blueMask); 1004642e01fSmrg} 1014642e01fSmrg 10205b261ecSmrg/* 10305b261ecSmrg * Given a list of formats for a screen, create a list 10405b261ecSmrg * of visuals and depths for the screen which coorespond to 10505b261ecSmrg * the set which can be used with this version of fb. 10605b261ecSmrg */ 10705b261ecSmrgBool 10835c4bbdfSmrgfbInitVisuals(VisualPtr * visualp, 10935c4bbdfSmrg DepthPtr * depthp, 11035c4bbdfSmrg int *nvisualp, 11135c4bbdfSmrg int *ndepthp, 11235c4bbdfSmrg int *rootDepthp, 11335c4bbdfSmrg VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB) 11405b261ecSmrg{ 11505b261ecSmrg return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp, 11635c4bbdfSmrg defaultVisp, sizes, bitsPerRGB, -1); 11705b261ecSmrg} 118