home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Tools - Objects / MacApp / MacApp 3.0a2 / Libraries / Debug.r < prev    next >
Encoding:
Text File  |  1991-05-01  |  9.0 KB  |  302 lines  |  [TEXT/MPS ]

  1. /*
  2.     Debug.r
  3.     MacApp® Debugging Resources
  4.     Copyright © 1986-1990 Apple Computer, Inc.  All rights reserved.
  5. */
  6.  
  7. /* • Auto-Include the requirements for this source */
  8. #ifndef __TYPES.R__
  9. #include "Types.r"
  10. #endif
  11.  
  12. #ifndef __MacAppTypes__
  13. #include "MacAppTypes.r"
  14. #endif
  15.  
  16. #ifndef __ViewTypes__
  17. #include "ViewTypes.r"
  18. #endif
  19.  
  20. #define cDebugSizeChange     800                
  21. #define cDebugSizeBase        800
  22. #define cDebugSizeMin        809
  23. #define cDebugSizeMax        824
  24. #define cDebugSizeGrow        898
  25. #define cDebugSizeShrink     899
  26.  
  27. #define      kDebugBuzzStrings            251
  28. #define      kDebugErrorStrings            252
  29. #define      kTranscriptWindowType        901
  30. #define      kForDebugging                128
  31. #define         kDebugSICN                    901
  32.  
  33. #define        kIDTranscriptView            'trns'
  34.  
  35.  
  36. /* memory stuff */
  37. resource 'mem!' (kForDebugging,
  38. #if qNames
  39.     "ForDebugging",
  40. #endif
  41.     purgeable) {
  42.     2048,                // Add to temporary reserve
  43.     0,                    // Add to permanent reserve
  44.     0                    // stack space
  45. };
  46.  
  47.  
  48. resource 'seg!' (kForDebugging,
  49. #if qNames
  50.     "ForDebugging",
  51. #endif
  52.     purgeable) {
  53.     {
  54.         "GDebug";
  55.         "GDebugger";
  56.         "GFields";
  57.         "GInspector";
  58.         "GNonRes";                                // Window resizing, beinport, drawprintfeedback, etc.
  59.         "GSelCommand";                            // Handling mousedowns
  60.         "GWriteLn"
  61.     };
  62. };
  63.  
  64. resource 'res!' (kForDebugging,
  65. #if qNames
  66.     "ForDebugging",
  67. #endif
  68.     purgeable) {
  69.     {
  70.         "GDebug";
  71.         "GDebugger";
  72.         "GFields";
  73.         "GInspector";
  74.         "GWriteLn"
  75.     };
  76. };
  77.  
  78. resource 'CMNU' (mDebug,
  79. #if qNames
  80.     "mDebug",
  81. #endif
  82.     nonpurgeable) {
  83.     mDebug,
  84.     textMenuProc,
  85.     0x7FFFFFBF,
  86.     enabled,
  87.     "Debug",
  88.     {
  89. #if qInspector
  90.     "New Inspector Window",                 noIcon, noKey,    noMark, plain,    cNewInspectorWindow;
  91. #endif
  92.     "-",                                    noIcon, noKey,    noMark, plain,    nocommand;
  93.     "Make Front Window Modal",                noIcon, noKey,    noMark, plain,    cModalToggle;
  94.     "Do First Click For This Window",        noIcon, noKey,    noMark, plain,    cDoFirstClick;
  95.     "Refresh Front Window",                 noIcon, "®",    noMark, plain,    cRefreshFrontWindow;
  96.     "-",                                    noIcon, noKey,    noMark, plain,    nocommand;
  97.     "Allow Trace of Menu Setups",            noIcon, noKey,    noMark, plain,    cTraceSetupMenus;
  98.     "Allow Trace During Idle",                noIcon, noKey,    noMark, plain,    cTraceIdle;
  99.     /*"Show Page Breaks",                    noIcon, noKey,    noMark, plain,    cShowBreaks;    */
  100.     "Set system justification",                noIcon, noKey,    noMark, plain,    cSetSysJust;
  101.     "Toggle Flag",                            noIcon, kHierarchicalMenu, hmDebugFlags, plain,    cToggleFlag;
  102.     "-",                                    noIcon, noKey,    noMark, plain,    nocommand;
  103.     "Enter MacApp Debugger",                noIcon, "`",    noMark, plain,    cEnterMacAppDebugger;
  104.     "Show Debug Transcript",                noIcon, noKey,    noMark, plain,    cDebugWind;
  105.     "Show Software Version",                noIcon, noKey,    noMark, plain,    cIdentifySoftware;
  106.     "Font",                                    noIcon, kHierarchicalMenu, hmDebugFont, plain,    cDebugFont;
  107.     "Size",                                    noIcon, kHierarchicalMenu, hmDebugSize, plain,    cDebugSize
  108.     }
  109. };
  110.  
  111. resource 'CMNU' (mDebugFlags,
  112. #if qNames
  113.     "mDebugFlags",
  114. #endif
  115.     nonpurgeable) {
  116.     mDebugFlags,
  117.     textMenuProc,
  118.     allEnabled,
  119.     enabled,
  120.     "Debug Flags",
  121.     { }
  122. };
  123.  
  124. resource 'CMNU' (mDebugFont,
  125. #if qNames
  126.     "mDebugFont",
  127. #endif
  128.     nonpurgeable) {
  129.     mDebugFont,
  130.     textMenuProc,
  131.     allEnabled,
  132.     enabled,
  133.     "Debug Fonts",
  134.     { }
  135. };
  136.  
  137. resource 'CMNU' (mDebugSize,
  138. #if qNames
  139.     "mDebugSize",
  140. #endif
  141.     nonpurgeable) {
  142.     mDebugSize,
  143.     textMenuProc,
  144.     allEnabled,
  145.     enabled,
  146.     "Debug Size",
  147.     {
  148. /* [ 1] */    " 9 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+9;
  149. /* [ 2] */    "10 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+10;
  150. /* [ 3] */    "12 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+12;
  151. /* [ 4] */    "14 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+14;
  152. /* [ 5] */    "18 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+18;
  153. /* [ 6] */    "24 Point",            noIcon,    noKey,    noMark,    plain,    cDebugSizeBase+24;
  154. /* [ 7] */    "-",                noIcon,    noKey,    noMark,    plain,    nocommand;
  155. /* [ 8] */    "Grow selection",    noIcon,    "]",    noMark,    plain,    cDebugSizeGrow;
  156. /* [ 9] */    "Shrink selection",    noIcon,    "[",    noMark,    plain,    cDebugSizeShrink
  157.     }
  158. };
  159.  
  160.  
  161. resource 'MBAR' (kMBarDebug,
  162. #if qNames
  163. "kMBarDebug",
  164. #endif
  165. nonpurgeable) {
  166.  
  167.     {mDebug}
  168. };
  169.  
  170. resource 'MBAR' (kMBarDebugHierarchical,
  171. #if qNames
  172. "kMBarDebugHierarchical",
  173. #endif
  174. nonpurgeable) {
  175.  
  176.     {mDebugFlags, mDebugFont, mDebugSize}
  177. };
  178.  
  179.  
  180. /* Debug Buzz-Strings */
  181. resource 'STR#' (kDebugBuzzStrings,
  182. #if qNames
  183.     "DebugBuzzStrings",
  184. #endif
  185.     purgeable) {
  186.      {    /* [1] */    "Make Front Window Modal";
  187.         /* [2] */    "Make Front Window Modeless";
  188.         /* [3] */    "Do First Click For This Window";
  189.         /* [4] */    "Don't Do First Click For This Window";
  190.         /* [5] */    "Set system to right justification";
  191.         /* [6] */    "Set system to left justification"
  192.     }
  193. };
  194.  
  195.  
  196. /* Debug Error-Strings */
  197. resource 'STR#' (kDebugErrorStrings,
  198. #if qNames
  199.     "kDebugErrorStrings",
  200. #endif
  201.     purgeable) {
  202.      {
  203.     "Level 7 Interupt";
  204.     "Bus error:  Invalid memory reference";
  205.     "Address error:  Word or long-word reference made to an odd address";
  206.     "Illegal instruction:  The processor received an instruction it didn't recognize.";
  207.     "Zero divide:  Signed Divide (DIVS) or Unsigned Divide (DIVU) instruction with a divisor of 0 was executed.";
  208.     "Check exception:  Check Register Against Bounds (CHK) instruction was executed and failed.  Pascal 'value out of range' errors are usually reported in this way.";
  209.     "TrapV exception:  Trap On Overflow (TRAPV) instruction was executed and failed.";
  210.     "Privilege violation:  Macintosh always runs in supervisor mode; perhaps an erroneous Return From Execution (RTE) instruction was executed.";
  211.     "Trace exception:  The trace bit in the status register is set.";
  212.     "Line 1010 exception:  The 1010 trap dispatcher has failed.";
  213.     "Line 1111 exception:  Unimplemented instruction";
  214.     "Miscellaneous exception:  All other processor exceptions";
  215.     "Unimplemented core routine:  An unimplemented trap number was encountered.";
  216.     "Spurious interrupt:  The interrupt vector table entry for a particular level of interrupt is NIL; usually occurs with level 4, 5, 6, or 7 interrupts.";
  217.     "I/O system error:  The File Manager is attempting to dequeue an entry from an I/O request queue that has a bad queue type field.";
  218.     "Segment Loader error:  A GetResource call to read a segment into memory failed.";
  219.     "Floating point error:  The halt bit in the floating-point environment word was set.";
  220.     "Can't load package 0:  A GetResource call to read a package into memory failed.";
  221.     "Can't load package 1:  A GetResource call to read a package into memory failed.";
  222.     "Can't load Disk Initialization package:  A GetResource call to read a package into memory failed.";
  223.     "Can't load Standard File package:  A GetResource call to read a package into memory failed.";
  224.     "Can't load Floating Point package:  A GetResource call to read a package into memory failed.";
  225.     "Can't load Trancendentals package:  A GetResource call to read a package into memory failed.";
  226.     "Can't load International Utilities package:  A GetResource call to read a package into memory failed.";
  227.     "Can't load Binary-Decimal package:  A GetResource call to read a package into memory failed.";
  228.     "Can't allocate requested memory block in the heap";
  229.     "Segment Loader error:  A GetResource call to read 'CODE' resource 0 into memory failed; usually indicates a nonexecutable file.";
  230.     "File map destroyed:  A logical block number was found that's greater than the number of the last logical block on the volume or less than the logical block number of the first allocation block on the volume.";
  231.     "Stack overflow error:  The stack has expanded into the heap.";
  232.     "Negative ZcbFree value (Memory manager error.  See TN-151)";
  233.     "The file named 'Finder' can't be found on the disk.";
  234.     "ShutDown Alert";
  235.     "Unserviceable slot interrupt";
  236.     "Bad opcode given to SANE package 4";
  237.     "Menu Manager tried to access a menu that's been purged.";
  238.     "Menu bar not found";
  239.     "Menu find error";
  240.     "Can't mount system startup volume.  The system couldn't read the system resource file into memory.";
  241.     "'Sorry, a system error occurred':  Default alert message";
  242.     "Mem Mgr Err";
  243.     "Unlisted error.  See IM III-205"
  244.      }
  245. };
  246.  
  247.  
  248. #if qTemplateViews
  249. resource 'view' (kTranscriptWindowType,
  250. #if qNames
  251.     "TranscriptWindowType",
  252. #endif
  253.     purgeable)  { {
  254.     root, 'WIND', { 270, 40 }, { 80, 410 }, sizeVariable, sizeVariable, notShown, enabled,
  255.     Window {
  256.         "",
  257.             zoomDocProc, goAwayBox, resizable, modeless, ignoreFirstClick, dontFreeOnClosing,
  258.             disposeOnFree, doesntCloseDocument, openWithDocument, dontAdaptToScreen,
  259.             dontStagger, ForceOnScreen, dontCenter, kIDTranscriptView, "Debug Transcript <<<>>>" };
  260.  
  261.     'WIND', 'SCLR', { 0, 0 }, { 80-kSBarSizeMinus1, 410-kSBarSizeMinus1 },
  262.     sizeRelSuperView, sizeRelSuperView, shown, enabled,
  263.     Scroller {
  264.         "",
  265.             vertScrollBar, horzScrollBar, 0, 0, 16, 16,
  266.             vertConstrain, horzConstrain, { 0, 0, 0, 0 } };
  267.     
  268.     'SCLR', kIDTranscriptView, { 0, 0 }, { 500, 500 }, sizeVariable, sizeVariable, shown, disabled,
  269.     View {
  270.         "TTranscriptView" }
  271. } };
  272. #else
  273.  
  274. /* This guy is used when the template stuff isn't */
  275. resource 'WIND' (kTranscriptWindowType,
  276. #if qNames
  277.     "TranscriptWindowType",
  278. #endif
  279.     purgeable) {
  280.     {20, 20, 250, 215},
  281.     zoomDocProc,
  282.     invisible,
  283.     goAway,
  284.     0x0,
  285.     "Debug Transcript <<<>>>",
  286.     noAutoCenter
  287. };
  288. #endif
  289.  
  290. resource 'SICN' (kDebugSICN,
  291. #if qNames
  292.     "MacApp® Debugger",
  293. #endif
  294.     purgeable) {
  295.     {    /* array: 1 elements */
  296.         /* [1] */
  297.         $"00 00 FF FF FF FF FF FF 00 00 88 8E D9 49 AA 29"
  298.         $"8B E9 8A 29 8A 2E 00 00 FF FF FF FF FF FF"
  299.     }
  300. };
  301.  
  302.