~ubuntu-branches/ubuntu/karmic/virtualbox-ose/karmic-updates

« back to all changes in this revision

Viewing changes to src/VBox/Additions/x11/x11include/7.0/xorg/fb.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2009-09-14 18:25:07 UTC
  • mfrom: (0.4.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090914182507-c98g07mq16hjmn6d
Tags: 3.0.6-dfsg-1ubuntu1
* Merge from debian unstable (LP: #429697), remaining changes:
  - Enable DKMS support on virtualbox host and guest modules (LP: #267097)
    - Drop virtualbox-ose{-guest,}-modules-* package templates
    - Recommend *-source instead of *-modules packages
    - Replace error messages related to missing/mismatched
      kernel module accordingly
  - Autoload kernel module
    - LOAD_VBOXDRV_MODULE=1 in virtualbox-ose.default
  - Disable update action
    - patches/u01-disable-update-action.dpatch
  - Virtualbox should go in Accessories, not in System tools (LP: #288590)
    - virtualbox-ose-qt.files/virtualbox-ose.desktop
  - Add apport hook
    - virtualbox-ose.files/source_virtualbox-ose.py
    - virtualbox-ose.install
  - Add launchpad integration
    - control
    - lpi-bug.xpm
    - patches/u02-lp-integration.dpatch
  - virtualbox, virtualbox-* (names of the upstream proprietary packages)
    conflict with virtualbox-ose (LP: #379878)
* Make debug package depend on normal or guest utils package
* Drop patches/22-pulseaudio-stubs.dpatch (applied upstream)
* Rename Ubuntu specific patches to uXX-*.dpatch
* Fix lintian warnings in maintainer scripts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * $XFree86: xc/programs/Xserver/fb/fb.h,v 1.36tsi Exp $
3
 
 *
4
 
 * Copyright © 1998 Keith Packard
5
 
 *
6
 
 * Permission to use, copy, modify, distribute, and sell this software and its
7
 
 * documentation for any purpose is hereby granted without fee, provided that
8
 
 * the above copyright notice appear in all copies and that both that
9
 
 * copyright notice and this permission notice appear in supporting
10
 
 * documentation, and that the name of Keith Packard not be used in
11
 
 * advertising or publicity pertaining to distribution of the software without
12
 
 * specific, written prior permission.  Keith Packard makes no
13
 
 * representations about the suitability of this software for any purpose.  It
14
 
 * is provided "as is" without express or implied warranty.
15
 
 *
16
 
 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
17
 
 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
18
 
 * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
19
 
 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20
 
 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21
 
 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
22
 
 * PERFORMANCE OF THIS SOFTWARE.
23
 
 */
24
 
 
25
 
/* $XdotOrg: xc/programs/Xserver/fb/fb.h,v 1.12 2005/08/24 11:18:33 daniels Exp $ */
26
 
 
27
 
#ifndef _FB_H_
28
 
#define _FB_H_
29
 
 
30
 
#include <X11/X.h>
31
 
#include "scrnintstr.h"
32
 
#include "pixmap.h"
33
 
#include "pixmapstr.h"
34
 
#include "region.h"
35
 
#include "gcstruct.h"
36
 
#include "colormap.h"
37
 
#include "miscstruct.h"
38
 
#include "servermd.h"
39
 
#include "windowstr.h"
40
 
#include "mi.h"
41
 
#include "migc.h"
42
 
#include "mibstore.h"
43
 
#ifdef RENDER
44
 
#include "picturestr.h"
45
 
#else
46
 
#include "picture.h"
47
 
#endif
48
 
 
49
 
/*
50
 
 * This single define controls the basic size of data manipulated
51
 
 * by this software; it must be log2(sizeof (FbBits) * 8)
52
 
 */
53
 
 
54
 
#ifndef FB_SHIFT
55
 
#define FB_SHIFT    LOG2_BITMAP_PAD
56
 
#endif
57
 
 
58
 
#if FB_SHIFT < LOG2_BITMAP_PAD
59
 
    error FB_SHIFT must be >= LOG2_BITMAP_PAD
60
 
#endif
61
 
    
62
 
#define FB_UNIT     (1 << FB_SHIFT)
63
 
#define FB_HALFUNIT (1 << (FB_SHIFT-1))
64
 
#define FB_MASK     (FB_UNIT - 1)
65
 
#define FB_ALLONES  ((FbBits) -1)
66
 
    
67
 
#if GLYPHPADBYTES != 4
68
 
#error "GLYPHPADBYTES must be 4"
69
 
#endif
70
 
#if GETLEFTBITS_ALIGNMENT != 1
71
 
#error "GETLEFTBITS_ALIGNMENT must be 1"
72
 
#endif
73
 
/* whether to bother to include 24bpp support */
74
 
#ifndef FBNO24BIT
75
 
#define FB_24BIT
76
 
#endif
77
 
 
78
 
/*
79
 
 * Unless otherwise instructed, fb includes code to advertise 24bpp
80
 
 * windows with 32bpp image format for application compatibility
81
 
 */
82
 
 
83
 
#ifdef FB_24BIT
84
 
#ifndef FBNO24_32
85
 
#define FB_24_32BIT
86
 
#endif
87
 
#endif
88
 
 
89
 
#define FB_STIP_SHIFT   LOG2_BITMAP_PAD
90
 
#define FB_STIP_UNIT    (1 << FB_STIP_SHIFT)
91
 
#define FB_STIP_MASK    (FB_STIP_UNIT - 1)
92
 
#define FB_STIP_ALLONES ((FbStip) -1)
93
 
    
94
 
#define FB_STIP_ODDSTRIDE(s)    (((s) & (FB_MASK >> FB_STIP_SHIFT)) != 0)
95
 
#define FB_STIP_ODDPTR(p)       ((((long) (p)) & (FB_MASK >> 3)) != 0)
96
 
    
97
 
#define FbStipStrideToBitsStride(s) (((s) >> (FB_SHIFT - FB_STIP_SHIFT)))
98
 
#define FbBitsStrideToStipStride(s) (((s) << (FB_SHIFT - FB_STIP_SHIFT)))
99
 
    
100
 
#define FbFullMask(n)   ((n) == FB_UNIT ? FB_ALLONES : ((((FbBits) 1) << n) - 1))
101
 
    
102
 
#if FB_SHIFT == 6
103
 
# ifdef WIN32
104
 
typedef unsigned __int64    FbBits;
105
 
# else
106
 
#  if defined(__alpha__) || defined(__alpha) || \
107
 
      defined(ia64) || defined(__ia64__) || \
108
 
      defined(__sparc64__) || defined(_LP64) || \
109
 
      defined(__s390x__) || \
110
 
      defined(amd64) || defined (__amd64__) || \
111
 
      defined (__powerpc64__) || \
112
 
      (defined(sgi) && (_MIPS_SZLONG == 64))
113
 
typedef unsigned long       FbBits;
114
 
#  else
115
 
typedef unsigned long long  FbBits;
116
 
#  endif
117
 
# endif
118
 
#endif
119
 
 
120
 
#if FB_SHIFT == 5
121
 
typedef CARD32              FbBits;
122
 
#endif
123
 
 
124
 
#if FB_SHIFT == 4
125
 
typedef CARD16              FbBits;
126
 
#endif
127
 
 
128
 
#if LOG2_BITMAP_PAD == FB_SHIFT
129
 
typedef FbBits              FbStip;
130
 
#else
131
 
# if LOG2_BITMAP_PAD == 5
132
 
typedef CARD32              FbStip;
133
 
# endif
134
 
#endif
135
 
 
136
 
typedef int                 FbStride;
137
 
 
138
 
 
139
 
#ifdef FB_DEBUG
140
 
extern void fbValidateDrawable(DrawablePtr d);
141
 
extern void fbInitializeDrawable(DrawablePtr d);
142
 
extern void fbSetBits (FbStip *bits, int stride, FbStip data);
143
 
#define FB_HEAD_BITS   (FbStip) (0xbaadf00d)
144
 
#define FB_TAIL_BITS   (FbStip) (0xbaddf0ad)
145
 
#else
146
 
#define fbValidateDrawable(d)
147
 
#define fdInitializeDrawable(d)
148
 
#endif
149
 
 
150
 
#include "fbrop.h"
151
 
 
152
 
#if BITMAP_BIT_ORDER == LSBFirst
153
 
#define FbScrLeft(x,n)  ((x) >> (n))
154
 
#define FbScrRight(x,n) ((x) << (n))
155
 
/* #define FbLeftBits(x,n)      ((x) & ((((FbBits) 1) << (n)) - 1)) */
156
 
#define FbLeftStipBits(x,n) ((x) & ((((FbStip) 1) << (n)) - 1))
157
 
#define FbStipMoveLsb(x,s,n)    (FbStipRight (x,(s)-(n)))
158
 
#define FbPatternOffsetBits     0
159
 
#else
160
 
#define FbScrLeft(x,n)  ((x) << (n))
161
 
#define FbScrRight(x,n) ((x) >> (n))
162
 
/* #define FbLeftBits(x,n)      ((x) >> (FB_UNIT - (n))) */
163
 
#define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
164
 
#define FbStipMoveLsb(x,s,n)    (x)
165
 
#define FbPatternOffsetBits     (sizeof (FbBits) - 1)
166
 
#endif
167
 
 
168
 
#include "micoord.h"
169
 
 
170
 
#define FbStipLeft(x,n) FbScrLeft(x,n)
171
 
#define FbStipRight(x,n) FbScrRight(x,n)
172
 
 
173
 
#define FbRotLeft(x,n)  FbScrLeft(x,n) | (n ? FbScrRight(x,FB_UNIT-n) : 0)
174
 
#define FbRotRight(x,n) FbScrRight(x,n) | (n ? FbScrLeft(x,FB_UNIT-n) : 0)
175
 
 
176
 
#define FbRotStipLeft(x,n)  FbStipLeft(x,n) | (n ? FbStipRight(x,FB_STIP_UNIT-n) : 0)
177
 
#define FbRotStipRight(x,n)  FbStipRight(x,n) | (n ? FbStipLeft(x,FB_STIP_UNIT-n) : 0)
178
 
 
179
 
#define FbLeftMask(x)       ( ((x) & FB_MASK) ? \
180
 
                             FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
181
 
#define FbRightMask(x)      ( ((FB_UNIT - (x)) & FB_MASK) ? \
182
 
                             FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
183
 
 
184
 
#define FbLeftStipMask(x)   ( ((x) & FB_STIP_MASK) ? \
185
 
                             FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) : 0)
186
 
#define FbRightStipMask(x)  ( ((FB_STIP_UNIT - (x)) & FB_STIP_MASK) ? \
187
 
                             FbScrLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - (x)) & FB_STIP_MASK) : 0)
