]> git.sesse.net Git - rdpsrv/blob - Xserver/include/XWDFile.h
Import X server from vnc-3.3.7.
[rdpsrv] / Xserver / include / XWDFile.h
1 /* $XConsortium: XWDFile.h /main/18 1995/12/07 10:24:58 kaleb $ */
2 /*
3
4 Copyright (c) 1985, 1986  X Consortium
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
19 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23 Except as contained in this notice, the name of the X Consortium shall not be
24 used in advertising or otherwise to promote the sale, use or other dealings
25 in this Software without prior written authorization from the X Consortium.
26
27 */
28
29 /*
30  * XWDFile.h    MIT Project Athena, X Window system window raster
31  *              image dumper, dump file format header file.
32  *
33  *  Author:     Tony Della Fera, DEC
34  *              27-Jun-85
35  * 
36  * Modifier:    William F. Wyatt, SAO
37  *              18-Nov-86  - version 6 for saving/restoring color maps
38  */
39
40 #ifndef XWDFILE_H
41 #define XWDFILE_H
42
43 #include <X11/Xmd.h>
44
45 #define XWD_FILE_VERSION 7
46 #define sz_XWDheader 100
47 #define sz_XWDColor 12
48
49 typedef CARD32 xwdval;          /* for old broken programs */
50
51 /* Values in the file are most significant byte first. */
52
53 typedef struct _xwd_file_header {
54         /* header_size = SIZEOF(XWDheader) + length of null-terminated
55          * window name. */
56         CARD32 header_size B32;         
57
58         CARD32 file_version B32;        /* = XWD_FILE_VERSION above */
59         CARD32 pixmap_format B32;       /* ZPixmap or XYPixmap */
60         CARD32 pixmap_depth B32;        /* Pixmap depth */
61         CARD32 pixmap_width B32;        /* Pixmap width */
62         CARD32 pixmap_height B32;       /* Pixmap height */
63         CARD32 xoffset B32;             /* Bitmap x offset, normally 0 */
64         CARD32 byte_order B32;          /* of image data: MSBFirst, LSBFirst */
65
66         /* bitmap_unit applies to bitmaps (depth 1 format XY) only.
67          * It is the number of bits that each scanline is padded to. */
68         CARD32 bitmap_unit B32;         
69
70         CARD32 bitmap_bit_order B32;    /* bitmaps only: MSBFirst, LSBFirst */
71
72         /* bitmap_pad applies to pixmaps (non-bitmaps) only.
73          * It is the number of bits that each scanline is padded to. */
74         CARD32 bitmap_pad B32;          
75
76         CARD32 bits_per_pixel B32;      /* Bits per pixel */
77
78         /* bytes_per_line is pixmap_width padded to bitmap_unit (bitmaps)
79          * or bitmap_pad (pixmaps).  It is the delta (in bytes) to get
80          * to the same x position on an adjacent row. */
81         CARD32 bytes_per_line B32;
82         CARD32 visual_class B32;        /* Class of colormap */
83         CARD32 red_mask B32;            /* Z red mask */
84         CARD32 green_mask B32;          /* Z green mask */
85         CARD32 blue_mask B32;           /* Z blue mask */
86         CARD32 bits_per_rgb B32;        /* Log2 of distinct color values */
87         CARD32 colormap_entries B32;    /* Number of entries in colormap; not used? */
88         CARD32 ncolors B32;             /* Number of XWDColor structures */
89         CARD32 window_width B32;        /* Window width */
90         CARD32 window_height B32;       /* Window height */
91         CARD32 window_x B32;            /* Window upper left X coordinate */
92         CARD32 window_y B32;            /* Window upper left Y coordinate */
93         CARD32 window_bdrwidth B32;     /* Window border width */
94 } XWDFileHeader;
95
96 /* Null-terminated window name follows the above structure. */
97
98 /* Next comes XWDColor structures, at offset XWDFileHeader.header_size in
99  * the file.  XWDFileHeader.ncolors tells how many XWDColor structures
100  * there are.
101  */
102
103 typedef struct {
104         CARD32  pixel B32;
105         CARD16  red B16;
106         CARD16  green B16;
107         CARD16  blue B16;
108         CARD8   flags;
109         CARD8   pad;
110 } XWDColor;
111
112 /* Last comes the image data in the format described by XWDFileHeader. */
113
114 #endif /* XWDFILE_H */
115