~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/programs/Xserver/ilbm/ilbm.h

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/programs/Xserver/ilbm/ilbm.h,v 3.2 1998/04/05 16:42:23 robin Exp $ */
 
2
/* Combined Purdue/PurduePlus patches, level 2.0, 1/17/89 */
 
3
/***********************************************************
 
4
 
 
5
Copyright (c) 1987  X Consortium
 
6
 
 
7
Permission is hereby granted, free of charge, to any person obtaining a copy
 
8
of this software and associated documentation files (the "Software"), to deal
 
9
in the Software without restriction, including without limitation the rights
 
10
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 
11
copies of the Software, and to permit persons to whom the Software is
 
12
furnished to do so, subject to the following conditions:
 
13
 
 
14
The above copyright notice and this permission notice shall be included in
 
15
all copies or substantial portions of the Software.
 
16
 
 
17
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 
18
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
19
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
 
20
X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
 
21
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
22
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
23
 
 
24
Except as contained in this notice, the name of the X Consortium shall not be
 
25
used in advertising or otherwise to promote the sale, use or other dealings
 
26
in this Software without prior written authorization from the X Consortium.
 
27
 
 
28
 
 
29
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
 
30
 
 
31
                        All Rights Reserved
 
32
 
 
33
Permission to use, copy, modify, and distribute this software and its
 
34
documentation for any purpose and without fee is hereby granted,
 
35
provided that the above copyright notice appear in all copies and that
 
36
both that copyright notice and this permission notice appear in
 
37
supporting documentation, and that the name of Digital not be
 
38
used in advertising or publicity pertaining to distribution of the
 
39
software without specific, written prior permission.
 
40
 
 
41
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
 
42
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
 
43
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
 
44
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
 
45
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
 
46
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
 
47
SOFTWARE.
 
48
 
 
49
******************************************************************/
 
50
/* $XConsortium: ilbm.h,v 5.31 94/04/17 20:28:15 dpw Exp $ */
 
51
/* Monochrome Frame Buffer definitions
 
52
   written by drewry, september 1986
 
53
*/
 
54
 
 
55
/* Modified jun 95 by Geert Uytterhoeven (Geert.Uytterhoeven@cs.kuleuven.ac.be)
 
56
   to use interleaved bitplanes instead of normal bitplanes */
 
57
 
 
58
#include "pixmap.h"
 
59
#include "region.h"
 
60
#include "gc.h"
 
61
#include "colormap.h"
 
62
#include "miscstruct.h"
 
63
#include "mibstore.h"
 
64
 
 
65
extern int ilbmInverseAlu[];
 
66
extern int ilbmScreenPrivateIndex;
 
67
/* warning: PixelType definition duplicated in maskbits.h */
 
68
#ifndef PixelType
 
69
#define PixelType unsigned long
 
70
#endif /* PixelType */
 
71
 
 
72
#define AFB_MAX_DEPTH 8
 
73
 
 
74
/* ilbmbitblt.c */
 
75
 
 
76
extern void ilbmDoBitblt(
 
77
#if NeedFunctionPrototypes
 
78
        DrawablePtr /*pSrc*/,
 
79
        DrawablePtr /*pDst*/,
 
80
        int /*alu*/,
 
81
        RegionPtr /*prgnDst*/,
 
82
        DDXPointPtr /*pptSrc*/,
 
83
        unsigned long /*planemask*/
 
84
#endif
 
85
);
 
86
 
 
87
extern RegionPtr ilbmBitBlt(
 
88
#if NeedFunctionPrototypes
 
89
        DrawablePtr /*pSrc*/,
 
90
        DrawablePtr /*pDst*/,
 
91
        GCPtr /*pGC*/,
 
92
        int /*srcx*/,
 
93
        int /*srcy*/,
 
94
        int /*width*/,
 
95
        int /*height*/,
 
96
        int /*dstx*/,
 
97
        int /*dsty*/,
 
98
        void (*doBitBlt)(),
 
99
        unsigned long /*planemask*/
 
100
#endif
 
101
);
 
102
 
 
103
extern RegionPtr ilbmCopyArea(
 
104
#if NeedFunctionPrototypes
 
105
        DrawablePtr /*pSrcDrawable*/,
 
106
        DrawablePtr /*pDstDrawable*/,
 
107
        GCPtr/*pGC*/,
 
108
        int /*srcx*/,
 
109
        int /*srcy*/,
 
110
        int /*width*/,
 
111
        int /*height*/,
 
112
        int /*dstx*/,
 
113
        int /*dsty*/
 
114
#endif
 
115
);
 
116
 
 
117
extern RegionPtr ilbmCopyPlane(
 
118
#if NeedFunctionPrototypes
 
119
        DrawablePtr /*pSrcDrawable*/,
 
120
        DrawablePtr /*pDstDrawable*/,
 
121
        GCPtr/*pGC*/,
 
122
        int /*srcx*/,
 
123
        int /*srcy*/,
 
124
        int /*width*/,
 
125
        int /*height*/,
 
126
        int /*dstx*/,
 
127
        int /*dsty*/,
 
128
        unsigned long /*plane*/
 
129
#endif
 
130
);
 
131
 
 
132
extern void ilbmCopy1ToN(
 
133
#if NeedFunctionPrototypes
 
134
        DrawablePtr /*pSrc*/,
 
135
        DrawablePtr /*pDst*/,
 
136
        int /*alu*/,
 
137
        RegionPtr /*prgnDst*/,
 
138
        DDXPointPtr /*pptSrc*/,
 
139
        unsigned long /*planemask*/
 
140
#endif
 
141
);
 
142
/* ilbmbltC.c */
 
143
 
 
144
extern void ilbmDoBitbltCopy(
 
145
#if NeedFunctionPrototypes
 
146
        DrawablePtr /*pSrc*/,
 
147
        DrawablePtr /*pDst*/,
 
148
        int /*alu*/,
 
149
        RegionPtr /*prgnDst*/,
 
150
        DDXPointPtr /*pptSrc*/,
 
151
        unsigned long /*planemask*/
 
152
#endif
 
153
);
 
154
/* ilbmbltCI.c */
 
