fbcmap.c 3.0 KB

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