188
 
 
189
 
#define FbBitsMask(x,w) (FbScrRight(FB_ALLONES,(x) & FB_MASK) & \
190
 
                         FbScrLeft(FB_ALLONES,(FB_UNIT - ((x) + (w))) & FB_MASK))
191
 
 
192
 
#define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
193
 
                         FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
194
 
 
195
 
 
196
 
#define FbMaskBits(x,w,l,n,r) { \
197
 
    n = (w); \
198
 
    r = FbRightMask((x)+n); \
199
 
    l = FbLeftMask(x); \
200
 
    if (l) { \
201
 
        n -= FB_UNIT - ((x) & FB_MASK); \
202
 
        if (n < 0) { \
203
 
            n = 0; \
204
 
            l &= r; \
205
 
            r = 0; \
206
 
        } \
207
 
    } \
208
 
    n >>= FB_SHIFT; \
209
 
}
210
 
 
211
 
#ifdef FBNOPIXADDR
212
 
#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) FbMaskBits(x,w,l,n,r)
213
 
#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
214
 
    *dst = FbDoMaskRRop(*dst,and,xor,l); \
215
 
}
216
 
#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
217
 
    *dst = FbDoMaskRRop(*dst,and,xor,r); \
218
 
}
219
 
#else
220
 
 
221
 
#define FbByteMaskInvalid   0x10
222
 
 
223
 
#define FbPatternOffset(o,t)  ((o) ^ (FbPatternOffsetBits & ~(sizeof (t) - 1)))
224
 
 
225
 
#define FbPtrOffset(p,o,t)              ((t *) ((CARD8 *) (p) + (o)))
226
 
#define FbSelectPatternPart(xor,o,t)    ((xor) >> (FbPatternOffset (o,t) << 3))
227
 
#define FbStorePart(dst,off,t,xor)      (*FbPtrOffset(dst,off,t) = \
228
 
                                         FbSelectPart(xor,off,t))
229
 
#ifndef FbSelectPart
230
 
#define FbSelectPart(x,o,t) FbSelectPatternPart(x,o,t)
231
 
#endif
232
 
 
233
 
#define FbMaskBitsBytes(x,w,copy,l,lb,n,r,rb) { \
234
 
    n = (w); \
235
 
    lb = 0; \
236
 
    rb = 0; \
237
 
    r = FbRightMask((x)+n); \
238
 
    if (r) { \
239
 
        /* compute right byte length */ \
240
 
        if ((copy) && (((x) + n) & 7) == 0) { \
241
 
            rb = (((x) + n) & FB_MASK) >> 3; \
242
 
        } else { \
243
 
            rb = FbByteMaskInvalid; \
244
 
        } \
245
 
    } \
246
 
    l = FbLeftMask(x); \
247
 
    if (l) { \
248
 
        /* compute left byte length */ \
249
 
        if ((copy) && ((x) & 7) == 0) { \
250
 
            lb = ((x) & FB_MASK) >> 3; \
251
 
        } else { \
252
 
            lb = FbByteMaskInvalid; \
253
 
        } \
254
 
        /* subtract out the portion painted by leftMask */ \
255
 
        n -= FB_UNIT - ((x) & FB_MASK); \
256
 
        if (n < 0) { \
257
 
            if (lb != FbByteMaskInvalid) { \
258
 
                if (rb == FbByteMaskInvalid) { \
259
 
                    lb = FbByteMaskInvalid; \
260
 
                } else if (rb) { \
261
 
                    lb |= (rb - lb) << (FB_SHIFT - 3); \
262
 
                    rb = 0; \
263
 
                } \
264
 
            } \
265
 
            n = 0; \
266
 
            l &= r; \
267
 
            r = 0; \
268
 
        }\
269
 
    } \
270
 
    n >>= FB_SHIFT; \
271
 
}
272
 
 
273
 
#if FB_SHIFT == 6
274
 
#define FbDoLeftMaskByteRRop6Cases(dst,xor) \
275
 
    case (sizeof (FbBits) - 7) | (1 << (FB_SHIFT - 3)): \
276
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
277
 
        break; \
278
 
    case (sizeof (FbBits) - 7) | (2 << (FB_SHIFT - 3)): \
279
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
280
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \
281
 
        break; \
282
 
    case (sizeof (FbBits) - 7) | (3 << (FB_SHIFT - 3)): \
283
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
284
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
285
 
        break; \
286
 
    case (sizeof (FbBits) - 7) | (4 << (FB_SHIFT - 3)): \
287
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
288
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
289
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
290
 
        break; \
291
 
    case (sizeof (FbBits) - 7) | (5 << (FB_SHIFT - 3)): \
292
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
293
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
294
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
295
 
        break; \
296
 
    case (sizeof (FbBits) - 7) | (6 << (FB_SHIFT - 3)): \
297
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
298
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
299
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
300
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
301
 
        break; \
302
 
    case (sizeof (FbBits) - 7): \
303
 
        FbStorePart(dst,sizeof (FbBits) - 7,CARD8,xor); \
304
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
305
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
306
 
        break; \
307
 
    case (sizeof (FbBits) - 6) | (1 << (FB_SHIFT - 3)): \
308
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD8,xor); \
309
 
        break; \
310
 
    case (sizeof (FbBits) - 6) | (2 << (FB_SHIFT - 3)): \
311
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
312
 
        break; \
313
 
    case (sizeof (FbBits) - 6) | (3 << (FB_SHIFT - 3)): \
314
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
315
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
316
 
        break; \
317
 
    case (sizeof (FbBits) - 6) | (4 << (FB_SHIFT - 3)): \
318
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
319
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
320
 
        break; \
321
 
    case (sizeof (FbBits) - 6) | (5 << (FB_SHIFT - 3)): \
322
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
323
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
324
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
325
 
        break; \
326
 
    case (sizeof (FbBits) - 6): \
327
 
        FbStorePart(dst,sizeof (FbBits) - 6,CARD16,xor); \
328
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
329
 
        break; \
330
 
    case (sizeof (FbBits) - 5) | (1 << (FB_SHIFT - 3)): \
331
 
        FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
332
 
        break; \
333
 
    case (sizeof (FbBits) - 5) | (2 << (FB_SHIFT - 3)): \
334
 
        FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
335
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
336
 
        break; \
337
 
    case (sizeof (FbBits) - 5) | (3 << (FB_SHIFT - 3)): \
338
 
        FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
339
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
340
 
        break; \
341
 
    case (sizeof (FbBits) - 5) | (4 << (FB_SHIFT - 3)): \
342
 
        FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
343
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
344
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
345
 
        break; \
346
 
    case (sizeof (FbBits) - 5): \
347
 
        FbStorePart(dst,sizeof (FbBits) - 5,CARD8,xor); \
348
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
349
 
        break; \
350
 
    case (sizeof (FbBits) - 4) | (1 << (FB_SHIFT - 3)): \
351
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD8,xor); \
352
 
        break; \
353
 
    case (sizeof (FbBits) - 4) | (2 << (FB_SHIFT - 3)): \
354
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
355
 
        break; \
356
 
    case (sizeof (FbBits) - 4) | (3 << (FB_SHIFT - 3)): \
357
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD16,xor); \
358
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
359
 
        break; \
360
 
    case (sizeof (FbBits) - 4): \
361
 
        FbStorePart(dst,sizeof (FbBits) - 4,CARD32,xor); \
362
 
        break;
363
 
 
364
 
#define FbDoRightMaskByteRRop6Cases(dst,xor) \
365
 
    case 4: \
366
 
        FbStorePart(dst,0,CARD32,xor); \
367
 
        break; \
368
 
    case 5: \
369
 
        FbStorePart(dst,0,CARD32,xor); \
370
 
        FbStorePart(dst,4,CARD8,xor); \
371
 
        break; \
372
 
    case 6: \
373
 
        FbStorePart(dst,0,CARD32,xor); \
374
 
        FbStorePart(dst,4,CARD16,xor); \
375
 
        break; \
376
 
    case 7: \
377
 
        FbStorePart(dst,0,CARD32,xor); \
378
 
        FbStorePart(dst,4,CARD16,xor); \
379
 
        FbStorePart(dst,6,CARD8,xor); \
380
 
        break;
381
 
#else
382
 
#define FbDoLeftMaskByteRRop6Cases(dst,xor)
383
 
#define FbDoRightMaskByteRRop6Cases(dst,xor)
384
 
#endif
385
 
 
386
 
#define FbDoLeftMaskByteRRop(dst,lb,l,and,xor) { \
387
 
    switch (lb) { \
388
 
    FbDoLeftMaskByteRRop6Cases(dst,xor) \
389
 
    case (sizeof (FbBits) - 3) | (1 << (FB_SHIFT - 3)): \
390
 
        FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
391
 
        break; \
392
 
    case (sizeof (FbBits) - 3) | (2 << (FB_SHIFT - 3)): \
393
 
        FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
394
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
395
 
        break; \
396
 
    case (sizeof (FbBits) - 2) | (1 << (FB_SHIFT - 3)): \
397
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD8,xor); \
398
 
        break; \
399
 
    case sizeof (FbBits) - 3: \
400
 
        FbStorePart(dst,sizeof (FbBits) - 3,CARD8,xor); \
401
 
    case sizeof (FbBits) - 2: \
402
 
        FbStorePart(dst,sizeof (FbBits) - 2,CARD16,xor); \
403
 
        break; \
404
 
    case sizeof (FbBits) - 1: \
405
 
        FbStorePart(dst,sizeof (FbBits) - 1,CARD8,xor); \
406
 
        break; \
407
 
    default: \
408
 
        *dst = FbDoMaskRRop(*dst, and, xor, l); \
409
 
        break; \
410
 
    } \
411
 
}
412
 
 
413
 
 
414
 
