Skip to content
Newer
Older
100644 396 lines (330 sloc) 12.7 KB
9f1c6f0 @mbert Import Elvis 2.2_0 (written by Steve Kirkendall)
authored Dec 10, 2011
1 /* This file is derived from the <X11/xpm.h> header file, which is copyrighted
2 * by GROUPE BULL. See the full copyright notice at the end of this file.
3 */
4
5 /* <X11/xpm.h> -lxpm Return codes */
6 #define XpmColorError 1 /* minor errors are positive */
7 #define XpmSuccess 0 /* success is 0 */
8 #define XpmOpenFailed -1 /* major errors are negative */
9 #define XpmFileInvalid -2
10 #define XpmNoMemory -3
11 #define XpmColorFailed -4
12
13 typedef struct {
14 char *name; /* Symbolic color name */
15 char *value; /* Color value */
16 Pixel pixel; /* Color pixel */
17 } XpmColorSymbol;
18
19 typedef struct {
20 char *name; /* name of the extension */
21 unsigned int nlines; /* number of lines in this extension */
22 char **lines; /* pointer to the extension array of strings */
23 } XpmExtension;
24
25 typedef struct {
26 char *string; /* characters string */
27 char *symbolic; /* symbolic name */
28 char *m_color; /* monochrom default */
29 char *g4_color; /* 4 level grayscale default */
30 char *g_color; /* other level grayscale default */
31 char *c_color; /* color default */
32 } XpmColor;
33
34 typedef struct {
35 unsigned int width; /* image width */
36 unsigned int height; /* image height */
37 unsigned int cpp; /* number of characters per pixel */
38 unsigned int ncolors; /* number of colors */
39 XpmColor *colorTable; /* list of related colors */
40 unsigned int *data; /* image data */
41 } XpmImage;
42
43 typedef struct {
44 unsigned long valuemask; /* Specifies which attributes are defined */
45 char *hints_cmt; /* Comment of the hints section */
46 char *colors_cmt; /* Comment of the colors section */
47 char *pixels_cmt; /* Comment of the pixels section */
48 unsigned int x_hotspot; /* Returns the x hotspot's coordinate */
49 unsigned int y_hotspot; /* Returns the y hotspot's coordinate */
50 unsigned int nextensions; /* number of extensions */
51 XpmExtension *extensions; /* pointer to array of extensions */
52 } XpmInfo;
53
54 typedef int (*XpmAllocColorFunc)(Display *display, Colormap colormap, char *colorname, XColor *xcolor, void *closure);
55
56 typedef int (*XpmFreeColorsFunc)(Display *display, Colormap colormap, Pixel *pixels, int npixels, void *closure);
57
58 typedef struct {
59 unsigned long valuemask; /* Specifies which attributes are
60 defined */
61
62 Visual *visual; /* Specifies the visual to use */
63 Colormap colormap; /* Specifies the colormap to use */
64 unsigned int depth; /* Specifies the depth */
65 unsigned int width; /* Returns the width of the created
66 pixmap */
67 unsigned int height; /* Returns the height of the created
68 pixmap */
69 unsigned int x_hotspot; /* Returns the x hotspot's
70 coordinate */
71 unsigned int y_hotspot; /* Returns the y hotspot's
72 coordinate */
73 unsigned int cpp; /* Specifies the number of char per
74 pixel */
75 Pixel *pixels; /* List of used color pixels */
76 unsigned int npixels; /* Number of used pixels */
77 XpmColorSymbol *colorsymbols; /* List of color symbols to override */
78 unsigned int numsymbols; /* Number of symbols */
79 char *rgb_fname; /* RGB text file name */
80 unsigned int nextensions; /* Number of extensions */
81 XpmExtension *extensions; /* List of extensions */
82
83 unsigned int ncolors; /* Number of colors */
84 XpmColor *colorTable; /* List of colors */
85 /* 3.2 backward compatibility code */
86 char *hints_cmt; /* Comment of the hints section */
87 char *colors_cmt; /* Comment of the colors section */
88 char *pixels_cmt; /* Comment of the pixels section */
89 /* end 3.2 bc */
90 unsigned int mask_pixel; /* Color table index of transparent
91 color */
92
93 /* Color Allocation Directives */
94 Bool exactColors; /* Only use exact colors for visual */
95 unsigned int closeness; /* Allowable RGB deviation */
96 unsigned int red_closeness; /* Allowable red deviation */
97 unsigned int green_closeness; /* Allowable green deviation */
98 unsigned int blue_closeness; /* Allowable blue deviation */
99 int color_key; /* Use colors from this color set */
100
101 Pixel *alloc_pixels; /* Returns the list of alloc'ed color
102 pixels */
103 int nalloc_pixels; /* Returns the number of alloc'ed
104 color pixels */
105
106 Bool alloc_close_colors; /* Specify whether close colors should
107 be allocated using XAllocColor
108 or not */
109 int bitmap_format; /* Specify the format of 1bit depth
110 images: ZPixmap or XYBitmap */
111
112 /* Color functions */
113 XpmAllocColorFunc alloc_color; /* Application color allocator */
114 XpmFreeColorsFunc free_colors; /* Application color de-allocator */
115 void *color_closure; /* Application private data to pass to
116 alloc_color and free_colors */
117
118 } XpmAttributes;
119
120 /* XpmAttributes value masks bits */
121 #define XpmVisual (1L<<0)
122 #define XpmColormap (1L<<1)
123 #define XpmDepth (1L<<2)
124 #define XpmSize (1L<<3) /* width & height */
125 #define XpmHotspot (1L<<4) /* x_hotspot & y_hotspot */
126 #define XpmCharsPerPixel (1L<<5)
127 #define XpmColorSymbols (1L<<6)
128 #define XpmRgbFilename (1L<<7)
129 /* 3.2 backward compatibility code */
130 #define XpmInfos (1L<<8)
131 #define XpmReturnInfos XpmInfos
132 /* end 3.2 bc */
133 #define XpmReturnPixels (1L<<9)
134 #define XpmExtensions (1L<<10)
135 #define XpmReturnExtensions XpmExtensions
136
137 #define XpmExactColors (1L<<11)
138 #define XpmCloseness (1L<<12)
139 #define XpmRGBCloseness (1L<<13)
140 #define XpmColorKey (1L<<14)
141
142 #define XpmColorTable (1L<<15)
143 #define XpmReturnColorTable XpmColorTable
144
145 #define XpmReturnAllocPixels (1L<<16)
146 #define XpmAllocCloseColors (1L<<17)
147 #define XpmBitmapFormat (1L<<18)
148
149 #define XpmAllocColor (1L<<19)
150 #define XpmFreeColors (1L<<20)
151 #define XpmColorClosure (1L<<21)
152
153
154 /* XpmInfo value masks bits */
155 #define XpmComments XpmInfos
156 #define XpmReturnComments XpmComments
157
158 /* XpmAttributes mask_pixel value when there is no mask */
159 #define XpmUndefPixel 0x80000000
160
161 /*
162 * color keys for visual type, they must fit along with the number key of
163 * each related element in xpmColorKeys[] defined in XpmI.h
164 */
165 #define XPM_MONO 2
166 #define XPM_GREY4 3
167 #define XPM_GRAY4 3
168 #define XPM_GREY 4
169 #define XPM_GRAY 4
170 #define XPM_COLOR 5
171
172
173 /* <X11/xpm.h> -lX11 */
174 int XpmCreatePixmapFromData(Display *display, Drawable d, char **data, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)
175 {
176 }
177
178 /* <X11/xpm.h> -lX11 */
179 int XpmCreateDataFromPixmap(Display *display, char ***data_return, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)
180 {
181 }
182
183 /* <X11/xpm.h> -lX11 */
184 int XpmReadFileToPixmap(Display *display, Drawable d, char *filename, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)
185 {
186 }
187
188 /* <X11/xpm.h> -lX11 */
189 int XpmWriteFileFromPixmap(Display *display, char *filename, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)
190 {
191 }
192
193 /* <X11/xpm.h> -lX11 */
194 int XpmCreateImageFromData(Display *display, char **data, XImage **image_return, XImage **shapemask_return, XpmAttributes *attributes)
195 {
196 }
197
198 /* <X11/xpm.h> -lX11 */
199 int XpmCreateDataFromImage(Display *display, char ***data_return, XImage *image, XImage *shapeimage, XpmAttributes *attributes)
200 {
201 }
202
203 /* <X11/xpm.h> -lX11 */
204 int XpmReadFileToImage(Display *display, char *filename, XImage **image_return, XImage **shapeimage_return, XpmAttributes *attributes)
205 {
206 }
207
208 /* <X11/xpm.h> -lX11 */
209 int XpmWriteFileFromImage(Display *display, char *filename, XImage *image, XImage *shapeimage, XpmAttributes *attributes)
210 {
211 }
212
213 /* <X11/xpm.h> -lX11 */
214 int XpmCreateImageFromBuffer(Display *display, char *buffer, XImage **image_return, XImage **shapemask_return, XpmAttributes *attributes)
215 {
216 }
217
218 /* <X11/xpm.h> -lX11 */
219 int XpmCreatePixmapFromBuffer(Display *display, Drawable d, char *buffer, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)
220 {
221 }
222
223 /* <X11/xpm.h> -lX11 */
224 int XpmCreateBufferFromImage(Display *display, char **buffer_return, XImage *image, XImage *shapeimage, XpmAttributes *attributes)
225 {
226 }
227
228 /* <X11/xpm.h> -lX11 */
229 int XpmCreateBufferFromPixmap(Display *display, char **buffer_return, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes)
230 {
231 }
232
233 /* <X11/xpm.h> -lX11 */
234 int XpmReadFileToBuffer(char *filename, char **buffer_return)
235 {
236 }
237
238 /* <X11/xpm.h> -lX11 */
239 int XpmWriteFileFromBuffer(char *filename, char *buffer)
240 {
241 }
242
243 /* <X11/xpm.h> -lX11 */
244 int XpmReadFileToData(char *filename, char ***data_return)
245 {
246 }
247
248 /* <X11/xpm.h> -lX11 */
249 int XpmWriteFileFromData(char *filename, char **data)
250 {
251 }
252
253 /* <X11/xpm.h> -lX11 */
254 int XpmAttributesSize(void)
255 {
256 }
257
258 /* <X11/xpm.h> -lX11 */
259 void XpmFreeAttributes(XpmAttributes *attributes)
260 {
261 }
262
263 /* <X11/xpm.h> -lX11 */
264 void XpmFreeExtensions(XpmExtension *extensions, int nextensions)
265 {
266 }
267
268 /* <X11/xpm.h> -lX11 */
269 void XpmFreeXpmImage(XpmImage *image)
270 {
271 }
272
273 /* <X11/xpm.h> -lX11 */
274 void XpmFreeXpmInfo(XpmInfo *info)
275 {
276 }
277
278 /* <X11/xpm.h> -lX11 */
279 char * XpmGetErrorString(int errcode)
280 {
281 }
282
283 /* <X11/xpm.h> -lX11 */
284 int XpmLibraryVersion(void)
285 {
286 }
287
288 /* <X11/xpm.h> -lX11 */
289 int XpmReadFileToXpmImage(char *filename, XpmImage *image, XpmInfo *info)
290 {
291 }
292
293 /* <X11/xpm.h> -lX11 */
294 int XpmWriteFileFromXpmImage(char *filename, XpmImage *image, XpmInfo *info)
295 {
296 }
297
298 /* <X11/xpm.h> -lX11 */
299 int XpmCreatePixmapFromXpmImage(Display *display, Drawable d, XpmImage *image, Pixmap *pixmap_return, Pixmap *shapemask_return, XpmAttributes *attributes)
300 {
301 }
302
303 /* <X11/xpm.h> -lX11 */
304 int XpmCreateImageFromXpmImage(Display *display, XpmImage *image, XImage **image_return, XImage **shapeimage_return, XpmAttributes *attributes)
305 {
306 }
307
308 /* <X11/xpm.h> -lX11 */
309 int XpmCreateXpmImageFromImage(Display *display, XImage *image, XImage *shapeimage, XpmImage *xpmimage, XpmAttributes *attributes)
310 {
311 }
312
313 /* <X11/xpm.h> -lX11 */
314 int XpmCreateXpmImageFromPixmap(Display *display, Pixmap pixmap, Pixmap shapemask, XpmImage *xpmimage, XpmAttributes *attributes)
315 {
316 }
317
318 /* <X11/xpm.h> -lX11 */
319 int XpmCreateDataFromXpmImage(char ***data_return, XpmImage *image, XpmInfo *info)
320 {
321 }
322
323 /* <X11/xpm.h> -lX11 */
324 int XpmCreateXpmImageFromData(char **data, XpmImage *image, XpmInfo *info)
325 {
326 }
327
328 /* <X11/xpm.h> -lX11 */
329 int XpmCreateXpmImageFromBuffer(char *buffer, XpmImage *image, XpmInfo *info)
330 {
331 }
332
333 /* <X11/xpm.h> -lX11 */
334 int XpmCreateBufferFromXpmImage(char **buffer_return, XpmImage *image, XpmInfo *info)
335 {
336 }
337
338 /* <X11/xpm.h> -lX11 */
339 int XpmGetParseError(char *filename, int *linenum_return, int *charnum_return)
340 {
341 }
342
343 /* <X11/xpm.h> -lX11 */
344 void XpmFree(void *ptr)
345 {
346 }
347
348 /* <Xlib.h> backward compatibility, for version 3.0c */
349 #define XpmPixmapColorError XpmColorError
350 #define XpmPixmapSuccess XpmSuccess
351 #define XpmPixmapOpenFailed XpmOpenFailed
352 #define XpmPixmapFileInvalid XpmFileInvalid
353 #define XpmPixmapNoMemory XpmNoMemory
354 #define XpmPixmapColorFailed XpmColorFailed
355 #define XpmReadPixmapFile XpmReadFileToPixmap
356 #define XpmWritePixmapFile XpmWriteFileFromPixmap
357
358 /* <Xlib.h> backward compatibility, for version 3.0b */
359 #define PixmapColorError XpmColorError
360 #define PixmapSuccess XpmSuccess
361 #define PixmapOpenFailed XpmOpenFailed
362 #define PixmapFileInvalid XpmFileInvalid
363 #define PixmapNoMemory XpmNoMemory
364 #define PixmapColorFailed XpmColorFailed
365 #define ColorSymbol XpmColorSymbol
366 #define XReadPixmapFile XpmReadFileToPixmap
367 #define XWritePixmapFile XpmWriteFileFromPixmap
368 #define XCreatePixmapFromData XpmCreatePixmapFromData
369 #define XCreateDataFromPixmap XpmCreateDataFromPixmap
370
371 /*
372 * Copyright (C) 1989-95 GROUPE BULL
373 *
374 * Permission is hereby granted, free of charge, to any person obtaining a copy
375 * of this software and associated documentation files (the "Software"), to
376 * deal in the Software without restriction, including without limitation the
377 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
378 * sell copies of the Software, and to permit persons to whom the Software is
379 * furnished to do so, subject to the following conditions:
380 *
381 * The above copyright notice and this permission notice shall be included in
382 * all copies or substantial portions of the Software.
383 *
384 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
385 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
386 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
387 * GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
388 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
389 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
390 *
391 * Except as contained in this notice, the name of GROUPE BULL shall not be
392 * used in advertising or otherwise to promote the sale, use or other dealings
393 * in this Software without prior written authorization from GROUPE BULL.
394 */
395
Something went wrong with that request. Please try again.