VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/XFree86-4.3/Xserver/fb.h@ 69098

Last change on this file since 69098 was 69098, checked in by vboxsync, 7 years ago

Clean up XFree86 driver header files.
bugref:3810: X11 Guest Additions maintenance
Over the years we have cleaned up the layout in the tree of the X.Org
header files we use to build drivers. The XFree86 ones were still in their
original, rather sub-optimal layout. This change fixes that.

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