#define FbDoRightMaskByteRRop(dst,rb,r,and,xor) { \
415
 
    switch (rb) { \
416
 
    case 1: \
417
 
        FbStorePart(dst,0,CARD8,xor); \
418
 
        break; \
419
 
    case 2: \
420
 
        FbStorePart(dst,0,CARD16,xor); \
421
 
        break; \
422
 
    case 3: \
423
 
        FbStorePart(dst,0,CARD16,xor); \
424
 
        FbStorePart(dst,2,CARD8,xor); \
425
 
        break; \
426
 
    FbDoRightMaskByteRRop6Cases(dst,xor) \
427
 
    default: \
428
 
        *dst = FbDoMaskRRop (*dst, and, xor, r); \
429
 
    } \
430
 
}
431
 
#endif
432
 
 
433
 
#define FbMaskStip(x,w,l,n,r) { \
434
 
    n = (w); \
435
 
    r = FbRightStipMask((x)+n); \
436
 
    l = FbLeftStipMask(x); \
437
 
    if (l) { \
438
 
        n -= FB_STIP_UNIT - ((x) & FB_STIP_MASK); \
439
 
        if (n < 0) { \
440
 
            n = 0; \
441
 
            l &= r; \
442
 
            r = 0; \
443
 
        } \
444
 
    } \
445
 
    n >>= FB_STIP_SHIFT; \
446
 
}
447
 
 
448
 
/*
449
 
 * These macros are used to transparently stipple
450
 
 * in copy mode; the expected usage is with 'n' constant
451
 
 * so all of the conditional parts collapse into a minimal
452
 
 * sequence of partial word writes
453
 
 *
454
 
 * 'n' is the bytemask of which bytes to store, 'a' is the address
455
 
 * of the FbBits base unit, 'o' is the offset within that unit
456
 
 *
457
 
 * The term "lane" comes from the hardware term "byte-lane" which
458
 
 */
459
 
 
460
 
#define FbLaneCase1(n,a,o)  ((n) == 0x01 ? \
461
 
                             (*(CARD8 *) ((a)+FbPatternOffset(o,CARD8)) = \
462
 
                              fgxor) : 0)
463
 
#define FbLaneCase2(n,a,o)  ((n) == 0x03 ? \
464
 
                             (*(CARD16 *) ((a)+FbPatternOffset(o,CARD16)) = \
465
 
                              fgxor) : \
466
 
                             ((void)FbLaneCase1((n)&1,a,o), \
467
 
                                    FbLaneCase1((n)>>1,a,(o)+1)))
468
 
#define FbLaneCase4(n,a,o)  ((n) == 0x0f ? \
469
 
                             (*(CARD32 *) ((a)+FbPatternOffset(o,CARD32)) = \
470
 
                              fgxor) : \
471
 
                             ((void)FbLaneCase2((n)&3,a,o), \
472
 
                                    FbLaneCase2((n)>>2,a,(o)+2)))
473
 
#define FbLaneCase8(n,a,o)  ((n) == 0x0ff ? (*(FbBits *) ((a)+(o)) = fgxor) : \
474
 
                             ((void)FbLaneCase4((n)&15,a,o), \
475
 
                                    FbLaneCase4((n)>>4,a,(o)+4)))
476
 
 
477
 
#if FB_SHIFT == 6
478
 
#define FbLaneCase(n,a)   FbLaneCase8(n,(CARD8 *) (a),0)
479
 
#endif
480
 
 
481
 
#if FB_SHIFT == 5
482
 
#define FbLaneCase(n,a)   FbLaneCase4(n,(CARD8 *) (a),0)
483
 
#endif
484
 
 
485
 
/* Rotate a filled pixel value to the specified alignement */
486
 
#define FbRot24(p,b)        (FbScrRight(p,b) | FbScrLeft(p,24-(b)))
487
 
#define FbRot24Stip(p,b)    (FbStipRight(p,b) | FbStipLeft(p,24-(b)))
488
 
 
489
 
/* step a filled pixel value to the next/previous FB_UNIT alignment */
490
 
#define FbNext24Pix(p)  (FbRot24(p,(24-FB_UNIT%24)))
491
 
#define FbPrev24Pix(p)  (FbRot24(p,FB_UNIT%24))
492
 
#define FbNext24Stip(p) (FbRot24(p,(24-FB_STIP_UNIT%24)))
493
 
#define FbPrev24Stip(p) (FbRot24(p,FB_STIP_UNIT%24))
494
 
 
495
 
/* step a rotation value to the next/previous rotation value */
496
 
#if FB_UNIT == 64
497
 
#define FbNext24Rot(r)        ((r) == 16 ? 0 : (r) + 8)
498
 
#define FbPrev24Rot(r)        ((r) == 0 ? 16 : (r) - 8)
499
 
 
500
 
#if IMAGE_BYTE_ORDER == MSBFirst
501
 
#define FbFirst24Rot(x)         (((x) + 8) % 24)
502
 
#else
503
 
#define FbFirst24Rot(x)         ((x) % 24)
504
 
#endif
505
 
 
506
 
#endif
507
 
 
508
 
#if FB_UNIT == 32
509
 
#define FbNext24Rot(r)        ((r) == 0 ? 16 : (r) - 8)
510
 
#define FbPrev24Rot(r)        ((r) == 16 ? 0 : (r) + 8)
511
 
 
512
 
#if IMAGE_BYTE_ORDER == MSBFirst
513
 
#define FbFirst24Rot(x)         (((x) + 16) % 24)
514
 
#else
515
 
#define FbFirst24Rot(x)         ((x) % 24)
516
 
#endif
517
 
#endif
518
 
 
519
 
#define FbNext24RotStip(r)        ((r) == 0 ? 16 : (r) - 8)
520
 
#define FbPrev24RotStip(r)        ((r) == 16 ? 0 : (r) + 8)
521
 
 
522
 
/* Whether 24-bit specific code is needed for this filled pixel value */
523
 
#define FbCheck24Pix(p) ((p) == FbNext24Pix(p))
524
 
 
525
 
/* Macros for dealing with dashing */
526
 
 
527
 
#define FbDashDeclare   \
528
 
    unsigned char       *__dash, *__firstDash, *__lastDash
529
 
    
530
 
#define FbDashInit(pGC,pPriv,dashOffset,dashlen,even) {     \
531
 
    (even) = TRUE;                                          \
532
 
    __firstDash = (pGC)->dash;                              \
533
 
    __lastDash = __firstDash + (pGC)->numInDashList;        \
534
 
    (dashOffset) %= (pPriv)->dashLength;                    \
535
 
                                                            \
536
 
    __dash = __firstDash;                                   \
537
 
    while ((dashOffset) >= ((dashlen) = *__dash))           \
538
 
    {                                                       \
539
 
        (dashOffset) -= (dashlen);                          \
540
 
        (even) = 1-(even);                                  \
541
 
        if (++__dash == __lastDash)                         \
542
 
            __dash = __firstDash;                           \
543
 
    }                                                       \
544
 
    (dashlen) -= (dashOffset);                              \
545
 
}
546
 
 
547
 
#define FbDashNext(dashlen) {                               \
548
 
    if (++__dash == __lastDash)                             \
549
 
        __dash = __firstDash;                               \
550
 
    (dashlen) = *__dash;                                    \
551
 
}
552
 
 
553
 
/* as numInDashList is always even, this case can skip a test */
554
 
 
555
 
#define FbDashNextEven(dashlen) {                           \
556
 
    (dashlen) = *++__dash;                                  \
557
 
}
558
 
 
559
 
#define FbDashNextOdd(dashlen)  FbDashNext(dashlen)
560
 
 
561
 
#define FbDashStep(dashlen,even) {                          \
562
 
    if (!--(dashlen)) {                                     \
563
 
        FbDashNext(dashlen);                                \
564
 
        (even) = 1-(even);                                  \
565
 
    }                                                       \
566
 
}
567
 
 
568
 
/* XXX fb*PrivateIndex should be static, but it breaks the ABI */
569
 
 
570
 
extern int      fbGCPrivateIndex;
571
 
extern int      fbGetGCPrivateIndex(void);
572
 
#ifndef FB_NO_WINDOW_PIXMAPS
573
 
extern int      fbWinPrivateIndex;
574
 
extern int      fbGetWinPrivateIndex(void);
575
 
#endif
576
 
extern const GCOps      fbGCOps;
577
 
extern const GCFuncs    fbGCFuncs;
578
 
 
579
 
#ifdef TEKX11
580
 
#define FB_OLD_GC
581
 
#define FB_OLD_SCREEN
582
 
#endif
583
 
 
584
 
#ifdef FB_OLD_SCREEN
585
 
# define FB_OLD_MISCREENINIT    /* miScreenInit requires 14 args, not 13 */
586
 
extern WindowPtr    *WindowTable;
587
 
#endif
588
 
 
589
 
#ifdef FB_24_32BIT
590
 
#define FB_SCREEN_PRIVATE
591
 
#endif
592
 
 
593
 
#ifdef FB_SCREEN_PRIVATE
594
 
extern int      fbScreenPrivateIndex;
595
 
extern int      fbGetScreenPrivateIndex(void);
596
 
 
597
 
/* private field of a screen */
598
 
typedef struct {
599
 
    unsigned char       win32bpp;       /* window bpp for 32-bpp images */
600
 
    unsigned char       pix32bpp;       /* pixmap bpp for 32-bpp images */
601
 
} FbScreenPrivRec, *FbScreenPrivPtr;
602
 
 
603
 
#define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \
604
 
                                     (pScreen)->devPrivates[fbGetScreenPrivateIndex()].ptr)
605
 
#endif
606
 
 
607
 
/* private field of GC */
608
 
typedef struct {
609
 
#ifdef FB_OLD_GC
610
 
    unsigned char       pad1;
611
 
    unsigned char       pad2;
612
 
    unsigned char       pad3;
613
 
    unsigned            fExpose:1;
614
 
    unsigned            freeCompClip:1;
615
 
    PixmapPtr           pRotatedPixmap;
616
 
    RegionPtr           pCompositeClip;
617
 
#endif    
618
 
    FbBits              and, xor;       /* reduced rop values */
619
 
    FbBits              bgand, bgxor;   /* for stipples */
620
 
    FbBits              fg, bg, pm;     /* expanded and filled */
621
 
    unsigned int        dashLength;     /* total of all dash elements */
622
 
    unsigned char       oneRect;        /* clip list is single rectangle */
623
 
    unsigned char       evenStipple;    /* stipple is even */
624
 
    unsigned char       bpp;            /* current drawable bpp */
625
 
} FbGCPrivRec, *FbGCPrivPtr;
626
 
 
627
 
