The Saga Continues...

Foundation Development History
Marc Wolfgram

Version 1.0

a1-a10 -The saga begins (16 Jan 91) with original shell definition.
        First we have to build the monster, real alpha starts later!
        Various systems coded and distributed - I'll keep this up to date
        from now on.

d11    -Special Apple release.

d12    -General release with 32 of 34 callbacks.
       -Now opening a copy of */system.setup/sys,resources below each open
        workfile and changed appropriate callbacks to set depth to 2 and
        retry once on an error $1E06 ResNotFound. (Supports app use of
        system resources).

d13    -Modified silly vidswap idler to display swap progress and actions.
       -Fixed problem with fSpecialMagic improperly resolving rItemStructs.
d13a   -Fixed problem with fSpecialMagic ignoring resolution of rControls and
        rControlTemplate resources to handles.
       -Fixed logic fault in returning invalResTypeOrID in fAddPrivateData if
        a native selector passed a null resource ID.
d13b   -Added native selector support to fGetWindowTitle.
d13c   -Fixed setup for REM_WRITE on close to assert the selector bit properly.
d13d   -Fixed addItem error in nameRec item count.
d13e   -Fixed Type window file num display in title.
       -Fixed Save As "Saving somesuchthing??..." bug.

d14-15 -Implemented dependency parent and child dependency support code.
       -Completed delete item support (primarilly to test dependency code.)
       -Added fFindLinkHand callback 36.
       -Added fSpinCursor callback 37.
       -Impemented initial resource "family" copy code for future clipboard

