65fea56f17cd614bc8908264df980a62e1931468vboxsync/***********************************************************
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987, 1998 The Open Group
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, distribute, and sell this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose is hereby granted without fee, provided that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncthe above copyright notice appear in all copies and that both that
65fea56f17cd614bc8908264df980a62e1931468vboxsynccopyright notice and this permission notice appear in supporting
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncThe above copyright notice and this permission notice shall be included in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncall copies or substantial portions of the Software.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
65fea56f17cd614bc8908264df980a62e1931468vboxsyncOPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncAN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncExcept as contained in this notice, the name of The Open Group shall not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or otherwise to promote the sale, use or other dealings
65fea56f17cd614bc8908264df980a62e1931468vboxsyncin this Software without prior written authorization from The Open Group.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncCopyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync All Rights Reserved
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncPermission to use, copy, modify, and distribute this software and its
65fea56f17cd614bc8908264df980a62e1931468vboxsyncdocumentation for any purpose and without fee is hereby granted,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncprovided that the above copyright notice appear in all copies and that
65fea56f17cd614bc8908264df980a62e1931468vboxsyncboth that copyright notice and this permission notice appear in
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsupporting documentation, and that the name of Digital not be
65fea56f17cd614bc8908264df980a62e1931468vboxsyncused in advertising or publicity pertaining to distribution of the
65fea56f17cd614bc8908264df980a62e1931468vboxsyncsoftware without specific, written prior permission.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
65fea56f17cd614bc8908264df980a62e1931468vboxsyncALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
65fea56f17cd614bc8908264df980a62e1931468vboxsyncDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65fea56f17cd614bc8908264df980a62e1931468vboxsyncANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
65fea56f17cd614bc8908264df980a62e1931468vboxsyncARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
65fea56f17cd614bc8908264df980a62e1931468vboxsyncSOFTWARE.
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync******************************************************************/
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef SERVERMD_H
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define SERVERMD_H 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Note: much of this is vestigial from mfb/cfb times. This should
65fea56f17cd614bc8908264df980a62e1931468vboxsync * really be simplified even further.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Machine dependent values:
65fea56f17cd614bc8908264df980a62e1931468vboxsync * GLYPHPADBYTES should be chosen with consideration for the space-time
65fea56f17cd614bc8908264df980a62e1931468vboxsync * trade-off. Padding to 0 bytes means that there is no wasted space
65fea56f17cd614bc8908264df980a62e1931468vboxsync * in the font bitmaps (both on disk and in memory), but that access of
65fea56f17cd614bc8908264df980a62e1931468vboxsync * the bitmaps will cause odd-address memory references. Padding to
65fea56f17cd614bc8908264df980a62e1931468vboxsync * 2 bytes would ensure even address memory references and would
65fea56f17cd614bc8908264df980a62e1931468vboxsync * be suitable for a 68010-class machine, but at the expense of wasted
65fea56f17cd614bc8908264df980a62e1931468vboxsync * space in the font bitmaps. Padding to 4 bytes would be good
65fea56f17cd614bc8908264df980a62e1931468vboxsync * for real 32 bit machines, etc. Be sure that you tell the font
65fea56f17cd614bc8908264df980a62e1931468vboxsync * compiler what kind of padding you want because its defines are
65fea56f17cd614bc8908264df980a62e1931468vboxsync * kept separate from this. See server/include/font.h for how
65fea56f17cd614bc8908264df980a62e1931468vboxsync * GLYPHPADBYTES is used.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __avr32__
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __avr32__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __arm32__
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __arm32__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__nds32__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(XF86MONOVGA) || defined(XF86VGA16) || defined(XF86MONO)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(XF86MONOVGA) || defined(XF86VGA16)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_UNIT 8
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GETLEFTBITS_ALIGNMENT 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LARGE_INSTRUCTION_CACHE
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define AVOID_MEMORY_READ
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __nds32__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined __hppa__
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4 /* to make fb work */
65fea56f17cd614bc8908264df980a62e1931468vboxsync /* byte boundries */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* hpux || __hppa__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__powerpc__) || defined(__ppc__) || defined(__ppc64__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* PowerPC */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__sh__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__BIG_ENDIAN__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SuperH */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__m32r__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__BIG_ENDIAN__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __m32r__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if (defined(sun) && (defined(__sparc) || defined(sparc))) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (defined(__uxp__) && (defined(sparc) || defined(mc68000))) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync defined(__sparc__) || defined(__mc68000__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__sparc) || defined(__sparc__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if !defined(sparc)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define sparc 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(sun386) || defined(sun5)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst /* Values for the SUN only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst /* Values for the SUN only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* sun && !(i386 && SVR4) */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(ibm032) || defined (ibm)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __i386__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst /* Value for PS/2 only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst /* Values for the RT only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 1
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* ibm pcc doesn't understand pragmas. */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __i386__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_UNIT 8
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* ibm */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if (defined(mips) || defined(__mips))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(MIPSEL) || defined(__MIPSEL__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst /* Values for the PMAX only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#else
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst /* Values for the MIPS only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* mips */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__alpha) || defined(__alpha__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst /* Values for the Alpha only */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* alpha */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined (linux) && defined (__s390__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_UNIT 8
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define FAST_UNALIGNED_READ
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* linux/s390 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined (linux) && defined (__s390x__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_UNIT 8
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define FAST_UNALIGNED_READ
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* linux/s390x */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__ia64__) || defined(ia64)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* ia64 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(__amd64__) || defined(amd64) || defined(__amd64)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* ???? */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* AMD64 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(SVR4) && (defined(__i386__) || defined(__i386) ) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync defined(__alpha__) || defined(__alpha) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync defined(__i386__) || \
65fea56f17cd614bc8908264df980a62e1931468vboxsync defined(__s390x__) || defined(__s390__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef IMAGE_BYTE_ORDER
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef BITMAP_BIT_ORDER
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef GLYPHPADBYTES
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SVR4 / BSD / i386 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined (linux) && defined (__mc68000__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* linux/m68k */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* linux on ARM */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined(linux) && defined(__arm__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* linux on IBM S/390 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#if defined (linux) && defined (__s390__)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* linux/s390 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __aarch64__
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __AARCH64EL__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER LSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifdef __AARCH64EB__
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BYTE_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_BIT_ORDER MSBFirst
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define GLYPHPADBYTES 4
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* __aarch64__ */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* size of buffer to use with GetImage, measured in bytes. There's obviously
65fea56f17cd614bc8908264df980a62e1931468vboxsync * a trade-off between the amount of heap used and the number of times the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * ddx routine has to be called.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef IMAGE_BUFSIZE
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define IMAGE_BUFSIZE (64*1024)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* pad scanline to a longword */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef BITMAP_SCANLINE_UNIT
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_UNIT 32
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#ifndef BITMAP_SCANLINE_PAD
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BITMAP_SCANLINE_PAD 32
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LOG2_BITMAP_PAD 5
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define LOG2_BYTES_PER_SCANLINE_PAD 2
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#include <X11/Xfuncproto.h>
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * This returns the number of padding units, for depth d and width w.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * For bitmaps this can be calculated with the macros above.
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Other depths require either grovelling over the formats field of the
65fea56f17cd614bc8908264df980a62e1931468vboxsync * screenInfo or hardwired constants.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsynctypedef struct _PaddingInfo {
65fea56f17cd614bc8908264df980a62e1931468vboxsync int padRoundUp; /* pixels per pad unit - 1 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int padPixelsLog2; /* log 2 (pixels per pad unit) */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int padBytesLog2; /* log 2 (bytes per pad unit) */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int notPower2; /* bitsPerPixel not a power of 2 */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int bytesPerPixel; /* only set when notPower2 is TRUE */
65fea56f17cd614bc8908264df980a62e1931468vboxsync int bitsPerPixel; /* bits per pixel */
65fea56f17cd614bc8908264df980a62e1931468vboxsync} PaddingInfo;
65fea56f17cd614bc8908264df980a62e1931468vboxsyncextern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[];
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/* The only portable way to get the bpp from the depth is to look it up */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PixmapWidthInPadUnits(w, d) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (PixmapWidthPaddingInfo[d].notPower2 ? \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapWidthPaddingInfo[d].padBytesLog2) : \
65fea56f17cd614bc8908264df980a62e1931468vboxsync ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
65fea56f17cd614bc8908264df980a62e1931468vboxsync PixmapWidthPaddingInfo[d].padPixelsLog2))
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync/*
65fea56f17cd614bc8908264df980a62e1931468vboxsync * Return the number of bytes to which a scanline of the given
65fea56f17cd614bc8908264df980a62e1931468vboxsync * depth and width will be padded.
65fea56f17cd614bc8908264df980a62e1931468vboxsync */
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PixmapBytePad(w, d) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BitmapBytePad(w) \
65fea56f17cd614bc8908264df980a62e1931468vboxsync (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PixmapWidthInPadUnitsProto(w, d) PixmapWidthInPadUnits(w, d)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define PixmapBytePadProto(w, d) PixmapBytePad(w, d)
65fea56f17cd614bc8908264df980a62e1931468vboxsync#define BitmapBytePadProto(w) BitmapBytePad(w)
65fea56f17cd614bc8908264df980a62e1931468vboxsync
65fea56f17cd614bc8908264df980a62e1931468vboxsync#endif /* SERVERMD_H */