Back to index

lightning-sunbird  0.9+nobinonly
pixman-xserver-compat.h
Go to the documentation of this file.
00001 /*
00002  * Copyright © 2005 Red Hat, Inc.
00003  *
00004  * Permission to use, copy, modify, distribute, and sell this software
00005  * and its documentation for any purpose is hereby granted without
00006  * fee, provided that the above copyright notice appear in all copies
00007  * and that both that copyright notice and this permission notice
00008  * appear in supporting documentation, and that the name of Red Hat,
00009  * Inc. not be used in advertising or publicity pertaining to
00010  * distribution of the software without specific, written prior
00011  * permission.  Red Hat, Inc. makes no representations about the
00012  * suitability of this software for any purpose.  It is provided "as
00013  * is" without express or implied warranty.
00014  *
00015  * RED HAT, INC. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
00016  * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
00017  * FITNESS, IN NO EVENT SHALL RED HAT, INC. BE LIABLE FOR ANY SPECIAL,
00018  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
00019  * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
00020  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
00021  * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
00022  *
00023  * Author: Carl Worth, Red Hat, Inc.
00024  */
00025 
00026 #ifndef _PIXMAN_XSERVER_COMPAT_H_
00027 #define _PIXMAN_XSERVER_COMPAT_H_
00028 
00029 /* This is a compatibility header file, designed to make it easier to
00030  * synchronize files between libpixman and the xserver repository.
00031  *
00032  * Of course, long-term we would instead like to have the X server
00033  * depend on libpixman to eliminate the code duplication. But for now,
00034  * we at least make it easy to share files.
00035  *
00036  * The libpixman code base regards the xserver repository as canonical
00037  * for any shared files, so changes should be pushed up there. Then,
00038  * to merge changes back down into libpixman, the process should be to
00039  * simply copy the file and to replace the block of include directives
00040  * with:
00041  *
00042  *     #include "pixman-xserver-compat.h"
00043  */
00044 
00045 /* First, include the primary internal header file for libpixman. */
00046 
00047 #include "icint.h"
00048 
00049 /* Then, define any names that the server code will be expecting in
00050  * terms of libpixman names. */
00051 /*
00052 typedef uint8_t                    CARD8;
00053 typedef uint16_t            CARD16;
00054 typedef int16_t                    INT16;
00055 
00056 typedef int                 Bool;
00057 #define FALSE 0
00058 #define TRUE  1
00059 
00060 typedef pixman_bits_t              FbBits;
00061 typedef pixman_image_t*            PicturePtr;
00062 typedef pixman_box16_t             BoxRec;
00063 typedef pixman_box16_t*            BoxPtr;
00064 
00065 typedef pixman_point_fixed_t       xPointFixed;
00066 typedef pixman_line_fixed_t xLineFixed;
00067 typedef pixman_trapezoid_t  xTrapezoid;
00068 typedef pixman_triangle_t   xTriangle;
00069 */
00070 #define RENDER 1
00071 /*
00072 #define FB_SHIFT IC_SHIFT 
00073 #define FB_MASK IC_MASK
00074 #define FB_ALLONES IC_ALLONES
00075 */
00076 //#define FbMaskBits IcMaskBits
00077 
00078 /* XXX: We changed some function and field names which makes for some
00079  * ugly hacks... */
00080 #define pDrawable pixels
00081 #define fbGetDrawable(pDrawable, buf, outstride, outbpp, xoff, yoff) { \
00082     (buf) = (pDrawable)->data; \
00083     (outstride) = ((int) pDrawable->stride) / sizeof (pixman_bits_t); \
00084     (outbpp) = (pDrawable)->bpp; \
00085     (xoff) = 0; \
00086     (yoff) = 0; \
00087 }
00088 
00089 /* Extended repeat attributes included in 0.10 */
00090 #define RepeatNone                          0
00091 #define RepeatNormal                        1
00092 #define RepeatPad                           2
00093 #define RepeatReflect                       3
00094 
00095 typedef pixman_vector_t PictVector;
00096 typedef pixman_vector_t* PictVectorPtr;
00097 
00098 #define miIndexedPtr FbIndexedPtr
00099 #define miIndexToEnt24 FbIndexToEnt24
00100 #define miIndexToEntY24 FbIndexToEntY24
00101 
00102 #define MAX_FIXED_48_16         ((xFixed_48_16) 0x7fffffff)
00103 #define MIN_FIXED_48_16         (-((xFixed_48_16) 1 << 31))
00104 
00105 /* Then, include any header files that have been copied directly
00106  * from xserver. */
00107 
00108 #include "renderedge.h"
00109 
00110 /* And finally, this one prototype must come after the include of
00111  * renderedge.h, so it can't live alongside the other prototypes in
00112  * the horrible mess that is icint.h.
00113  */
00114 
00115 pixman_private void
00116 fbRasterizeEdges (pixman_bits_t           *buf,
00117                 int                bpp,
00118                 int                width,
00119                 int                stride,
00120                 RenderEdge         *l,
00121                 RenderEdge         *r,
00122                 pixman_fixed16_16_t       t,
00123                 pixman_fixed16_16_t       b);
00124 
00125 
00126 #endif