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