155
 
 
156
extern void ilbmDoBitbltCopyInverted(
 
157
#if NeedFunctionPrototypes
 
158
        DrawablePtr /*pSrc*/,
 
159
        DrawablePtr /*pDst*/,
 
160
        int /*alu*/,
 
161
        RegionPtr /*prgnDst*/,
 
162
        DDXPointPtr /*pptSrc*/,
 
163
        unsigned long /*planemask*/
 
164
#endif
 
165
);
 
166
/* ilbmbltG.c */
 
167
 
 
168
extern void ilbmDoBitbltGeneral(
 
169
#if NeedFunctionPrototypes
 
170
        DrawablePtr /*pSrc*/,
 
171
        DrawablePtr /*pDst*/,
 
172
        int /*alu*/,
 
173
        RegionPtr /*prgnDst*/,
 
174
        DDXPointPtr /*pptSrc*/,
 
175
        unsigned long /*planemask*/
 
176
#endif
 
177
);
 
178
/* ilbmbltO.c */
 
179
 
 
180
extern void ilbmDoBitbltOr(
 
181
#if NeedFunctionPrototypes
 
182
        DrawablePtr /*pSrc*/,
 
183
        DrawablePtr /*pDst*/,
 
184
        int /*alu*/,
 
185
        RegionPtr /*prgnDst*/,
 
186
        DDXPointPtr /*pptSrc*/,
 
187
        unsigned long /*planemask*/
 
188
#endif
 
189
);
 
190
/* ilbmbltX.c */
 
191
 
 
192
extern void ilbmDoBitbltXor(
 
193
#if NeedFunctionPrototypes
 
194
        DrawablePtr /*pSrc*/,
 
195
        DrawablePtr /*pDst*/,
 
196
        int /*alu*/,
 
197
        RegionPtr /*prgnDst*/,
 
198
        DDXPointPtr /*pptSrc*/,
 
199
        unsigned long /*planemask*/
 
200
#endif
 
201
);
 
202
/* ilbmbres.c */
 
203
 
 
204
extern void ilbmBresS(
 
205
#if NeedFunctionPrototypes
 
206
        PixelType * /*addrl*/,
 
207
        int /*nlwidth*/,
 
208
        int /*sizeDst*/,
 
209
        int /*depthDst*/,
 
210
        int /*signdx*/,
 
211
        int /*signdy*/,
 
212
        int /*axis*/,
 
213
        int /*x1*/,
 
214
        int /*y1*/,
 
215
        int /*e*/,
 
216
        int /*e1*/,
 
217
        int /*e2*/,
 
218
        int /*len*/,
 
219
        unsigned char * /*rrops*/
 
220
#endif
 
221
);
 
222
/* ilbmbresd.c */
 
223
 
 
224
extern void ilbmBresD(
 
225
#if NeedFunctionPrototypes
 
226
        int * /*pdashIndex*/,
 
227
        unsigned char * /*pDash*/,
 
228
        int /*numInDashList*/,
 
229
        int * /*pdashOffset*/,
 
230
        int /*isDoubleDash*/,
 
231
        PixelType * /*addrl*/,
 
232
        int /*nlwidth*/,
 
233
        int /*sizeDst*/,
 
234
        int /*depthDst*/,
 
235
        int /*signdx*/,
 
236
        int /*signdy*/,
 
237
        int /*axis*/,
 
238
        int /*x1*/,
 
239
        int /*y1*/,
 
240
        int /*e*/,
 
241
        int /*e1*/,
 
242
        int /*e2*/,
 
243
        int /*len*/,
 
244
        unsigned char * /*rrops*/,
 
245
        unsigned char * /*bgrrops*/
 
246
#endif
 
247
);
 
248
/* ilbmbstore.c */
 
249
 
 
250
extern void ilbmSaveAreas(
 
251
#if NeedFunctionPrototypes
 
252
        PixmapPtr /*pPixmap*/,
 
253
        RegionPtr /*prgnSave*/,
 
254
        int /*xorg*/,
 
255
        int /*yorg*/,
 
256
        WindowPtr /*pWin*/
 
257
#endif
 
258
);
 
259
 
 
260
extern void ilbmRestoreAreas(
 
261
#if NeedFunctionPrototypes
 
262
        PixmapPtr /*pPixmap*/,
 
263
        RegionPtr /*prgnRestore*/,
 
264
        int /*xorg*/,
 
265
        int /*yorg*/,
 
266
        WindowPtr /*pWin*/
 
267
#endif
 
268
);
 
269
/* ilbmclip.c */
 
270
 
 
271
extern RegionPtr ilbmPixmapToRegion(
 
272
#if NeedFunctionPrototypes
 
273
        PixmapPtr /*pPix*/
 
274
#endif
 
275
);
 
276
 
 
277
/* ilbmcmap.c */
 
278
 
 
279
extern Bool ilbmInitializeColormap(
 
280
#if NeedFunctionPrototypes
 
281
        ColormapPtr /*pmap*/
 
282
#endif
 
283
);
 
284
 
 
285
extern void ilbmResolveColor(
 
286
#if NeedFunctionPrototypes
 
287
        unsigned short * /*pred*/,
 
288
        unsigned short * /*pgreen*/,
 
289
        unsigned short * /*pblue*/,
 
290
        VisualPtr /*pVisual*/
 
291
#endif
 
292
);
 
293
 
 
294
extern Bool ilbmSetVisualTypes(
 
295
#if NeedFunctionPrototypes
 
296
        int /*depth*/,
 
297
        int /*visuals*/,
 
298
        int /*bitsPerRGB*/
 
299
#endif
 
300
);
 
301
 
 
302
/* ilbmfillarc.c */
 
303
 
 
304
extern void ilbmPolyFillArcSolid(
 
305
#if NeedFunctionPrototypes
 
306
        DrawablePtr /*pDraw*/,
 
307
        GCPtr /*pGC*/,
 
308
        int /*narcs*/,
 
309
        xArc * /*parcs*/
 
310
#endif
 
311
);
 
312
/* ilbmfillrct.c */
 
313
 
 
314
extern void ilbmPolyFillRect(
 
315
#if NeedFunctionPrototypes
 
316
        DrawablePtr /*pDrawable*/,
 
317
        GCPtr /*pGC*/,
 
318
        int /*nrectFill*/,
 
319
        xRectangle * /*prectInit*/
 
320
#endif
 
321
);
 
322
 
 
323
/* ilbmply1rct.c */
 
