fbcmap_mi.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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. * This version of fbcmap.c is implemented in terms of mi functions.
  25. * These functions used to be in fbcmap.c and depended upon the symbol
  26. * XFree86Server being defined.
  27. */
  28. #ifdef HAVE_DIX_CONFIG_H
  29. #include <dix-config.h>
  30. #endif
  31. #include <X11/X.h>
  32. #include "fb.h"
  33. #include "micmap.h"
  34. int
  35. fbListInstalledColormaps(ScreenPtr pScreen, Colormap * pmaps)
  36. {
  37. return miListInstalledColormaps(pScreen, pmaps);
  38. }
  39. void
  40. fbInstallColormap(ColormapPtr pmap)
  41. {
  42. miInstallColormap(pmap);
  43. }
  44. void
  45. fbUninstallColormap(ColormapPtr pmap)
  46. {
  47. miUninstallColormap(pmap);
  48. }
  49. void
  50. fbResolveColor(unsigned short *pred,
  51. unsigned short *pgreen, unsigned short *pblue, VisualPtr pVisual)
  52. {
  53. miResolveColor(pred, pgreen, pblue, pVisual);
  54. }
  55. Bool
  56. fbInitializeColormap(ColormapPtr pmap)
  57. {
  58. return miInitializeColormap(pmap);
  59. }
  60. int
  61. fbExpandDirectColors(ColormapPtr pmap,
  62. int ndef, xColorItem * indefs, xColorItem * outdefs)
  63. {
  64. return miExpandDirectColors(pmap, ndef, indefs, outdefs);
  65. }
  66. Bool
  67. fbCreateDefColormap(ScreenPtr pScreen)
  68. {
  69. return miCreateDefColormap(pScreen);
  70. }
  71. void
  72. fbClearVisualTypes(void)
  73. {
  74. miClearVisualTypes();
  75. }
  76. Bool
  77. fbSetVisualTypes(int depth, int visuals, int bitsPerRGB)
  78. {
  79. return miSetVisualTypes(depth, visuals, bitsPerRGB, -1);
  80. }
  81. Bool
  82. fbSetVisualTypesAndMasks(int depth, int visuals, int bitsPerRGB,
  83. Pixel redMask, Pixel greenMask, Pixel blueMask)
  84. {
  85. return miSetVisualTypesAndMasks(depth, visuals, bitsPerRGB, -1,
  86. redMask, greenMask, blueMask);
  87. }
  88. /*
  89. * Given a list of formats for a screen, create a list
  90. * of visuals and depths for the screen which coorespond to
  91. * the set which can be used with this version of fb.
  92. */
  93. Bool
  94. fbInitVisuals(VisualPtr * visualp,
  95. DepthPtr * depthp,
  96. int *nvisualp,
  97. int *ndepthp,
  98. int *rootDepthp,
  99. VisualID * defaultVisp, unsigned long sizes, int bitsPerRGB)
  100. {
  101. return miInitVisuals(visualp, depthp, nvisualp, ndepthp, rootDepthp,
  102. defaultVisp, sizes, bitsPerRGB, -1);
  103. }