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

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


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

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext 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:18:38 1995, modified Wed Jul 26 04:18:38 1995, creator 'CWIE', type ASCII, 1848 bytes "RestoreCluts.c" , at 0x7b8 542 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 0e 52 65 73 74 6f 72 | 65 43 6c 75 74 73 2e 63 |..Restor|eCluts.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 07 38 00 | 00 02 1e ac 3b aa de ac |......8.|....;...|
|00000060| 3b aa de 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 e6 32 00 00 |........|.....2..|
|00000080| 2f 2a 0d 52 65 73 74 6f | 72 65 43 6c 75 74 73 2e |/*.Resto|reCluts.|
|00000090| 63 0d 44 65 76 65 6c 6f | 70 69 6e 67 20 70 72 6f |c.Develo|ping pro|
|000000a0| 67 72 61 6d 73 20 74 68 | 61 74 20 6d 6f 64 69 66 |grams th|at modif|
|000000b0| 79 20 74 68 65 20 63 6c | 75 74 20 63 61 6e 20 62 |y the cl|ut can b|
|000000c0| 65 20 61 6e 6e 6f 79 69 | 6e 67 2c 20 62 65 63 61 |e annoyi|ng, beca|
|000000d0| 75 73 65 20 6f 6e 65 20 | 66 72 65 71 75 65 6e 74 |use one |frequent|
|000000e0| 6c 79 0d 61 62 6f 72 74 | 73 20 74 68 65 20 70 72 |ly.abort|s the pr|
|000000f0| 6f 67 72 61 6d 20 66 6f | 72 20 6f 6e 65 20 72 65 |ogram fo|r one re|
|00000100| 61 73 6f 6e 20 6f 72 20 | 61 6e 6f 74 68 65 72 20 |ason or |another |
|00000110| 61 6e 64 20 74 68 65 6e | 20 66 61 63 65 73 20 61 |and then| faces a|
|00000120| 6e 20 65 64 69 74 69 6e | 67 20 65 6e 76 69 72 6f |n editin|g enviro|
|00000130| 6e 6d 65 6e 74 0d 69 6e | 20 77 68 69 63 68 20 74 |nment.in| which t|
|00000140| 65 78 74 20 69 73 20 68 | 61 72 64 20 74 6f 20 73 |ext is h|ard to s|
|00000150| 65 65 20 62 65 63 61 75 | 73 65 20 6f 66 20 74 68 |ee becau|se of th|
|00000160| 65 20 77 65 69 72 64 20 | 63 6c 75 74 20 73 65 74 |e weird |clut set|
|00000170| 74 69 6e 67 73 2e 20 4e | 6f 20 6c 6f 6e 67 65 72 |tings. N|o longer|
|00000180| 2e 0d 0d 53 6f 6d 65 77 | 68 65 72 65 20 6e 65 61 |...Somew|here nea|
|00000190| 72 20 74 68 65 20 62 65 | 67 69 6e 6e 69 6e 67 20 |r the be|ginning |
|000001a0| 6f 66 20 79 6f 75 72 20 | 70 72 6f 67 72 61 6d 20 |of your |program |
|000001b0| 69 6e 73 65 72 74 20 74 | 68 65 20 6c 69 6e 65 3a |insert t|he line:|
|000001c0| 0d 0d 41 74 45 78 69 74 | 54 6f 53 68 65 6c 6c 28 |..AtExit|ToShell(|
|000001d0| 52 65 73 74 6f 72 65 43 | 6c 75 74 73 29 3b 0d 0d |RestoreC|luts);..|
|000001e0| 54 68 69 73 20 72 65 71 | 75 65 73 74 73 20 74 68 |This req|uests th|
|000001f0| 61 74 20 52 65 73 74 6f | 72 65 43 6c 75 74 73 28 |at Resto|reCluts(|
|00000200| 29 20 62 65 20 72 75 6e | 20 77 68 65 6e 20 79 6f |) be run| when yo|
|00000210| 75 20 71 75 69 74 2c 20 | 65 76 65 6e 20 69 66 0d |u quit, |even if.|
|00000220| 69 74 27 73 20 61 6e 20 | 61 62 6e 6f 72 6d 61 6c |it's an |abnormal|
|00000230| 20 65 78 69 74 2c 20 65 | 2e 67 2e 20 65 73 63 61 | exit, e|.g. esca|
|00000240| 70 65 20 74 6f 20 73 68 | 65 6c 6c 20 66 72 6f 6d |pe to sh|ell from|
|00000250| 20 4d 61 63 73 42 75 67 | 2e 0d 28 41 74 45 78 69 | MacsBug|..(AtExi|
|00000260| 74 54 6f 53 68 65 6c 6c | 20 69 73 20 65 71 75 69 |tToShell| is equi|
|00000270| 76 61 6c 65 6e 74 20 74 | 6f 20 74 68 65 20 6e 6f |valent t|o the no|
|00000280| 6e 2d 41 4e 53 49 20 5f | 61 74 65 78 69 74 28 29 |n-ANSI _|atexit()|
|00000290| 20 72 6f 75 74 69 6e 65 | 20 70 72 6f 76 69 64 65 | routine| provide|
|000002a0| 64 0d 62 79 20 74 68 65 | 20 54 48 49 4e 4b 20 43 |d.by the| THINK C|
|000002b0| 20 65 6e 76 69 72 6f 6e | 6d 65 6e 74 2e 29 0d 0d | environ|ment.)..|
|000002c0| 43 41 55 54 49 4f 4e 3a | 20 74 68 65 20 61 74 65 |CAUTION:| the ate|
|000002d0| 78 69 74 28 29 2c 20 61 | 6e 64 20 5f 61 74 65 78 |xit(), a|nd _atex|
|000002e0| 69 74 28 29 20 72 6f 75 | 74 69 6e 65 73 20 73 68 |it() rou|tines sh|
|000002f0| 6f 75 6c 64 20 6e 6f 74 | 20 62 65 20 75 73 65 64 |ould not| be used|
|00000300| 20 69 6e 0d 4d 41 54 4c | 41 42 20 63 6f 64 65 20 | in.MATL|AB code |
|00000310| 72 65 73 6f 75 72 63 65 | 73 2e 20 54 68 65 20 72 |resource|s. The r|
|00000320| 65 61 73 6f 6e 20 69 73 | 20 74 68 61 74 20 74 68 |eason is| that th|
|00000330| 65 79 20 77 69 6c 6c 20 | 6f 6e 6c 79 20 62 65 20 |ey will |only be |
|00000340| 69 6e 76 6f 6b 65 64 20 | 77 68 65 6e 20 4d 41 54 |invoked |when MAT|
|00000350| 4c 41 42 0d 65 78 69 74 | 73 2c 20 61 66 74 65 72 |LAB.exit|s, after|
|00000360| 20 79 6f 75 72 20 63 6f | 64 65 20 72 65 73 6f 75 | your co|de resou|
|00000370| 72 63 65 73 20 68 61 76 | 65 20 61 6c 72 65 61 64 |rces hav|e alread|
|00000380| 79 20 62 65 65 6e 20 66 | 6c 75 73 68 65 64 2c 20 |y been f|lushed, |
|00000390| 73 6f 20 79 6f 75 27 6c | 6c 20 63 72 61 73 68 2e |so you'l|l crash.|
|000003a0| 0d 41 74 20 74 68 69 73 | 20 77 72 69 74 69 6e 67 |.At this| writing|
|000003b0| 20 28 37 2f 31 2f 39 35 | 29 20 69 74 27 73 20 73 | (7/1/95|) it's s|
|000003c0| 61 66 65 20 74 6f 20 63 | 61 6c 6c 20 41 74 45 78 |afe to c|all AtEx|
|000003d0| 69 74 54 6f 53 68 65 6c | 6c 28 29 2c 20 62 75 74 |itToShel|l(), but|
|000003e0| 20 69 74 20 77 69 6c 6c | 20 68 61 76 65 0d 6e 6f | it will| have.no|
|000003f0| 20 65 66 66 65 63 74 20 | 69 66 20 4d 41 54 4c 41 | effect |if MATLA|
|00000400| 42 20 69 73 20 74 72 75 | 65 2e 0d 0d 46 6f 72 20 |B is tru|e...For |
|00000410| 72 65 61 73 6f 6e 73 20 | 74 68 61 74 20 49 20 64 |reasons |that I d|
|00000420| 6f 6e 27 74 20 75 6e 64 | 65 72 73 74 61 6e 64 2c |on't und|erstand,|
|00000430| 20 41 70 70 6c 65 27 73 | 20 52 65 73 74 6f 72 65 | Apple's| Restore|
|00000440| 44 65 76 69 63 65 43 6c | 75 74 20 64 6f 65 73 6e |DeviceCl|ut doesn|
|00000450| 27 74 20 73 65 65 6d 20 | 74 6f 20 0d 64 6f 20 61 |'t seem |to .do a|
|00000460| 6e 79 74 68 69 6e 67 2c | 20 65 76 65 6e 20 74 68 |nything,| even th|
|00000470| 6f 75 67 68 20 6d 79 20 | 47 44 52 65 73 74 6f 72 |ough my |GDRestor|
|00000480| 65 44 65 76 69 63 65 43 | 6c 75 74 20 77 6f 72 6b |eDeviceC|lut work|
|00000490| 73 20 66 69 6e 65 2e 0d | 0d 48 49 53 54 4f 52 59 |s fine..|.HISTORY|
|000004a0| 3a 0d 34 2f 32 35 2f 39 | 32 20 64 67 70 09 77 72 |:.4/25/9|2 dgp.wr|
|000004b0| 6f 74 65 20 69 74 2e 20 | 57 68 79 20 64 69 64 6e |ote it. |Why didn|
|000004c0| 27 74 20 49 20 74 68 69 | 6e 6b 20 6f 66 20 74 68 |'t I thi|nk of th|
|000004d0| 69 73 20 73 6f 6f 6e 65 | 72 3f 0d 31 32 2f 38 2f |is soone|r?.12/8/|
|000004e0| 39 32 20 64 67 70 20 73 | 69 6d 70 6c 69 66 69 65 |92 dgp s|implifie|
|000004f0| 64 20 63 6f 64 65 2c 20 | 62 61 73 65 64 20 6f 6e |d code, |based on|
|00000500| 20 41 70 70 6c 65 27 73 | 20 53 6e 69 70 70 65 74 | Apple's| Snippet|
|00000510| 3a 20 0d 09 09 09 52 65 | 73 74 6f 72 65 43 6f 6c |: ....Re|storeCol|
|00000520| 6f 72 73 53 6c 61 6d 28 | 29 20 69 6e 20 43 6f 6c |orsSlam(|) in Col|
|00000530| 6f 72 52 65 73 65 74 2e | 63 2e 0d 31 32 2f 39 2f |orReset.|c..12/9/|
|00000540| 39 32 09 64 67 70 09 72 | 65 70 6c 61 63 65 64 20 |92.dgp.r|eplaced |
|00000550| 63 61 6c 6c 20 74 6f 20 | 41 70 70 6c 65 27 73 20 |call to |Apple's |
|00000560| 52 65 73 74 6f 72 65 44 | 65 76 69 63 65 43 6c 75 |RestoreD|eviceClu|
|00000570| 74 20 62 79 20 6d 79 20 | 47 44 52 65 73 74 6f 72 |t by my |GDRestor|
|00000580| 65 44 65 76 69 63 65 43 | 6c 75 74 2c 20 0d 09 09 |eDeviceC|lut, ...|
|00000590| 09 73 69 6e 63 65 20 41 | 70 70 6c 65 27 73 20 72 |.since A|pple's r|
|000005a0| 6f 75 74 69 6e 65 20 64 | 6f 65 73 6e 27 74 20 73 |outine d|oesn't s|
|000005b0| 65 65 6d 20 74 6f 20 64 | 6f 20 61 6e 79 74 68 69 |eem to d|o anythi|
|000005c0| 6e 67 2e 0d 31 32 2f 31 | 35 2f 39 32 20 64 67 70 |ng..12/1|5/92 dgp|
|000005d0| 20 52 65 6e 61 6d 65 64 | 20 74 6f 20 47 44 52 65 | Renamed| to GDRe|
|000005e0| 73 74 6f 72 65 44 65 76 | 69 63 65 43 6c 75 74 20 |storeDev|iceClut |
|000005f0| 66 6f 72 20 63 6f 6e 73 | 69 73 74 65 6e 74 63 79 |for cons|istentcy|
|00000600| 20 77 69 74 68 0d 09 09 | 09 41 70 70 6c 65 27 73 | with...|.Apple's|
|00000610| 20 63 61 70 69 74 61 6c | 69 7a 61 74 69 6f 6e 20 | capital|ization |
|00000620| 6f 66 20 52 65 73 74 6f | 72 65 44 65 76 69 63 65 |of Resto|reDevice|
|00000630| 43 6c 75 74 2e 0d 32 2f | 32 32 2f 39 33 20 20 64 |Clut..2/|22/93 d|
|00000640| 68 62 20 26 20 64 67 70 | 20 43 6f 6e 76 65 72 74 |hb & dgp| Convert|
|00000650| 65 64 20 66 6f 72 20 4d | 41 54 4c 41 42 0d 2a 2f |ed for M|ATLAB.*/|
|00000660| 0d 0d 23 69 6e 63 6c 75 | 64 65 20 22 56 69 64 65 |..#inclu|de "Vide|
|00000670| 6f 54 6f 6f 6c 62 6f 78 | 2e 68 22 0d 2f 2f 23 69 |oToolbox|.h".//#i|
|00000680| 6e 63 6c 75 64 65 20 3c | 4d 65 6e 75 73 2e 68 3e |nclude <|Menus.h>|
|00000690| 0d 0d 76 6f 69 64 20 52 | 65 73 74 6f 72 65 43 6c |..void R|estoreCl|
|000006a0| 75 74 73 28 76 6f 69 64 | 29 0d 7b 0d 09 2f 2f 20 |uts(void|).{..// |
|000006b0| 52 65 73 74 6f 72 65 44 | 65 76 69 63 65 43 6c 75 |RestoreD|eviceClu|
|000006c0| 74 28 4e 55 4c 4c 29 3b | 09 2f 2f 20 20 41 70 70 |t(NULL);|.// App|
|000006d0| 6c 65 27 73 20 76 65 72 | 73 69 6f 6e 2c 20 72 65 |le's ver|sion, re|
|000006e0| 73 74 6f 72 65 20 61 6c | 6c 20 63 6c 75 74 73 0d |store al|l cluts.|
|000006f0| 09 47 44 52 65 73 74 6f | 72 65 44 65 76 69 63 65 |.GDResto|reDevice|
|00000700| 43 6c 75 74 28 4e 55 4c | 4c 29 3b 09 2f 2f 20 6d |Clut(NUL|L);.// m|
|00000710| 79 20 76 65 72 73 69 6f | 6e 2c 20 72 65 73 74 6f |y versio|n, resto|
|00000720| 72 65 20 61 6c 6c 20 63 | 6c 75 74 73 0d 09 2f 2f |re all c|luts..//|
|00000730| 20 41 70 70 6c 65 20 73 | 75 67 67 65 73 74 73 20 | Apple s|uggests |
|00000740| 6d 61 6b 69 6e 67 20 74 | 68 65 73 65 20 74 77 6f |making t|hese two|
|00000750| 20 63 61 6c 6c 73 20 61 | 73 20 77 65 6c 6c 2c 20 | calls a|s well, |
|00000760| 74 6f 20 66 6f 72 63 65 | 20 72 65 64 72 61 77 69 |to force| redrawi|
|00000770| 6e 67 20 6f 66 0d 09 2f | 2f 20 65 76 65 72 79 74 |ng of../|/ everyt|
|00000780| 68 69 6e 67 2e 0d 09 50 | 61 69 6e 74 42 65 68 69 |hing...P|aintBehi|
|00000790| 6e 64 28 4e 55 4c 4c 2c | 47 65 74 47 72 61 79 52 |nd(NULL,|GetGrayR|
|000007a0| 67 6e 28 29 29 3b 0d 09 | 44 72 61 77 4d 65 6e 75 |gn());..|DrawMenu|
|000007b0| 42 61 72 28 29 3b 0d 7d | 00 00 00 00 00 00 00 00 |Bar();.}|........|
|000007c0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007d0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000007f0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000800| 00 00 01 00 00 00 01 a4 | 00 00 00 a4 00 00 00 7a |........|.......z|
|00000810| 00 00 02 fd 00 08 a7 30 | d7 99 00 00 25 70 00 00 |.......0|....%p..|
|00000820| 02 f7 00 08 a7 30 d7 99 | 00 00 25 76 00 00 02 bd |.....0..|..%v....|
|00000830| 0e 52 65 73 74 6f 72 65 | 43 6c 75 74 73 2e 63 6c |.Restore|Cluts.cl|
|00000840| 02 00 00 00 54 45 58 54 | 43 57 49 45 01 00 00 28 |....TEXT|CWIE...(|
|00000850| 00 00 54 45 58 54 43 57 | 49 45 01 00 00 28 04 e0 |..TEXTCW|IE...(..|
|00000860| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000870| 00 00 a6 1f 8c 1a 00 00 | 07 38 00 00 02 1e 25 91 |........|.8....%.|
|00000880| 00 00 02 bd 00 08 a7 30 | d7 9b 00 00 25 94 00 00 |.......0|....%...|
|00000890| 02 bd 00 08 a7 30 d7 9c | 00 00 05 84 00 00 02 bd |.....0..|........|
|000008a0| 00 08 a7 30 d7 9c 00 00 | 25 99 00 00 03 09 00 08 |...0....|%.......|
|000008b0| a7 30 d7 9c 00 00 25 a7 | 00 00 03 0a 00 08 a7 30 |.0....%.|.......0|
|000008c0| d7 9c 00 00 25 b0 00 00 | 03 09 00 08 a7 30 d7 9c |....%...|.....0..|
|000008d0| 00 00 25 bd 00 00 03 09 | 00 08 a7 30 d7 9c 00 00 |..%.....|...0....|
|000008e0| 25 c8 00 00 03 09 00 08 | a7 30 d7 9c 00 00 25 cb |%.......|.0....%.|
|000008f0| 00 00 03 0e 00 08 a7 30 | d7 9d 00 00 25 d6 00 00 |.......0|....%...|
|00000900| 00 00 00 0a 00 00 04 31 | ff ff 00 00 00 00 00 00 |.......1|........|
|00000910| 00 1c 00 01 00 1a 00 00 | 05 c5 00 25 00 5a d9 9c |........|...%.Z..|
|00000920| 00 00 0b 6d 79 47 44 48 | 61 6e 64 6c 65 20 00 00 |...myGDH|andle ..|
|00000930| 00 1e 00 5c 00 41 01 99 | 02 5e 00 5c 00 41 01 99 |...\.A..|.^.\.A..|
|00000940| 02 5e 00 00 01 ac 00 00 | 00 00 00 00 00 00 00 00 |.^......|........|
|00000950| 00 00 00 48 00 09 4d 6f | 6e 61 63 6f 00 00 00 00 |...H..Mo|naco....|
|00000960| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000970| 00 00 00 00 00 00 00 03 | 00 04 00 69 00 a1 01 a6 |........|...i....|
|00000980| 02 be 00 69 00 a1 01 a6 | 02 be ac 3b 72 ad 00 00 |...i....|...;r...|
|00000990| 05 fe 00 00 05 fe 00 00 | 03 8b 01 00 00 00 00 04 |........|........|
|000009a0| 00 01 00 01 00 00 01 00 | 00 00 01 a4 00 00 00 a4 |........|........|
|000009b0| 00 00 00 7a 01 89 2f e8 | 1a d0 00 00 00 1c 00 7a |...z../.|.......z|
|000009c0| 00 03 42 4b 50 54 00 00 | 00 22 44 54 56 55 00 00 |..BKPT..|."DTVU..|
|000009d0| 00 2e 4d 50 53 52 00 01 | 00 3a 4d 57 42 42 00 00 |..MPSR..|.:MWBB..|
|000009e0| 00 52 28 f8 ff ff 00 00 | 00 00 00 00 00 00 22 42 |.R(.....|......"B|
|000009f0| ff ff 00 00 00 0e 00 00 | 00 00 03 f0 ff ff 00 00 |........|........|
|00000a00| 00 2e 00 00 00 00 03 ed | ff ff 00 00 00 50 00 00 |........|.....P..|
|00000a10| 00 00 03 f0 ff ff 00 00 | 00 9c 00 00 00 00 00 00 |........|........|
|00000a20| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a30| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a40| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a50| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a60| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000a70| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+