#define fbGetGCPrivate(pGC)     ((FbGCPrivPtr)\
628
 
        (pGC)->devPrivates[fbGetGCPrivateIndex()].ptr)
629
 
 
630
 
#ifdef FB_OLD_GC
631
 
#define fbGetCompositeClip(pGC) (fbGetGCPrivate(pGC)->pCompositeClip)
632
 
#define fbGetExpose(pGC)        (fbGetGCPrivate(pGC)->fExpose)
633
 
#define fbGetFreeCompClip(pGC)  (fbGetGCPrivate(pGC)->freeCompClip)
634
 
#define fbGetRotatedPixmap(pGC) (fbGetGCPrivate(pGC)->pRotatedPixmap)
635
 
#else
636
 
#define fbGetCompositeClip(pGC) ((pGC)->pCompositeClip)
637
 
#define fbGetExpose(pGC)        ((pGC)->fExpose)
638
 
#define fbGetFreeCompClip(pGC)  ((pGC)->freeCompClip)
639
 
#define fbGetRotatedPixmap(pGC) ((pGC)->pRotatedPixmap)
640
 
#endif
641
 
 
642
 
#define fbGetScreenPixmap(s)    ((PixmapPtr) (s)->devPrivate)
643
 
#ifdef FB_NO_WINDOW_PIXMAPS
644
 
#define fbGetWindowPixmap(d)    fbGetScreenPixmap(((DrawablePtr) (d))->pScreen)
645
 
#else
646
 
#define fbGetWindowPixmap(pWin) ((PixmapPtr)\
647
 
        ((WindowPtr) (pWin))->devPrivates[fbGetWinPrivateIndex()].ptr)
648
 
#endif
649
 
 
650
 
#ifdef ROOTLESS
651
 
#define __fbPixDrawableX(pPix)  ((pPix)->drawable.x)
652
 
#define __fbPixDrawableY(pPix)  ((pPix)->drawable.y)
653
 
#else
654
 
#define __fbPixDrawableX(pPix)  0
655
 
#define __fbPixDrawableY(pPix)  0
656
 
#endif
657
 
 
658
 
#ifdef COMPOSITE
659
 
#define __fbPixOffXWin(pPix)    (__fbPixDrawableX(pPix) - (pPix)->screen_x)
660
 
#define __fbPixOffYWin(pPix)    (__fbPixDrawableY(pPix) - (pPix)->screen_y)
661
 
#else
662
 
#define __fbPixOffXWin(pPix)    (__fbPixDrawableX(pPix))
663
 
#define __fbPixOffYWin(pPix)    (__fbPixDrawableY(pPix))
664
 
#endif
665
 
#define __fbPixOffXPix(pPix)    (__fbPixDrawableX(pPix))
666
 
#define __fbPixOffYPix(pPix)    (__fbPixDrawableY(pPix))
667
 
 
668
 
#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
669
 
    PixmapPtr   _pPix; \
670
 
    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
671
 
        _pPix = fbGetWindowPixmap(pDrawable); \
672
 
        (xoff) = __fbPixOffXWin(_pPix); \
673
 
        (yoff) = __fbPixOffYWin(_pPix); \
674
 
    } else { \
675
 
        _pPix = (PixmapPtr) (pDrawable); \
676
 
        (xoff) = __fbPixOffXPix(_pPix); \
677
 
        (yoff) = __fbPixOffYPix(_pPix); \
678
 
    } \
679
 
    (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
680
 
    (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
681
 
    (bpp) = _pPix->drawable.bitsPerPixel;  (void)(bpp); \
682
 
}
683
 
 
684
 
#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
685
 
    PixmapPtr   _pPix; \
686
 
    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
687
 
        _pPix = fbGetWindowPixmap(pDrawable); \
688
 
        (xoff) = __fbPixOffXWin(_pPix); \
689
 
        (yoff) = __fbPixOffYWin(_pPix); \
690
 
    } else { \
691
 
        _pPix = (PixmapPtr) (pDrawable); \
692
 
        (xoff) = __fbPixOffXPix(_pPix); \
693
 
        (yoff) = __fbPixOffYPix(_pPix); \
694
 
    } \
695
 
    (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
696
 
    (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
697
 
    (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
698
 
}
699
 
 
700
 
/*
701
 
 * XFree86 empties the root BorderClip when the VT is inactive,
702
 
 * here's a macro which uses that to disable GetImage and GetSpans
703
 
 */
704
 
 
705
 
#define fbWindowEnabled(pWin) \
706
 
    REGION_NOTEMPTY((pWin)->drawable.pScreen, \
707
 
                    &WindowTable[(pWin)->drawable.pScreen->myNum]->borderClip)
708
 
 
709
 
#define fbDrawableEnabled(pDrawable) \
710
 
    ((pDrawable)->type == DRAWABLE_PIXMAP ? \
711
 
     TRUE : fbWindowEnabled((WindowPtr) pDrawable))
712
 
 
713
 
#ifdef FB_OLD_SCREEN
714
 
#define BitsPerPixel(d) (\
715
 
    ((1 << PixmapWidthPaddingInfo[d].padBytesLog2) * 8 / \
716
 
    (PixmapWidthPaddingInfo[d].padRoundUp+1)))
717
 
#endif
718
 
 
719
 
#define FbPowerOfTwo(w)     (((w) & ((w) - 1)) == 0)
720
 
/*
721
 
 * Accelerated tiles are power of 2 width <= FB_UNIT
722
 
 */
723
 
#define FbEvenTile(w)       ((w) <= FB_UNIT && FbPowerOfTwo(w))
724
 
/*
725
 
 * Accelerated stipples are power of 2 width and <= FB_UNIT/dstBpp
726
 
 * with dstBpp a power of 2 as well
727
 
 */
728
 
#define FbEvenStip(w,bpp)   ((w) * (bpp) <= FB_UNIT && FbPowerOfTwo(w) && FbPowerOfTwo(bpp))
729
 
 
730
 
/*
731
 
 * fb24_32.c
732
 
 */
733
 
void
734
 
fb24_32GetSpans(DrawablePtr     pDrawable, 
735
 
                int             wMax, 
736
 
                DDXPointPtr     ppt, 
737
 
                int             *pwidth, 
738
 
                int             nspans, 
739
 
                char            *pchardstStart);
740
 
 
741
 
void
742
 
fb24_32SetSpans (DrawablePtr        pDrawable,
743
 
                 GCPtr              pGC,
744
 
                 char               *src,
745
 
                 DDXPointPtr        ppt,
746
 
                 int                *pwidth,
747
 
                 int                nspans,
748
 
                 int                fSorted);
749
 
 
750
 
void
751
 
fb24_32PutZImage (DrawablePtr   pDrawable,
752
 
                  RegionPtr     pClip,
753
 
                  int           alu,
754
 
                  FbBits        pm,
755
 
                  int           x,
756
 
                  int           y,
757
 
                  int           width,
758
 
                  int           height,
759
 
                  CARD8         *src,
760
 
                  FbStride      srcStride);
761
 
    
762
 
void
763
 
fb24_32GetImage (DrawablePtr     pDrawable,
764
 
                 int             x,
765
 
                 int             y,
766
 
                 int             w,
767
 
                 int             h,
768
 
                 unsigned int    format,
769
 
                 unsigned long   planeMask,
770
 
                 char            *d);
771
 
 
772
 
void
773
 
fb24_32CopyMtoN (DrawablePtr pSrcDrawable,
774
 
                 DrawablePtr pDstDrawable,
775
 
                 GCPtr       pGC,
776
 
                 BoxPtr      pbox,
777
 
                 int         nbox,
778
 
                 int         dx,
779
 
                 int         dy,
780
 
                 Bool        reverse,
781
 
                 Bool        upsidedown,
782
 
                 Pixel       bitplane,
783
 
                 void        *closure);
784
 
 
785
 
PixmapPtr
786
 
fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel);
787
 
    
788
 
Bool
789
 
fb24_32CreateScreenResources(ScreenPtr pScreen);
790
 
 
791
 
Bool
792
 
fb24_32ModifyPixmapHeader (PixmapPtr   pPixmap,
793
 
                           int         width,
794
 
                           int         height,
795
 
                           int         depth,
796
 
                           int         bitsPerPixel,
797
 
                           int         devKind,
798
 
                           pointer     pPixData);
799
 
 
800
 
/*
801
 
 * fballpriv.c
802
 
 */
803
 
Bool
804
 
fbAllocatePrivates(ScreenPtr pScreen, int *pGCIndex);
805
 
    
806
 
/*
807
 
 * fbarc.c
808
 
 */
809
 
 
810
 
void
811
 
fbPolyArc (DrawablePtr  pDrawable,
812
 
           GCPtr        pGC,
813
 
           int          narcs,
814
 
           xArc         *parcs);
815
 
 
816
 
/*
817
 
 * fbbits.c
818
 
 */
819
 
 
820
 
void    
821
 
fbBresSolid8(DrawablePtr    pDrawable,
822
 
             GCPtr          pGC,
823
 
             int            dashOffset,
824
 
             int            signdx,
825
 
             int            signdy,
826
 
             int            axis,
827
 
             int            x,
828
 
             int            y,
829
 
             int            e,
830
 
             int            e1,
831
 
             int            e3,
832
 
             int            len);
833
 
 
834
 
void    
835
 
fbBresDash8 (DrawablePtr    pDrawable,
836
 
             GCPtr          pGC,
837
 
             int            dashOffset,
838
 
             int            signdx,
839
 
             int            signdy,
840
 
             int            axis,
841
 
             int            x,
842
 
             int            y,
843
 
             int            e,
844
 
             int            e1,
845
 
             int            e3,
846
 
             int            len);
847
 
 
848
 
void    
849
 
fbDots8 (FbBits     *dst,
850
 
         FbStride   dstStride,
851
 
         int        dstBpp,
852
 
         BoxPtr     pBox,
853
 
         xPoint     *pts,
854
 
         int        npt,
855
 
         int        xorg,
856
 
         int        yorg,
857
 
         int        xoff,
858
 
         int        yoff,
859
 
         FbBits     and,
860
 
         FbBits     xor);
