home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Mac Game Programming Gurus / TricksOfTheMacGameProgrammingGurus.iso / More Source / Pascal / Skel 3.0i / Skel history < prev    next >
Encoding:
Text File  |  1994-06-06  |  9.0 KB  |  223 lines  |  [TEXT/Rich]

  1. PROGRAM Skel;
  2.  
  3. Original Lisa Pascal version written by
  4.                  Steve Maker
  5.                  Academic Computing
  6.                  Kiewit Computation Center
  7.                  Dartmouth College
  8.                  July 14, 1984
  9.          
  10. Translated for Megamax C compiler by
  11.          Bill Jefferys
  12.          Astronomy Department
  13.          University of Texas
  14.          Austin TX 78712
  15.          March 11, 1985
  16.          
  17. Simple convert to Lightspeed C by
  18.         Michael Peirce
  19.         1258 Manet Drive
  20.         Sunnyvale, CA 94087
  21.         June 16, 1986
  22.         
  23. Some fixes for newer Think C plus Think Pascal conversion (back to Pascal again!),
  24. WaitNextEvent support and Apple Events by
  25.         Ingemar Ragnemalm
  26.         ingemar@lysator.liu.se
  27.  
  28.  
  29. Copyright notice:
  30.        SKEL may be copied and used by anyone, so long as that use
  31.        is not for commercial purposes.  Please send significant 
  32.        changes back to Steve Maker for incorporation into future 
  33.        versions.
  34.  
  35. Why SKEL?
  36.        Skel is a skeleton demo program.  Its purpose is to illustrate
  37.        in a clear fashion, isolated from any particular application,
  38.        the basic code for handling a simple Macintosh user interface.
  39.  
  40.        It strives to be correct as far as it goes, without many 
  41.        short-cuts that would lead to trouble in larger applications.
  42.  
  43.        I think of SKEL as a program that does nothing, but does 
  44.        it well.
  45.  
  46. What does SKEL do?
  47.            It handles:
  48.                Events, carefully handling only those which are its
  49.                        business, and passing the others on to their
  50.                        respective handlers.
  51.                A Window, which is filled with Dark Gray, and can be
  52.                        activated or inactivated, updated, dragged
  53.                        and grown but NOT scrolled or closed.
  54.                Menus, including the Apple Menu.  An "About Skel" menu entry
  55.                        is provided.  A File menu offers Rattle and
  56.                        Frighten, which just invoke dialog boxes, and Quit.
  57.                Command key equivalents are supported.
  58.                The Desk Accessories, supported in the Apple menu,
  59.                        and correctly meshed with the other features.
  60.                        NOT supported are Undo, Cut, Copy, Paste and Clear
  61.                        (and keyboard equivalents) for desk accessories.
  62.                A Modal Dialog Box, used to communicate with the user.
  63.                Special icons for the application and its related files.
  64.                The Finder information (in the resource file).
  65.  
  66.            In accordance with Macintosh guidelines, everything possible is
  67.            kept in the resource file: window description, menus,
  68.            dialog specification, and the "About Skel" and other strings.
  69.  
  70.            In addition, the resource file handles the Bundle, File
  71.        References, and Icons that determine what Skel's icon looks 
  72.        like, and other information for the Finder.
  73.  
  74. How do I use SKEL?
  75.            Study it.  Modify it to test your knowledge.  Steal working
  76.            pieces of code for your own programs.  Beat on it.  Subject
  77.            it to cruel and unusual experiments.  Pay heed to its warnings.
  78.  
  79. What do I study first in SKEL?
  80.            Initially you should ignore several sections of SKEL, and the
  81.        calls made to them.  I recommend X-ing them out in your listing.
  82.            The sections to ignore on the first round of study are:
  83.  
  84.                Report: ignore the implementation
  85.                SetUpMemory: ignore all of it
  86.                DrawWindow: ignore the scroll bar and grow icon handling
  87.                ReSize: ignore all of it
  88.                DoCommand: ignore the Desk Accessory handling in the
  89.               Apple Menu
  90.                MainEventLoop:
  91.                   mouseDown handling: ignore inSysWindow, inDrag, inGrow
  92.                   keyDown, autoKey handling: ignore this.
  93.  
  94.            In the resource definition file, SKEL.R:
  95.                Finder information (offset by asterisks):
  96.                   ignore this whole section, icons and all.
  97.  
  98. What should I read in Inside Macintosh?
  99.            You should read the following sections of Inside Macintosh,
  100.            in the order given.  At first, just lightly skim the sections
  101.            with parenthesized names.  Read the others in some depth.  Read
  102.            the starred (*) ones in great detail.  Eventually, you will
  103.        have to read all sections thoroughly, and many many times, 
  104.        I promise you.
  105.  
  106.            To start:
  107.              * Inside Macintosh: A Road Map
  108.                (User Interface Guidelines)
  109.                Structure of a Macintosh Application
  110.              * Putting Together a Macintosh Application
  111.  
  112.            Then, (low-level sections are listed first):
  113.             *  Memory Mgr Intro
  114.               (Memory Mgr)
  115.             *  Resource Mgr (through "Using the Resource Mgr")
  116.             *  QuickDraw
  117.               (Desk Mgr)
  118.             *  Event Mgr (through "Event Mgr routines")
  119.                Window Mgr
  120.                Menu Mgr
  121.               (Dialog Mgr)
  122.  
  123. How do I get SKEL to run?
  124.        Double-click Skel.π (the project file), and then select "Go".
  125.               
  126. What is the history of SKEL?
  127.       v1.0 July 14, 1984   sm: major revision of earlier version
  128.            Sept 30, 1984   sm: used \14 for apple symbol in res. file,
  129.                                bracketed OpenDeskAcc with Get and SetPort,
  130.            Oct 11, 1984   sm:  changed FREF, BNDL resources from HEXA
  131.                                   to readable,
  132.                                nested some routines in SKEL,
  133.                                added constants for FILE menu items,
  134.       v2.0 Nov 12, 1984   sm:  made resources pre-loaded and/or purgeable,
  135.                                turned off range-checking,
  136.                                documented no Resume proc passed to
  137.                       InitDialogs,
  138.                                added SetUpMemory:
  139.                                   calls MoreMasters, MaxApplZone,
  140.                                   sets the NIL address to -1,
  141.                                   lots of general memory doc.
  142.                                added a warning about passing doubly-
  143.                                   dereferenced handles,
  144.                                   removed en/disabling of Rattle and 
  145.                                   Frighten items,
  146.       v2.1 Dec 4, 1984    sm:    added menu key handling,
  147.                 put Rattle and Frighten strings in res file,
  148.                 rewrote intro documentation
  149.  
  150.       v2.2 Mar 6, 1985    sm:    converted to % describes,
  151.                 Fixed SKELX for both 2.0 and 3.0 workshop,
  152.                 set the event mask
  153.       
  154.       v2.2C 3/11/85  whj:    converted to Megamax "C"; future Megamax "C"
  155.                 version numbers will have the same version
  156.                 number as the corresponding Pascal version,
  157.                 but with an appended "C".
  158.       
  159.       v2.2.1C 4/1/85 whj:    Added in-place conversion of Pascal strings
  160.                       to C strings for the string resources.  Uses
  161.                 new procedure "initStrRes", included in
  162.                 this file.  This is a kludge required because
  163.                 the RMaker program supplied does not
  164.                 support C-Style strings.  v. 2.0 of Megamax C
  165.                 is different in its handling of string
  166.                 resources than v. 1.2, which necessitated this
  167.                 change.  Strings resources must not be 
  168.                 purgeable for this to work.  
  169.                 
  170.                 Also modified the header file "qdvars.h" which was
  171.                 supplied with Megamax C v. 2.0.  Use the new version
  172.                 in place of the Megamax version; the interface will
  173.                 be similar to the Lisa Pascal interface.
  174.                    
  175.     v.2.2.2C 5/20/85 whj:    Corrected two minor bugs reported on Usenet.
  176.                 The bugs apparently had no effect on the operation
  177.                 of the program.
  178.                    
  179.                 The distribution version of the program has been
  180.                 converted to Inside Macintosh toolbox names using
  181.                 Convert.  To use with Megamax C Compiler, use
  182.                 Convert as distributed with Version 2.0, with the
  183.                 "-L" argument to get a file containing all lowercase
  184.                 toolbox calls.
  185.                 
  186.     v. 2.2.3C 8/1/85 whj:    C-Style strings put into the Resource Fork 
  187.                 following a suggestion of Joel West, of CACI, Inc 
  188.                     (USENET: gould9!joel; ARPANET: gould9!joel@NOSC.ARPA).
  189.                   This uses the RMaker type 'GNRL' to Create 
  190.                    null-terminated strings in the Resource Fork.
  191.                 "initStrRes" kludge eliminated.Special handling 
  192.                 of periods (ASCII 2E) is required.  See skel.r for
  193.                 details.  Thank you, Joel!
  194.  
  195.  
  196.     v. 2.2.3LSC 6/16/86 mrp: Works under Lightspeed C now. Took out
  197.                 "C-style" strings; converted some &points; changed the
  198.                 includes; random others stuff.  Also broke up the source
  199.                 to better fit into Lightspeed's project organization.
  200.  
  201.  
  202. ---
  203.  
  204. v. 3.0i, 1994, LIR
  205.  
  206. In 1994 - 8 years after the last revision above - I digged up these old SKEL
  207. sources again, primarily for testing a C-to-Pascal converter (Dan's Source
  208. converter). Then I thought I could just as well improve on it, make some
  209. minimal modernizations:
  210.  
  211. - WaitNextEvent support
  212. - suspend/resume events
  213. - minimal Apple Event support (i.e. Quit)
  214. - color support, using a "ppat" for filling the window
  215. - Added color icons for the Finder, SIZE and vers resources.
  216.  
  217. All was done without losing backwards compatibility!
  218.  
  219. Some minor changes: TEXT resources were not used, and were removed. I no longer
  220. include a .r file.
  221.  
  222. What is then left? AppleScript support, I guess.
  223.