|
|
1.1 ! root 1: /*********************************************************** ! 2: Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, ! 3: and the Massachusetts Institute of Technology, Cambridge, Massachusetts. ! 4: ! 5: All Rights Reserved ! 6: ! 7: Permission to use, copy, modify, and distribute this software and its ! 8: documentation for any purpose and without fee is hereby granted, ! 9: provided that the above copyright notice appear in all copies and that ! 10: both that copyright notice and this permission notice appear in ! 11: supporting documentation, and that the names of Digital or MIT not be ! 12: used in advertising or publicity pertaining to distribution of the ! 13: software without specific, written prior permission. ! 14: ! 15: DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ! 16: ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ! 17: DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ! 18: ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, ! 19: WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ! 20: ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS ! 21: SOFTWARE. ! 22: ! 23: ******************************************************************/ ! 24: #ifndef SERVERMD_H ! 25: #define SERVERMD_H 1 ! 26: /* $Header: servermd.h,v 1.26 87/09/13 00:56:46 toddb Exp $ */ ! 27: ! 28: /* ! 29: * The vendor string identifies the vendor responsible for the ! 30: * server executable. ! 31: */ ! 32: #ifndef VENDOR_STRING ! 33: #define VENDOR_STRING "Massachusetts Institute of Technology" ! 34: #endif VENDOR_STRING ! 35: ! 36: /* ! 37: * The vendor release number identifies, for the purpose of submitting ! 38: * traceable bug reports, the release number of software produced ! 39: * by the vendor. ! 40: */ ! 41: #ifndef VENDOR_RELEASE ! 42: #define VENDOR_RELEASE 1 ! 43: #endif VENDOR_RELEASE ! 44: ! 45: /* ! 46: * Machine dependent values: ! 47: * GLYPHPADBYTES should be chosen with consideration for the space-time ! 48: * trade-off. Padding to 0 bytes means that there is no wasted space ! 49: * in the font bitmaps (both on disk and in memory), but that access of ! 50: * the bitmaps will cause odd-address memory references. Padding to ! 51: * 2 bytes would ensure even address memory references and would ! 52: * be suitable for a 68010-class machine, but at the expense of wasted ! 53: * space in the font bitmaps. Padding to 4 bytes would be good ! 54: * for real 32 bit machines, etc. Be sure that you tell the font ! 55: * compiler what kind of padding you want because its defines are ! 56: * kept separate from this. See server/include/fonts.h for how ! 57: * GLYPHPADBYTES is used. ! 58: * ! 59: * Along with this, you should choose an appropriate value for ! 60: * GETLEFTBITS_ALIGNMENT, which is used in ddx/mfb/maskbits.h. This ! 61: * constant choses what kind of memory references are guarenteed during ! 62: * font access; either 1, 2 or 4, for byte, word or longword access, ! 63: * respectively. For instance, if you have decided to to have ! 64: * GLYPHPADBYTES == 4, then it is pointless for you to have a ! 65: * GETLEFTBITS_ALIGNMENT > 1, because the padding of the fonts has already ! 66: * guarenteed you that your fonts are longword aligned. On the other ! 67: * hand, even if you have chosen GLYPHPADBYTES == 1 to save space, you may ! 68: * also decide that the computing involved in aligning the pointer is more ! 69: * costly than an odd-address access; you choose GETLEFTBITS_ALIGNMENT == 1. ! 70: * ! 71: * XXX: this code has changed since beta test and only GLYPHPADBYTES == 4 ! 72: * has been tested, hence all machines have this same value. ! 73: * ! 74: */ ! 75: ! 76: #ifdef vax ! 77: ! 78: #define IMAGE_BYTE_ORDER LSBFirst /* Values for the VAX only */ ! 79: #define BITMAP_BIT_ORDER LSBFirst ! 80: #define GLYPHPADBYTES 1 ! 81: #define GETLEFTBITS_ALIGNMENT 4 ! 82: ! 83: #else ! 84: # ifdef sun ! 85: ! 86: #define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */ ! 87: #define BITMAP_BIT_ORDER MSBFirst ! 88: #define GLYPHPADBYTES 4 ! 89: #define GETLEFTBITS_ALIGNMENT 4 ! 90: ! 91: # else ! 92: # ifdef apollo ! 93: ! 94: #define IMAGE_BYTE_ORDER MSBFirst /* Values for the Apollo only*/ ! 95: #define BITMAP_BIT_ORDER MSBFirst ! 96: #define GLYPHPADBYTES 2 ! 97: #define GETLEFTBITS_ALIGNMENT 4 ! 98: ! 99: # else ! 100: # ifdef ibm032 ! 101: ! 102: #define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only*/ ! 103: #define BITMAP_BIT_ORDER MSBFirst ! 104: #define GLYPHPADBYTES 1 ! 105: #define GETLEFTBITS_ALIGNMENT 4 ! 106: /* ibm pcc doesn't understand pragmas. */ ! 107: ! 108: # endif ! 109: # endif ! 110: # endif ! 111: #endif ! 112: ! 113: /* size of buffer to use with GetImage, measured in bytes. There's obviously ! 114: * a trade-off between the amount of stack (or whatever ALLOCATE_LOCAL gives ! 115: * you) used and the number of times the ddx routine has to be called. ! 116: * ! 117: * for a 1024 x 864 bit monochrome screen with a 32 bit word we get ! 118: * 8192/4 words per buffer ! 119: * (1024/32) = 32 words per scanline ! 120: * 2048 words per buffer / 32 words per scanline = 64 scanlines per buffer ! 121: * 864 scanlines / 64 scanlines = 14 buffers to draw a full screen ! 122: */ ! 123: #define IMAGE_BUFSIZE 8192 ! 124: ! 125: /* pad scanline to a longword */ ! 126: #define BITMAP_SCANLINE_UNIT 32 ! 127: #define BITMAP_SCANLINE_PAD 32 ! 128: ! 129: #define LOG2_BITMAP_PAD 5 ! 130: #define LOG2_BYTES_PER_SCANLINE_PAD 2 ! 131: ! 132: /* ! 133: * This returns the number of padding units, for depth d and width w. ! 134: * For bitmaps this can be calculated with the macros above. ! 135: * Other depths require either grovelling over the formats field of the ! 136: * screenInfo or hardwired constants. ! 137: */ ! 138: ! 139: typedef struct _PaddingInfo { ! 140: int scanlinePad; ! 141: int bitmapPadLog2; ! 142: } PaddingInfo; ! 143: extern PaddingInfo PixmapWidthPaddingInfo[]; ! 144: ! 145: #define PixmapWidthInPadUnits(w, d) \ ! 146: (((w) + PixmapWidthPaddingInfo[d].scanlinePad) >> \ ! 147: PixmapWidthPaddingInfo[d].bitmapPadLog2) ! 148: ! 149: /* ! 150: * Return the number of bytes to which a scanline of the given ! 151: * depth and width will be padded. ! 152: */ ! 153: #define PixmapBytePad(w, d) \ ! 154: (PixmapWidthInPadUnits(w, d) << LOG2_BYTES_PER_SCANLINE_PAD) ! 155: ! 156: #endif SERVERMD_H
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.