VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.17.1/servermd.h@ 78293

Last change on this file since 78293 was 54163, checked in by vboxsync, 10 years ago

Additions/x11/vboxvideo: support X.Org Server 1.17 (still untested).

  • Property svn:eol-style set to native
File size: 4.9 KB
Line 
1/***********************************************************
2
3Copyright 1987, 1998 The Open Group
4
5Permission to use, copy, modify, distribute, and sell this software and its
6documentation for any purpose is hereby granted without fee, provided that
7the above copyright notice appear in all copies and that both that
8copyright notice and this permission notice appear in supporting
9documentation.
10
11The above copyright notice and this permission notice shall be included in
12all copies or substantial portions of the Software.
13
14THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20
21Except as contained in this notice, the name of The Open Group shall not be
22used in advertising or otherwise to promote the sale, use or other dealings
23in this Software without prior written authorization from The Open Group.
24
25Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
26
27 All Rights Reserved
28
29Permission to use, copy, modify, and distribute this software and its
30documentation for any purpose and without fee is hereby granted,
31provided that the above copyright notice appear in all copies and that
32both that copyright notice and this permission notice appear in
33supporting documentation, and that the name of Digital not be
34used in advertising or publicity pertaining to distribution of the
35software without specific, written prior permission.
36
37DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
40ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
41WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
42ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
43SOFTWARE.
44
45******************************************************************/
46
47#ifndef SERVERMD_H
48#define SERVERMD_H 1
49
50#if !defined(_DIX_CONFIG_H_) && !defined(_XORG_SERVER_H_)
51#error Drivers must include xorg-server.h before any other xserver headers
52#error xserver code must include dix-config.h before any other headers
53#endif
54
55#if X_BYTE_ORDER == X_LITTLE_ENDIAN
56#define IMAGE_BYTE_ORDER LSBFirst
57#define BITMAP_BIT_ORDER LSBFirst
58#elif X_BYTE_ORDER == X_BIG_ENDIAN
59#define IMAGE_BYTE_ORDER MSBFirst
60#define BITMAP_BIT_ORDER MSBFirst
61#else
62#error "Too weird to live."
63#endif
64
65#ifndef GLYPHPADBYTES
66#define GLYPHPADBYTES 4
67#endif
68
69/* size of buffer to use with GetImage, measured in bytes. There's obviously
70 * a trade-off between the amount of heap used and the number of times the
71 * ddx routine has to be called.
72 */
73#ifndef IMAGE_BUFSIZE
74#define IMAGE_BUFSIZE (64*1024)
75#endif
76
77/* pad scanline to a longword */
78#ifndef BITMAP_SCANLINE_UNIT
79#define BITMAP_SCANLINE_UNIT 32
80#endif
81
82#ifndef BITMAP_SCANLINE_PAD
83#define BITMAP_SCANLINE_PAD 32
84#define LOG2_BITMAP_PAD 5
85#define LOG2_BYTES_PER_SCANLINE_PAD 2
86#endif
87
88#include <X11/Xfuncproto.h>
89/*
90 * This returns the number of padding units, for depth d and width w.
91 * For bitmaps this can be calculated with the macros above.
92 * Other depths require either grovelling over the formats field of the
93 * screenInfo or hardwired constants.
94 */
95
96typedef struct _PaddingInfo {
97 int padRoundUp; /* pixels per pad unit - 1 */
98 int padPixelsLog2; /* log 2 (pixels per pad unit) */
99 int padBytesLog2; /* log 2 (bytes per pad unit) */
100 int notPower2; /* bitsPerPixel not a power of 2 */
101 int bytesPerPixel; /* only set when notPower2 is TRUE */
102 int bitsPerPixel; /* bits per pixel */
103} PaddingInfo;
104extern _X_EXPORT PaddingInfo PixmapWidthPaddingInfo[];
105
106/* The only portable way to get the bpp from the depth is to look it up */
107#define BitsPerPixel(d) (PixmapWidthPaddingInfo[d].bitsPerPixel)
108
109#define PixmapWidthInPadUnits(w, d) \
110 (PixmapWidthPaddingInfo[d].notPower2 ? \
111 (((int)(w) * PixmapWidthPaddingInfo[d].bytesPerPixel + \
112 PixmapWidthPaddingInfo[d].bytesPerPixel) >> \
113 PixmapWidthPaddingInfo[d].padBytesLog2) : \
114 ((int)((w) + PixmapWidthPaddingInfo[d].padRoundUp) >> \
115 PixmapWidthPaddingInfo[d].padPixelsLog2))
116
117/*
118 * Return the number of bytes to which a scanline of the given
119 * depth and width will be padded.
120 */
121#define PixmapBytePad(w, d) \
122 (PixmapWidthInPadUnits(w, d) << PixmapWidthPaddingInfo[d].padBytesLog2)
123
124#define BitmapBytePad(w) \
125 (((int)((w) + BITMAP_SCANLINE_PAD - 1) >> LOG2_BITMAP_PAD) << LOG2_BYTES_PER_SCANLINE_PAD)
126
127#endif /* SERVERMD_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette