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