d16    -Removed rStringList as a potential rPString parent and rStringList
        dependency code.  (Don't laugh - study TBR3 appendix page E-61)
   NOTE-Changed fLoadResource callback 3 to use LoadResource2, returning the
        previous state of the resource handle in the special parameter word.
        This changes the documented operation of the special flag:  it is no
        longer valid to ask for a detached load so special is ignored as
        input. All calls to fLoadResource where special was formerly set to
        -1 should now be followed by a call to fDetachResource only if special
        returns $FFFF... any other value indicates an active resource, and a
        copy should be made using subsequent tool calls to GetHandleSize,
        NewHandle and Hand2Hand.
       -Broke closeFile code into 3 calls for future optimize use.
       -Changed the close operation on various window classes as follows if
        the Option key is down:  Selectors (native or standard) will remain
        open and all open editor windows of the selectors type in the current
        file will be closed.  The Root selector will remain open, and all open
        editor and selector windows in the current file will close.
       -Changed About Foundation secret access to Apple, Option, Shift OR
        Control key down (for those who can never find easter eggs :)
d16a   -Type Window popup menuID's now in the $2f0-2ff range (2ff-2f7 for now.
       -fSelectorRequest now works with special set to 0-7 or $2f0-2f7 for ID
        compatability with fSelectorMenu.
       -Type Window popup menu items are now dehilighted as appropriate. (Find
        Parent and Find Dependents are randomly dehilighting - not done in 16a)
       -Fixed Mike's bug in the fAddPrivateData callback where passing a NIL
        value in the remTaskMask would set the shell task mask to NIL.
d16b   -Added "Matt's Alert".
       -Fixed bug in findOwner function.
d16c   -Added old iconButtonControl proc ref value to addChildRef, copyResource
        and remTwiddleSpecial functions.
       -Implemented the new menu setup code.
       -Added DA menu support in the null event code.
       -Changed the fReleaseResource callback to call REM_CLOSE before deleting
        the resource.
       -Various unloader code now locks the link handles during dispose so the
        pointers remain valid.
       -Fixed Type Window popup so the Edit Item and Find xxx are dehlighted in
        640 mode as appropriate.  Also played with fire and setup proper menu
        setup in 320 mode.
       -Resource Name list entry will no longer be selected if it's the first
        item in a root window.
       -Killed the original delete bug (wrong window pointer returned from a
        findSignature summation).
       -Fixed a major "ORCA" in the allocTypeList function!  The handle for a
        Type Window was not correctly being dereferenced: listP = *listH; and
        the resulting list ended up at the right address in the wrong bank.
bug     Fixing this broke the delete in our famous "HyperCard Control Test"
        when attempting to delete a second item.  NOTICE: 1.0b1 was not sent
        to Apple tonight due to this secondary bug!  (Mark will call Tim Wed.)
bug    -The New/Open items are not dehilited now with 4 files open.
d16d   -Replaced all xxxP = *xxxH for complex structrues with deref calls.
       -Tracked down the nasty in opening Hypercard controls (252), Hall of
        Montezuma controls (315), and (wow) coff usertype1s (1117) to be a
        total depletion of stack space due to using the ORCA/C qsort call.
        This calls itself recursively... 252 or 315 or 1117 odd times the stack
        frame doesn't make bank 0 happy.  Rewrote the list member array code
        as an optimized insertion sort, and yes, Bob, you can edit the coff
        usertype1 resources in HexREM!
       -Fixed the new/open enable bug in d16c.
       -Added and removed a "this is the Bundle that Mark built" rBundle for
        foundation... gone because we made Andy's night and found a bug in the
        "no carrier" Finder.
       -Changed the icon reference in the delete's check use window to the Note
        alert in SYS.RESOURCES.  This caused a bug to appear in the deleteItem
        code, hurting the affected Type Window list (and more :).  Fixed this
        and disabled hits on the icon while I was there.
       -Zeroed out the hostType and hostID fields in the nameSubRec arrays as
        they are being generated.  Dependency code is working perfectly now
        (although we never really saw a problem from this).
       -Added the now infamous spinning cursor during name loading, saving and
        list construction (coff usertype1's took over 10 minutes to build the
        Type Window with an earlier worse case insertion sort at 8mhz).

v1.0b1, 25Jan92

       -Native editors now appear in bold text in the Add Type menu.  Scripts
        appear as plain text.
       -Fixed bug in list code to select the first member again and disabled
        resource items with a null resource ID.
       -Fixed a bug introduced in d16d where a spin cursor was left up after
        deleting a single resource.
       -Find xxx in the Type popup now displaying the beta...unimplemented
        feature alert.
       -Updated the shell's version from develop to beta.  Added a comment and
        version resource to Foundation.Data.
       -built the release CD image (HFS partition).

v1.0b2, 27Jan92

       -Fixed a major bug in list rebuilding after a delete.  Indexing was done
        from the new, lower count down to the beginning of the list, rather
        than from the end of the name/nameSub data, causing the index to go
        below the data start during the build.  (Jim Murphy gets a gold star!)
       -Added RemoveResource calls in calls.c and names.c for rResNames loaded
        indirectly by the RMGetResourceName and RMSetResourceName calls.  In
        investigating the Delete Item bug, a resName resource was discovered in
        memory.  Not really a big deal, but I have a 5mb machine.
       -Added Namer support for the standard type selector window (>>Jim). This
        caused a missing operation that was supposed to mark the existing list
        dirty to appear.
       -Fixed the changeItem routine.  It wasn't marking the nameSub data as
        dirty on namer action so the standard selector windows weren't updated.

       -HexREM 1.0b1 - renamed the REM Script resources to comply with the form
        used within the shell.  Also applied a patch to the REM Script script
        to fix an offset bug that crashed and burned.
       -HexREM 1.0b1 - there is a bug in the dispatch cascade operation within
        the code that handles the "No script...continuing with HexEdit" alert.
        For now do not expect sanity if you cascade into HexEdit!  We suggest
        that you use 'Edit using HexEdit' if you aren't sure a script exists.

1.0b3, 28Jan92

       -Noticed menu fatals ($1E06 for PStrings or ItemStructs) related to the
        Type Window popup (draw proc initiated).  Tracked it down to Genesys
        created resources randomly missing the locked and fixed bits in menus
        and menu items.  Fixed!
       -Dave answered the bit 31 bug in SetCursor... the FIRST call in a cursor
        sequence MUST have bit 31 clear. Fixed - flickerless spinning moon!

	RELEASED TO AOL

1.0b4, 30Jan92

       -Replaced the File and Type Window NewWindow2(RefIsResource) calls with
        RefIsHandle and now call remLoadSpecial (fSpecialMagic internal) to do
        the actual resource load/detach resolution.  This kills the root cause
        of the occasional and often fatal $1E06 errors when accessing/opening
        these windows.  Basically, I was using the same resources for all the
        windows of each type, and when one window closed it marked the resources
        as purgable.  All worked well until memory moves or purgable blocks
        expire.  These are the only multiply-used resources in the shell!
       -Sound and ACE Tools are now started.
       -Updated the "secret" About.

	UPDATED AOL
	RELEASED TO GENIE

1.0b5, 3Feb92

       -Added a check to see if the REM has a resource fork to skip corrupted,
        unresourceful editors during shell startup.
       -Fixed bug in fLoadResource where the first byte at the address in the
        resName field would be nulled out even if that field was invalid.  Now
        this only will occur if the resource is unnamed and the pCount includes
        the resName field in the parameter block.
       -Added a "Special" Help window ("Help" opens and closes same) to display
        shell internal information.  This is a debugging window that I should
        have put in here ages ago, but the SoundREM/HexREM dispatch problem has
        forced this now.
bug    -Editing with non-Hex/Script windows does sustain valid editor vectors!
b5a    -Fixed major logic bomb on dispatching to non Hex/Script editors if the
        Hex/Scripr editor was _ever_ called!  The parameter blocks fFlag word
        was being built initially like this: anyoldPB.fFlag |= curMurphy;  The
        problem is obvious now... the hex/script bits were never being cleared
        by curMurphy of 0.  The initialization is now an assignment.
       -Added Task/Modifier data to "Help" in place of the file number (found
        also in the low nibble of the Signature word.)
b5b    -The special "Help" now requires option down to display the internals
        and no longer gets confused after it closes "accidentaly" when the last
        open file is closed.
       -Fixed a bug around the SFGetFile in the Preferences Choose option that
        was introduced when the d61 port bug was fixed.

1.0b6, 17Feb92

       -Optimized MoonCursor code slightly.  Really not worth mentioning.
       -Added a StringList resource (ID 1) containing all the strings that can
        be changed to support localization.  Impelemented a loader that accesses
        the cStrings packaged in pStrings within the StringList, and replaced
        all hard-coded strings with loaded references.
       -Specialized routines to back-reference a parent ControlTemplate from its
        ListRef to determine member size has been extended to support any fork.
       -Added an initial check of the minimum shell parameter of the REM_Start
        resource to make sure things don't break in the future.  Also caught a
        little network problem... editors are global and are now opened read
        only.

1.0b7, 25Feb92

       -Changed Limit Delete Warning preference to Limit Selector Popup action.

	UPDATED AOL AND GENIE - THIS IS ON THE 6.0 GOLDEM MASTER CD

1.0b8, 08Mar92

       -Changed the "...Fork is Improperly Formatted..." Alert.
       -Started clipboard support from the type window. (NOT COMPLETE - but I
        did managed to break some of the menu enable/disable code)
       -Mike found a nice little bug related to New crashing after a compactMem
        call.  I think I found the cause - remLoadSpecial (and thus the shell
        callback fSpecialMagic [action 0 - load] does a great job loading all
        the resources to ref by handle - UNLOCKED.  This is correct, but I need
        to call remTwiddleSpecial fSpecialMagic [action 1 - lock] in a few
        places throughout the shell.)
b8a    -Found, bludgeoned, stabbed, shot, maimed and otherwise molested the
        broken SetupMenu routine.  Menu sanity has been restored.  Now back to
        the clipboard work in progress.

1.0b9, 31Mar92

       -Changed the memory allocation for fLoadFileData to allow bank crossing.
        This was a programmer error, as we don't want to limit REM import to
        a single bank.
       -In working the cut/paste code up a particularly ugly bug was unearthed
        in the fAddResource callback:  The internal AddResource call failed to
        put the correct data in the fork because of a strange combination of
        the Resource Manager calls following it.  This HAS been fixed... note
        that it probably didn't appear with editor io because of the nature
        of the beast.
       -Resource dependency copy/paste now works with these limitations:
           1- Only standard resources are supported (6.0 complete).
           2- The "find owner" code (like in Delete Item) has not been added
              yet, so to get a complete family you must start at the top-most
              resource in the link.
           3- The clipboard window does not show scrap resource info yet.
           4- Our neat "Spinning Moon" wait cursor isn't used during the copy.
        Note that the copy/paste code uses the new ResourceReferenceScrap type
        $8003 of this format:  word         scrapResourceType
                               long         scrapResourceID
                               GSString255  scrapResourceFilePath
       -Changed the menu-enable code to allow Paste to a main file window.
        Code will eventually be added to do this for both the file and type
        windows only if a scrap type $8003 is waiting in the wings.

1.0b10, 13Apr92

       -Fixed several bugs and/or made enhancements in these callbacks:
          fAddResource now asserts the resource changed bit.  We suspect that
            the SetResourceAttr call, which followed the AddResource call,
            was causing all sorts of evil by clearing this bit..
          fCopyResource now uses the dependent resource copy code.  Also fixed
            a bug that ignored the passed target resource file ID.
          fSetResourceAttr now leaves the resource changed bit alone.
          fWriteResource now restores the attributes with the resource changed
            bit cleared.  An unnecessary UpdateResourceFile was removed.
       -Cleaned up root/type copy/paste functions.  (More to do)
       -Show Clipboard now displays type $8001 picture mask scrap correctly
        identifies types $0002 sampled sound, $0064 textedit style, $8002 color
        table and $8003 resource reference scraps.  Type $4945 Icon scraps will
        be added soon and some of those identified may be enhanced.
b10+   -Reinstalled the WriteResource call in fAddResource because preserving
        the res changed bit didn't really work.  Even DTS is wondering why the
        AddResource tool call doesn't always set bit 5!

1.0b11, 22Apr92

       -Changed the message, attributes, clipboard and namer windows per HIG
        to be horizontally centered.  (Matt "TogIIGS" Deatherage)
       -Added "System resource added" alert in fLoadResource callback.
       -Optimize started...

1.0b12, 26May92

       -Make reference file completed.  (Make sure you check out the reference
        format setup under the Preferences item.)
b12+   -Jim "bug killer" Murphy found the root cause of the random save crash
        bug that only I had previously seen.  The key word here is random.
        Thanks are not enough, Jim!
       -Re-segmented the code as the shell is now a freckle under 2 banks of
        pure code.
       -Revised the "localization" string list loader.  All strings except the
        one that blasts to the text screen if the tools fail to load are in
        resources.  (Anyone care to do a Spanish, German, or French version of
        the shells resource based text can contact me :)
       -Optimize completed.  Do you think that a progress thermometer should be
        added?  Check out some large files.

1.0b13, 04Jun92      (The "Jim 'BugFinder' Murphy" Memorial Release)

       -Fixed a bug in Make reference file where items were ignored in the
        output file, then ripped it apart and optimized the heck out of it
        resulting in an unbelievable speed improvement.
       -Fixed the elusive list bug: delete resource + paste resource = trash!
        This puppy was destroying other random data near or in the internal
        type array data, which should take care of other strangeness in shell
        save file operations as well as root list integrity anomolies.
       -Fixed a close bug tied to the "Shell Internals" debugger window. Also
        added a close box to this window.
       -Fixed menu item enabling so that "Paste" does not stay active after
        closing the last root window.
       -Fixed a odd bug where opening two files, naming a resource in the
        first, and then closing the second would dehiglight Save and Save As
        and inhibit opening any more files.
       -Added ctlWantsEvents to the root and type window lists.
       -Fixed a bug that prevented changing an ID to within the system range
        $07FF0000..07FFFFFF.
       -Changed Jim Murphy's AOL address to Jimurphy3.
b13+   -Added return code support in root and type selectors.
       -Fixed reversed parameters to UserShutdown, releasing editors properly
        on close!

           THIS IS THE LAST BETA RELEASE THAT WILL GO IN PUBLIC LIBRARIES!

1.0b14, 20Jun92

       -Improved Delete "alert" window initial button handling.
       -Fixed a bug that appeared with an error opening the Foundation.Data
        preferences which resulted in an eventual failure to close the shell
        resource fork during application shutdown.
       -Added Item Dependents code.  Changed the Type window's Find Parents
        and Find Dependents popup items to Item Dependents.  This now also
        is available in 320 mode now.
       -Fixed error in selecting proper menu for ScriptEdit.
       -Added Export Item code.
CHANGED-Completed the fLoadScrap and fSaveScrap callbacks, and added a new
SEE     callback (38) fCloseResScrap.  All 3 scrap calls use the fResDataRec
b17     parameter block and support the new standard Resource Scrap Type
        $8003.  fLoadScrap and fSaveScrap additionally support all other
        scrap types as well.   To manipulate a scrap other than type $8003,
        only resData and special are significant, with special being input
        defining the scrap type, and resData being the requested or provided
        scrap handle.  To manipulate an $8003 type, things get a bit busier.
        The returned handle from fLoadScrap is not the scrap itself, rather
        a Foundation link handle (see fQueryLinkHand in the docs).  Because
        the actual resource data is contained in an external resource file
        the resource file ID is returned as well, AND THE SCRAP FILE IS LEFT
        OPEN FOR YOUR IMMEDIATE USE!  When you are done using the scrap file
        you MUST issue a fCloseScrapFile call, hopefully before returning to
        the shell.  Just pass the load's parameter block back to the close call.

           For all Scrap Types EXCEPT $8003 Resource Reference Scrap:

                  fLoadScrap           fSaveScrap
         pCount     4                    4
         resType    ignored              ignored
         resID      ignored              ignored
         resData    scrap handle output  scrap handle input
         special    scrap type input     scrap type input

           For $8003 Resource Reference Scrap Only:

                  fLoadScrap           fSaveScrap            fCloseResScrap
          pCount     5                    4                     5
          resType    parent type output   parent type input     ignored
          resID      parent ID output     parent ID input       ignored
          resData    link handle output   ignored               ignored
          special    $8003 input          $8003 input           $8003 input
          resFileID  scrap file output                          scrap file input

1.0b15, 27Jun92

       -Fixed logic bug in Item Dependency code preventing popup dispatch.
       -Fixed a stupid mistake in the main control code where the GrafPort
        wasn't set to the target window correctly (real old bug.)
       -Changed shutdown scrap handling to be scrap count rather than scrap
        state based.
       -Fixed a bug in the Item Dependency draw proc that resolved the item
        link index for item and parents as the selected member, which was
        only correct if the item or parent were selected.
       -Added callback 39, fColorPalette, which presents a modal color picker
        window.  The call uses a fColorRec parameter block:

          pCount   must be 2
          loc      point input - location of the top/left window corner.
          color    0-15 input/result - default and returned color.

       -Started import code - on hold waiting for SFPGetFile info from DTS.
       -Added code to create the Foundation.User folder if it does not exist.

1.0b16, 30Jun92

       -fAddPrivateData has been slightly modified for Jim's ScriptEdit only.
       -fBuildLinkHand needs a pCount of 4 or 8 - I had it coded for 4 or 7!
        (Mike Nuzzi gets credit for making me find this one - Thanks!)
       -Workfiles are now deleted at quit.
       -Import completed per plan 2 (Matt and Dave said I can't do plan 1 yet.)
       -Changed shutdown scrap handling again... now scrap count AND scrap
        state based. (there you go Mike!)

1.0b17, 10Jul92

       -Found a major fubar in fLoadScrap... was pushing a GSString instead of
        its address.  (I still prefer C to assembler).
NOTE   -Removed callback (38) fCloseResScrap.  The scrap type $8003 resource
        file is only open for the duration of the current REM call and is now
        automatically closed by the shell upon return from an editor.
       -Item Dependent's "(No parent)" text is now "dehilighted". TestMemNever
        flag bit is now set in the Item Dependency list control to inhibit bad
        dispatching on a "(No dependents)" double-click.  Added a cute static
        icon (two really) to try and better present the parent/item/dependent
        relationship in the two rects and list.
       -fSpecialMagic now uses a resource depth of -1 so editors (like Jim's)
        can access resource data in Sys.Resources.
       -Added definition for fFlag bit 6 - Changed Help ID for editor help data
        support.  fFlags was already checked upon return from editor calls for
        menu status and the help data now can be updated easilly when required.
       -Added some snazzy code from Jim that updates menubar item 5 without the
        annoying full menuebar flash.  Fixed a similar problem enabling item 4.
       -Fixed a Hex/Script dispatch bug... (lda 0 is not as good as lda #0.)
       -Namer no longer goes nuts with Jim's interrum private windows.
       -Added named resource support in the copy/paste code.  In the process
        fCopyResource was cleaned up a bit and fAddResource will now add names
        to an external file.
       -Help 90% complete (text not done).
       -James Smith discovered that upon opening a default file the proper menu
        items were not all setup.  I fixed this.
       -Added callback (38) fMarquee, to let you animate a dashed b/w outline
        around the RegionHand.  The call format is:

                  fMarquee
        pCount      3
        action      input/output        0 animate, 1 init or 2 kill regions.
        windowPtr   GrafPortPtr         target window
        rgnListHndl rgnListHand         Handle to rgnList structure

        You must set all the region handles you want fMarquee to animate in the
        rgnListHand's list array, also setting rgnListHand's count value to the
        number of region handles.  The index field is maintained by fMarquee.
        Refer to the rgnListHndl structure definition if foundation.h!
       -Changed the Namer support for the description rect at the bottom of the
        current Item Dependency window.
       -Optimize now copies rResourceName resources for the sole purpose of
        preserving res names used as data in a file, even if there are no items
        that directly coorespond to the names.  Foundation uses at least one
        name resource like this, and I suspect that we're not alone.  Normally
        a workfile's resource names accessable within the shell are processed
        only if they are tied to an real item... resName resNames are a special
        case.  Optimize now also sets the file dirty bit.

1.0b18, 11Jul92

       -Removed REM_Help resources.  I thought this one through, and figured I
        was breaking my own rule of using standard resources whenever possible.
        Help data is now referenced in $8016 rText resources.  $7ffe is now
        identified as REM_reserved.
       -Fixed two slight bugs that Jim found in fMarquee.
18b    -Resource Names used to appear dimmed in the File window list, now they
        do not appear at all.  This was done because if a file had no names and
        an item was subsequently named, the dimmed item was never added to the
        list.  Since we don't directly edit rResNames, showing them was mute.
       -Menu setup cleaned for DA windows. (Jeff made me do this :)
       -Paste availabilty with Type and File windows now only if 8003 present.
       -Fixed Help data resolution from an active editor.

1.0b19, 14Jul92

       -Fixed second instance of Help data resolution miscalculation (2 of 2,
        the one fixed in b18 was in activate, this one was in the update help
        handler, and I remembered it earlier today.)
       -Added callback (40) fGetKernalID so editors written for future versions
        can determine the level of callback support.  There is no parameter to
        fGetKernalID, which returns the Foundation shell version in a BCD word.
        Version 1.0 returns $0100 (and version 2.3 would return $0203.)
       -Finished up the help text  (look for spelling and grammer errors - I'm
        starting to fade :)

1.0b20, 16Jul92 (Unless bug reports arrive on this before July 20, this is 1.0)

       -Found and fixed a really strange cascading weirdness in Optimize where
        the shell ended up as the source resource fork after encountering a
        system range resource and electing to remove it in the process.  Note
        that in my defence I didn't find this because I was usually stressing
        Optimize with a copy of the shell's fork.  Jim Murphy wins the "last
        minute major bug discovery" award for this one (although by accident.)
       -Tweaked the fMarquee code because Jim wanted it to run a little faster.
       -Found a lurking grue in the quit code if the Help window was open.
       -Optimized the optimize code.
       -Added and edited more Help data.
       -Rebuilt with #pragma optimize 14 (was -1) to eliminate a potential
        source of ORCA/C long math errors.

1.0, 20Jul82  ******** FINAL 1.0 SHELL ********

       -Final full build with resources optimized and a few last minute tweaks.

1.0, 24Jul92

       -Put a temporary patch in the item dependency window list build code to
        prevent a multiply used item from appearing multiple times as a child
        of the first item that uses it.
       -Disabled ScriptEdit dispatching in the selector menus.

               1.0 WAS INTRODUCED ON 25JULY92 AT APPLE EXPO CENTRAL
