home *** CD-ROM | disk | FTP | other *** search
- /*
- *****************************************************************************
- ** *
- ** COPYRIGHT (c) 1988 BY *
- ** DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS. *
- ** ALL RIGHTS RESERVED *
- ** *
- ** THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED *
- ** ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE AND WITH THE *
- ** INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS SOFTWARE OR ANY OTHER *
- ** COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY *
- ** OTHER PERSON. NO TITLE TO AND OWNERSHIP OF THE SOFTWARE IS HEREBY *
- ** TRANSFERRED. *
- ** *
- ** THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE *
- ** AND SHOULD NOT BE CONSTRUED AS A COMMITMENT BY DIGITAL EQUIPMENT *
- ** CORPORATION. *
- ** *
- ** DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS *
- ** SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL. *
- ** *
- *****************************************************************************
- **++
- ** FACILITY:
- **
- ** < to be supplied >
- **
- ** ABSTRACT:
- **
- ** < to be supplied >
- **
- ** ENVIRONMENT:
- **
- ** < to be supplied >
- **
- ** MODIFICATION HISTORY:
- **
- ** < to be supplied >
- **
- **--
- **/
- #ifndef XMD_H
- #define XMD_H 1
- /* $Header: Xmd.h,v 1.16 87/07/05 17:12:43 susan Exp $ */
- /*
- * MACHINE DEPENDENT DECLARATIONS.
- *
- * These are for the VAX
- *
- */
-
- #define B16
- #define B32
-
- typedef long INT32;
- typedef short INT16;
- typedef char INT8;
-
- typedef unsigned long CARD32;
- typedef unsigned short CARD16;
- typedef unsigned char CARD8;
-
- typedef unsigned long BITS32;
- typedef unsigned short BITS16;
- typedef unsigned char BYTE;
-
- typedef unsigned char BOOL;
-
- /*
- * Machine dependent values:
- * GLYPHPADBYTES should be chosen with consideration for the space-time
- * trade-off. Padding to 0 bytes means that there is no wasted space
- * in the font bitmaps (both on disk and in memory), but that access of
- * the bitmaps will cause odd-address memory references. Padding to
- * 2 bytes would ensure even address memory references and would
- * be suitable for a 68010-class machine, but at the expense of wasted
- * space in the font bitmaps. Padding to 4 bytes would be good
- * for real 32 bit machines, etc. Be sure that you tell the font
- * compiler what kind of padding you want because its defines are
- * kept separate from this. See server/include/fonts.h for how
- * GLYPHPADBYTES is used.
- *
- * Along with this, you should choose an appropriate value for
- * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h. This
- * constant choses what kind of memory references are guarenteed during
- * font access; either 1, 2 or 4, for byte, word or longword access,
- * respectively. For instance, if you have decided to to have
- * GLYPHPADBYTES == 4, then it is pointless for you to have a
- * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already
- * guarenteed you that your fonts are longword aligned. On the other
- * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may
- * also decide that the computing involved in aligning the pointer is more
- * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1.
- *
- * XXX: this code has changed since beta test and only GLYPHPADBYTES == 4
- * has been tested, hence all machines have this same value.
- *
- */
-
- /* size of buffer to use with GetImage, measured in bytes. There's obviously
- * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives
- * you) used and the number of times the ddx routine has to be called.
- *
- * for a 1024 x 864 bit monochrome screen with a 32 bit word we get
- * 8192/4 words per buffer
- * (1024/32) = 32 words per scanline
- * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer
- * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen
- */
-
- #define IMAGE_BUFSIZE 8192
-
- #define IMAGE_BYTE_ORDER LSBFirst
- #define BITMAP_SCANLINE_UNIT 32
- #define BITMAP_SCANLINE_PAD 32 /* for a VAX, pad scanline to a longword */
- #define BITMAP_BIT_ORDER LSBFirst
- #define GLYPHPADBYTES 1
- #define GETLEFTBITS_ALIGNMENT 4
-
- #define LOG2_BITMAP_PAD 5
- #define LOG2_BYTES_PER_SCANLINE_PAD 2
-
- /*
- * this returns the number of padding units, for depth d and width w.
- * for bitmaps this can be calculated with the macros above.
- * other depths require either grovelling over the formats field of the
- * screenInfo or hardwired constants.
- */
-
- typedef struct _PaddingInfo {
- int scanlinePad;
- int bitmapPadLog2;
- } PaddingInfo;
-
- extern PaddingInfo PixmapWidthPaddingInfo[];
-
- #define PixmapWidthInPadUnits(w, d) \
- (((w) + PixmapWidthPaddingInfo[d].scanlinePad) >> \
- PixmapWidthPaddingInfo[d].bitmapPadLog2)
-
- /*
- * Return the number of bytes to which a scanline of the given
- * depth and width will be padded.
- */
- #define PixmapBytePad(w, d) \
- (PixmapWidthInPadUnits(w, d) << LOG2_BYTES_PER_SCANLINE_PAD)
-
- /* Get a bit from a pixel. pixel is a pixel of the specified depth and we
- * want the bit in position plane (where 0 is the least significant plane
- * and depth -1 is the most significant.)
- * How you extract the bit depends on image-byte-order and depth.
- * You can assume that pixel is big enough to hold a pixel depth bits deep.
- *
- * The result is cast to be an unsigned char. This seems like the least
- * common denominator, no matter what depth you have, you're only getting a
- * bit out.
- *
- * (Currently this is used only by miGetPlane.)
- * The one bit case, shown below, is obvious. The least significant bit
- * is the one we want. */
-
- #define GetBitFromPixel(pixel, plane, depth) \
- ((unsigned char) ((depth*0)+((pixel) & (1 << (plane)))))
-
- #endif /* XMD_H */
-