324
extern void ilbmFillPolygonSolid(
 
325
#if NeedFunctionPrototypes
 
326
        DrawablePtr /*pDrawable*/,
 
327
        GCPtr /*pGC*/,
 
328
        int /*mode*/,
 
329
        int /*shape*/,
 
330
        int /*count*/,
 
331
        DDXPointPtr /*ptsIn*/
 
332
#endif
 
333
);
 
334
 
 
335
/* ilbmfillsp.c */
 
336
 
 
337
extern void ilbmSolidFS(
 
338
#if NeedFunctionPrototypes
 
339
        DrawablePtr /*pDrawable*/,
 
340
        GCPtr /*pGC*/,
 
341
        int /*nInit*/,
 
342
        DDXPointPtr /*pptInit*/,
 
343
        int * /*pwidthInit*/,
 
344
        int /*fSorted*/
 
345
#endif
 
346
);
 
347
 
 
348
extern void ilbmStippleFS(
 
349
#if NeedFunctionPrototypes
 
350
        DrawablePtr /*pDrawable*/,
 
351
        GCPtr/*pGC*/,
 
352
        int /*nInit*/,
 
353
        DDXPointPtr /*pptInit*/,
 
354
        int * /*pwidthInit*/,
 
355
        int /*fSorted*/
 
356
#endif
 
357
);
 
358
 
 
359
extern void ilbmTileFS(
 
360
#if NeedFunctionPrototypes
 
361
        DrawablePtr /*pDrawable*/,
 
362
        GCPtr/*pGC*/,
 
363
        int /*nInit*/,
 
364
        DDXPointPtr /*pptInit*/,
 
365
        int * /*pwidthInit*/,
 
366
        int /*fSorted*/
 
367
#endif
 
368
);
 
369
 
 
370
extern void ilbmUnnaturalTileFS(
 
371
#if NeedFunctionPrototypes
 
372
        DrawablePtr /*pDrawable*/,
 
373
        GCPtr/*pGC*/,
 
374
        int /*nInit*/,
 
375
        DDXPointPtr /*pptInit*/,
 
376
        int * /*pwidthInit*/,
 
377
        int /*fSorted*/
 
378
#endif
 
379
);
 
380
 
 
381
extern void ilbmUnnaturalStippleFS(
 
382
#if NeedFunctionPrototypes
 
383
        DrawablePtr /*pDrawable*/,
 
384
        GCPtr/*pGC*/,
 
385
        int /*nInit*/,
 
386
        DDXPointPtr /*pptInit*/,
 
387
        int * /*pwidthInit*/,
 
388
        int /*fSorted*/
 
389
#endif
 
390
);
 
391
 
 
392
extern void ilbmOpaqueStippleFS(
 
393
#if NeedFunctionPrototypes
 
394
        DrawablePtr /*pDrawable*/,
 
395
        GCPtr/*pGC*/,
 
396
        int /*nInit*/,
 
397
        DDXPointPtr /*pptInit*/,
 
398
        int * /*pwidthInit*/,
 
399
        int /*fSorted*/
 
400
#endif
 
401
);
 
402
 
 
403
extern void ilbmUnnaturalOpaqueStippleFS(
 
404
#if NeedFunctionPrototypes
 
405
        DrawablePtr /*pDrawable*/,
 
406
        GCPtr/*pGC*/,
 
407
        int /*nInit*/,
 
408
        DDXPointPtr /*pptInit*/,
 
409
        int * /*pwidthInit*/,
 
410
        int /*fSorted*/
 
411
#endif
 
412
);
 
413
 
 
414
/* ilbmfont.c */
 
415
 
 
416
extern Bool ilbmRealizeFont(
 
417
#if NeedFunctionPrototypes
 
418
        ScreenPtr /*pscr*/,
 
419
        FontPtr /*pFont*/
 
420
#endif
 
421
);
 
422
 
 
423
extern Bool ilbmUnrealizeFont(
 
424
#if NeedFunctionPrototypes
 
425
        ScreenPtr /*pscr*/,
 
426
        FontPtr /*pFont*/
 
427
#endif
 
428
);
 
429
/* ilbmgc.c */
 
430
 
 
431
extern Bool ilbmCreateGC(
 
432
#if NeedFunctionPrototypes
 
433
        GCPtr /*pGC*/
 
434
#endif
 
435
);
 
436
 
 
437
extern void ilbmValidateGC(
 
438
#if NeedFunctionPrototypes
 
439
        GCPtr /*pGC*/,
 
440
        unsigned long /*changes*/,
 
441
        DrawablePtr /*pDrawable*/
 
442
#endif
 
443
);
 
444
 
 
445
extern void ilbmDestroyGC(
 
446
#if NeedFunctionPrototypes
 
447
        GCPtr /*pGC*/
 
448
#endif
 
449
);
 
450
 
 
451
extern void ilbmReduceRop(
 
452
#if NeedFunctionPrototypes
 
453
        int /*alu*/,
 
454
        Pixel /*src*/,
 
455
        unsigned long /*planemask*/,
 
456
        int /*depth*/,
 
457
        unsigned char * /*rrops*/
 
458
#endif
 
459
);
 
460
 
 
461
extern void ilbmReduceOpaqueStipple (
 
462
#if NeedFunctionPrototypes
 
463
        Pixel /*fg*/,
 
464
        Pixel /*bg*/,
 
465
        unsigned long /*planemask*/,
 
466
        int /*depth*/,
 
467
        unsigned char * /*rrops*/
 
468
#endif
 
469
);
 
470
 
 
471
extern void ilbmComputeCompositeClip(
 
472
#if NeedFunctionPrototypes
 
473
   GCPtr /*pGC*/,
 
474
   DrawablePtr /*pDrawable*/
 
475
#endif
 
476
);
 
477
 
 
478
/* ilbmgetsp.c */
 
479
 
 
480
extern void ilbmGetSpans(
 
481
#if NeedFunctionPrototypes
 
482
        DrawablePtr /*pDrawable*/,
 
483
        int /*wMax*/,
 
484
        DDXPointPtr /*ppt*/,
 
485
        int * /*pwidth*/,
 
486
        int /*nspans*/,
 
487
        char * /*pdstStart*/
 
488
#endif
 
489
);
 
490
/* ilbmhrzvert.c */
 
