home *** CD-ROM | disk | FTP | other *** search
/ Mac Power 1997 January / macpower199701.bin / AMUG / Programming_10 / Videotoolbox 96-08-22-c.sit / VideoToolbox / VideoToolboxSources / CopyWindows.c < prev    next >
MacBinary  |  1995-07-26  |  10.0 KB  |  [TEXT/CWIE]

open in: MacOS 8.1     |     Win98     |     DOS

view JSON data     |     view as text

This file was processed as: MacBinary (archive/macBinary).

You can browse this item here: CopyWindows.c

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
20% dexvert Blazing Paddles (image/blazingPaddles) fileSize Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Wed Jul 26 04:07:59 1995, modified Wed Jul 26 04:07:59 1995, creator 'CWIE', type ASCII, 9414 bytes "CopyWindows.c" , at 0x2546 594 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[CWIE]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 43 6f 70 79 57 69 | 6e 64 6f 77 73 2e 63 00 |..CopyWi|ndows.c.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 43 57 49 | 45 01 00 00 00 00 00 00 |.TEXTCWI|E.......|
|00000050| 00 00 00 00 00 24 c6 00 | 00 02 52 ac 3b a8 5f ac |.....$..|..R.;._.|
|00000060| 3b a8 5f 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |;._.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 ce 36 00 00 |........|.....6..|
|00000080| 2f 2a 0d 43 6f 70 79 57 | 69 6e 64 6f 77 73 2e 63 |/*.CopyW|indows.c|
|00000090| 0d 0d 43 6f 70 79 57 69 | 6e 64 6f 77 73 28 73 72 |..CopyWi|ndows(sr|
|000000a0| 63 57 69 6e 64 6f 77 2c | 64 73 74 57 69 6e 64 6f |cWindow,|dstWindo|
|000000b0| 77 2c 73 72 63 52 65 63 | 74 50 74 72 2c 64 73 74 |w,srcRec|tPtr,dst|
|000000c0| 52 65 63 74 50 74 72 2c | 73 72 63 4d 6f 64 65 2c |RectPtr,|srcMode,|
|000000d0| 6d 61 73 6b 52 67 6e 29 | 3b 0d 0d 43 6f 70 79 57 |maskRgn)|;..CopyW|
|000000e0| 69 6e 64 6f 77 73 28 29 | 20 70 72 6f 76 69 64 65 |indows()| provide|
|000000f0| 73 20 61 20 68 69 67 68 | 2d 6c 65 76 65 6c 20 69 |s a high|-level i|
|00000100| 6e 74 65 72 66 61 63 65 | 20 74 6f 20 43 6f 70 79 |nterface| to Copy|
|00000110| 42 69 74 73 20 61 6e 64 | 20 43 6f 70 79 42 69 74 |Bits and| CopyBit|
|00000120| 73 51 75 69 63 6b 6c 79 | 2c 0d 61 63 63 65 70 74 |sQuickly|,.accept|
|00000130| 69 6e 67 20 77 69 6e 64 | 6f 77 73 20 28 57 69 6e |ing wind|ows (Win|
|00000140| 64 6f 77 50 74 72 2c 20 | 43 57 69 6e 64 6f 77 50 |dowPtr, |CWindowP|
|00000150| 74 72 2c 20 6f 72 20 47 | 57 6f 72 6c 64 50 74 72 |tr, or G|WorldPtr|
|00000160| 29 20 69 6e 73 74 65 61 | 64 20 6f 66 20 70 69 78 |) instea|d of pix|
|00000170| 6d 61 70 73 20 6f 72 0d | 62 69 74 6d 61 70 73 2e |maps or.|bitmaps.|
|00000180| 0d 0d 59 6f 75 20 73 65 | 6c 65 63 74 20 43 6f 70 |..You se|lect Cop|
|00000190| 79 42 69 74 73 51 75 69 | 63 6b 6c 79 20 62 79 20 |yBitsQui|ckly by |
|000001a0| 75 73 69 6e 67 20 61 20 | 73 72 63 4d 6f 64 65 20 |using a |srcMode |
|000001b0| 74 68 61 74 20 68 61 73 | 20 74 68 65 20 22 63 6f |that has| the "co|
|000001c0| 70 79 4c 69 74 65 72 61 | 6c 6c 79 22 20 62 69 74 |pyLitera|lly" bit|
|000001d0| 0d 73 65 74 2c 20 69 2e | 65 2e 20 65 69 74 68 65 |.set, i.|e. eithe|
|000001e0| 72 20 73 72 63 43 6f 70 | 79 4c 69 74 65 72 61 6c |r srcCop|yLiteral|
|000001f0| 6c 79 2c 20 61 64 64 4f | 76 65 72 4c 69 74 65 72 |ly, addO|verLiter|
|00000200| 61 6c 6c 79 2c 20 61 64 | 64 4f 76 65 72 50 61 72 |ally, ad|dOverPar|
|00000210| 61 6c 6c 65 6c 4c 69 74 | 65 72 61 6c 6c 79 2c 0d |allelLit|erally,.|
|00000220| 6f 72 20 6d 75 6c 4f 76 | 65 72 4c 69 74 65 72 61 |or mulOv|erLitera|
|00000230| 6c 6c 79 2e 0d 0d 46 6f | 72 20 79 6f 75 72 20 63 |lly...Fo|r your c|
|00000240| 6f 6e 76 65 6e 69 65 6e | 63 65 2c 20 43 6f 70 79 |onvenien|ce, Copy|
|00000250| 57 69 6e 64 6f 77 73 20 | 6e 6f 72 6d 61 6c 6c 79 |Windows |normally|
|00000260| 20 73 65 74 73 20 75 70 | 20 74 68 65 20 66 6f 72 | sets up| the for|
|00000270| 65 67 72 6f 75 6e 64 20 | 61 6e 64 20 62 61 63 6b |eground |and back|
|00000280| 67 72 6f 75 6e 64 0d 63 | 6f 6c 6f 72 73 20 74 6f |ground.c|olors to|
|00000290| 20 70 72 65 76 65 6e 74 | 20 75 6e 64 65 73 69 72 | prevent| undesir|
|000002a0| 65 64 20 63 6f 6c 6f 72 | 69 7a 69 6e 67 2e 20 49 |ed color|izing. I|
|000002b0| 66 20 79 6f 75 20 77 61 | 6e 74 20 74 6f 20 63 6f |f you wa|nt to co|
|000002c0| 6c 6f 72 69 7a 65 20 74 | 68 65 6e 20 61 64 64 0d |lorize t|hen add.|
|000002d0| 22 63 6f 70 79 43 6f 6c | 6f 72 69 7a 65 22 20 74 |"copyCol|orize" t|
|000002e0| 6f 20 74 68 65 20 73 72 | 63 4d 6f 64 65 20 61 72 |o the sr|cMode ar|
|000002f0| 67 75 6d 65 6e 74 2e 0d | 0d 43 6f 70 79 42 69 74 |gument..|.CopyBit|
|00000300| 73 28 29 20 69 73 20 61 | 6e 20 65 78 74 72 65 6d |s() is a|n extrem|
|00000310| 65 6c 79 20 75 73 65 66 | 75 6c 20 63 6f 6d 70 6f |ely usef|ul compo|
|00000320| 6e 65 6e 74 20 6f 66 20 | 51 75 69 63 6b 44 72 61 |nent of |QuickDra|
|00000330| 77 2c 20 62 75 74 20 69 | 74 27 73 20 74 72 69 63 |w, but i|t's tric|
|00000340| 6b 79 20 74 6f 0d 75 73 | 65 2c 20 65 73 70 65 63 |ky to.us|e, espec|
|00000350| 69 61 6c 6c 79 20 69 66 | 20 79 6f 75 20 6a 75 73 |ially if| you jus|
|00000360| 74 20 77 61 6e 74 20 61 | 20 66 61 69 74 68 66 75 |t want a| faithfu|
|00000370| 6c 20 63 6f 70 79 2e 20 | 49 74 73 20 75 73 65 72 |l copy. |Its user|
|00000380| 2d 69 6e 74 65 72 66 61 | 63 65 20 77 61 73 20 66 |-interfa|ce was f|
|00000390| 72 6f 7a 65 6e 0d 61 20 | 6c 6f 6e 67 20 74 69 6d |rozen.a |long tim|
|000003a0| 65 20 61 67 6f 2c 20 77 | 68 65 6e 20 6f 66 66 2d |e ago, w|hen off-|
|000003b0| 73 63 72 65 65 6e 20 69 | 6d 61 67 65 73 20 77 65 |screen i|mages we|
|000003c0| 72 65 20 72 65 66 65 72 | 72 65 64 20 74 6f 20 62 |re refer|red to b|
|000003d0| 79 20 74 68 65 69 72 20 | 42 69 74 4d 61 70 0d 70 |y their |BitMap.p|
|000003e0| 6f 69 6e 74 65 72 73 2e | 20 41 70 70 6c 65 20 67 |ointers.| Apple g|
|000003f0| 65 6e 65 72 61 6c 69 7a | 65 64 20 69 74 73 20 75 |eneraliz|ed its u|
|00000400| 6e 64 65 72 6c 79 69 6e | 67 20 63 6f 64 65 20 74 |nderlyin|g code t|
|00000410| 6f 20 61 63 63 65 70 74 | 20 50 69 78 4d 61 70 20 |o accept| PixMap |
|00000420| 70 6f 69 6e 74 65 72 73 | 20 61 73 0d 77 65 6c 6c |pointers| as.well|
|00000430| 2c 20 62 75 74 20 74 68 | 65 20 72 65 61 6c 69 74 |, but th|e realit|
|00000440| 79 20 69 73 20 74 68 61 | 74 20 6e 6f 77 61 64 61 |y is tha|t nowada|
|00000450| 79 73 20 74 68 65 20 6f | 62 6a 65 63 74 20 74 68 |ys the o|bject th|
|00000460| 61 74 20 77 65 20 77 6f | 72 6b 20 77 69 74 68 20 |at we wo|rk with |
|00000470| 69 73 20 61 20 77 69 6e | 64 6f 77 2c 0d 65 69 74 |is a win|dow,.eit|
|00000480| 68 65 72 20 6f 6e 2d 73 | 63 72 65 65 6e 2c 20 6f |her on-s|creen, o|
|00000490| 72 20 6f 66 66 2d 73 63 | 72 65 65 6e 20 28 69 2e |r off-sc|reen (i.|
|000004a0| 65 2e 20 61 20 47 57 6f | 72 6c 64 29 2e 20 43 6f |e. a GWo|rld). Co|
|000004b0| 70 79 57 69 6e 64 6f 77 | 73 20 61 63 63 65 70 74 |pyWindow|s accept|
|000004c0| 73 20 74 77 6f 0d 77 69 | 6e 64 6f 77 73 2c 20 73 |s two.wi|ndows, s|
|000004d0| 6f 75 72 63 65 20 61 6e | 64 20 64 65 73 74 69 6e |ource an|d destin|
|000004e0| 61 74 69 6f 6e 2c 20 66 | 69 67 75 72 65 73 20 6f |ation, f|igures o|
|000004f0| 75 74 20 77 68 65 72 65 | 20 74 68 65 20 61 73 73 |ut where| the ass|
|00000500| 6f 63 69 61 74 65 64 20 | 50 69 78 2f 42 69 74 4d |ociated |Pix/BitM|
|00000510| 61 70 73 0d 61 72 65 2c | 20 61 6e 64 20 63 61 6c |aps.are,| and cal|
|00000520| 6c 73 20 43 6f 70 79 42 | 69 74 73 20 6f 72 20 43 |ls CopyB|its or C|
|00000530| 6f 70 79 42 69 74 73 51 | 75 69 63 6b 6c 79 2c 20 |opyBitsQ|uickly, |
|00000540| 61 66 74 65 72 20 6d 61 | 6b 69 6e 67 20 61 6c 6c |after ma|king all|
|00000550| 20 74 68 65 20 61 70 70 | 72 6f 70 72 69 61 74 65 | the app|ropriate|
|00000560| 0d 69 6e 63 61 6e 74 61 | 74 69 6f 6e 73 20 74 6f |.incanta|tions to|
|00000570| 20 67 65 74 20 74 68 65 | 20 64 65 73 69 72 65 64 | get the| desired|
|00000580| 20 72 65 73 75 6c 74 73 | 2e 0d 0d 54 68 65 20 61 | results|...The a|
|00000590| 6c 6c 6f 77 65 64 20 76 | 61 6c 75 65 73 20 66 6f |llowed v|alues fo|
|000005a0| 72 20 73 72 63 4d 6f 64 | 65 20 61 72 65 20 64 6f |r srcMod|e are do|
|000005b0| 63 75 6d 65 6e 74 65 64 | 20 62 79 20 41 70 70 6c |cumented| by Appl|
|000005c0| 65 20 61 6c 6f 6e 67 20 | 77 69 74 68 20 43 6f 70 |e along |with Cop|
|000005d0| 79 42 69 74 73 20 69 6e | 20 74 68 65 0d 4e 65 77 |yBits in| the.New|
|000005e0| 20 49 6e 73 69 64 65 20 | 4d 61 63 3a 20 22 49 6d | Inside |Mac: "Im|
|000005f0| 61 67 69 6e 67 20 77 69 | 74 68 20 51 75 69 63 6b |aging wi|th Quick|
|00000600| 44 72 61 77 22 2e 20 54 | 68 65 20 61 64 64 69 74 |Draw". T|he addit|
|00000610| 69 6f 6e 61 6c 20 6d 6f | 64 65 73 20 69 6d 70 6c |ional mo|des impl|
|00000620| 65 6d 65 6e 74 65 64 20 | 62 79 0d 43 6f 70 79 42 |emented |by.CopyB|
|00000630| 69 74 73 51 75 69 63 6b | 6c 79 20 61 72 65 20 64 |itsQuick|ly are d|
|00000640| 6f 63 75 6d 65 6e 74 65 | 64 20 69 6e 20 43 6f 70 |ocumente|d in Cop|
|00000650| 79 42 69 74 73 51 75 69 | 63 6b 6c 79 2e 63 2e 20 |yBitsQui|ckly.c. |
|00000660| 43 6f 70 79 42 69 74 73 | 20 61 6e 64 0d 43 6f 70 |CopyBits| and.Cop|
|00000670| 79 42 69 74 73 51 75 69 | 63 6b 6c 79 20 64 65 66 |yBitsQui|ckly def|
|00000680| 69 6e 65 20 73 72 63 4d | 6f 64 65 20 61 73 20 61 |ine srcM|ode as a|
|00000690| 20 73 68 6f 72 74 2e 20 | 43 6f 70 79 57 69 6e 64 | short. |CopyWind|
|000006a0| 6f 77 73 20 64 65 66 69 | 6e 65 73 20 73 72 63 4d |ows defi|nes srcM|
|000006b0| 6f 64 65 20 61 73 20 61 | 0d 6c 6f 6e 67 2c 20 75 |ode as a|.long, u|
|000006c0| 73 69 6e 67 20 74 77 6f | 20 62 69 74 73 20 69 6e |sing two| bits in|
|000006d0| 20 74 68 65 20 75 70 70 | 65 72 20 77 6f 72 64 20 | the upp|er word |
|000006e0| 61 73 20 66 6c 61 67 73 | 20 66 6f 72 20 63 6f 70 |as flags| for cop|
|000006f0| 79 4c 69 74 65 72 61 6c | 6c 79 20 61 6e 64 0d 63 |yLiteral|ly and.c|
|00000700| 6f 70 79 43 6f 6c 6f 72 | 69 7a 65 2e 20 48 65 72 |opyColor|ize. Her|
|00000710| 65 27 73 20 61 20 73 75 | 6d 6d 61 72 79 20 6f 66 |e's a su|mmary of|
|00000720| 20 74 68 65 20 6d 6f 64 | 65 73 20 74 68 61 74 20 | the mod|es that |
|00000730| 49 20 75 73 65 20 6d 6f | 73 74 3a 0d 0d 73 72 63 |I use mo|st:..src|
|00000740| 43 6f 70 79 0d 0d 54 68 | 69 73 20 6d 6f 64 65 20 |Copy..Th|is mode |
|00000750| 69 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 62 |is imple|mented b|
|00000760| 79 20 43 6f 70 79 42 69 | 74 73 2e 20 49 66 20 74 |y CopyBi|ts. If t|
|00000770| 68 65 20 73 6f 75 72 63 | 65 20 61 6e 64 20 64 65 |he sourc|e and de|
|00000780| 73 74 69 6e 61 74 69 6f | 6e 20 68 61 76 65 20 74 |stinatio|n have t|
|00000790| 68 65 0d 73 61 6d 65 20 | 64 65 70 74 68 20 28 69 |he.same |depth (i|
|000007a0| 2e 65 2e 20 70 69 78 65 | 6c 53 69 7a 65 29 20 61 |.e. pixe|lSize) a|
|000007b0| 6e 64 20 65 78 61 63 74 | 6c 79 20 74 68 65 20 73 |nd exact|ly the s|
|000007c0| 61 6d 65 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |ame colo|r table |
|000007d0| 74 68 65 6e 20 79 6f 75 | 27 6c 6c 20 67 65 74 0d |then you|'ll get.|
|000007e0| 66 61 69 74 68 66 75 6c | 20 63 6f 70 79 69 6e 67 |faithful| copying|
|000007f0| 20 6f 66 20 74 68 65 20 | 61 63 74 75 61 6c 20 6e | of the |actual n|
|00000800| 75 6d 62 65 72 73 20 73 | 74 6f 72 65 64 20 69 6e |umbers s|tored in|
|00000810| 20 65 61 63 68 20 70 69 | 78 65 6c 2e 20 28 49 27 | each pi|xel. (I'|
|00000820| 6d 20 61 73 73 75 6d 69 | 6e 67 20 74 68 61 74 0d |m assumi|ng that.|
|00000830| 74 68 65 20 64 65 73 74 | 69 6e 61 74 69 6f 6e 20 |the dest|ination |
|00000840| 77 69 6e 64 6f 77 20 68 | 61 73 20 74 68 65 20 73 |window h|as the s|
|00000850| 61 6d 65 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |ame colo|r table |
|00000860| 61 73 20 69 74 73 20 64 | 65 76 69 63 65 2c 20 77 |as its d|evice, w|
|00000870| 68 69 63 68 20 77 69 6c | 6c 20 62 65 0d 74 72 75 |hich wil|l be.tru|
|00000880| 65 20 69 66 20 79 6f 75 | 20 63 72 65 61 74 65 64 |e if you| created|
|00000890| 20 74 68 65 20 77 69 6e | 64 6f 77 20 75 73 69 6e | the win|dow usin|
|000008a0| 67 20 47 44 4f 70 65 6e | 57 69 6e 64 6f 77 20 6f |g GDOpen|Window o|
|000008b0| 72 20 4e 65 77 47 57 6f | 72 6c 64 2e 29 20 49 66 |r NewGWo|rld.) If|
|000008c0| 20 74 68 65 20 73 6f 75 | 72 63 65 0d 61 6e 64 20 | the sou|rce.and |
|000008d0| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 68 61 76 65 |destinat|ion have|
|000008e0| 20 64 69 66 66 65 72 65 | 6e 74 20 63 6f 6c 6f 72 | differe|nt color|
|000008f0| 20 74 61 62 6c 65 73 2c | 20 65 2e 67 2e 20 62 65 | tables,| e.g. be|
|00000900| 63 61 75 73 65 20 74 68 | 65 20 70 69 78 65 6c 20 |cause th|e pixel |
|00000910| 73 69 7a 65 73 0d 64 69 | 66 66 65 72 2c 20 74 68 |sizes.di|ffer, th|
|00000920| 65 6e 20 43 6f 70 79 42 | 69 74 73 20 77 69 6c 6c |en CopyB|its will|
|00000930| 20 74 72 61 6e 73 6c 61 | 74 65 20 76 69 61 20 74 | transla|te via t|
|00000940| 68 65 20 63 6f 6c 6f 72 | 20 74 61 62 6c 65 73 2e |he color| tables.|
|00000950| 20 43 6f 70 79 42 69 74 | 73 20 69 73 20 70 65 72 | CopyBit|s is per|
|00000960| 68 61 70 73 0d 41 70 70 | 6c 65 27 73 20 70 72 69 |haps.App|le's pri|
|00000970| 7a 65 20 70 69 65 63 65 | 20 6f 66 20 63 6f 64 65 |ze piece| of code|
|00000980| 20 61 6e 64 20 72 75 6e | 73 20 76 65 72 79 20 66 | and run|s very f|
|00000990| 61 73 74 2c 20 74 61 6b | 69 6e 67 20 61 64 76 61 |ast, tak|ing adva|
|000009a0| 6e 74 61 67 65 20 6f 66 | 20 73 70 65 63 69 61 6c |ntage of| special|
|000009b0| 0d 69 6e 73 74 72 75 63 | 74 69 6f 6e 73 20 6f 66 |.instruc|tions of|
|000009c0| 20 70 61 72 74 69 63 75 | 6c 61 72 20 70 72 6f 63 | particu|lar proc|
|000009d0| 65 73 73 6f 72 73 20 28 | 65 2e 67 2e 20 74 6f 20 |essors (|e.g. to |
|000009e0| 64 6f 20 36 34 20 62 69 | 74 20 6d 6f 76 65 73 20 |do 64 bi|t moves |
|000009f0| 6f 6e 20 36 38 30 34 30 | 20 61 6e 64 0d 50 6f 77 |on 68040| and.Pow|
|00000a00| 65 72 50 43 29 20 61 6e | 64 20 63 61 6e 20 64 6f |erPC) an|d can do|
|00000a10| 20 77 6f 6e 64 65 72 66 | 75 6c 20 74 68 69 6e 67 | wonderf|ul thing|
|00000a20| 73 2c 20 6c 69 6b 65 20 | 73 74 72 65 74 63 68 20 |s, like |stretch |
|00000a30| 61 6e 64 20 73 68 72 69 | 6e 6b 20 61 6e 64 20 6d |and shri|nk and m|
|00000a40| 61 73 6b 20 62 79 20 61 | 0d 72 65 67 69 6f 6e 2e |ask by a|.region.|
|00000a50| 20 41 70 70 6c 65 20 64 | 65 66 69 6e 65 73 20 6d | Apple d|efines m|
|00000a60| 61 6e 79 20 6f 74 68 65 | 72 20 73 72 63 4d 6f 64 |any othe|r srcMod|
|00000a70| 65 20 76 61 6c 75 65 73 | 20 62 75 74 20 49 20 6e |e values| but I n|
|00000a80| 65 76 65 72 20 75 73 65 | 20 74 68 65 6d 20 77 69 |ever use| them wi|
|00000a90| 74 68 0d 43 6f 70 79 42 | 69 74 73 20 62 65 63 61 |th.CopyB|its beca|
|00000aa0| 75 73 65 20 74 68 65 79 | 20 61 6c 6c 20 72 65 73 |use they| all res|
|00000ab0| 75 6c 74 20 69 6e 20 63 | 6f 6c 6f 72 20 74 72 61 |ult in c|olor tra|
|00000ac0| 6e 73 6c 61 74 69 6f 6e | 73 20 74 68 61 74 20 49 |nslation|s that I|
|00000ad0| 20 64 6f 6e 27 74 20 77 | 61 6e 74 2e 0d 0d 73 72 | don't w|ant...sr|
|00000ae0| 63 43 6f 70 79 4c 69 74 | 65 72 61 6c 6c 79 2c 61 |cCopyLit|erally,a|
|00000af0| 64 64 4f 76 65 72 4c 69 | 74 65 72 61 6c 6c 79 2c |ddOverLi|terally,|
|00000b00| 61 64 64 4f 76 65 72 50 | 61 72 61 6c 6c 65 6c 4c |addOverP|arallelL|
|00000b10| 69 74 65 72 61 6c 6c 79 | 2c 6d 75 6c 4f 76 65 72 |iterally|,mulOver|
|00000b20| 4c 69 74 65 72 61 6c 6c | 79 0d 0d 54 68 65 73 65 |Literall|y..These|
|00000b30| 20 6d 6f 64 65 73 20 61 | 72 65 20 69 6d 70 6c 65 | modes a|re imple|
|00000b40| 6d 65 6e 74 65 64 20 62 | 79 20 43 6f 70 79 42 69 |mented b|y CopyBi|
|00000b50| 74 73 51 75 69 63 6b 6c | 79 2c 20 77 68 69 63 68 |tsQuickl|y, which|
|00000b60| 20 6e 65 76 65 72 20 64 | 6f 65 73 20 63 6f 6c 6f | never d|oes colo|
|00000b70| 72 0d 74 72 61 6e 73 6c | 61 74 69 6f 6e 2e 20 61 |r.transl|ation. a|
|00000b80| 64 64 4f 76 65 72 4c 69 | 74 65 72 61 6c 6c 79 20 |ddOverLi|terally |
|00000b90| 61 64 64 73 20 74 68 65 | 20 70 69 78 65 6c 20 76 |adds the| pixel v|
|00000ba0| 61 6c 75 65 73 2c 20 69 | 67 6e 6f 72 69 6e 67 20 |alues, i|gnoring |
|00000bb0| 6f 76 65 72 66 6c 6f 77 | 2e 0d 61 64 64 4f 76 65 |overflow|..addOve|
|00000bc0| 72 50 61 72 61 6c 6c 65 | 6c 4c 69 74 65 72 61 6c |rParalle|lLiteral|
|00000bd0| 6c 79 20 64 6f 65 73 20 | 74 68 65 20 73 61 6d 65 |ly does |the same|
|00000be0| 2c 20 62 75 74 20 64 6f | 65 73 20 74 68 65 20 61 |, but do|es the a|
|00000bf0| 64 64 69 74 69 6f 6e 20 | 66 6f 72 20 33 32 2d 62 |ddition |for 32-b|
|00000c00| 69 74 73 20 61 74 20 61 | 0d 74 69 6d 65 2c 20 61 |its at a|.time, a|
|00000c10| 64 64 69 6e 67 20 73 65 | 76 65 72 61 6c 20 70 69 |dding se|veral pi|
|00000c20| 78 65 6c 73 20 61 74 20 | 6f 6e 63 65 2c 20 73 6f |xels at |once, so|
|00000c30| 20 74 68 61 74 20 69 66 | 20 6f 76 65 72 66 6c 6f | that if| overflo|
|00000c40| 77 20 6f 63 63 75 72 73 | 20 69 74 20 77 69 6c 6c |w occurs| it will|
|00000c50| 20 6f 76 65 72 66 6c 6f | 77 0d 69 6e 74 6f 20 61 | overflo|w.into a|
|00000c60| 6e 20 61 64 6a 6f 69 6e | 67 20 70 69 78 65 6c 2e |n adjoin|g pixel.|
|00000c70| 20 6d 75 6c 4f 76 65 72 | 4c 69 74 65 72 61 6c 6c | mulOver|Literall|
|00000c80| 79 20 6d 75 6c 74 69 70 | 6c 69 65 73 20 74 68 65 |y multip|lies the|
|00000c90| 20 28 75 6e 73 69 67 6e | 65 64 29 20 70 69 78 65 | (unsign|ed) pixe|
|00000ca0| 6c 73 2c 0d 64 69 76 69 | 64 65 73 20 74 68 65 20 |ls,.divi|des the |
|00000cb0| 70 72 6f 64 75 63 74 20 | 62 79 20 31 32 38 2c 20 |product |by 128, |
|00000cc0| 61 6e 64 20 73 74 6f 72 | 65 73 20 74 68 65 20 72 |and stor|es the r|
|00000cd0| 65 73 75 6c 74 20 69 6e | 20 74 68 65 20 64 65 73 |esult in| the des|
|00000ce0| 74 69 6e 61 74 69 6f 6e | 2e 0d 43 6f 70 79 42 69 |tination|..CopyBi|
|00000cf0| 74 73 51 75 69 63 6b 6c | 79 20 68 61 73 20 6d 61 |tsQuickl|y has ma|
|00000d00| 6e 79 20 72 65 73 74 72 | 69 63 74 69 6f 6e 73 2e |ny restr|ictions.|
|00000d10| 20 54 68 65 20 73 6f 75 | 72 63 65 20 61 6e 64 20 | The sou|rce and |
|00000d20| 64 65 73 74 69 6e 61 74 | 69 6f 6e 20 6d 75 73 74 |destinat|ion must|
|00000d30| 20 68 61 76 65 20 74 68 | 65 0d 73 61 6d 65 20 72 | have th|e.same r|
|00000d40| 65 63 74 20 73 69 7a 65 | 20 61 6e 64 20 74 68 65 |ect size| and the|
|00000d50| 20 73 61 6d 65 20 70 69 | 78 65 6c 20 73 69 7a 65 | same pi|xel size|
|00000d60| 2e 20 61 64 64 4f 76 65 | 72 4c 69 74 65 72 61 6c |. addOve|rLiteral|
|00000d70| 6c 79 20 61 6e 64 20 6d | 75 6c 4f 76 65 72 4c 69 |ly and m|ulOverLi|
|00000d80| 74 65 72 61 6c 6c 79 0d | 69 6e 73 69 73 74 20 6f |terally.|insist o|
|00000d90| 6e 20 38 2d 62 69 74 20 | 70 69 78 65 6c 73 2e 20 |n 8-bit |pixels. |
|00000da0| 41 6c 6c 20 74 68 65 20 | 6d 6f 64 65 73 20 72 65 |All the |modes re|
|00000db0| 73 6f 6c 76 65 20 6f 6e | 6c 79 20 62 79 74 65 73 |solve on|ly bytes|
|00000dc0| 2c 20 6e 6f 74 20 62 69 | 74 73 2c 20 73 6f 20 61 |, not bi|ts, so a|
|00000dd0| 20 66 65 77 0d 62 69 74 | 73 20 61 74 20 74 68 65 | few.bit|s at the|
|00000de0| 20 6c 65 66 74 20 61 6e | 64 20 72 69 67 68 74 20 | left an|d right |
|00000df0| 6f 66 20 79 6f 75 72 20 | 69 6d 61 67 65 20 6d 61 |of your |image ma|
|00000e00| 79 20 6e 6f 74 20 62 65 | 20 63 6f 70 69 65 64 20 |y not be| copied |
|00000e10| 69 66 20 74 68 61 74 20 | 77 6f 75 6c 64 20 72 65 |if that |would re|
|00000e20| 71 75 69 72 65 0d 77 72 | 69 74 69 6e 67 20 74 6f |quire.wr|iting to|
|00000e30| 20 61 20 62 79 74 65 20 | 6e 6f 74 20 61 6c 6c 20 | a byte |not all |
|00000e40| 6f 66 20 77 68 6f 73 65 | 20 62 69 74 73 20 61 72 |of whose| bits ar|
|00000e50| 65 20 69 6e 20 74 68 65 | 20 64 65 73 74 69 6e 61 |e in the| destina|
|00000e60| 74 69 6f 6e 2e 0d 0d 4e | 4f 54 45 53 3a 0d 0d 30 |tion...N|OTES:..0|
|00000e70| 2e 20 52 65 61 64 20 22 | 56 69 64 65 6f 54 6f 6f |. Read "|VideoToo|
|00000e80| 6c 62 6f 78 3a 4e 6f 74 | 65 73 3a 43 6f 70 79 42 |lbox:Not|es:CopyB|
|00000e90| 69 74 73 20 73 6c 61 76 | 69 73 68 6c 79 22 2e 0d |its slav|ishly"..|
|00000ea0| 0d 31 2e 20 43 6f 70 79 | 42 69 74 73 20 68 61 73 |.1. Copy|Bits has|
|00000eb0| 20 61 20 72 61 72 65 6c | 79 20 75 73 65 64 20 66 | a rarel|y used f|
|00000ec0| 65 61 74 75 72 65 20 63 | 61 6c 6c 65 64 20 22 63 |eature c|alled "c|
|00000ed0| 6f 6c 6f 72 69 7a 69 6e | 67 22 20 77 68 65 72 65 |olorizin|g" where|
|00000ee0| 62 79 20 69 66 20 74 68 | 65 0d 66 6f 72 65 67 72 |by if th|e.foregr|
|00000ef0| 6f 75 6e 64 20 61 6e 64 | 20 62 61 63 6b 67 72 6f |ound and| backgro|
|00000f00| 75 6e 64 20 63 6f 6c 6f | 72 73 20 6f 66 20 74 68 |und colo|rs of th|
|00000f10| 65 20 63 75 72 72 65 6e | 74 20 70 6f 72 74 20 61 |e curren|t port a|
|00000f20| 72 65 20 6e 6f 74 20 62 | 6c 61 63 6b 20 61 6e 64 |re not b|lack and|
|00000f30| 20 77 68 69 74 65 0d 74 | 68 65 6e 20 65 61 63 68 | white.t|hen each|
|00000f40| 20 73 6f 75 72 63 65 20 | 70 69 78 65 6c 27 73 20 | source |pixel's |
|00000f50| 63 6f 6c 6f 72 20 69 73 | 20 74 72 61 6e 73 6c 61 |color is| transla|
|00000f60| 74 65 64 20 62 79 20 6c | 69 6e 65 61 72 20 69 6e |ted by l|inear in|
|00000f70| 74 65 72 70 6f 6c 61 74 | 69 6f 6e 20 62 65 74 77 |terpolat|ion betw|
|00000f80| 65 65 6e 20 74 68 65 0d | 66 6f 72 65 67 72 6f 75 |een the.|foregrou|
|00000f90| 6e 64 20 61 6e 64 20 62 | 61 63 6b 67 72 6f 75 6e |nd and b|ackgroun|
|00000fa0| 64 20 63 6f 6c 6f 72 2e | 20 50 72 6f 67 72 61 6d |d color.| Program|
|00000fb0| 6d 65 72 73 20 6f 66 74 | 65 6e 20 66 6f 72 67 65 |mers oft|en forge|
|00000fc0| 74 20 61 62 6f 75 74 20 | 74 68 69 73 2c 20 61 6e |t about |this, an|
|00000fd0| 64 20 61 72 65 0d 73 75 | 72 70 72 69 73 65 64 20 |d are.su|rprised |
|00000fe0| 62 79 20 74 68 65 20 75 | 6e 64 65 73 69 72 65 64 |by the u|ndesired|
|00000ff0| 20 63 6f 6c 6f 72 69 7a | 69 6e 67 2e 20 54 6f 20 | coloriz|ing. To |
|00001000| 6d 61 6b 65 20 6c 69 66 | 65 20 65 61 73 69 65 72 |make lif|e easier|
|00001010| 20 49 27 76 65 20 64 65 | 66 69 6e 65 64 20 61 6e | I've de|fined an|
|00001020| 20 65 78 74 72 61 0d 62 | 69 74 20 69 6e 20 73 72 | extra.b|it in sr|
|00001030| 63 4d 6f 64 65 2e 20 49 | 66 20 74 68 65 20 22 63 |cMode. I|f the "c|
|00001040| 6f 70 79 43 6f 6c 6f 72 | 69 7a 65 22 20 66 6c 61 |opyColor|ize" fla|
|00001050| 67 20 69 73 20 66 61 6c | 73 65 20 28 6e 65 61 72 |g is fal|se (near|
|00001060| 6c 79 20 61 6c 77 61 79 | 73 20 74 68 65 20 63 61 |ly alway|s the ca|
|00001070| 73 65 29 0d 74 68 65 6e | 20 43 6f 70 79 57 69 6e |se).then| CopyWin|
|00001080| 64 6f 77 73 20 77 69 6c | 6c 20 6d 61 6b 65 20 73 |dows wil|l make s|
|00001090| 75 72 65 20 6e 6f 20 63 | 6f 6c 6f 72 69 7a 69 6e |ure no c|olorizin|
|000010a0| 67 20 6f 63 63 75 72 73 | 20 62 79 20 73 65 74 74 |g occurs| by sett|
|000010b0| 69 6e 67 20 74 68 65 20 | 66 6f 72 65 20 61 6e 64 |ing the |fore and|
|000010c0| 0d 62 61 63 6b 20 63 6f | 6c 6f 72 73 20 74 6f 20 |.back co|lors to |
|000010d0| 62 6c 61 63 6b 20 61 6e | 64 20 77 68 69 74 65 2e |black an|d white.|
|000010e0| 20 28 54 68 65 20 63 6f | 6c 6f 72 73 20 61 72 65 | (The co|lors are|
|000010f0| 20 72 65 73 74 6f 72 65 | 64 20 62 65 66 6f 72 65 | restore|d before|
|00001100| 20 72 65 74 75 72 6e 69 | 6e 67 2e 29 0d 0d 32 2e | returni|ng.)..2.|
|00001110| 20 41 70 70 6c 65 27 73 | 20 43 6f 70 79 42 69 74 | Apple's| CopyBit|
|00001120| 73 20 75 73 65 73 20 74 | 68 65 20 63 6f 6c 6f 72 |s uses t|he color|
|00001130| 20 74 61 62 6c 65 20 61 | 6e 64 20 70 61 6c 65 74 | table a|nd palet|
|00001140| 74 65 20 6f 66 20 74 68 | 65 20 73 6f 75 72 63 65 |te of th|e source|
|00001150| 20 70 69 78 6d 61 70 20 | 61 73 0d 79 6f 75 27 64 | pixmap |as.you'd|
|00001160| 20 65 78 70 65 63 74 2c | 20 62 75 74 20 69 67 6e | expect,| but ign|
|00001170| 6f 72 65 73 20 74 68 65 | 20 63 6f 6c 6f 72 20 74 |ores the| color t|
|00001180| 61 62 6c 65 20 61 6e 64 | 20 70 61 6c 65 74 74 65 |able and| palette|
|00001190| 20 6f 66 20 74 68 65 20 | 64 65 73 74 69 6e 61 74 | of the |destinat|
|000011a0| 69 6f 6e 20 70 69 78 6d | 61 70 2c 0d 61 6e 64 20 |ion pixm|ap,.and |
|000011b0| 69 6e 73 74 65 61 64 20 | 75 73 65 73 20 74 68 65 |instead |uses the|
|000011c0| 20 63 6f 6c 6f 72 20 74 | 61 62 6c 65 20 6f 66 20 | color t|able of |
|000011d0| 74 68 65 20 63 75 72 72 | 65 6e 74 20 64 65 76 69 |the curr|ent devi|
|000011e0| 63 65 2e 20 54 68 69 73 | 20 69 73 20 61 6e 6e 6f |ce. This| is anno|
|000011f0| 79 69 6e 67 2c 20 61 6e | 64 0d 68 61 72 64 20 74 |ying, an|d.hard t|
|00001200| 6f 20 72 65 6d 65 6d 62 | 65 72 2e 20 41 70 70 6c |o rememb|er. Appl|
|00001210| 65 20 64 69 64 20 69 74 | 20 74 68 69 73 20 77 61 |e did it| this wa|
|00001220| 79 20 62 65 63 61 75 73 | 65 20 43 6f 70 79 42 69 |y becaus|e CopyBi|
|00001230| 74 73 20 75 73 65 73 20 | 74 68 65 20 69 6e 76 65 |ts uses |the inve|
|00001240| 72 73 65 20 63 6f 6c 6f | 72 0d 74 61 62 6c 65 2c |rse colo|r.table,|
|00001250| 20 77 68 69 63 68 20 74 | 61 6b 65 73 20 61 20 6c | which t|akes a l|
|00001260| 6f 6e 67 20 74 69 6d 65 | 20 74 6f 20 63 6f 6d 70 |ong time| to comp|
|00001270| 75 74 65 2c 20 61 6e 64 | 20 74 68 65 79 20 64 65 |ute, and| they de|
|00001280| 63 69 64 65 64 20 74 68 | 61 74 20 69 74 20 77 6f |cided th|at it wo|
|00001290| 75 6c 64 20 62 65 20 74 | 6f 6f 0d 74 69 6d 65 20 |uld be t|oo.time |
|000012a0| 61 6e 64 20 6d 65 6d 6f | 72 79 20 69 6e 74 65 6e |and memo|ry inten|
|000012b0| 73 69 76 65 20 74 6f 20 | 6d 61 69 6e 74 61 69 6e |sive to |maintain|
|000012c0| 20 61 6e 20 69 6e 76 65 | 72 73 65 20 74 61 62 6c | an inve|rse tabl|
|000012d0| 65 20 66 6f 72 20 65 61 | 63 68 20 77 69 6e 64 6f |e for ea|ch windo|
|000012e0| 77 2c 20 73 6f 0d 69 6e | 73 74 65 61 64 20 74 68 |w, so.in|stead th|
|000012f0| 65 79 20 6d 61 69 6e 74 | 61 69 6e 20 74 68 65 6d |ey maint|ain them|
|00001300| 20 6f 6e 6c 79 20 66 6f | 72 20 64 65 76 69 63 65 | only fo|r device|
|00001310| 73 2e 20 54 68 65 20 6f | 70 65 72 61 74 69 6e 67 |s. The o|perating|
|00001320| 20 73 79 73 74 65 6d 20 | 63 72 65 61 74 65 73 0d | system |creates.|
|00001330| 69 6e 76 65 72 73 65 20 | 63 6f 6c 6f 72 20 74 61 |inverse |color ta|
|00001340| 62 6c 65 73 20 66 6f 72 | 20 61 6c 6c 20 67 72 61 |bles for| all gra|
|00001350| 70 68 69 63 20 64 65 76 | 69 63 65 73 2e 20 54 68 |phic dev|ices. Th|
|00001360| 75 73 20 69 74 20 69 73 | 20 69 6d 70 6f 72 74 61 |us it is| importa|
|00001370| 6e 74 20 74 6f 20 72 65 | 6d 65 6d 62 65 72 0d 74 |nt to re|member.t|
|00001380| 6f 20 73 65 74 20 74 68 | 65 20 64 65 76 69 63 65 |o set th|e device|
|00001390| 20 62 65 66 6f 72 65 20 | 63 61 6c 6c 69 6e 67 20 | before |calling |
|000013a0| 43 6f 70 79 42 69 74 73 | 2e 20 54 6f 20 73 61 76 |CopyBits|. To sav|
|000013b0| 65 20 79 6f 75 20 74 68 | 65 20 74 72 6f 75 62 6c |e you th|e troubl|
|000013c0| 65 2c 20 43 6f 70 79 57 | 69 6e 64 6f 77 73 0d 73 |e, CopyW|indows.s|
|000013d0| 65 74 73 20 74 68 65 20 | 64 65 76 69 63 65 20 74 |ets the |device t|
|000013e0| 6f 20 62 65 20 77 68 61 | 74 65 76 65 72 20 64 65 |o be wha|tever de|
|000013f0| 76 69 63 65 20 69 73 20 | 61 73 73 6f 63 69 61 74 |vice is |associat|
|00001400| 65 64 20 77 69 74 68 20 | 74 68 65 20 64 65 73 74 |ed with |the dest|
|00001410| 69 6e 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 2e 0d |ination |window..|
|00001420| 54 68 65 20 64 65 76 69 | 63 65 20 69 73 20 66 6f |The devi|ce is fo|
|00001430| 75 6e 64 20 62 79 20 47 | 65 74 57 69 6e 64 6f 77 |und by G|etWindow|
|00001440| 44 65 76 69 63 65 28 29 | 2c 20 77 68 69 63 68 2c |Device()|, which,|
|00001450| 20 66 6f 72 20 61 6e 20 | 6f 6e 2d 73 63 72 65 65 | for an |on-scree|
|00001460| 6e 20 77 69 6e 64 6f 77 | 2c 0d 72 65 74 75 72 6e |n window|,.return|
|00001470| 73 20 74 68 65 20 73 63 | 72 65 65 6e 20 64 65 76 |s the sc|reen dev|
|00001480| 69 63 65 20 77 69 74 68 | 20 6c 61 72 67 65 73 74 |ice with| largest|
|00001490| 20 69 6e 74 65 72 73 65 | 63 74 69 6f 6e 20 77 69 | interse|ction wi|
|000014a0| 74 68 20 74 68 65 20 77 | 69 6e 64 6f 77 27 73 20 |th the w|indow's |
|000014b0| 63 6f 6e 74 65 6e 74 2c | 0d 61 6e 64 20 66 6f 72 |content,|.and for|
|000014c0| 20 61 6e 20 6f 66 66 2d | 73 63 72 65 65 6e 20 77 | an off-|screen w|
|000014d0| 69 6e 64 6f 77 20 28 69 | 2e 65 2e 20 47 57 6f 72 |indow (i|.e. GWor|
|000014e0| 6c 64 29 2c 20 72 65 74 | 75 72 6e 73 20 74 68 65 |ld), ret|urns the|
|000014f0| 20 47 57 6f 72 6c 64 27 | 73 20 64 65 76 69 63 65 | GWorld'|s device|
|00001500| 2e 20 57 68 65 6e 0d 79 | 6f 75 20 63 72 65 61 74 |. When.y|ou creat|
|00001510| 65 20 79 6f 75 72 20 47 | 57 6f 72 6c 64 20 79 6f |e your G|World yo|
|00001520| 75 20 73 68 6f 75 6c 64 | 20 73 75 70 70 6c 79 20 |u should| supply |
|00001530| 74 68 65 20 63 6f 6c 6f | 72 20 74 61 62 6c 65 20 |the colo|r table |
|00001540| 6f 66 20 79 6f 75 72 20 | 64 65 76 69 63 65 2c 20 |of your |device, |
|00001550| 0d 28 2a 28 2a 64 65 76 | 69 63 65 29 2d 3e 67 64 |.(*(*dev|ice)->gd|
|00001560| 50 4d 61 70 29 2d 3e 70 | 6d 54 61 62 6c 65 2c 20 |PMap)->p|mTable, |
|00001570| 69 66 20 79 6f 75 27 6c | 6c 20 6c 61 74 65 72 20 |if you'l|l later |
|00001580| 62 65 20 63 6f 70 79 69 | 6e 67 20 66 72 6f 6d 20 |be copyi|ng from |
|00001590| 74 68 65 20 47 57 6f 72 | 6c 64 0d 74 6f 20 74 68 |the GWor|ld.to th|
|000015a0| 65 20 64 65 76 69 63 65 | 2e 0d 0d 33 2e 20 43 6f |e device|...3. Co|
|000015b0| 70 79 57 69 6e 64 6f 77 | 73 51 75 69 63 6b 6c 79 |pyWindow|sQuickly|
|000015c0| 20 63 61 6c 6c 73 20 53 | 68 69 65 6c 64 43 75 72 | calls S|hieldCur|
|000015d0| 73 6f 72 28 29 2c 20 74 | 6f 20 6d 61 6b 65 20 75 |sor(), t|o make u|
|000015e0| 70 20 66 6f 72 20 74 68 | 65 20 66 61 63 74 20 74 |p for th|e fact t|
|000015f0| 68 61 74 0d 43 6f 70 79 | 42 69 74 73 51 75 69 63 |hat.Copy|BitsQuic|
|00001600| 6b 6c 79 20 64 6f 65 73 | 6e 27 74 2e 20 51 75 69 |kly does|n't. Qui|
|00001610| 63 6b 44 72 61 77 20 61 | 75 74 6f 6d 61 74 69 63 |ckDraw a|utomatic|
|00001620| 61 6c 6c 79 20 63 61 6c | 6c 73 20 53 68 69 65 6c |ally cal|ls Shiel|
|00001630| 64 43 75 72 73 6f 72 20 | 66 6f 72 20 61 6c 6c 0d |dCursor |for all.|
|00001640| 73 63 72 65 65 6e 2d 64 | 72 61 77 69 6e 67 20 6f |screen-d|rawing o|
|00001650| 70 65 72 61 74 69 6f 6e | 73 2c 20 62 75 74 20 43 |peration|s, but C|
|00001660| 6f 70 79 42 69 74 73 51 | 75 69 63 6b 6c 79 20 62 |opyBitsQ|uickly b|
|00001670| 79 70 61 73 73 65 73 20 | 51 75 69 63 6b 44 72 61 |ypasses |QuickDra|
|00001680| 77 2e 20 54 68 65 20 6f | 62 76 69 6f 75 73 0d 63 |w. The o|bvious.c|
|00001690| 6f 73 6d 65 74 69 63 20 | 62 65 6e 65 66 69 74 20 |osmetic |benefit |
|000016a0| 6f 66 20 63 61 6c 6c 69 | 6e 67 20 53 68 69 65 6c |of calli|ng Shiel|
|000016b0| 64 43 75 72 73 6f 72 20 | 69 73 20 74 68 61 74 20 |dCursor |is that |
|000016c0| 69 74 20 70 72 65 76 65 | 6e 74 73 20 74 68 65 20 |it preve|nts the |
|000016d0| 63 75 72 73 6f 72 20 66 | 72 6f 6d 0d 61 70 70 65 |cursor f|rom.appe|
|000016e0| 61 72 69 6e 67 20 77 69 | 74 68 69 6e 20 73 63 72 |aring wi|thin scr|
|000016f0| 65 65 6e 20 61 72 65 61 | 73 20 74 68 61 74 20 61 |een area|s that a|
|00001700| 72 65 20 62 65 69 6e 67 | 20 72 65 61 64 20 6f 72 |re being| read or|
|00001710| 20 77 72 69 74 74 65 6e | 2e 20 41 20 66 75 72 74 | written|. A furt|
|00001720| 68 65 72 2c 20 73 75 62 | 74 6c 65 2c 0d 62 65 6e |her, sub|tle,.ben|
|00001730| 65 66 69 74 20 6f 66 20 | 63 61 6c 6c 69 6e 67 20 |efit of |calling |
|00001740| 53 68 69 65 6c 64 43 75 | 72 73 6f 72 20 69 73 20 |ShieldCu|rsor is |
|00001750| 63 6f 6d 70 61 74 69 62 | 69 6c 69 74 79 20 77 69 |compatib|ility wi|
|00001760| 74 68 20 74 68 65 20 6f | 6e 65 20 6f 72 20 74 77 |th the o|ne or tw|
|00001770| 6f 20 76 69 64 65 6f 0d | 64 65 76 69 63 65 73 2c |o video.|devices,|
|00001780| 20 65 2e 67 2e 20 52 61 | 64 69 75 73 20 50 6f 77 | e.g. Ra|dius Pow|
|00001790| 65 72 56 69 65 77 2c 20 | 74 68 61 74 20 64 65 70 |erView, |that dep|
|000017a0| 65 6e 64 20 6f 6e 20 6e | 6f 74 69 66 69 63 61 74 |end on n|otificat|
|000017b0| 69 6f 6e 20 66 72 6f 6d | 20 51 75 69 63 6b 44 72 |ion from| QuickDr|
|000017c0| 61 77 20 74 68 61 74 0d | 74 68 65 79 27 76 65 20 |aw that.|they've |
|000017d0| 62 65 65 6e 20 77 72 69 | 74 74 65 6e 20 74 6f 2e |been wri|tten to.|
|000017e0| 20 41 63 63 6f 72 64 69 | 6e 67 20 74 6f 20 74 68 | Accordi|ng to th|
|000017f0| 65 20 70 72 6f 67 72 61 | 6d 6d 65 72 20 77 68 6f |e progra|mmer who|
|00001800| 20 77 72 6f 74 65 20 74 | 68 65 20 50 6f 77 65 72 | wrote t|he Power|
|00001810| 56 69 65 77 0d 64 72 69 | 76 65 72 2c 20 69 74 27 |View.dri|ver, it'|
|00001820| 73 20 65 6e 6f 75 67 68 | 20 74 6f 20 63 61 6c 6c |s enough| to call|
|00001830| 20 53 68 69 65 6c 64 43 | 75 72 73 6f 72 28 29 2c | ShieldC|ursor(),|
|00001840| 20 73 70 65 63 69 66 79 | 69 6e 67 20 74 68 65 20 | specify|ing the |
|00001850| 67 6c 6f 62 61 6c 20 72 | 65 63 74 20 74 68 61 74 |global r|ect that|
|00001860| 20 77 61 73 0d 6d 6f 64 | 69 66 69 65 64 2e 20 54 | was.mod|ified. T|
|00001870| 68 61 74 27 73 20 68 61 | 72 64 20 74 6f 20 64 6f |hat's ha|rd to do|
|00001880| 20 77 69 74 68 69 6e 20 | 43 6f 70 79 42 69 74 73 | within |CopyBits|
|00001890| 51 75 69 63 6b 6c 79 20 | 62 65 63 61 75 73 65 20 |Quickly |because |
|000018a0| 74 68 65 20 50 69 78 4d | 61 70 20 64 6f 65 73 6e |the PixM|ap doesn|
|000018b0| 27 74 0d 68 61 76 65 20 | 61 6e 79 20 67 6c 6f 62 |'t.have |any glob|
|000018c0| 61 6c 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 3b 20 |al coord|inates; |
|000018d0| 69 74 20 6d 65 72 65 6c | 79 20 68 61 73 20 6c 6f |it merel|y has lo|
|000018e0| 63 61 6c 20 63 6f 6f 72 | 64 69 6e 61 74 65 73 20 |cal coor|dinates |
|000018f0| 61 6e 64 20 74 68 65 20 | 61 64 64 72 65 73 73 20 |and the |address |
|00001900| 6f 66 0d 76 69 64 65 6f | 20 6d 65 6d 6f 72 79 2e |of.video| memory.|
|00001910| 20 28 4f 6e 65 20 77 6f | 75 6c 64 20 68 61 76 65 | (One wo|uld have|
|00001920| 20 74 6f 20 75 73 65 20 | 74 68 65 20 76 69 64 65 | to use |the vide|
|00001930| 6f 20 61 64 64 72 65 73 | 73 20 74 6f 20 66 69 67 |o addres|s to fig|
|00001940| 75 72 65 20 6f 75 74 20 | 74 68 65 20 64 65 76 69 |ure out |the devi|
|00001950| 63 65 2c 0d 61 6e 64 20 | 67 65 74 20 74 68 65 20 |ce,.and |get the |
|00001960| 67 6c 6f 62 61 6c 20 63 | 6f 6f 72 64 69 6e 61 74 |global c|oordinat|
|00001970| 65 73 20 66 72 6f 6d 20 | 74 68 65 20 64 65 76 69 |es from |the devi|
|00001980| 63 65 2e 29 20 42 75 74 | 20 69 74 27 73 20 65 61 |ce.) But| it's ea|
|00001990| 73 79 20 74 6f 20 63 61 | 6c 6c 0d 53 68 69 65 6c |sy to ca|ll.Shiel|
|000019a0| 64 43 75 72 73 6f 72 20 | 66 72 6f 6d 20 77 69 74 |dCursor |from wit|
|000019b0| 68 69 6e 20 43 6f 70 79 | 57 69 6e 64 6f 77 73 51 |hin Copy|WindowsQ|
|000019c0| 75 69 63 6b 6c 79 2c 20 | 73 69 6e 63 65 20 69 74 |uickly, |since it|
|000019d0| 20 68 61 73 20 61 63 63 | 65 73 73 20 74 6f 20 74 | has acc|ess to t|
|000019e0| 68 65 20 77 69 6e 64 6f | 77 73 2c 0d 77 68 69 63 |he windo|ws,.whic|
|000019f0| 68 20 69 6e 63 6c 75 64 | 65 20 74 68 65 20 6e 65 |h includ|e the ne|
|00001a00| 63 65 73 73 61 72 79 20 | 67 6c 6f 62 61 6c 20 63 |cessary |global c|
|00001a10| 6f 6f 72 64 69 6e 61 74 | 65 73 2e 0d 0d 48 49 53 |oordinat|es...HIS|
|00001a20| 54 4f 52 59 3a 0d 31 30 | 2f 33 2f 39 34 20 64 67 |TORY:.10|/3/94 dg|
|00001a30| 70 20 77 72 6f 74 65 20 | 69 74 2e 0d 31 31 2f 35 |p wrote |it..11/5|
|00001a40| 2f 39 34 20 64 67 70 20 | 61 64 64 65 64 20 74 68 |/94 dgp |added th|
|00001a50| 65 20 6e 65 77 20 66 6c | 61 67 73 20 63 6f 70 79 |e new fl|ags copy|
|00001a60| 4c 69 74 65 72 61 6c 6c | 79 20 61 6e 64 20 63 6f |Literall|y and co|
|00001a70| 70 79 43 6f 6c 6f 72 69 | 7a 65 2e 0d 2a 2f 0d 23 |pyColori|ze..*/.#|
|00001a80| 69 6e 63 6c 75 64 65 20 | 22 56 69 64 65 6f 54 6f |include |"VideoTo|
|00001a90| 6f 6c 62 6f 78 2e 68 22 | 0d 73 74 61 74 69 63 20 |olbox.h"|.static |
|00001aa0| 69 6e 74 20 43 6f 70 79 | 57 69 6e 64 6f 77 73 51 |int Copy|WindowsQ|
|00001ab0| 75 69 63 6b 6c 79 28 43 | 57 69 6e 64 6f 77 50 74 |uickly(C|WindowPt|
|00001ac0| 72 20 73 72 63 57 69 6e | 64 6f 77 2c 43 57 69 6e |r srcWin|dow,CWin|
|00001ad0| 64 6f 77 50 74 72 20 64 | 73 74 57 69 6e 64 6f 77 |dowPtr d|stWindow|
|00001ae0| 0d 09 2c 52 65 63 74 20 | 2a 73 72 63 52 65 63 74 |..,Rect |*srcRect|
|00001af0| 50 74 72 2c 52 65 63 74 | 20 2a 64 73 74 52 65 63 |Ptr,Rect| *dstRec|
|00001b00| 74 50 74 72 2c 6c 6f 6e | 67 20 73 72 63 4d 6f 64 |tPtr,lon|g srcMod|
|00001b10| 65 2c 52 67 6e 48 61 6e | 64 6c 65 20 6d 61 73 6b |e,RgnHan|dle mask|
|00001b20| 52 67 6e 29 3b 0d 0d 69 | 6e 74 20 43 6f 70 79 57 |Rgn);..i|nt CopyW|
|00001b30| 69 6e 64 6f 77 73 28 43 | 57 69 6e 64 6f 77 50 74 |indows(C|WindowPt|
|00001b40| 72 20 73 72 63 57 69 6e | 64 6f 77 2c 43 57 69 6e |r srcWin|dow,CWin|
|00001b50| 64 6f 77 50 74 72 20 64 | 73 74 57 69 6e 64 6f 77 |dowPtr d|stWindow|
|00001b60| 0d 09 2c 52 65 63 74 20 | 2a 73 72 63 52 65 63 74 |..,Rect |*srcRect|
|00001b70| 50 74 72 2c 52 65 63 74 | 20 2a 64 73 74 52 65 63 |Ptr,Rect| *dstRec|
|00001b80| 74 50 74 72 2c 6c 6f 6e | 67 20 73 72 63 4d 6f 64 |tPtr,lon|g srcMod|
|00001b90| 65 2c 52 67 6e 48 61 6e | 64 6c 65 20 6d 61 73 6b |e,RgnHan|dle mask|
|00001ba0| 52 67 6e 29 0d 7b 0d 09 | 47 57 6f 72 6c 64 50 74 |Rgn).{..|GWorldPt|
|00001bb0| 72 20 6f 6c 64 50 6f 72 | 74 3b 0d 09 47 44 48 61 |r oldPor|t;..GDHa|
|00001bc0| 6e 64 6c 65 20 6f 6c 64 | 44 65 76 69 63 65 2c 64 |ndle old|Device,d|
|00001bd0| 65 76 69 63 65 3b 0d 09 | 69 6e 74 20 65 72 72 6f |evice;..|int erro|
|00001be0| 72 3b 0d 20 20 20 20 73 | 74 61 74 69 63 20 63 6f |r;. s|tatic co|
|00001bf0| 6e 73 74 20 52 47 42 43 | 6f 6c 6f 72 20 62 6c 61 |nst RGBC|olor bla|
|00001c00| 63 6b 52 47 42 3d 7b 30 | 2c 30 2c 30 7d 2c 77 68 |ckRGB={0|,0,0},wh|
|00001c10| 69 74 65 52 47 42 3d 7b | 30 78 46 46 46 46 2c 30 |iteRGB={|0xFFFF,0|
|00001c20| 78 46 46 46 46 2c 30 78 | 46 46 46 46 7d 3b 0d 09 |xFFFF,0x|FFFF};..|
|00001c30| 52 47 42 43 6f 6c 6f 72 | 20 66 6f 72 65 52 47 42 |RGBColor| foreRGB|
|00001c40| 2c 62 61 63 6b 52 47 42 | 3b 0d 20 20 20 20 43 6f |,backRGB|;. Co|
|00001c50| 6c 6f 72 53 70 65 63 20 | 66 6f 72 65 43 6f 6c 6f |lorSpec |foreColo|
|00001c60| 72 2c 62 61 63 6b 43 6f | 6c 6f 72 3b 0d 09 42 69 |r,backCo|lor;..Bi|
|00001c70| 74 4d 61 70 20 2a 73 72 | 63 42 69 74 73 2c 2a 64 |tMap *sr|cBits,*d|
|00001c80| 73 74 42 69 74 73 3b 0d | 09 73 74 61 74 69 63 20 |stBits;.|.static |
|00001c90| 42 6f 6f 6c 65 61 6e 20 | 71 64 38 2c 71 64 33 32 |Boolean |qd8,qd32|
|00001ca0| 2c 66 69 72 73 74 54 69 | 6d 65 3d 31 3b 0d 09 42 |,firstTi|me=1;..B|
|00001cb0| 6f 6f 6c 65 61 6e 20 63 | 6f 6c 6f 72 69 7a 65 3b |oolean c|olorize;|
|00001cc0| 0d 09 0d 09 69 66 28 73 | 72 63 4d 6f 64 65 20 26 |....if(s|rcMode &|
|00001cd0| 20 63 6f 70 79 4c 69 74 | 65 72 61 6c 6c 79 29 0d | copyLit|erally).|
|00001ce0| 09 09 72 65 74 75 72 6e | 20 43 6f 70 79 57 69 6e |..return| CopyWin|
|00001cf0| 64 6f 77 73 51 75 69 63 | 6b 6c 79 28 73 72 63 57 |dowsQuic|kly(srcW|
|00001d00| 69 6e 64 6f 77 2c 64 73 | 74 57 69 6e 64 6f 77 2c |indow,ds|tWindow,|
|00001d10| 73 72 63 52 65 63 74 50 | 74 72 2c 64 73 74 52 65 |srcRectP|tr,dstRe|
|00001d20| 63 74 50 74 72 2c 73 72 | 63 4d 6f 64 65 2c 6d 61 |ctPtr,sr|cMode,ma|
|00001d30| 73 6b 52 67 6e 29 3b 0d | 09 63 6f 6c 6f 72 69 7a |skRgn);.|.coloriz|
|00001d40| 65 3d 28 73 72 63 4d 6f | 64 65 26 63 6f 70 79 43 |e=(srcMo|de&copyC|
|00001d50| 6f 6c 6f 72 69 7a 65 29 | 21 3d 30 3b 0d 09 73 72 |olorize)|!=0;..sr|
|00001d60| 63 4d 6f 64 65 26 3d 30 | 78 66 66 66 66 3b 09 2f |cMode&=0|xffff;./|
|00001d70| 2f 20 6e 6f 20 6d 6f 72 | 65 20 6e 65 65 64 20 66 |/ no mor|e need f|
|00001d80| 6f 72 20 75 70 70 65 72 | 20 62 69 74 73 2e 0d 09 |or upper| bits...|
|00001d90| 69 66 28 66 69 72 73 74 | 54 69 6d 65 29 7b 0d 09 |if(first|Time){..|
|00001da0| 09 6c 6f 6e 67 20 71 64 | 3b 0d 09 09 47 65 73 74 |.long qd|;...Gest|
|00001db0| 61 6c 74 28 67 65 73 74 | 61 6c 74 51 75 69 63 6b |alt(gest|altQuick|
|00001dc0| 64 72 61 77 56 65 72 73 | 69 6f 6e 2c 26 71 64 29 |drawVers|ion,&qd)|
|00001dd0| 3b 0d 09 09 71 64 38 20 | 3d 20 71 64 3e 3d 67 65 |;...qd8 |= qd>=ge|
|00001de0| 73 74 61 6c 74 38 42 69 | 74 51 44 3b 0d 09 09 71 |stalt8Bi|tQD;...q|
|00001df0| 64 33 32 20 3d 20 71 64 | 3e 3d 67 65 73 74 61 6c |d32 = qd|>=gestal|
|00001e00| 74 33 32 42 69 74 51 44 | 3b 0d 09 09 66 69 72 73 |t32BitQD|;...firs|
|00001e10| 74 54 69 6d 65 3d 30 3b | 0d 09 7d 0d 09 64 65 76 |tTime=0;|..}..dev|
|00001e20| 69 63 65 3d 47 65 74 57 | 69 6e 64 6f 77 44 65 76 |ice=GetW|indowDev|
|00001e30| 69 63 65 28 28 57 69 6e | 64 6f 77 50 74 72 29 64 |ice((Win|dowPtr)d|
|00001e40| 73 74 57 69 6e 64 6f 77 | 29 3b 0d 09 69 66 28 71 |stWindow|);..if(q|
|00001e50| 64 33 32 29 7b 0d 09 09 | 47 65 74 47 57 6f 72 6c |d32){...|GetGWorl|
|00001e60| 64 28 26 6f 6c 64 50 6f | 72 74 2c 26 6f 6c 64 44 |d(&oldPo|rt,&oldD|
|00001e70| 65 76 69 63 65 29 3b 0d | 09 09 53 65 74 47 57 6f |evice);.|..SetGWo|
|00001e80| 72 6c 64 28 28 47 57 6f | 72 6c 64 50 74 72 29 64 |rld((GWo|rldPtr)d|
|00001e90| 73 74 57 69 6e 64 6f 77 | 2c 64 65 76 69 63 65 29 |stWindow|,device)|
|00001ea0| 3b 0d 09 7d 65 6c 73 65 | 7b 0d 09 09 47 65 74 50 |;..}else|{...GetP|
|00001eb0| 6f 72 74 28 28 57 69 6e | 64 6f 77 50 74 72 20 2a |ort((Win|dowPtr *|
|00001ec0| 29 26 6f 6c 64 50 6f 72 | 74 29 3b 0d 09 09 53 65 |)&oldPor|t);...Se|
|00001ed0| 74 50 6f 72 74 28 28 57 | 69 6e 64 6f 77 50 74 72 |tPort((W|indowPtr|
|00001ee0| 29 64 73 74 57 69 6e 64 | 6f 77 29 3b 0d 09 09 69 |)dstWind|ow);...i|
|00001ef0| 66 28 71 64 38 29 7b 0d | 09 09 09 6f 6c 64 44 65 |f(qd8){.|...oldDe|
|00001f00| 76 69 63 65 3d 47 65 74 | 47 44 65 76 69 63 65 28 |vice=Get|GDevice(|
|00001f10| 29 3b 0d 09 09 09 53 65 | 74 47 44 65 76 69 63 65 |);....Se|tGDevice|
|00001f20| 28 64 65 76 69 63 65 29 | 3b 0d 09 09 7d 0d 09 7d |(device)|;...}..}|
|00001f30| 0d 09 69 66 28 21 63 6f | 6c 6f 72 69 7a 65 20 26 |..if(!co|lorize &|
|00001f40| 26 20 71 64 38 29 7b 0d | 09 09 47 65 74 46 6f 72 |& qd8){.|..GetFor|
|00001f50| 65 43 6f 6c 6f 72 28 26 | 66 6f 72 65 52 47 42 29 |eColor(&|foreRGB)|
|00001f60| 3b 0d 09 09 47 65 74 42 | 61 63 6b 43 6f 6c 6f 72 |;...GetB|ackColor|
|00001f70| 28 26 62 61 63 6b 52 47 | 42 29 3b 0d 09 09 69 66 |(&backRG|B);...if|
|00001f80| 28 71 64 33 32 29 7b 0d | 09 09 09 53 61 76 65 46 |(qd32){.|...SaveF|
|00001f90| 6f 72 65 28 26 66 6f 72 | 65 43 6f 6c 6f 72 29 3b |ore(&for|eColor);|
|00001fa0| 0d 09 09 09 53 61 76 65 | 42 61 63 6b 28 26 62 61 |....Save|Back(&ba|
|00001fb0| 63 6b 43 6f 6c 6f 72 29 | 3b 0d 09 09 7d 0d 09 09 |ckColor)|;...}...|
|00001fc0| 52 47 42 46 6f 72 65 43 | 6f 6c 6f 72 28 26 62 6c |RGBForeC|olor(&bl|
|00001fd0| 61 63 6b 52 47 42 29 3b | 20 20 2f 2a 20 73 6f 20 |ackRGB);| /* so |
|00001fe0| 43 6f 70 79 42 69 74 73 | 20 77 6f 6e 27 74 20 63 |CopyBits| won't c|
|00001ff0| 6f 6c 6f 72 69 7a 65 20 | 20 2a 2f 0d 09 09 52 47 |olorize | */...RG|
|00002000| 42 42 61 63 6b 43 6f 6c | 6f 72 28 26 77 68 69 74 |BBackCol|or(&whit|
|00002010| 65 52 47 42 29 3b 20 20 | 2f 2a 20 73 6f 20 43 6f |eRGB); |/* so Co|
|00002020| 70 79 42 69 74 73 20 77 | 6f 6e 27 74 20 63 6f 6c |pyBits w|on't col|
|00002030| 6f 72 69 7a 65 20 20 2a | 2f 0d 09 7d 0d 09 73 72 |orize *|/..}..sr|
|00002040| 63 42 69 74 73 3d 47 65 | 74 42 69 74 4d 61 70 50 |cBits=Ge|tBitMapP|
|00002050| 74 72 28 73 72 63 57 69 | 6e 64 6f 77 29 3b 0d 09 |tr(srcWi|ndow);..|
|00002060| 64 73 74 42 69 74 73 3d | 47 65 74 42 69 74 4d 61 |dstBits=|GetBitMa|
|00002070| 70 50 74 72 28 64 73 74 | 57 69 6e 64 6f 77 29 3b |pPtr(dst|Window);|
|00002080| 0d 09 69 66 28 73 72 63 | 42 69 74 73 3d 3d 4e 55 |..if(src|Bits==NU|
|00002090| 4c 4c 20 7c 7c 20 64 73 | 74 42 69 74 73 3d 3d 4e |LL || ds|tBits==N|
|000020a0| 55 4c 4c 29 72 65 74 75 | 72 6e 20 2d 31 3b 0d 09 |ULL)retu|rn -1;..|
|000020b0| 43 6f 70 79 42 69 74 73 | 28 73 72 63 42 69 74 73 |CopyBits|(srcBits|
|000020c0| 2c 64 73 74 42 69 74 73 | 2c 73 72 63 52 65 63 74 |,dstBits|,srcRect|
|000020d0| 50 74 72 2c 64 73 74 52 | 65 63 74 50 74 72 2c 73 |Ptr,dstR|ectPtr,s|
|000020e0| 72 63 4d 6f 64 65 2c 6d | 61 73 6b 52 67 6e 29 3b |rcMode,m|askRgn);|
|000020f0| 0d 09 65 72 72 6f 72 3d | 51 44 45 72 72 6f 72 28 |..error=|QDError(|
|00002100| 29 3b 0d 09 69 66 28 21 | 63 6f 6c 6f 72 69 7a 65 |);..if(!|colorize|
|00002110| 20 26 26 20 71 64 38 29 | 7b 0d 09 09 52 47 42 46 | && qd8)|{...RGBF|
|00002120| 6f 72 65 43 6f 6c 6f 72 | 28 26 66 6f 72 65 52 47 |oreColor|(&foreRG|
|00002130| 42 29 3b 0d 09 09 52 47 | 42 42 61 63 6b 43 6f 6c |B);...RG|BBackCol|
|00002140| 6f 72 28 26 62 61 63 6b | 52 47 42 29 3b 0d 09 09 |or(&back|RGB);...|
|00002150| 69 66 28 71 64 33 32 29 | 7b 0d 09 09 09 52 65 73 |if(qd32)|{....Res|
|00002160| 74 6f 72 65 46 6f 72 65 | 28 26 66 6f 72 65 43 6f |toreFore|(&foreCo|
|00002170| 6c 6f 72 29 3b 0d 09 09 | 09 52 65 73 74 6f 72 65 |lor);...|.Restore|
|00002180| 42 61 63 6b 28 26 62 61 | 63 6b 43 6f 6c 6f 72 29 |Back(&ba|ckColor)|
|00002190| 3b 0d 09 09 7d 0d 09 7d | 0d 09 69 66 28 71 64 33 |;...}..}|..if(qd3|
|000021a0| 32 29 7b 0d 09 09 53 65 | 74 47 57 6f 72 6c 64 28 |2){...Se|tGWorld(|
|000021b0| 6f 6c 64 50 6f 72 74 2c | 6f 6c 64 44 65 76 69 63 |oldPort,|oldDevic|
|000021c0| 65 29 3b 0d 09 7d 65 6c | 73 65 7b 0d 09 09 53 65 |e);..}el|se{...Se|
|000021d0| 74 50 6f 72 74 28 28 57 | 69 6e 64 6f 77 50 74 72 |tPort((W|indowPtr|
|000021e0| 29 6f 6c 64 50 6f 72 74 | 29 3b 0d 09 09 69 66 28 |)oldPort|);...if(|
|000021f0| 71 64 38 29 53 65 74 47 | 44 65 76 69 63 65 28 6f |qd8)SetG|Device(o|
|00002200| 6c 64 44 65 76 69 63 65 | 29 3b 0d 09 7d 0d 09 72 |ldDevice|);..}..r|
|00002210| 65 74 75 72 6e 20 65 72 | 72 6f 72 3b 0d 7d 0d 0d |eturn er|ror;.}..|
|00002220| 73 74 61 74 69 63 20 69 | 6e 74 20 43 6f 70 79 57 |static i|nt CopyW|
|00002230| 69 6e 64 6f 77 73 51 75 | 69 63 6b 6c 79 28 43 57 |indowsQu|ickly(CW|
|00002240| 69 6e 64 6f 77 50 74 72 | 20 73 72 63 57 69 6e 64 |indowPtr| srcWind|
|00002250| 6f 77 2c 43 57 69 6e 64 | 6f 77 50 74 72 20 64 73 |ow,CWind|owPtr ds|
|00002260| 74 57 69 6e 64 6f 77 0d | 09 2c 52 65 63 74 20 2a |tWindow.|.,Rect *|
|00002270| 73 72 63 52 65 63 74 50 | 74 72 2c 52 65 63 74 20 |srcRectP|tr,Rect |
|00002280| 2a 64 73 74 52 65 63 74 | 50 74 72 2c 6c 6f 6e 67 |*dstRect|Ptr,long|
|00002290| 20 73 72 63 4d 6f 64 65 | 2c 52 67 6e 48 61 6e 64 | srcMode|,RgnHand|
|000022a0| 6c 65 20 6d 61 73 6b 52 | 67 6e 29 0d 7b 0d 09 69 |le maskR|gn).{..i|
|000022b0| 6e 74 20 65 72 72 6f 72 | 2c 69 2c 73 68 69 65 6c |nt error|,i,shiel|
|000022c0| 64 73 3d 30 3b 0d 09 42 | 69 74 4d 61 70 20 2a 73 |ds=0;..B|itMap *s|
|000022d0| 72 63 42 69 74 73 2c 2a | 64 73 74 42 69 74 73 3b |rcBits,*|dstBits;|
|000022e0| 0d 09 50 6f 69 6e 74 20 | 70 74 3b 0d 09 57 69 6e |..Point |pt;..Win|
|000022f0| 64 6f 77 50 74 72 20 6f | 6c 64 50 6f 72 74 3b 0d |dowPtr o|ldPort;.|
|00002300| 09 0d 09 47 65 74 50 6f | 72 74 28 26 6f 6c 64 50 |...GetPo|rt(&oldP|
|00002310| 6f 72 74 29 3b 0d 09 69 | 66 28 21 49 73 47 57 6f |ort);..i|f(!IsGWo|
|00002320| 72 6c 64 50 74 72 28 73 | 72 63 57 69 6e 64 6f 77 |rldPtr(s|rcWindow|
|00002330| 29 29 7b 0d 09 09 53 65 | 74 50 6f 72 74 28 28 57 |)){...Se|tPort((W|
|00002340| 69 6e 64 6f 77 50 74 72 | 29 73 72 63 57 69 6e 64 |indowPtr|)srcWind|
|00002350| 6f 77 29 3b 0d 09 09 70 | 74 2e 68 3d 70 74 2e 76 |ow);...p|t.h=pt.v|
|00002360| 3d 30 3b 0d 09 09 4c 6f | 63 61 6c 54 6f 47 6c 6f |=0;...Lo|calToGlo|
|00002370| 62 61 6c 28 26 70 74 29 | 3b 0d 09 09 53 68 69 65 |bal(&pt)|;...Shie|
|00002380| 6c 64 43 75 72 73 6f 72 | 28 73 72 63 52 65 63 74 |ldCursor|(srcRect|
|00002390| 50 74 72 2c 70 74 29 3b | 0d 09 09 73 68 69 65 6c |Ptr,pt);|...shiel|
|000023a0| 64 73 2b 2b 3b 0d 09 7d | 0d 09 69 66 28 21 49 73 |ds++;..}|..if(!Is|
|000023b0| 47 57 6f 72 6c 64 50 74 | 72 28 64 73 74 57 69 6e |GWorldPt|r(dstWin|
|000023c0| 64 6f 77 29 29 7b 0d 09 | 09 53 65 74 50 6f 72 74 |dow)){..|.SetPort|
|000023d0| 28 28 57 69 6e 64 6f 77 | 50 74 72 29 64 73 74 57 |((Window|Ptr)dstW|
|000023e0| 69 6e 64 6f 77 29 3b 0d | 09 09 70 74 2e 68 3d 70 |indow);.|..pt.h=p|
|000023f0| 74 2e 76 3d 30 3b 0d 09 | 09 4c 6f 63 61 6c 54 6f |t.v=0;..|.LocalTo|
|00002400| 47 6c 6f 62 61 6c 28 26 | 70 74 29 3b 0d 09 09 53 |Global(&|pt);...S|
|00002410| 68 69 65 6c 64 43 75 72 | 73 6f 72 28 64 73 74 52 |hieldCur|sor(dstR|
|00002420| 65 63 74 50 74 72 2c 70 | 74 29 3b 0d 09 09 73 68 |ectPtr,p|t);...sh|
|00002430| 69 65 6c 64 73 2b 2b 3b | 0d 09 7d 0d 09 53 65 74 |ields++;|..}..Set|
|00002440| 50 6f 72 74 28 6f 6c 64 | 50 6f 72 74 29 3b 0d 09 |Port(old|Port);..|
|00002450| 73 72 63 42 69 74 73 3d | 47 65 74 42 69 74 4d 61 |srcBits=|GetBitMa|
|00002460| 70 50 74 72 28 73 72 63 | 57 69 6e 64 6f 77 29 3b |pPtr(src|Window);|
|00002470| 0d 09 64 73 74 42 69 74 | 73 3d 47 65 74 42 69 74 |..dstBit|s=GetBit|
|00002480| 4d 61 70 50 74 72 28 64 | 73 74 57 69 6e 64 6f 77 |MapPtr(d|stWindow|
|00002490| 29 3b 0d 09 69 66 28 73 | 72 63 42 69 74 73 3d 3d |);..if(s|rcBits==|
|000024a0| 4e 55 4c 4c 20 7c 7c 20 | 64 73 74 42 69 74 73 3d |NULL || |dstBits=|
|000024b0| 3d 4e 55 4c 4c 29 72 65 | 74 75 72 6e 20 34 3b 0d |=NULL)re|turn 4;.|
|000024c0| 09 65 72 72 6f 72 3d 43 | 6f 70 79 42 69 74 73 51 |.error=C|opyBitsQ|
|000024d0| 75 69 63 6b 6c 79 28 73 | 72 63 42 69 74 73 2c 64 |uickly(s|rcBits,d|
|000024e0| 73 74 42 69 74 73 2c 73 | 72 63 52 65 63 74 50 74 |stBits,s|rcRectPt|
|000024f0| 72 2c 64 73 74 52 65 63 | 74 50 74 72 2c 73 72 63 |r,dstRec|tPtr,src|
|00002500| 4d 6f 64 65 2c 6d 61 73 | 6b 52 67 6e 29 3b 0d 09 |Mode,mas|kRgn);..|
|00002510| 66 6f 72 28 69 3d 30 3b | 69 3c 73 68 69 65 6c 64 |for(i=0;|i<shield|
|00002520| 73 3b 69 2b 2b 29 53 68 | 6f 77 43 75 72 73 6f 72 |s;i++)Sh|owCursor|
|00002530| 28 29 3b 0d 09 72 65 74 | 75 72 6e 20 65 72 72 6f |();..ret|urn erro|
|00002540| 72 3b 0d 7d 0d 0d 00 00 | 00 00 00 00 00 00 00 00 |r;.}....|........|
|00002550| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002560| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002570| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002580| 00 00 01 00 00 00 01 c4 | 00 00 00 c4 00 00 00 8e |........|........|
|00002590| 00 00 3b 7c 1d 34 2e 35 | 20 73 74 64 69 6e 20 73 |..;|.4.5| stdin s|
|000025a0| 68 6f 75 6c 64 20 53 65 | 6c 65 63 74 57 69 6e 64 |hould Se|lectWind|
|000025b0| 0d 43 6f 70 79 57 69 6e | 64 6f 77 73 2e 63 02 00 |.CopyWin|dows.c..|
|000025c0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 14 01 20 |..TEXTCW|IE..... |
|000025d0| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 14 01 20 |..TEXTCW|IE..... |
|000025e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000025f0| 00 00 aa b5 e0 1e 00 00 | 24 c6 00 00 02 52 00 01 |........|$....R..|
|00002600| 00 00 00 00 00 00 00 00 | 24 3f 00 01 00 00 00 00 |........|$?......|
|00002610| 00 00 00 00 00 00 00 00 | 1f 00 00 00 3b 7c 19 34 |........|....;|.4|
|00002620| 2e 35 20 73 74 64 69 6f | 20 5c 72 20 61 6e 64 20 |.5 stdio| \r and |
|00002630| 5c 6e 20 72 65 63 61 70 | 02 00 02 00 54 45 58 54 |\n recap|....TEXT|
|00002640| 51 45 44 31 01 00 ff ff | ff ff 00 00 00 00 41 0c |QED1....|......A.|
|00002650| 00 00 00 00 1e ae 00 00 | 2c 00 00 00 00 00 00 00 |........|,.......|
|00002660| 00 00 00 00 aa b5 de 2d | aa b5 de 2e 00 00 00 00 |.......-|........|
|00002670| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002680| 00 00 00 1e 00 2a 00 03 | 01 81 01 ff 00 2a 00 03 |.....*..|.....*..|
|00002690| 01 6b 01 3a 00 00 00 00 | 00 00 00 00 00 00 00 00 |.k.:....|........|
|000026a0| 00 00 00 00 00 2a 00 09 | 06 47 65 6e 65 76 61 00 |.....*..|.Geneva.|
|000026b0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000026d0| 00 00 00 04 00 06 00 04 | 00 00 00 14 00 00 00 52 |........|.......R|
|000026e0| 00 12 ff f4 00 0c ff ff | 00 00 04 1a 00 00 04 22 |........|......."|
|000026f0| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00002700| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00002710| 00 00 00 00 00 00 00 03 | 00 04 00 57 00 04 02 6c |........|...W...l|
|00002720| 02 7c 00 57 00 04 02 6c | 02 7c ad ad ec 14 00 00 |.|.W...l|.|......|
|00002730| 09 c9 00 00 09 cf 00 00 | 04 94 00 00 00 00 00 04 |........|........|
|00002740| 00 01 00 01 00 00 01 00 | 00 00 01 c4 00 00 00 c4 |........|........|
|00002750| 00 00 00 8e 01 35 1a e4 | 3e cc 00 00 00 1c 00 8e |.....5..|>.......|
|00002760| 00 04 4d 50 53 52 00 01 | 00 2a 45 46 4e 54 00 00 |..MPSR..|.*EFNT..|
|00002770| 00 42 45 54 41 42 00 00 | 00 4e 45 51 45 44 00 00 |.BETAB..|.NEQED..|
|00002780| 00 5a 4d 57 42 42 00 00 | 00 66 03 f0 ff ff 00 00 |.ZMWBB..|.f......|
|00002790| 00 00 00 00 00 00 03 ed | ff ff 00 00 00 70 00 00 |........|.....p..|
|000027a0| 00 00 03 eb ff ff 00 00 | 00 22 00 00 00 00 03 ec |........|."......|
|000027b0| ff ff 00 00 00 50 00 00 | 00 00 03 eb ff ff 00 00 |.....P..|........|
|000027c0| 00 58 00 00 00 00 03 f0 | ff ff 00 00 00 bc 00 00 |.X......|........|
|000027d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000027f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+