Subversion Repositories shark

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
55 pj 1
 
2
/**************************************************************************
3
 
4
Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
5
All Rights Reserved.
6
 
7
Permission is hereby granted, free of charge, to any person obtaining a
8
copy of this software and associated documentation files (the
9
"Software"), to deal in the Software without restriction, including
10
without limitation the rights to use, copy, modify, merge, publish,
11
distribute, sub license, and/or sell copies of the Software, and to
12
permit persons to whom the Software is furnished to do so, subject to
13
the following conditions:
14
 
15
The above copyright notice and this permission notice (including the
16
next paragraph) shall be included in all copies or substantial portions
17
of the Software.
18
 
19
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
22
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
23
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
24
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
25
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26
 
27
**************************************************************************/
28
 
29
/*
30
 * Authors:
31
 *   Kevin E. Martin <kevin@precisioninsight.com>
32
 *
33
 * $Header: /home/fabio/w/shark/sharkcvs/CVSROOT/shark/ports/mesa/include/GL/xmesa_xf86.h,v 1.1 2003-02-28 11:41:57 pj Exp $
34
 */
35
 
36
#ifndef _XMESA_XF86_H_
37
#define _XMESA_XF86_H_
38
 
39
#include "scrnintstr.h"
40
#include "pixmapstr.h"
41
 
42
typedef struct _XMesaImageRec XMesaImage;
43
 
44
typedef ScreenRec   XMesaDisplay;
45
typedef PixmapPtr   XMesaPixmap;
46
typedef ColormapPtr XMesaColormap;
47
typedef DrawablePtr XMesaDrawable;
48
typedef WindowPtr   XMesaWindow;
49
typedef GCPtr       XMesaGC;
50
typedef VisualPtr   XMesaVisualInfo;
51
typedef DDXPointRec XMesaPoint;
52
typedef xColorItem  XMesaColor;
53
 
54
#define XMesaSetGeneric(__d,__gc,__val,__mask) \
55
do { \
56
    CARD32 __v[1]; \
57
    (void) __d; \
58
    __v[0] = __val; \
59
    dixChangeGC(NullClient, __gc, __mask, __v, NULL); \
60
} while (0)
61
 
62
#define XMesaSetGenericPtr(__d,__gc,__pval,__mask) \
63
do { \
64
    ChangeGCVal __v[1]; \
65
    (void) __d; \
66
    __v[0].ptr = __pval; \
67
    dixChangeGC(NullClient, __gc, __mask, NULL, __v); \
68
} while (0)
69
 
70
#define XMesaSetDashes(__d,__gc,__do,__dl,__n) \
71
do { \
72
    (void) __d; \
73
    SetDashes(__gc, __do, __n, (unsigned char *)__dl); \
74
} while (0)
75
 
76
#define XMesaSetLineAttributes(__d,__gc,__lw,__ls,__cs,__js) \
77
do { \
78
    CARD32 __v[4]; \
79
    (void) __d; \
80
    __v[0] = __lw; \
81
    __v[1] = __ls; \
82
    __v[2] = __cs; \
83
    __v[3] = __js; \
84
    dixChangeGC(NullClient, __gc, \
85
                GCLineWidth|GCLineStyle|GCCapStyle|GCJoinStyle, \
86
                __v, NULL); \
87
} while (0)
88
 
89
#define XMesaSetForeground(d,gc,v) XMesaSetGeneric(d,gc,v,GCForeground)
90
#define XMesaSetBackground(d,gc,v) XMesaSetGeneric(d,gc,v,GCBackground)
91
#define XMesaSetPlaneMask(d,gc,v)  XMesaSetGeneric(d,gc,v,GCPlaneMask)
92
#define XMesaSetFunction(d,gc,v)   XMesaSetGeneric(d,gc,v,GCFunction)
93
#define XMesaSetFillStyle(d,gc,v)  XMesaSetGeneric(d,gc,v,GCFillStyle)
94
 
95
#define XMesaSetTile(d,gc,v)       XMesaSetGenericPtr(d,gc,v,GCTile)
96
#define XMesaSetStipple(d,gc,v)    XMesaSetGenericPtr(d,gc,v,GCStipple)
97
 