491
 
 
492
extern int ilbmHorzS(
 
493
#if NeedFunctionPrototypes
 
494
        PixelType * /*addrl*/,
 
495
        int /*nlwidth*/,
 
496
        int /*sizeDst*/,
 
497
        int /*depthDst*/,
 
498
        int /*x1*/,
 
499
        int /*y1*/,
 
500
        int /*len*/,
 
501
        unsigned char * /*rrops*/
 
502
#endif
 
503
);
 
504
 
 
505
extern int ilbmVertS(
 
506
#if NeedFunctionPrototypes
 
507
        PixelType * /*addrl*/,
 
508
        int /*nlwidth*/,
 
509
        int /*sizeDst*/,
 
510
        int /*depthDst*/,
 
511
        int /*x1*/,
 
512
        int /*y1*/,
 
513
        int /*len*/,
 
514
        unsigned char * /*rrops*/
 
515
#endif
 
516
);
 
517
/* ilbmigbblak.c */
 
518
 
 
519
extern void ilbmImageGlyphBlt (
 
520
#if NeedFunctionPrototypes
 
521
        DrawablePtr /*pDrawable*/,
 
522
        GCPtr/*pGC*/,
 
523
        int /*x*/,
 
524
        int /*y*/,
 
525
        unsigned int /*nglyph*/,
 
526
        CharInfoPtr * /*ppci*/,
 
527
        pointer /*pglyphBase*/
 
528
#endif
 
529
);
 
530
/* ilbmigbwht.c */
 
531
 
 
532
/* ilbmimage.c */
 
533
 
 
534
extern void ilbmPutImage(
 
535
#if NeedFunctionPrototypes
 
536
        DrawablePtr /*dst*/,
 
537
        GCPtr /*pGC*/,
 
538
        int /*depth*/,
 
539
        int /*x*/,
 
540
        int /*y*/,
 
541
        int /*w*/,
 
542
        int /*h*/,
 
543
        int /*leftPad*/,
 
544
        int /*format*/,
 
545
        char * /*pImage*/
 
546
#endif
 
547
);
 
548
 
 
549
extern void ilbmGetImage(
 
550
#if NeedFunctionPrototypes
 
551
        DrawablePtr /*pDrawable*/,
 
552
        int /*sx*/,
 
553
        int /*sy*/,
 
554
        int /*w*/,
 
555
        int /*h*/,
 
556
        unsigned int /*format*/,
 
557
        unsigned long /*planeMask*/,
 
558
        char * /*pdstLine*/
 
559
#endif
 
560
);
 
561
/* ilbmline.c */
 
562
 
 
563
extern void ilbmLineSS(
 
564
#if NeedFunctionPrototypes
 
565
        DrawablePtr /*pDrawable*/,
 
566
        GCPtr /*pGC*/,
 
567
        int /*mode*/,
 
568
        int /*npt*/,
 
569
        DDXPointPtr /*pptInit*/
 
570
#endif
 
571
);
 
572
 
 
573
extern void ilbmLineSD(
 
574
#if NeedFunctionPrototypes
 
575
        DrawablePtr /*pDrawable*/,
 
576
        GCPtr /*pGC*/,
 
577
        int /*mode*/,
 
578
        int /*npt*/,
 
579
        DDXPointPtr /*pptInit*/
 
580
#endif
 
581
);
 
582
 
 
583
/* ilbmmisc.c */
 
584
 
 
585
extern void ilbmQueryBestSize(
 
586
#if NeedFunctionPrototypes
 
587
        int /*class*/,
 
588
        unsigned short * /*pwidth*/,
 
589
        unsigned short * /*pheight*/,
 
590
        ScreenPtr /*pScreen*/
 
591
#endif
 
592
);
 
593
/* ilbmpntarea.c */
 
594
 
 
595
extern void ilbmSolidFillArea(
 
596
#if NeedFunctionPrototypes
 
597
        DrawablePtr /*pDraw*/,
 
598
        int /*nbox*/,
 
599
        BoxPtr /*pbox*/,
 
600
        unsigned char * /*rrops*/
 
601
#endif
 
602
);
 
603
 
 
604
extern void ilbmStippleAreaPPW(
 
605
#if NeedFunctionPrototypes
 
606
        DrawablePtr /*pDraw*/,
 
607
        int /*nbox*/,
 
608
        BoxPtr /*pbox*/,
 
609
        PixmapPtr /*pstipple*/,
 
610
        unsigned char * /*rrops*/
 
611
#endif
 
612
);
 
613
extern void ilbmStippleArea(
 
614
#if NeedFunctionPrototypes
 
615
        DrawablePtr /*pDraw*/,
 
616
        int /*nbox*/,
 
617
        BoxPtr /*pbox*/,
 
618
        PixmapPtr /*pstipple*/,
 
619
        int /*xOff*/,
 
620
        int /*yOff*/,
 
621
        unsigned char * /*rrops*/
 
622
#endif
 
623
);
 
624
/* ilbmplygblt.c */
 
625
 
 
626
extern void ilbmPolyGlyphBlt(
 
627
#if NeedFunctionPrototypes
 
628
        DrawablePtr /*pDrawable*/,
 
629
        GCPtr /*pGC*/,
 
630
        int /*x*/,
 
631
        int /*y*/,
 
632
        unsigned int /*nglyph*/,
 
633
        CharInfoPtr * /*ppci*/,
 
634
        pointer /*pglyphBase*/
 
635
#endif
 
636
);
 
637
 
 
638
/* ilbmpixmap.c */
 
639
 
 
640
extern PixmapPtr ilbmCreatePixmap(
 
641
#if NeedFunctionPrototypes
 
642
        ScreenPtr /*pScreen*/,
 
643
        int /*width*/,
 
644
        int /*height*/,
 
645
        int /*depth*/
 
646
#endif
 
647
);
 
648
 
 
649
extern Bool ilbmDestroyPixmap(
 
650
#if NeedFunctionPrototypes
 
651
        PixmapPtr /*pPixmap*/
 
652
#endif
 
653
);
 
654
 
 
655
extern PixmapPtr ilbmCopyPixmap(
 
656
#if NeedFunctionPrototypes
 
657
        PixmapPtr /*pSrc*/
 
658
#endif
 
659
);
 
660
 
 
661
extern void ilbmPadPixmap(
 
662
#if NeedFunctionPrototypes
 
663
        PixmapPtr /*pPixmap*/
 
664
#endif
 
665
);
 