861
 
 
862
 
void    
863
 
fbArc8 (FbBits      *dst,
864
 
        FbStride    dstStride,
865
 
        int         dstBpp,
866
 
        xArc        *arc,
867
 
        int         dx,
868
 
        int         dy,
869
 
        FbBits      and,
870
 
        FbBits      xor);
871
 
 
872
 
void
873
 
fbGlyph8 (FbBits    *dstLine,
874
 
          FbStride  dstStride,
875
 
          int       dstBpp,
876
 
          FbStip    *stipple,
877
 
          FbBits    fg,
878
 
          int       height,
879
 
          int       shift);
880
 
 
881
 
void
882
 
fbPolyline8 (DrawablePtr    pDrawable,
883
 
             GCPtr          pGC,
884
 
             int            mode,
885
 
             int            npt,
886
 
             DDXPointPtr    ptsOrig);
887
 
 
888
 
void
889
 
fbPolySegment8 (DrawablePtr pDrawable,
890
 
                GCPtr       pGC,
891
 
                int         nseg,
892
 
                xSegment    *pseg);
893
 
 
894
 
void    
895
 
fbBresSolid16(DrawablePtr   pDrawable,
896
 
              GCPtr         pGC,
897
 
              int           dashOffset,
898
 
              int           signdx,
899
 
              int           signdy,
900
 
              int           axis,
901
 
              int           x,
902
 
              int           y,
903
 
              int           e,
904
 
              int           e1,
905
 
              int           e3,
906
 
              int           len);
907
 
 
908
 
void    
909
 
fbBresDash16(DrawablePtr    pDrawable,
910
 
             GCPtr          pGC,
911
 
             int            dashOffset,
912
 
             int            signdx,
913
 
             int            signdy,
914
 
             int            axis,
915
 
             int            x,
916
 
             int            y,
917
 
             int            e,
918
 
             int            e1,
919
 
             int            e3,
920
 
             int            len);
921
 
 
922
 
void    
923
 
fbDots16(FbBits     *dst,
924
 
         FbStride   dstStride,
925
 
         int        dstBpp,
926
 
         BoxPtr     pBox,
927
 
         xPoint     *pts,
928
 
         int        npt,
929
 
         int        xorg,
930
 
         int        yorg,
931
 
         int        xoff,
932
 
         int        yoff,
933
 
         FbBits     and,
934
 
         FbBits     xor);
935
 
 
936
 
void    
937
 
fbArc16(FbBits      *dst,
938
 
        FbStride    dstStride,
939
 
        int         dstBpp,
940
 
        xArc        *arc,
941
 
        int         dx,
942
 
        int         dy,
943
 
        FbBits      and,
944
 
        FbBits      xor);
945
 
 
946
 
void
947
 
fbGlyph16(FbBits    *dstLine,
948
 
          FbStride  dstStride,
949
 
          int       dstBpp,
950
 
          FbStip    *stipple,
951
 
          FbBits    fg,
952
 
          int       height,
953
 
          int       shift);
954
 
 
955
 
void
956
 
fbPolyline16 (DrawablePtr   pDrawable,
957
 
              GCPtr         pGC,
958
 
              int           mode,
959
 
              int           npt,
960
 
              DDXPointPtr   ptsOrig);
961
 
 
962
 
void
963
 
fbPolySegment16 (DrawablePtr    pDrawable,
964
 
                 GCPtr          pGC,
965
 
                 int            nseg,
966
 
                 xSegment       *pseg);
967
 
 
968
 
 
969
 
void    
970
 
fbBresSolid24(DrawablePtr   pDrawable,
971
 
              GCPtr         pGC,
972
 
              int           dashOffset,
973
 
              int           signdx,
974
 
              int           signdy,
975
 
              int           axis,
976
 
              int           x,
977
 
              int           y,
978
 
              int           e,
979
 
              int           e1,
980
 
              int           e3,
981
 
              int           len);
982
 
 
983
 
void    
984
 
fbBresDash24(DrawablePtr    pDrawable,
985
 
             GCPtr          pGC,
986
 
             int            dashOffset,
987
 
             int            signdx,
988
 
             int            signdy,
989
 
             int            axis,
990
 
             int            x,
991
 
             int            y,
992
 
             int            e,
993
 
             int            e1,
994
 
             int            e3,
995
 
             int            len);
996
 
 
997
 
void    
998
 
fbDots24(FbBits     *dst,
999
 
         FbStride   dstStride,
1000
 
         int        dstBpp,
1001
 
         BoxPtr     pBox,
1002
 
         xPoint     *pts,
1003
 
         int        npt,
1004
 
         int        xorg,
1005
 
         int        yorg,
1006
 
         int        xoff,
1007
 
         int        yoff,
1008
 
         FbBits     and,
1009
 
         FbBits     xor);
1010
 
 
1011
 
void    
1012
 
fbArc24(FbBits      *dst,
1013
 
        FbStride    dstStride,
1014
 
        int         dstBpp,
1015
 
        xArc        *arc,
1016
 
        int         dx,
1017
 
        int         dy,
1018
 
        FbBits      and,
1019
 
        FbBits      xor);
1020
 
 
1021
 
void
1022
 
fbGlyph24(FbBits    *dstLine,
1023
 
          FbStride  dstStride,
1024
 
          int       dstBpp,
1025
 
          FbStip    *stipple,
1026
 
          FbBits    fg,
1027
 
          int       height,
1028
 
          int       shift);
1029
 
 
1030
 
void
1031
 
fbPolyline24 (DrawablePtr   pDrawable,
1032
 
              GCPtr         pGC,
1033
 
              int           mode,
1034
 
              int           npt,
1035
 
              DDXPointPtr   ptsOrig);
1036
 
 
1037
 
void
1038
 
fbPolySegment24 (DrawablePtr    pDrawable,
1039
 
                 GCPtr          pGC,
1040
 
                 int            nseg,
1041
 
                 xSegment       *pseg);
1042
 
 
1043
 
 
1044
 
void    
1045
 
fbBresSolid32(DrawablePtr   pDrawable,
1046
 
              GCPtr         pGC,
1047
 
              int           dashOffset,
1048
 
              int           signdx,
1049
 
              int           signdy,
1050
 
              int           axis,
1051
 
              int           x,
1052
 
              int           y,
1053
 
              int           e,
1054
 
              int           e1,
1055
 
              int           e3,
1056
 
              int           len);
1057
 
 
1058
 
void    
1059
 
fbBresDash32(DrawablePtr    pDrawable,
1060
 
             GCPtr          pGC,
1061
 
             int            dashOffset,
1062
 
             int            signdx,
1063
 
             int            signdy,
1064
 
             int            axis,
1065
 
             int            x,
1066
 
             int            y,
1067
 
             int            e,
1068
 
             int            e1,
1069
 
             int            e3,
1070
 
             int            len);
1071
 
 
1072
 
void    
1073
 
fbDots32(FbBits     *dst,
1074
 
         FbStride   dstStride,
1075
 
         int        dstBpp,
1076
 
         BoxPtr     pBox,
1077
 
         xPoint     *pts,
1078
 
         int        npt,
1079
 
         int        xorg,
1080
 
         int        yorg,
1081
 
         int        xoff,
1082
 
         int        yoff,
1083
 
         FbBits     and,
1084
 
         FbBits     xor);
1085
 
 
1086
 
void    
1087
 
fbArc32(FbBits      *dst,
1088
 
        FbStride    dstStride,
1089
 
        int         dstBpp,
1090
 
        xArc        *arc,
1091
 
        int         dx,
1092
 
        int         dy,
1093
 
        FbBits      and,
1094
 
        FbBits      xor);
1095
 
 
1096
 
void
1097
 
fbGlyph32(FbBits    *dstLine,
1098
 
          FbStride  dstStride,
1099
 
          int       dstBpp,
1100
 
          FbStip    *stipple,
1101
 
          FbBits    fg,
1102
 
          int       height,
1103
 
          int       shift);
1104
 
void
1105
 
fbPolyline32 (DrawablePtr   pDrawable,
1106
 
              GCPtr         pGC,
1107
 
              int           mode,
1108
 
              int           npt,
1109
 
              DDXPointPtr   ptsOrig);
1110
 
 
1111
 
void
1112
 
fbPolySegment32 (DrawablePtr    pDrawable,
1113
 
                 GCPtr          pGC,
1114
 
                 int            nseg,
1115
 
                 xSegment       *pseg);
1116
 
 
1117
 
/*
1118
 
 * fbblt.c
1119
 
 */
1120
 
void
1121
 
fbBlt (FbBits   *src, 
1122
 
       FbStride srcStride,
1123
 
       int      srcX,
1124
 
       
1125
 
       FbBits   *dst,
1126
 
       FbStride dstStride,
1127
 
       int      dstX,
1128
 
       
1129
 
       int      width, 
1130
 
       int      height,
1131
 
       
1132
 
       int      alu,
1133
 
       FbBits   pm,
1134
 
       int      bpp,
1135
 
       
1136
 
       Bool     reverse,
1137
 
       Bool     upsidedown);
1138
 
 
1139
 
void
1140
 
fbBlt24 (FbBits     *srcLine,
1141
 
         FbStride   srcStride,
1142
 
         int        srcX,
1143
 
 
1144
 
         FbBits     *dstLine,
1145
 
         FbStride   dstStride,
1146
 
         int        dstX,
1147
 
 
1148
 
         int        width, 
1149
 
         int        height,
1150
 
 
1151
 
         int        alu,
1152
 
         FbBits     pm,
1153
 
 
1154
 
         Bool       reverse,
1155
 
         Bool       upsidedown);
1156
 
    
1157
 
void
1158
 
fbBltStip (FbStip   *src,
1159
 
           FbStride srcStride,      /* in FbStip units, not FbBits units */
1160
 
           int      srcX,
1161
 
           
1162
 
           FbStip   *dst,
1163
 
           FbStride dstStride,      /* in FbStip units, not FbBits units */
1164
 
           int      dstX,
1165
 
 
1166
 
           int      width, 
1167
 
           int      height,
1168
 
 
1169
 
           int      alu,
1170
 
           FbBits   pm,
1171
 
           int      bpp);