98
#define XMesaDrawPoint(__d,__b,__gc,__x,__y) \
99
do { \
100
    XMesaPoint __p[1]; \
101
    (void) __d; \
102
    __p[0].x = __x; \
103
    __p[0].y = __y; \
104
    ValidateGC(__b, __gc); \
105
    (*gc->ops->PolyPoint)(__b, __gc, CoordModeOrigin, 1, __p); \
106
} while (0)
107
 
108
#define XMesaDrawPoints(__d,__b,__gc,__p,__n,__m) \
109
do { \
110
    (void) __d; \
111
    ValidateGC(__b, __gc); \
112
    (*gc->ops->PolyPoint)(__b, __gc, __m, __n, __p); \
113
} while (0)
114
 
115
#define XMesaDrawLine(__d,__b,__gc,__x0,__y0,__x1,__y1) \
116
do { \
117
    XMesaPoint __p[2]; \
118
    (void) __d; \
119
    ValidateGC(__b, __gc); \
120
    __p[0].x = __x0; \
121
    __p[0].y = __y0; \
122
    __p[1].x = __x1; \
123
    __p[1].y = __y1; \
124
    (*__gc->ops->Polylines)(__b, __gc, CoordModeOrigin, 2, __p); \
125
} while (0)
126
 
127
#define XMesaFillRectangle(__d,__b,__gc,__x,__y,__w,__h) \
128
do { \
129
    xRectangle __r[1]; \
130
    (void) __d; \
131
    ValidateGC((DrawablePtr)__b, __gc); \
132
    __r[0].x = __x; \
133
    __r[0].y = __y; \
134
    __r[0].width = __w; \
135
    __r[0].height = __h; \
136
    (*__gc->ops->PolyFillRect)((DrawablePtr)__b, __gc, 1, __r); \
137
} while (0)
138
 
139
#define XMesaPutImage(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h) \
140
do { \
141
    /* Assumes: Images are always in ZPixmap format */ \
142
    (void) __d; \
143
    if (__sx || __sy) /* The non-trivial case */ \
144
        XMesaPutImageHelper(__d,__b,__gc,__i,__sx,__sy,__x,__y,__w,__h); \
145
    ValidateGC(__b, __gc); \
146
    (*__gc->ops->PutImage)(__b, __gc, ((XMesaDrawable)(__b))->depth, \
147
                           __x, __y, __w, __h, 0, ZPixmap, \
148
                           ((XMesaImage *)(__i))->data); \
149
} while (0)
150
 
151
#define XMesaCopyArea(__d,__sb,__db,__gc,__sx,__sy,__w,__h,__x,__y) \
152
do { \
153
    (void) __d; \
154
    ValidateGC(__db, __gc); \
155
    (*__gc->ops->CopyArea)((DrawablePtr)__sb, __db, __gc, \
156
                           __sx, __sy, __w, __h, __x, __y); \
157
} while (0)
158
 
159
#define XMesaFillPolygon(__d,__b,__gc,__p,__n,__s,__m) \
160
do { \
161
    (void) __d; \
162
    ValidateGC(__b, __gc); \
163
    (*__gc->ops->FillPolygon)(__b, __gc, __s, __m, __n, __p); \
164
} while (0)
165
 
166
/* CreatePixmap returns a PixmapPtr; so, it cannot be inside braces */
167
#define XMesaCreatePixmap(__d,__b,__w,__h,__depth) \
168
    (*__d->CreatePixmap)(__d, __w, __h, __depth)
169
#define XMesaFreePixmap(__d,__b) \
170
    (*__d->DestroyPixmap)(__b)
171
 
172
#define XMesaFreeGC(__d,__gc) \
173
do { \
174
    (void) __d; \
175
    FreeScratchGC(__gc); \
176
} while (0)
177
 
178
#define GET_COLORMAP_SIZE(__v)  __v->visinfo->ColormapEntries
179
#define GET_REDMASK(__v)        __v->visinfo->redMask
180
#define GET_GREENMASK(__v)      __v->visinfo->greenMask
181
#define GET_BLUEMASK(__v)       __v->visinfo->blueMask
182
#define GET_VISUAL_CLASS(__v)   __v->visinfo->class
183
#define GET_VISUAL_DEPTH(__v)   __v->visinfo->nplanes
184
#define GET_BLACK_PIXEL(__v)    __v->display->blackPixel
185
#define CHECK_BYTE_ORDER(__v)   GL_TRUE
186
#define CHECK_FOR_HPCR(__v)     GL_FALSE
187
 
188
#endif