666
 
 
667
extern void ilbmXRotatePixmap(
 
668
#if NeedFunctionPrototypes
 
669
        PixmapPtr /*pPix*/,
 
670
        int /*rw*/
 
671
#endif
 
672
);
 
673
 
 
674
extern void ilbmYRotatePixmap(
 
675
#if NeedFunctionPrototypes
 
676
        PixmapPtr /*pPix*/,
 
677
        int /*rh*/
 
678
#endif
 
679
);
 
680
 
 
681
extern void ilbmCopyRotatePixmap(
 
682
#if NeedFunctionPrototypes
 
683
        PixmapPtr /*psrcPix*/,
 
684
        PixmapPtr * /*ppdstPix*/,
 
685
        int /*xrot*/,
 
686
        int /*yrot*/
 
687
#endif
 
688
);
 
689
extern void ilbmPaintWindow(
 
690
#if NeedFunctionPrototypes
 
691
        WindowPtr /*pWin*/,
 
692
        RegionPtr /*pRegion*/,
 
693
        int /*what*/
 
694
#endif
 
695
);
 
696
/* ilbmpolypnt.c */
 
697
 
 
698
extern void ilbmPolyPoint(
 
699
#if NeedFunctionPrototypes
 
700
        DrawablePtr /*pDrawable*/,
 
701
        GCPtr /*pGC*/,
 
702
        int /*mode*/,
 
703
        int /*npt*/,
 
704
        xPoint * /*pptInit*/
 
705
#endif
 
706
);
 
707
/* ilbmpushpxl.c */
 
708
 
 
709
extern void ilbmPushPixels(
 
710
#if NeedFunctionPrototypes
 
711
        GCPtr /*pGC*/,
 
712
        PixmapPtr /*pBitMap*/,
 
713
        DrawablePtr /*pDrawable*/,
 
714
        int /*dx*/,
 
715
        int /*dy*/,
 
716
        int /*xOrg*/,
 
717
        int /*yOrg*/
 
718
#endif
 
719
);
 
720
/* ilbmscrclse.c */
 
721
 
 
722
extern Bool ilbmCloseScreen(
 
723
#if NeedFunctionPrototypes
 
724
        int /*index*/,
 
725
        ScreenPtr /*pScreen*/
 
726
#endif
 
727
);
 
728
/* ilbmscrinit.c */
 
729
 
 
730
extern Bool ilbmAllocatePrivates(
 
731
#if NeedFunctionPrototypes
 
732
        ScreenPtr /*pScreen*/,
 
733
        int * /*pWinIndex*/,
 
734
        int * /*pGCIndex*/
 
735
#endif
 
736
);
 
737
 
 
738
extern Bool ilbmScreenInit(
 
739
#if NeedFunctionPrototypes
 
740
        ScreenPtr /*pScreen*/,
 
741
        pointer /*pbits*/,
 
742
        int /*xsize*/,
 
743
        int /*ysize*/,
 
744
        int /*dpix*/,
 
745
        int /*dpiy*/,
 
746
        int /*width*/
 
747
#endif
 
748
);
 
749
 
 
750
extern PixmapPtr ilbmGetWindowPixmap(
 
751
#if NeedFunctionPrototypes
 
752
        WindowPtr /*pWin*/
 
753
#endif
 
754
);
 
755
 
 
756
extern void ilbmSetWindowPixmap(
 
757
#if NeedFunctionPrototypes
 
758
        WindowPtr /*pWin*/,
 
759
        PixmapPtr /*pPix*/
 
760
#endif
 
761
);
 
762
 
 
763
/* ilbmseg.c */
 
764
 
 
765
extern void ilbmSegmentSS(
 
766
#if NeedFunctionPrototypes
 
767
        DrawablePtr /*pDrawable*/,
 
768
        GCPtr /*pGC*/,
 
769
        int /*nseg*/,
 
770
        xSegment * /*pSeg*/
 
771
#endif
 
772
);
 
773
 
 
774
extern void ilbmSegmentSD(
 
775
#if NeedFunctionPrototypes
 
776
        DrawablePtr /*pDrawable*/,
 
777
        GCPtr /*pGC*/,
 
778
        int /*nseg*/,
 
779
        xSegment * /*pSeg*/
 
780
#endif
 
781
);
 
782
/* ilbmsetsp.c */
 
783
 
 
784
extern int ilbmSetScanline(
 
785
#if NeedFunctionPrototypes
 
786
        int /*y*/,
 
787
        int /*xOrigin*/,
 
788
        int /*xStart*/,
 
789
        int /*xEnd*/,
 
790
        PixelType * /*psrc*/,
 
791
        int /*alu*/,
 
792
        PixelType * /*pdstBase*/,
 
793
        int /*widthDst*/,
 
794
        int /*sizeDst*/,
 
795
        int /*depthDst*/,
 
796
        int /*sizeSrc*/
 
797
#endif
 
798
);
 
799
 
 
800
extern void ilbmSetSpans(
 
801
#if NeedFunctionPrototypes
 
802
        DrawablePtr /*pDrawable*/,
 
803
        GCPtr /*pGC*/,
 
804
        char * /*psrc*/,
 
805
        DDXPointPtr /*ppt*/,
 
806
        int * /*pwidth*/,
 
807
        int /*nspans*/,
 
808
        int /*fSorted*/
 
809
#endif
 
810
);
 
811
/* ilbmtegblt.c */
 
812
 
 
813
extern void ilbmTEGlyphBlt(
 
814
#if NeedFunctionPrototypes
 
815
        DrawablePtr /*pDrawable*/,
 
816
        GCPtr/*pGC*/,
 
817
        int /*x*/,
 
818
        int /*y*/,
 
819
        unsigned int /*nglyph*/,
 
820
        CharInfoPtr * /*ppci*/,
 
821
        pointer /*pglyphBase*/
 
822
#endif
 
823
);
 
824
/* ilbmtileC.c */
 
825
 
 
826
extern void ilbmTileAreaPPWCopy(
 
827
#if NeedFunctionPrototypes
 
828
        DrawablePtr /*pDraw*/,
 
829
        int /*nbox*/,
 
830
        BoxPtr /*pbox*/,
 
831
        int /*alu*/,
 
832
        PixmapPtr /*ptile*/,
 
833
        unsigned long /*planemask*/
 
834
#endif
 
835
);
 