1172
 
    
1173
 
/*
1174
 
 * fbbltone.c
1175
 
 */
1176
 
void
1177
 
fbBltOne (FbStip   *src,
1178
 
          FbStride srcStride,
1179
 
          int      srcX,
1180
 
          FbBits   *dst,
1181
 
          FbStride dstStride,
1182
 
          int      dstX,
1183
 
          int      dstBpp,
1184
 
 
1185
 
          int      width,
1186
 
          int      height,
1187
 
 
1188
 
          FbBits   fgand,
1189
 
          FbBits   fbxor,
1190
 
          FbBits   bgand,
1191
 
          FbBits   bgxor);
1192
 
 
1193
 
#ifdef FB_24BIT
1194
 
void
1195
 
fbBltOne24 (FbStip    *src,
1196
 
          FbStride  srcStride,      /* FbStip units per scanline */
1197
 
          int       srcX,           /* bit position of source */
1198
 
          FbBits    *dst,
1199
 
          FbStride  dstStride,      /* FbBits units per scanline */
1200
 
          int       dstX,           /* bit position of dest */
1201
 
          int       dstBpp,         /* bits per destination unit */
1202
 
 
1203
 
          int       width,          /* width in bits of destination */
1204
 
          int       height,         /* height in scanlines */
1205
 
 
1206
 
          FbBits    fgand,          /* rrop values */
1207
 
          FbBits    fgxor,
1208
 
          FbBits    bgand,
1209
 
          FbBits    bgxor);
1210
 
#endif
1211
 
 
1212
 
void
1213
 
fbBltPlane (FbBits          *src,
1214
 
            FbStride        srcStride,
1215
 
            int             srcX,
1216
 
            int             srcBpp,
1217
 
 
1218
 
            FbStip          *dst,
1219
 
            FbStride        dstStride,
1220
 
            int             dstX,
1221
 
            
1222
 
            int             width,
1223
 
            int             height,
1224
 
            
1225
 
            FbStip          fgand,
1226
 
            FbStip          fgxor,
1227
 
            FbStip          bgand,
1228
 
            FbStip          bgxor,
1229
 
            Pixel           planeMask);
1230
 
 
1231
 
/*
1232
 
 * fbbstore.c
1233
 
 */
1234
 
void
1235
 
fbSaveAreas(PixmapPtr   pPixmap,
1236
 
            RegionPtr   prgnSave,
1237
 
            int         xorg,
1238
 
            int         yorg,
1239
 
            WindowPtr   pWin);
1240
 
 
1241
 
void
1242
 
fbRestoreAreas(PixmapPtr    pPixmap,
1243
 
               RegionPtr    prgnRestore,
1244
 
               int          xorg,
1245
 
               int          yorg,
1246
 
               WindowPtr    pWin);
1247
 
 
1248
 
/*
1249
 
 * fbcmap.c
1250
 
 */
1251
 
int
1252
 
fbListInstalledColormaps(ScreenPtr pScreen, Colormap *pmaps);
1253
 
 
1254
 
void
1255
 
fbInstallColormap(ColormapPtr pmap);
1256
 
 
1257
 
void
1258
 
fbUninstallColormap(ColormapPtr pmap);
1259
 
 
1260
 
void
1261
 
fbResolveColor(unsigned short   *pred, 
1262
 
               unsigned short   *pgreen, 
1263
 
               unsigned short   *pblue,
1264
 
               VisualPtr        pVisual);
1265
 
 
1266
 
Bool
1267
 
fbInitializeColormap(ColormapPtr pmap);
1268
 
 
1269
 
int
1270
 
fbExpandDirectColors (ColormapPtr   pmap, 
1271
 
                      int           ndef,
1272
 
                      xColorItem    *indefs,
1273
 
                      xColorItem    *outdefs);
1274
 
 
1275
 
Bool
1276
 
fbCreateDefColormap(ScreenPtr pScreen);
1277
 
 
1278
 
void
1279
 
fbClearVisualTypes(void);
1280
 
 
1281
 
Bool
1282
 
fbSetVisualTypes (int depth, int visuals, int bitsPerRGB);
1283
 
 
1284
 
Bool
1285
 
fbSetVisualTypesAndMasks (int depth, int visuals, int bitsPerRGB,
1286
 
                          Pixel redMask, Pixel greenMask, Pixel blueMask);
1287
 
 
1288
 
Bool
1289
 
fbInitVisuals (VisualPtr    *visualp, 
1290
 
               DepthPtr     *depthp,
1291
 
               int          *nvisualp,
1292
 
               int          *ndepthp,
1293
 
               int          *rootDepthp,
1294
 
               VisualID     *defaultVisp,
1295
 
               unsigned long    sizes,
1296
 
               int          bitsPerRGB);
1297
 
 
1298
 
/*
1299
 
 * fbcopy.c
1300
 
 */
1301
 
 
1302
 
typedef void    (*fbCopyProc) (DrawablePtr  pSrcDrawable,
1303
 
                               DrawablePtr  pDstDrawable,
1304
 
                               GCPtr        pGC,
1305
 
                               BoxPtr       pDstBox,
1306
 
                               int          nbox,
1307
 
                               int          dx,
1308
 
                               int          dy,
1309
 
                               Bool         reverse,
1310
 
                               Bool         upsidedown,
1311
 
                               Pixel        bitplane,
1312
 
                               void         *closure);
1313
 
 
1314
 
void
1315
 
fbCopyNtoN (DrawablePtr pSrcDrawable,
1316
 
            DrawablePtr pDstDrawable,
1317
 
            GCPtr       pGC,
1318
 
            BoxPtr      pbox,
1319
 
            int         nbox,
1320
 
            int         dx,
1321
 
            int         dy,
1322
 
            Bool        reverse,
1323
 
            Bool        upsidedown,
1324
 
            Pixel       bitplane,
1325
 
            void        *closure);
1326
 
 
1327
 
void
1328
 
fbCopy1toN (DrawablePtr pSrcDrawable,
1329
 
            DrawablePtr pDstDrawable,
1330
 
            GCPtr       pGC,
1331
 
            BoxPtr      pbox,
1332
 
            int         nbox,
1333
 
            int         dx,
1334
 
            int         dy,
1335
 
            Bool        reverse,
1336
 
            Bool        upsidedown,
1337
 
            Pixel       bitplane,
1338
 
            void        *closure);
1339
 
 
1340
 
void
1341
 
fbCopyNto1 (DrawablePtr pSrcDrawable,
1342
 
            DrawablePtr pDstDrawable,
1343
 
            GCPtr       pGC,
1344
 
            BoxPtr      pbox,
1345
 
            int         nbox,
1346
 
            int         dx,
1347
 
            int         dy,
1348
 
            Bool        reverse,
1349
 
            Bool        upsidedown,
1350
 
            Pixel       bitplane,
1351
 
            void        *closure);
1352
 
 
1353
 
void
1354
 
fbCopyRegion (DrawablePtr   pSrcDrawable,
1355
 
              DrawablePtr   pDstDrawable,
1356
 
              GCPtr         pGC,
1357
 
              RegionPtr     pDstRegion,
1358
 
              int           dx,
1359
 
              int           dy,
1360
 
              fbCopyProc    copyProc,
1361
 
              Pixel         bitPlane,
1362
 
              void          *closure);
1363
 
 
1364
 
RegionPtr
1365
 
fbDoCopy (DrawablePtr   pSrcDrawable,
1366
 
          DrawablePtr   pDstDrawable,
1367
 
          GCPtr         pGC,
1368
 
          int           xIn, 
1369
 
          int           yIn,
1370
 
          int           widthSrc, 
1371
 
          int           heightSrc,
1372
 
          int           xOut, 
1373
 
          int           yOut,
1374
 
          fbCopyProc    copyProc,
1375
 
          Pixel         bitplane,
1376
 
          void          *closure);
1377
 
          
1378
 
RegionPtr
1379
 
fbCopyArea (DrawablePtr pSrcDrawable,
1380
 
            DrawablePtr pDstDrawable,
1381
 
            GCPtr       pGC,
1382
 
            int         xIn, 
1383
 
            int         yIn,
1384
 
            int         widthSrc, 
1385
 
            int         heightSrc,
1386
 
            int         xOut, 
1387
 
            int         yOut);
1388
 
 
1389
 
RegionPtr
1390
 
fbCopyPlane (DrawablePtr    pSrcDrawable,
1391
 
             DrawablePtr    pDstDrawable,
1392
 
             GCPtr          pGC,
1393
 
             int            xIn, 
1394
 
             int            yIn,
1395
 
             int            widthSrc, 
1396
 
             int            heightSrc,
1397
 
             int            xOut, 
1398
 
             int            yOut,
1399
 
             unsigned long  bitplane);
1400
 
 
1401
 
/*
1402
 
 * fbfill.c
1403
 
 */
1404
 
void
1405
 
fbFill (DrawablePtr pDrawable,
1406
 
        GCPtr       pGC,
1407
 
        int         x,
1408
 
        int         y,
1409
 
        int         width,
1410
 
        int         height);
1411
 
 
1412
 
void
1413
 
fbSolidBoxClipped (DrawablePtr  pDrawable,
1414
 
                   RegionPtr    pClip,
1415
 
                   int          xa,
1416
 
                   int          ya,
1417
 
                   int          xb,
1418
 
                   int          yb,
1419
 
                   FbBits       and,
1420
 
                   FbBits       xor);
1421
 
 
1422
 
/*
1423
 
 * fbfillrect.c
1424
 
 */
1425
 
void
1426
 
fbPolyFillRect(DrawablePtr  pDrawable, 
1427
 
               GCPtr        pGC, 
1428
 
               int          nrectInit,
1429
 
               xRectangle   *prectInit);
1430
 
 
1431
 
#define fbPolyFillArc miPolyFillArc
1432
 
 
1433
 
#define fbFillPolygon miFillPolygon
1434
 
 
1435
 
/*
1436
 
 * fbfillsp.c
1437
 
 */
1438
 
void
1439
 
fbFillSpans (DrawablePtr    pDrawable,
1440
 
             GCPtr          pGC,
1441
 
             int            nInit,
1442
 
             DDXPointPtr    pptInit,
1443
 
             int            *pwidthInit,
1444
 
             int            fSorted);
