ilX.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: ilX.h /main/3 1995/10/23 15:41:07 rswiston $ */
  24. /**---------------------------------------------------------------------
  25. ***
  26. *** file: ilX.h
  27. ***
  28. *** description: Public declarations and functions for accessing X drawables with IL
  29. ***
  30. ***
  31. *** (c)Copyright 1991 Hewlett-Packard Co.
  32. ***
  33. *** RESTRICTED RIGHTS LEGEND
  34. *** Use, duplication, or disclosure by the U.S. Government is subject to
  35. *** restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
  36. *** Technical Data and Computer Software clause in DFARS 252.227-7013.
  37. *** Hewlett-Packard Company
  38. *** 3000 Hanover Street
  39. *** Palo Alto, CA 94304 U.S.A.
  40. *** Rights for non-DOD U.S. Government Departments and Agencies are as set
  41. *** forth in FAR 52.227-19(c)(1,2).
  42. ***
  43. ***-------------------------------------------------------------------*/
  44. #ifndef ILX_H
  45. #define ILX_H
  46. #ifndef IL_H
  47. #include "il.h"
  48. #endif
  49. #ifndef X_H
  50. #include <X11/X.h>
  51. #endif
  52. #ifndef _XLIB_H_
  53. #include <X11/Xlib.h>
  54. #endif
  55. #ifndef NeedFunctionPrototypes
  56. #if defined(FUNCPROTO) || defined(__STDC__) || defined(__cplusplus) || defined(c_plusplus)
  57. #define NeedFunctionPrototypes 1
  58. #else
  59. #define NeedFunctionPrototypes 0
  60. #endif /* __STDC__ */
  61. #endif /* NeedFunctionPrototypes */
  62. #ifndef NeedWidePrototypes
  63. #if defined(NARROWPROTO)
  64. #define NeedWidePrototypes 0
  65. #else
  66. #define NeedWidePrototypes 1 /* default to make interropt. easier */
  67. #endif
  68. #endif
  69. #ifdef __cplusplus /* do not leave open across includes */
  70. extern "C" { /* for C++ V2.0 */
  71. #endif
  72. /* Option codes to ilChangeXWC() */
  73. #define IL_XWC_ALLOC_GRAYS 0 /* pData = null */
  74. #define IL_XWC_FREE_GRAYS 1 /* pData = null */
  75. #define IL_XWC_ALLOC_COLORS 2 /* pData = null */
  76. #define IL_XWC_FREE_COLORS 3 /* pData = null */
  77. #define IL_XWC_SET_DITHER_METHOD 4 /* pData -> unsigned int */
  78. #define IL_XWC_SET_RAW_MODE 5 /* pData -> ilBool */
  79. #define IL_XWC_ALLOC_DITHER_COLORS IL_XWC_ALLOC_COLORS /* no longer used */
  80. #define IL_XWC_FREE_DITHER_COLORS IL_XWC_FREE_COLORS /* no longer used */
  81. /* Values for ilQueryXWCInfo.visualType */
  82. #define IL_XWC_BITONAL 0
  83. #define IL_XWC_GRAY_8 1
  84. #define IL_XWC_COLOR_8 2
  85. #define IL_XWC_COLOR_24 3
  86. /* Values for ilQueryXWCInfo.writeType */
  87. #define IL_XWC_WRITE_BITONAL 0
  88. #define IL_XWC_WRITE_GRAY 1
  89. #define IL_XWC_WRITE_COLOR_DITHER 2
  90. #define IL_XWC_WRITE_COLOR 3
  91. /* Masks for "flags" to ilReadXDrawable */
  92. #define IL_READ_X_RAW_MODE (1<<0)
  93. typedef struct {
  94. Display *display;
  95. Visual *visual;
  96. Colormap colormap;
  97. GC gc;
  98. unsigned short visualType;
  99. ilShortBool staticVisual;
  100. unsigned int ditherMethod;
  101. ilBool rawMode;
  102. unsigned short writeType;
  103. short filler[19];
  104. } ilXWCInfo;
  105. typedef ilObject ilXWC;
  106. extern ilBool ilReadXDrawable (
  107. #if NeedFunctionPrototypes
  108. ilPipe pipe,
  109. Display *display,
  110. Drawable drawable,
  111. Visual *visual,
  112. Colormap colormap,
  113. ilBool blackIsZero,
  114. ilRect *pSrcRect,
  115. ilBool copyToPixmap,
  116. unsigned long flags
  117. #endif
  118. );
  119. extern ilBool ilConvertForXWrite (
  120. #if NeedFunctionPrototypes
  121. ilPipe pipe,
  122. ilXWC XWC,
  123. ilBool mapPixels,
  124. unsigned long mustBeZero,
  125. void *mustBeNull
  126. #endif
  127. );
  128. extern ilBool ilWriteXDrawable (
  129. #if NeedFunctionPrototypes
  130. ilPipe pipe,
  131. Drawable drawable,
  132. ilXWC XWC,
  133. ilRect *pSrcRect,
  134. int dstX,
  135. int dstY,
  136. unsigned long mustBeZero
  137. #endif
  138. );
  139. extern ilXWC ilCreateXWC (
  140. #if NeedFunctionPrototypes
  141. ilContext context,
  142. Display *display,
  143. Visual *visual,
  144. Colormap colormap,
  145. GC gc,
  146. unsigned long mustBeZero1,
  147. unsigned long mustBeZero2
  148. #endif
  149. );
  150. extern ilBool ilChangeXWC (
  151. #if NeedFunctionPrototypes
  152. ilXWC XWC,
  153. unsigned int code,
  154. void *pData
  155. #endif
  156. );
  157. extern ilBool ilQueryXWC (
  158. #if NeedFunctionPrototypes
  159. ilXWC XWC,
  160. ilXWCInfo *pInfo
  161. #endif
  162. );
  163. #ifdef __cplusplus
  164. } /* for C++ V2.0 */
  165. #endif
  166. #endif