836
/* ilbmtileG.c */
 
837
 
 
838
extern void ilbmTileAreaPPWGeneral(
 
839
#if NeedFunctionPrototypes
 
840
        DrawablePtr /*pDraw*/,
 
841
        int /*nbox*/,
 
842
        BoxPtr /*pbox*/,
 
843
        int /*alu*/,
 
844
        PixmapPtr /*ptile*/,
 
845
        unsigned long /*planemask*/
 
846
#endif
 
847
);
 
848
 
 
849
extern void ilbmTileAreaCopy(
 
850
#if NeedFunctionPrototypes
 
851
        DrawablePtr /*pDraw*/,
 
852
        int /*nbox*/,
 
853
        BoxPtr /*pbox*/,
 
854
        int /*alu*/,
 
855
        PixmapPtr /*ptile*/,
 
856
        int /*xOff*/,
 
857
        int /*yOff*/,
 
858
        unsigned long /*planemask*/
 
859
#endif
 
860
);
 
861
/* ilbmtileG.c */
 
862
 
 
863
extern void ilbmTileAreaGeneral(
 
864
#if NeedFunctionPrototypes
 
865
        DrawablePtr /*pDraw*/,
 
866
        int /*nbox*/,
 
867
        BoxPtr /*pbox*/,
 
868
        int /*alu*/,
 
869
        PixmapPtr /*ptile*/,
 
870
        int /*xOff*/,
 
871
        int /*yOff*/,
 
872
        unsigned long /*planemask*/
 
873
#endif
 
874
);
 
875
 
 
876
extern void ilbmOpaqueStippleAreaPPWCopy(
 
877
#if NeedFunctionPrototypes
 
878
        DrawablePtr /*pDraw*/,
 
879
        int /*nbox*/,
 
880
        BoxPtr /*pbox*/,
 
881
        int /*alu*/,
 
882
        PixmapPtr /*ptile*/,
 
883
        unsigned char */*rropsOS*/,
 
884
        unsigned long /*planemask*/
 
885
#endif
 
886
);
 
887
/* ilbmtileG.c */
 
888
 
 
889
extern void ilbmOpaqueStippleAreaPPWGeneral(
 
890
#if NeedFunctionPrototypes
 
891
        DrawablePtr /*pDraw*/,
 
892
        int /*nbox*/,
 
893
        BoxPtr /*pbox*/,
 
894
        int /*alu*/,
 
895
        PixmapPtr /*ptile*/,
 
896
        unsigned char */*rropsOS*/,
 
897
        unsigned long /*planemask*/
 
898
#endif
 
899
);
 
900
 
 
901
extern void ilbmOpaqueStippleAreaCopy(
 
902
#if NeedFunctionPrototypes
 
903
        DrawablePtr /*pDraw*/,
 
904
        int /*nbox*/,
 
905
        BoxPtr /*pbox*/,
 
906
        int /*alu*/,
 
907
        PixmapPtr /*ptile*/,
 
908
        int /*xOff*/,
 
909
        int /*yOff*/,
 
910
        unsigned char */*rropsOS*/,
 
911
        unsigned long /*planemask*/
 
912
#endif
 
913
);
 
914
/* ilbmtileG.c */
 
915
 
 
916
extern void ilbmOpaqueStippleAreaGeneral(
 
917
#if NeedFunctionPrototypes
 
918
        DrawablePtr /*pDraw*/,
 
919
        int /*nbox*/,
 
920
        BoxPtr /*pbox*/,
 
921
        int /*alu*/,
 
922
        PixmapPtr /*ptile*/,
 
923
        int /*xOff*/,
 
924
        int /*yOff*/,
 
925
        unsigned char */*rropsOS*/,
 
926
        unsigned long /*planemask*/
 
927
#endif
 
928
);
 
929
 
 
930
/* ilbmwindow.c */
 
931
 
 
932
extern Bool ilbmCreateWindow(
 
933
#if NeedFunctionPrototypes
 
934
        WindowPtr /*pWin*/
 
935
#endif
 
936
);
 
937
 
 
938
extern Bool ilbmDestroyWindow(
 
939
#if NeedFunctionPrototypes
 
940
        WindowPtr /*pWin*/
 
941
#endif
 
942
);
 
943
 
 
944
extern Bool ilbmMapWindow(
 
945
#if NeedFunctionPrototypes
 
946
        WindowPtr /*pWindow*/
 
947
#endif
 
948
);
 
949
 
 
950
extern Bool ilbmPositionWindow(
 
951
#if NeedFunctionPrototypes
 
952
        WindowPtr /*pWin*/,
 
953
        int /*x*/,
 
954
        int /*y*/
 
955
#endif
 
956
);
 
957
 
 
958
extern Bool ilbmUnmapWindow(
 
959
#if NeedFunctionPrototypes
 
960
        WindowPtr /*pWindow*/
 
961
#endif
 
962
);
 
963
 
 
964
extern void ilbmCopyWindow(
 
965
#if NeedFunctionPrototypes
 
966
        WindowPtr /*pWin*/,
 
967
        DDXPointRec /*ptOldOrg*/,
 
968
        RegionPtr /*prgnSrc*/
 
969
#endif
 
970
);
 
971
 
 
972
extern Bool ilbmChangeWindowAttributes(
 
973
#if NeedFunctionPrototypes
 
974
        WindowPtr /*pWin*/,
 
975
        unsigned long /*mask*/
 
976
#endif
 
977
);
 
978
/* ilbmzerarc.c */
 
979
 
 
980
extern void ilbmZeroPolyArcSS(
 
981
#if NeedFunctionPrototypes
 
982
        DrawablePtr /*pDraw*/,
 
983
        GCPtr /*pGC*/,
 
984
        int /*narcs*/,
 
985
        xArc * /*parcs*/
 
986
#endif
 
987
);
 
988
 
 
989
/*
 
990
        private field of pixmap
 
991
        pixmap.devPrivate = (PixelType *)pointer_to_bits
 
992
        pixmap.devKind = width_of_pixmap_in_bytes
 
993
 
 
994
        private field of screen
 
995
        a pixmap, for which we allocate storage.  devPrivate is a pointer to
 
996
the bits in the hardware framebuffer.  note that devKind can be poked to
 
997
make the code work for framebuffers that are wider than their
 
998
displayable screen (e.g. the early vsII, which displayed 960 pixels
 
999
across, but was 1024 in the hardware.)
 
1000
 
 
1001
        private field of GC
 
1002
*/
 