1445
 
 
1446
 
 
1447
 
/*
1448
 
 * fbgc.c
1449
 
 */
1450
 
 
1451
 
Bool
1452
 
fbCreateGC(GCPtr pGC);
1453
 
 
1454
 
void
1455
 
fbPadPixmap (PixmapPtr pPixmap);
1456
 
    
1457
 
void
1458
 
fbValidateGC(GCPtr pGC, unsigned long changes, DrawablePtr pDrawable);
1459
 
 
1460
 
/*
1461
 
 * fbgetsp.c
1462
 
 */
1463
 
void
1464
 
fbGetSpans(DrawablePtr  pDrawable, 
1465
 
           int          wMax, 
1466
 
           DDXPointPtr  ppt, 
1467
 
           int          *pwidth, 
1468
 
           int          nspans, 
1469
 
           char         *pchardstStart);
1470
 
 
1471
 
/*
1472
 
 * fbglyph.c
1473
 
 */
1474
 
 
1475
 
Bool
1476
 
fbGlyphIn (RegionPtr    pRegion,
1477
 
           int          x,
1478
 
           int          y,
1479
 
           int          width,
1480
 
           int          height);
1481
 
    
1482
 
void
1483
 
fbPolyGlyphBlt (DrawablePtr     pDrawable,
1484
 
                GCPtr           pGC,
1485
 
                int             x, 
1486
 
                int             y,
1487
 
                unsigned int    nglyph,
1488
 
                CharInfoPtr     *ppci,
1489
 
                pointer         pglyphBase);
1490
 
 
1491
 
void
1492
 
fbImageGlyphBlt (DrawablePtr    pDrawable,
1493
 
                 GCPtr          pGC,
1494
 
                 int            x,
1495
 
                 int            y,
1496
 
                 unsigned int   nglyph,
1497
 
                 CharInfoPtr    *ppci,
1498
 
                 pointer        pglyphBase);
1499
 
 
1500
 
/*
1501
 
 * fbimage.c
1502
 
 */
1503
 
 
1504
 
void
1505
 
fbPutImage (DrawablePtr pDrawable,
1506
 
            GCPtr       pGC,
1507
 
            int         depth,
1508
 
            int         x,
1509
 
            int         y,
1510
 
            int         w,
1511
 
            int         h,
1512
 
            int         leftPad,
1513
 
            int         format,
1514
 
            char        *pImage);
1515
 
 
1516
 
void
1517
 
fbPutZImage (DrawablePtr        pDrawable,
1518
 
             RegionPtr          pClip,
1519
 
             int                alu,
1520
 
             FbBits             pm,
1521
 
             int                x,
1522
 
             int                y,
1523
 
             int                width,
1524
 
             int                height,
1525
 
             FbStip             *src,
1526
 
             FbStride           srcStride);
1527
 
 
1528
 
void
1529
 
fbPutXYImage (DrawablePtr       pDrawable,
1530
 
              RegionPtr         pClip,
1531
 
              FbBits            fg,
1532
 
              FbBits            bg,
1533
 
              FbBits            pm,
1534
 
              int               alu,
1535
 
              Bool              opaque,
1536
 
              
1537
 
              int               x,
1538
 
              int               y,
1539
 
              int               width,
1540
 
              int               height,
1541
 
 
1542
 
              FbStip            *src,
1543
 
              FbStride          srcStride,
1544
 
              int               srcX);
1545
 
 
1546
 
void
1547
 
fbGetImage (DrawablePtr     pDrawable,
1548
 
            int             x,
1549
 
            int             y,
1550
 
            int             w,
1551
 
            int             h,
1552
 
            unsigned int    format,
1553
 
            unsigned long   planeMask,
1554
 
            char            *d);
1555
 
/*
1556
 
 * fbline.c
1557
 
 */
1558
 
 
1559
 
void
1560
 
fbZeroLine (DrawablePtr pDrawable,
1561
 
            GCPtr       pGC,
1562
 
            int         mode,
1563
 
            int         npt,
1564
 
            DDXPointPtr ppt);
1565
 
 
1566
 
void
1567
 
fbZeroSegment (DrawablePtr  pDrawable,
1568
 
               GCPtr        pGC,
1569
 
               int          nseg,
1570
 
               xSegment     *pSegs);
1571
 
 
1572
 
void
1573
 
fbPolyLine (DrawablePtr pDrawable,
1574
 
            GCPtr       pGC,
1575
 
            int         mode,
1576
 
            int         npt,
1577
 
            DDXPointPtr ppt);
1578
 
 
1579
 
void
1580
 
fbFixCoordModePrevious (int npt,
1581
 
                        DDXPointPtr ppt);
1582
 
 
1583
 
void
1584
 
fbPolySegment (DrawablePtr  pDrawable,
1585
 
               GCPtr        pGC,
1586
 
               int          nseg,
1587
 
               xSegment     *pseg);
1588
 
 
1589
 
#define fbPolyRectangle miPolyRectangle
1590
 
 
1591
 
/*
1592
 
 * fbpict.c
1593
 
 */
1594
 
 
1595
 
Bool
1596
 
fbPictureInit (ScreenPtr pScreen,
1597
 
               PictFormatPtr formats,
1598
 
               int nformats);
1599
 
 
1600
 
/*
1601
 
 * fbpixmap.c
1602
 
 */
1603
 
 
1604
 
PixmapPtr
1605
 
fbCreatePixmapBpp (ScreenPtr pScreen, int width, int height, int depth, int bpp);
1606
 
 
1607
 
PixmapPtr
1608
 
fbCreatePixmap (ScreenPtr pScreen, int width, int height, int depth);
1609
 
 
1610
 
Bool
1611
 
fbDestroyPixmap (PixmapPtr pPixmap);
1612
 
 
1613
 
RegionPtr
1614
 
fbPixmapToRegion(PixmapPtr pPix);
1615
 
 
1616
 
/*
1617
 
 * fbpoint.c
1618
 
 */
1619
 
 
1620
 
void
1621
 
fbDots (FbBits      *dstOrig,
1622
 
        FbStride    dstStride,
1623
 
        int         dstBpp,
1624
 
        BoxPtr      pBox,
1625
 
        xPoint      *pts,
1626
 
        int         npt,
1627
 
        int         xorg,
1628
 
        int         yorg,
1629
 
        int         xoff,
1630
 
        int         yoff,
1631
 
        FbBits      andOrig,
1632
 
        FbBits      xorOrig);
1633
 
 
1634
 
void
1635
 
fbPolyPoint (DrawablePtr    pDrawable,
1636
 
             GCPtr          pGC,
1637
 
             int            mode,
1638
 
             int            npt,
1639
 
             xPoint         *pptInit);
1640
 
 
1641
 
/*
1642
 
 * fbpush.c
1643
 
 */
1644
 
void
1645
 
fbPushPattern (DrawablePtr  pDrawable,
1646
 
               GCPtr        pGC,
1647
 
               
1648
 
               FbStip       *src,
1649
 
               FbStride     srcStride,
1650
 
               int          srcX,
1651
 
 
1652
 
               int          x,
1653
 
               int          y,
1654
 
 
1655
 
               int          width,
1656
 
               int          height);
1657
 
 
1658
 
void
1659
 
fbPushFill (DrawablePtr pDrawable,
1660
 
            GCPtr       pGC,
1661
 
 
1662
 
            FbStip      *src,
1663
 
            FbStride    srcStride,
1664
 
            int         srcX,
1665
 
            
1666
 
            int         x,
1667
 
            int         y,
1668
 
            int         width,
1669
 
            int         height);
1670
 
 
1671
 
void
1672
 
fbPush1toN (DrawablePtr pSrcDrawable,
1673
 
            DrawablePtr pDstDrawable,
1674
 
            GCPtr       pGC,
1675
 
            BoxPtr      pbox,
1676
 
            int         nbox,
1677
 
            int         dx,
1678
 
            int         dy,
1679
 
            Bool        reverse,
1680
 
            Bool        upsidedown,
1681
 
            Pixel       bitplane,
1682
 
            void        *closure);
1683
 
 
1684
 
void
1685
 
fbPushImage (DrawablePtr    pDrawable,
1686
 
             GCPtr          pGC,
1687
 
             
1688
 
             FbStip         *src,
1689
 
             FbStride       srcStride,
1690
 
             int            srcX,
1691
 
 
1692
 
             int            x,
1693
 
             int            y,
1694
 
             int            width,
1695
 
             int            height);
1696
 
 
1697
 
void
1698
 
fbPushPixels (GCPtr         pGC,
1699
 
              PixmapPtr     pBitmap,
1700
 
              DrawablePtr   pDrawable,
1701
 
              int           dx,
1702
 
              int           dy,
1703
 
              int           xOrg,
1704
 
              int           yOrg);
1705
 
 
1706
 
 
1707
 
/*
1708
 
 * fbscreen.c
1709
 
 */
1710
 
 
1711
 
Bool
1712
 
fbCloseScreen (int indx, ScreenPtr pScreen);
1713
 
 
1714
 
Bool
1715
 
fbRealizeFont(ScreenPtr pScreen, FontPtr pFont);
1716
 
 
1717
 
Bool
1718
 
fbUnrealizeFont(ScreenPtr pScreen, FontPtr pFont);
1719
 
 
1720
 
void
1721
 
fbQueryBestSize (int class, 
1722
 
                 unsigned short *width, unsigned short *height,
1723
 
                 ScreenPtr pScreen);
1724
 
 
1725
 
#ifndef FB_OLD_SCREEN
1726
 
PixmapPtr
1727
 
_fbGetWindowPixmap (WindowPtr pWindow);
1728
 
 
1729
 
void
1730
 
_fbSetWindowPixmap (WindowPtr pWindow, PixmapPtr pPixmap);
1731
 
#endif
1732
 
 
1733
 
Bool
1734
 
fbSetupScreen(ScreenPtr pScreen, 
1735
 
              pointer   pbits,          /* pointer to screen bitmap */
1736
 
              int       xsize,          /* in pixels */
1737
 
              int       ysize,
1738
 
              int       dpix,           /* dots per inch */
1739
 
              int       dpiy,
1740
 
              int       width,          /* pixel width of frame buffer */
1741
 
              int       bpp);           /* bits per pixel of frame buffer */
