colormap.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /*
  2. Copyright 1987, 1998 The Open Group
  3. Permission to use, copy, modify, distribute, and sell this software and its
  4. documentation for any purpose is hereby granted without fee, provided that
  5. the above copyright notice appear in all copies and that both that
  6. copyright notice and this permission notice appear in supporting
  7. documentation.
  8. The above copyright notice and this permission notice shall be included in
  9. all copies or substantial portions of the Software.
  10. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  11. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  12. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  13. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  14. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  15. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  16. Except as contained in this notice, the name of The Open Group shall not be
  17. used in advertising or otherwise to promote the sale, use or other dealings
  18. in this Software without prior written authorization from The Open Group.
  19. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
  20. All Rights Reserved
  21. Permission to use, copy, modify, and distribute this software and its
  22. documentation for any purpose and without fee is hereby granted,
  23. provided that the above copyright notice appear in all copies and that
  24. both that copyright notice and this permission notice appear in
  25. supporting documentation, and that the name of Digital not be
  26. used in advertising or publicity pertaining to distribution of the
  27. software without specific, written prior permission.
  28. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  29. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  30. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  31. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  32. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  33. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  34. SOFTWARE.
  35. */
  36. #ifndef CMAP_H
  37. #define CMAP_H 1
  38. #include <X11/Xproto.h>
  39. #include "screenint.h"
  40. #include "window.h"
  41. /* these follow X.h's AllocNone and AllocAll */
  42. #define CM_PSCREEN 2
  43. #define CM_PWIN 3
  44. /* Passed internally in colormap.c */
  45. #define REDMAP 0
  46. #define GREENMAP 1
  47. #define BLUEMAP 2
  48. #define PSEUDOMAP 3
  49. #define AllocPrivate (-1)
  50. #define AllocTemporary (-2)
  51. #define DynamicClass 1
  52. /* Values for the flags field of a colormap. These should have 1 bit set
  53. * and not overlap */
  54. #define IsDefault 1
  55. #define AllAllocated 2
  56. #define BeingCreated 4
  57. typedef CARD32 Pixel;
  58. typedef struct _CMEntry *EntryPtr;
  59. /* moved to screenint.h: typedef struct _ColormapRec *ColormapPtr */
  60. typedef struct _colorResource *colorResourcePtr;
  61. int CreateColormap(
  62. Colormap /*mid*/,
  63. ScreenPtr /*pScreen*/,
  64. VisualPtr /*pVisual*/,
  65. ColormapPtr* /*ppcmap*/,
  66. int /*alloc*/,
  67. int /*client*/);
  68. int FreeColormap(
  69. pointer /*pmap*/,
  70. XID /*mid*/);
  71. int TellLostMap(
  72. WindowPtr /*pwin*/,
  73. pointer /* Colormap *pmid */);
  74. int TellGainedMap(
  75. WindowPtr /*pwin*/,
  76. pointer /* Colormap *pmid */);
  77. int CopyColormapAndFree(
  78. Colormap /*mid*/,
  79. ColormapPtr /*pSrc*/,
  80. int /*client*/);
  81. int AllocColor(
  82. ColormapPtr /*pmap*/,
  83. unsigned short* /*pred*/,
  84. unsigned short* /*pgreen*/,
  85. unsigned short* /*pblue*/,
  86. Pixel* /*pPix*/,
  87. int /*client*/);
  88. void FakeAllocColor(
  89. ColormapPtr /*pmap*/,
  90. xColorItem * /*item*/);
  91. void FakeFreeColor(
  92. ColormapPtr /*pmap*/,
  93. Pixel /*pixel*/);
  94. typedef int (*ColorCompareProcPtr)(
  95. EntryPtr /*pent*/,
  96. xrgb * /*prgb*/);
  97. int FindColor(
  98. ColormapPtr /*pmap*/,
  99. EntryPtr /*pentFirst*/,
  100. int /*size*/,
  101. xrgb* /*prgb*/,
  102. Pixel* /*pPixel*/,
  103. int /*channel*/,
  104. int /*client*/,
  105. ColorCompareProcPtr /*comp*/);
  106. int QueryColors(
  107. ColormapPtr /*pmap*/,
  108. int /*count*/,
  109. Pixel* /*ppixIn*/,
  110. xrgb* /*prgbList*/);
  111. int FreeClientPixels(
  112. pointer /*pcr*/,
  113. XID /*fakeid*/);
  114. int AllocColorCells(
  115. int /*client*/,
  116. ColormapPtr /*pmap*/,
  117. int /*colors*/,
  118. int /*planes*/,
  119. Bool /*contig*/,
  120. Pixel* /*ppix*/,
  121. Pixel* /*masks*/);
  122. int AllocColorPlanes(
  123. int /*client*/,
  124. ColormapPtr /*pmap*/,
  125. int /*colors*/,
  126. int /*r*/,
  127. int /*g*/,
  128. int /*b*/,
  129. Bool /*contig*/,
  130. Pixel* /*pixels*/,
  131. Pixel* /*prmask*/,
  132. Pixel* /*pgmask*/,
  133. Pixel* /*pbmask*/);
  134. int FreeColors(
  135. ColormapPtr /*pmap*/,
  136. int /*client*/,
  137. int /*count*/,
  138. Pixel* /*pixels*/,
  139. Pixel /*mask*/);
  140. int StoreColors(
  141. ColormapPtr /*pmap*/,
  142. int /*count*/,
  143. xColorItem* /*defs*/);
  144. int IsMapInstalled(
  145. Colormap /*map*/,
  146. WindowPtr /*pWin*/);
  147. #endif /* CMAP_H */