1003
 
 
1004
typedef struct {
 
1005
        unsigned char rrops[AFB_MAX_DEPTH];             /* reduction of rasterop to 1 of 3 */
 
1006
        unsigned char rropOS[AFB_MAX_DEPTH];    /* rop for opaque stipple */
 
1007
} ilbmPrivGC;
 
1008
typedef ilbmPrivGC *ilbmPrivGCPtr;
 
1009
 
 
1010
extern int ilbmGCPrivateIndex;                  /* index into GC private array */
 
1011
extern int ilbmWindowPrivateIndex;              /* index into Window private array */
 
1012
#ifdef PIXMAP_PER_WINDOW
 
1013
extern int frameWindowPrivateIndex;             /* index into Window private array */
 
1014
#endif
 
1015
 
 
1016
#define ilbmGetGCPrivate(pGC) \
 
1017
        ((ilbmPrivGC *)((pGC)->devPrivates[ilbmGCPrivateIndex].ptr))
 
1018
 
 
1019
/* private field of window */
 
1020
typedef struct {
 
1021
        unsigned char fastBorder;       /* non-zero if border tile is 32 bits wide */
 
1022
        unsigned char fastBackground;
 
1023
        unsigned short unused; /* pad for alignment with Sun compiler */
 
1024
        DDXPointRec oldRotate;
 
1025
        PixmapPtr pRotatedBackground;
 
1026
        PixmapPtr pRotatedBorder;
 
1027
} ilbmPrivWin;
 
1028
 
 
1029
/* Common macros for extracting drawing information */
 
1030
 
 
1031
#define ilbmGetPixelWidthAuxDepthAndPointer(pDrawable, width, aux, dep, pointer) {\
 
1032
        PixmapPtr _pPix; \
 
1033
        if ((pDrawable)->type == DRAWABLE_WINDOW) \
 
1034
                _pPix = (PixmapPtr)(pDrawable)->pScreen->devPrivates[ilbmScreenPrivateIndex].ptr; \
 
1035
        else \
 
1036
                _pPix = (PixmapPtr)(pDrawable); \
 
1037
        (pointer) = (PixelType *)_pPix->devPrivate.ptr; \
 
1038
        (width) = ((int)_pPix->devKind)/sizeof(PixelType); \
 
1039
        (dep) = _pPix->drawable.depth; \
 
1040
        (aux) = (width)*(dep); \
 
1041
}
 
1042
 
 
1043
/*  ilbm uses the following macros to calculate addresses in drawables.
 
1044
 *  To support banked framebuffers, the macros come in four flavors.
 
1045
 *  All four collapse into the same definition on unbanked devices.
 
1046
 *
 
1047
 *  ilbmScanlineFoo - calculate address and do bank switching
 
1048
 *  ilbmScanlineFooNoBankSwitch - calculate address, don't bank switch
 
1049
 *  ilbmScanlineFooSrc - calculate address, switch source bank
 
1050
 *  ilbmScanlineFooDst - calculate address, switch destination bank
 
1051
 */
 
1052
 
 
1053
/* The NoBankSwitch versions are the same for banked and unbanked cases */
 
1054
 
 
1055
#define ilbmScanlineIncNoBankSwitch(_ptr, _off) _ptr += (_off)
 
1056
#define ilbmScanlineOffsetNoBankSwitch(_ptr, _off) ((_ptr)+(_off))
 
1057
#define ilbmScanlineDeltaNoBankSwitch(_ptr, _y, _w) \
 
1058
        ilbmScanlineOffsetNoBankSwitch(_ptr, (_y)*(_w))
 
1059
#define ilbmScanlineNoBankSwitch(_ptr, _x, _y, _w) \
 
1060
        ilbmScanlineOffsetNoBankSwitch(_ptr, (_y)*(_w)+((_x)>>MFB_PWSH))
 
1061
 
 
1062
#ifdef MFB_LINE_BANK
 
1063
 
 
1064
#include "ilbmlinebank.h" /* get macro definitions from this file */
 
1065
 
 
1066
#else /* !MFB_LINE_BANK - unbanked case */
 
1067
 
 
1068
#define ilbmScanlineInc(_ptr, _off)                             ilbmScanlineIncNoBankSwitch(_ptr, _off)
 
1069
#define ilbmScanlineIncSrc(_ptr, _off)                  ilbmScanlineInc(_ptr, _off)
 
1070
#define ilbmScanlineIncDst(_ptr, _off)                  ilbmScanlineInc(_ptr, _off)
 
1071
 
 
1072
#define ilbmScanlineOffset(_ptr, _off)                  ilbmScanlineOffsetNoBankSwitch(_ptr, _off)
 
1073
#define ilbmScanlineOffsetSrc(_ptr, _off)               ilbmScanlineOffset(_ptr, _off)
 
1074
#define ilbmScanlineOffsetDst(_ptr, _off)               ilbmScanlineOffset(_ptr, _off)
 
1075
 
 
1076
#define ilbmScanlineSrc(_ptr, _x, _y, _w)               ilbmScanline(_ptr, _x, _y, _w)
 
1077
#define ilbmScanlineDst(_ptr, _x, _y, _w)               ilbmScanline(_ptr, _x, _y, _w)
 
1078
 
 
1079
#define ilbmScanlineDeltaSrc(_ptr, _y, _w)      ilbmScanlineDelta(_ptr, _y, _w)
 
1080
#define ilbmScanlineDeltaDst(_ptr, _y, _w)      ilbmScanlineDelta(_ptr, _y, _w)
 
1081
 
 
1082
#endif /* MFB_LINE_BANK */
 
1083
 
 
1084
#define ilbmScanlineDelta(_ptr, _y, _w) \
 
1085
        ilbmScanlineOffset(_ptr, (_y)*(_w))
 
1086
 
 
1087
#define ilbmScanline(_ptr, _x, _y, _w) \
 
1088
        ilbmScanlineOffset(_ptr, (_y)*(_w)+((_x)>>MFB_PWSH))
 
1089
 
 
1090
/* precomputed information about each glyph for GlyphBlt code.
 
1091
   this saves recalculating the per glyph information for each box.
 
1092
*/
 