1742
 
 
1743
 
Bool
1744
 
fbFinishScreenInit(ScreenPtr    pScreen,
1745
 
                   pointer      pbits,
1746
 
                   int          xsize,
1747
 
                   int          ysize,
1748
 
                   int          dpix,
1749
 
                   int          dpiy,
1750
 
                   int          width,
1751
 
                   int          bpp);
1752
 
 
1753
 
Bool
1754
 
fbScreenInit(ScreenPtr  pScreen,
1755
 
             pointer    pbits,
1756
 
             int        xsize,
1757
 
             int        ysize,
1758
 
             int        dpix,
1759
 
             int        dpiy,
1760
 
             int        width,
1761
 
             int        bpp);
1762
 
 
1763
 
void
1764
 
fbInitializeBackingStore (ScreenPtr pScreen);
1765
 
    
1766
 
/*
1767
 
 * fbseg.c
1768
 
 */
1769
 
typedef void    FbBres (DrawablePtr     pDrawable,
1770
 
                        GCPtr           pGC,
1771
 
                        int             dashOffset,
1772
 
                        int             signdx,
1773
 
                        int             signdy,
1774
 
                        int             axis,
1775
 
                        int             x,
1776
 
                        int             y,
1777
 
                        int             e,
1778
 
                        int             e1,
1779
 
                        int             e3,
1780
 
                        int             len);
1781
 
 
1782
 
FbBres fbBresSolid, fbBresDash, fbBresFill, fbBresFillDash;
1783
 
/*
1784
 
 * fbsetsp.c
1785
 
 */
1786
 
 
1787
 
void
1788
 
fbSetSpans (DrawablePtr     pDrawable,
1789
 
            GCPtr           pGC,
1790
 
            char            *src,
1791
 
            DDXPointPtr     ppt,
1792
 
            int             *pwidth,
1793
 
            int             nspans,
1794
 
            int             fSorted);
1795
 
 
1796
 
FbBres *
1797
 
fbSelectBres (DrawablePtr   pDrawable,
1798
 
              GCPtr         pGC);
1799
 
 
1800
 
void
1801
 
fbBres (DrawablePtr     pDrawable,
1802
 
        GCPtr           pGC,
1803
 
        int             dashOffset,
1804
 
        int             signdx,
1805
 
        int             signdy,
1806
 
        int             axis,
1807
 
        int             x,
1808
 
        int             y,
1809
 
        int             e,
1810
 
        int             e1,
1811
 
        int             e3,
1812
 
        int             len);
1813
 
 
1814
 
void
1815
 
fbSegment (DrawablePtr  pDrawable,
1816
 
           GCPtr        pGC,
1817
 
           int          xa,
1818
 
           int          ya,
1819
 
           int          xb,
1820
 
           int          yb,
1821
 
           Bool         drawLast,
1822
 
           int          *dashOffset);
1823
 
 
1824
 
 
1825
 
/*
1826
 
 * fbsolid.c
1827
 
 */
1828
 
 
1829
 
void
1830
 
fbSolid (FbBits     *dst,
1831
 
         FbStride   dstStride,
1832
 
         int        dstX,
1833
 
         int        bpp,
1834
 
 
1835
 
         int        width,
1836
 
         int        height,
1837
 
 
1838
 
         FbBits     and,
1839
 
         FbBits     xor);
1840
 
 
1841
 
#ifdef FB_24BIT
1842
 
void
1843
 
fbSolid24 (FbBits   *dst,
1844
 
           FbStride dstStride,
1845
 
           int      dstX,
1846
 
 
1847
 
           int      width,
1848
 
           int      height,
1849
 
 
1850
 
           FbBits   and,
1851
 
           FbBits   xor);
1852
 
#endif
1853
 
 
1854
 
/*
1855
 
 * fbstipple.c
1856
 
 */
1857
 
 
1858
 
void
1859
 
fbTransparentSpan (FbBits   *dst,
1860
 
                   FbBits   stip,
1861
 
                   FbBits   fgxor,
1862
 
                   int      n);
1863
 
 
1864
 
void
1865
 
fbEvenStipple (FbBits   *dst,
1866
 
               FbStride dstStride,
1867
 
               int      dstX,
1868
 
               int      dstBpp,
1869
 
 
1870
 
               int      width,
1871
 
               int      height,
1872
 
 
1873
 
               FbStip   *stip,
1874
 
               FbStride stipStride,
1875
 
               int      stipHeight,
1876
 
 
1877
 
               FbBits   fgand,
1878
 
               FbBits   fgxor,
1879
 
               FbBits   bgand,
1880
 
               FbBits   bgxor,
1881
 
 
1882
 
               int      xRot,
1883
 
               int      yRot);
1884
 
 
1885
 
void
1886
 
fbOddStipple (FbBits    *dst,
1887
 
              FbStride  dstStride,
1888
 
              int       dstX,
1889
 
              int       dstBpp,
1890
 
 
1891
 
              int       width,
1892
 
              int       height,
1893
 
 
1894
 
              FbStip    *stip,
1895
 
              FbStride  stipStride,
1896
 
              int       stipWidth,
1897
 
              int       stipHeight,
1898
 
 
1899
 
              FbBits    fgand,
1900
 
              FbBits    fgxor,
1901
 
              FbBits    bgand,
1902
 
              FbBits    bgxor,
1903
 
 
1904
 
              int       xRot,
1905
 
              int       yRot);
1906
 
 
1907
 
void
1908
 
fbStipple (FbBits   *dst,
1909
 
           FbStride dstStride,
1910
 
           int      dstX,
1911
 
           int      dstBpp,
1912
 
 
1913
 
           int      width,
1914
 
           int      height,
1915
 
 
1916
 
           FbStip   *stip,
1917
 
           FbStride stipStride,
1918
 
           int      stipWidth,
1919
 
           int      stipHeight,
1920
 
           Bool     even,
1921
 
 
1922
 
           FbBits   fgand,
1923
 
           FbBits   fgxor,
1924
 
           FbBits   bgand,
1925
 
           FbBits   bgxor,
1926
 
 
1927
 
           int      xRot,
1928
 
           int      yRot);
1929
 
 
1930
 
/*
1931
 
 * fbtile.c
1932
 
 */
1933
 
 
1934
 
void
1935
 
fbEvenTile (FbBits      *dst,
1936
 
            FbStride    dstStride,
1937
 
            int         dstX,
1938
 
 
1939
 
            int         width,
1940
 
            int         height,
1941
 
 
1942
 
            FbBits      *tile,
1943
 
            int         tileHeight,
1944
 
 
1945
 
            int         alu,
1946
 
            FbBits      pm,
1947
 
            int         xRot,
1948
 
            int         yRot);
1949
 
 
1950
 
void
1951
 
fbOddTile (FbBits       *dst,
1952
 
           FbStride     dstStride,
1953
 
           int          dstX,
1954
 
 
1955
 
           int          width,
1956
 
           int          height,
1957
 
 
1958
 
           FbBits       *tile,
1959
 
           FbStride     tileStride,
1960
 
           int          tileWidth,
1961
 
           int          tileHeight,
1962
 
 
1963
 
           int          alu,
1964
 
           FbBits       pm,
1965
 
           int          bpp,
1966
 
           
1967
 
           int          xRot,
1968
 
           int          yRot);
1969
 
 
1970
 
void
1971
 
fbTile (FbBits      *dst,
1972
 
        FbStride    dstStride,
1973
 
        int         dstX,
1974
 
 
1975
 
        int         width,
1976
 
        int         height,
1977
 
 
1978
 
        FbBits      *tile,
1979
 
        FbStride    tileStride,
1980
 
        int         tileWidth,
1981
 
        int         tileHeight,
1982
 
        
1983
 
        int         alu,
1984
 
        FbBits      pm,
1985
 
        int         bpp,
1986
 
        
1987
 
        int         xRot,
1988
 
        int         yRot);
1989
 
 
1990
 
/*
1991
 
 * fbutil.c
1992
 
 */
1993
 
FbBits
1994
 
fbReplicatePixel (Pixel p, int bpp);
1995
 
 
1996
 
void
1997
 
fbReduceRasterOp (int rop, FbBits fg, FbBits pm, FbBits *andp, FbBits *xorp);
1998
 
 
1999
 
/*
2000
 
 * fbwindow.c
2001
 
 */
2002
 
 
2003
 
Bool
2004
 
fbCreateWindow(WindowPtr pWin);
2005
 
 
2006
 
Bool
2007
 
fbDestroyWindow(WindowPtr pWin);
2008
 
 
2009
 
Bool
2010
 
fbMapWindow(WindowPtr pWindow);
2011
 
 
2012
 
Bool
2013
 
fbPositionWindow(WindowPtr pWin, int x, int y);
2014
 
 
2015
 
Bool 
2016
 
fbUnmapWindow(WindowPtr pWindow);
2017
 
    
2018
 
void
2019
 
fbCopyWindowProc (DrawablePtr   pSrcDrawable,
2020
 
                  DrawablePtr   pDstDrawable,
2021
 
                  GCPtr         pGC,
2022
 
                  BoxPtr        pbox,
2023
 
                  int           nbox,
2024
 
                  int           dx,
2025
 
                  int           dy,
2026
 
                  Bool          reverse,
2027
 
                  Bool          upsidedown,
2028
 
                  Pixel         bitplane,
2029
 
                  void          *closure);
2030
 
 
2031
 
void 
2032
 
fbCopyWindow(WindowPtr      pWin, 
2033
 
             DDXPointRec    ptOldOrg, 
2034
 
             RegionPtr      prgnSrc);
2035
 
 
2036
 
Bool
2037
 
fbChangeWindowAttributes(WindowPtr pWin, unsigned long mask);
2038
 
 
2039
 
void
2040
 
fbFillRegionSolid (DrawablePtr  pDrawable,
2041
 
                   RegionPtr    pRegion,
2042
 
                   FbBits       and,
2043
 
                   FbBits       xor);
2044
 
 
2045
 
void
2046
 
fbFillRegionTiled (DrawablePtr  pDrawable,
2047
 
                   RegionPtr    pRegion,
2048
 
                   PixmapPtr    pTile);
2049
 
 
2050
 
void
2051
 
fbPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what);
2052
 
 
2053
 
 
2054
 
#endif /* _FB_H_ */