1093
 
 
1094
typedef struct _ilbmpos{
 
1095
        int xpos;                                       /* xposition of glyph's origin */
 
1096
        int xchar;                                      /* x position mod 32 */
 
1097
        int leftEdge;
 
1098
        int rightEdge;
 
1099
        int topEdge;
 
1100
        int bottomEdge;
 
1101
        PixelType *pdstBase;            /* longword with character origin */
 
1102
        int widthGlyph;                 /* width in bytes of this glyph */
 
1103
} ilbmTEXTPOS;
 
1104
 
 
1105
/* reduced raster ops for ilbm */
 
1106
#define RROP_BLACK                      GXclear
 
1107
#define RROP_WHITE                      GXset
 
1108
#define RROP_NOP                                GXnoop
 
1109
#define RROP_INVERT                     GXinvert
 
1110
#define RROP_COPY                               GXcopy
 
1111
 
 
1112
/* macros for ilbmbitblt.c, ilbmfillsp.c
 
1113
        these let the code do one switch on the rop per call, rather
 
1114
        than a switch on the rop per item (span or rectangle.)
 
1115
*/
 
1116
 
 
1117
#define fnCLEAR(src, dst)                               (0)
 
1118
#define fnAND(src, dst)                                 (src & dst)
 
1119
#define fnANDREVERSE(src, dst)          (src & ~dst)
 
1120
#define fnCOPY(src, dst)                                (src)
 
1121
#define fnANDINVERTED(src, dst)         (~src & dst)
 
1122
#define fnNOOP(src, dst)                                (dst)
 
1123
#define fnXOR(src, dst)                                 (src ^ dst)
 
1124
#define fnOR(src, dst)                                  (src | dst)
 
1125
#define fnNOR(src, dst)                                 (~(src | dst))
 
1126
#define fnEQUIV(src, dst)                               (~src ^ dst)
 
1127
#define fnINVERT(src, dst)                              (~dst)
 
1128
#define fnORREVERSE(src, dst)                   (src | ~dst)
 
1129
#define fnCOPYINVERTED(src, dst)                (~src)
 
1130
#define fnORINVERTED(src, dst)          (~src | dst)
 
1131
#define fnNAND(src, dst)                                (~(src & dst))
 
1132
#define fnSET(src, dst)                                 (~0)
 
1133
 
 
1134
/*  Using a "switch" statement is much faster in most cases
 
1135
 *  since the compiler can do a look-up table or multi-way branch
 
1136
 *  instruction, depending on the architecture.  The result on
 
1137
 *  A Sun 3/50 is at least 2.5 times faster, assuming a uniform
 
1138
 *  distribution of RasterOp operation types.
 
1139
 *
 
1140
 *  However, doing some profiling on a running system reveals
 
1141
 *  GXcopy is the operation over 99.5% of the time and
 
1142
 *  GXxor is the next most frequent (about .4%), so we make special
 
1143
 *  checks for those first.
 
1144
 *
 
1145
 *  Note that this requires a change to the "calling sequence"
 
1146
 *  since we can't engineer a "switch" statement to have an lvalue.
 
1147
 */
 
1148
#define DoRop(result, alu, src, dst) \
 
1149
{ \
 
1150
        if (alu == GXcopy) \
 
1151
                result = fnCOPY (src, dst); \
 
1152
        else if (alu == GXxor) \
 
1153
                result = fnXOR (src, dst); \
 
1154
        else \
 
1155
                switch (alu) { \
 
1156
                        case GXclear: \
 
1157
                                result = fnCLEAR (src, dst); \
 
1158
                                break; \
 
1159
                        case GXand: \
 
1160
                                result = fnAND (src, dst); \
 
1161
                                break; \
 
1162
                        case GXandReverse: \
 
1163
                                result = fnANDREVERSE (src, dst); \
 
1164
                                break; \
 
1165
                        case GXandInverted: \
 
1166
                                result = fnANDINVERTED (src, dst); \
 
1167
                                break; \
 
1168
                        case GXnoop: \
 
1169
                                result = fnNOOP (src, dst); \
 
1170
                                break; \
 
1171
                        case GXor: \
 
1172
                                result = fnOR (src, dst); \
 
1173
                                break; \
 
1174
                        case GXnor: \
 
1175
                                result = fnNOR (src, dst); \
 
1176
                                break; \
 
1177
                        case GXequiv: \
 
1178
                                result = fnEQUIV (src, dst); \
 
1179
                                break; \
 
1180
                        case GXinvert: \
 
1181
                                result = fnINVERT (src, dst); \
 
1182
                                break; \
 
1183
                        case GXorReverse: \
 
1184
                                result = fnORREVERSE (src, dst); \
 
1185
                                break; \
 
1186
                        case GXcopyInverted: \
 
1187
                                result = fnCOPYINVERTED (src, dst); \
 
1188
                                break; \
 
1189
                        case GXorInverted: \
 
1190
                                result = fnORINVERTED (src, dst); \
 
1191
                                break; \
 
1192
                        case GXnand: \
 
1193
                                result = fnNAND (src, dst); \
 
1194
                                break; \
 
1195
                        case GXset: \
 
1196
                                result = fnSET (src, dst); \
 
1197
                                break; \
 
1198
        } \
 
1199
}
 
1200
 
 
1201
 
 
1202
/*  C expression fragments for various operations.  These get passed in
 
1203
 *  as -D's on the compile command line.  See ilbm/Imakefile.  This
 
1204
 *  fixes XBUG 6319.
 
1205
 *
 
1206
 *  This seems like a good place to point out that ilbm's use of the
 
1207
 *  words black and white is an unfortunate misnomer.  In ilbm code, black
 
1208
 *  means zero, and white means one.
 
1209
 */
 
1210
#define MFB_OPEQ_WHITE                          |=
 
1211
#define MFB_OPEQ_BLACK                          &=~
 
1212
#define MFB_OPEQ_INVERT                         ^=
 
1213
#define MFB_EQWHOLEWORD_WHITE           =~0
 
1214
#define MFB_EQWHOLEWORD_BLACK           =0
 
1215
#define MFB_EQWHOLEWORD_INVERT  ^=~0
 
1216
#define MFB_OP_WHITE                                    /* nothing */
 
1217
#define MFB_OP_BLACK                                    ~