crunch@well.UUCP (John Draper) (01/05/89)
Does anyone know the person who moderates the "comp.sys.mac.prog" newsgroup.
I would like to get the Crunched Shell Object oriented system out to the
world.
Greg Dow wrote all of the code, and I talked to him at the BMUG Developers
meeting tonight, and he says that he is placing it into the public domain.
The final copy will come from Greg, and his Email address is posted below,
so you can ask him questions directly. A description of the Crunched
shell follows:
NEWS RELEASE FROM THE PROGRAMMERRS NETWORK:
===========================================
I met with Greg Dow, and both of us have decided to place the LOW
LEVEL CORE of the Crunched Shell into the Public Domain. This includes
26 source code modules, A Resource file, and all the appropriate
headers, and includes a DEMO program witn an implementation of Tear
Off menus, and how to use it. Greg currently has posession of the
code because he wants to add one thing, and do some more QA testing
before publishing it.
I have absulutly NO idea when this will happen, but be expecting it
to show up on one of the BMUG Disks soon, and can be requested through
BMUG Berkeley Macintosh UserGroup.
I don't know if posting something this big on the Networks would cause
nasty flames from the site administrations, but I'm open for suggestions
on how to do it. I suspect we might want to use Stuffit or Packit and
Kermit it?? How does one post things this large??
The Crunched Shell is an implementation of an Object Oriented Programming
model built using standard C, and follows some of the methodology outlined
in the last summers issue of Byte Magazine. The description of the
Object classes described below are:
CApplication - Main Application Object class. Accepts the INIT, RUN
and EXIT messages. Also handles MouseMoved events, and has
built-in capability for cursor changes as the user moves it from
view to View.
CCheckBox - Macintosh Control Checkboxes. Used in Dialogs, and
other User interfaces.
CView - An area or portion of a window. Windows can have many views,
and this is the parent class of all other views listed below.
The WIndow class accepts an ADDVIEW message, which sends an
INSTALL message to a view, which adds it to the List of other
views in a window. See CWindow below for details on the
Window view.
CScrollView - A Scrolling View within a window.
CConsoleView - A Console text output view, for displaying outputted
text within a window.
CDebugger - A Special class used for displaying output, showing entry
into an Object dispatcher function, the messages it recieved,
and Exit from dispatcher. Used for examination of the message
flow.
CError - A General Error handling function that handles Object handling,
User defined, Memory, Resource manager, file manager, and printer
errors.
CFile - Parent class of ALL file classes. Handles SFGetFile, SFPut
file, and all StdFile operations. SubClasses of this class would
handle Specific Application functions, then call "SendSuper" to
send Parent message to bring up StdFile Dialog boxes. Instance
variables are filled with informatin about the file selected by
the user.
CList - Handles LISTS of Objects. For instance, a Window containing
an arbetrary number of Views, would store the View classes in a
List class. Lists are good for Drawing objects, or any time
Multiple objects are use.
CMenu - Menu class, and sub-classes off this class handle Palettes
Tearoffs, or other custom designed menus. Also keeps record of
Last menu item used for THAT menu.
CModelessDialog - Handles Modeless dialog, also gives the programmer
opportunitys to build "DoDialog" functions, and leaves a number of
hooks to treat Modeless Dialogs like windows. It gives you 2 levels
of control, which makes the Dialog Manager almost manageable.
CObject - Parent of ALL objects. Handles INIT, CLONE, and DISPOSE
functions that ALL classes inherit.
COneLiner - A Sub class of a View. Handles ONE LINE of text, drawn
in a window. Used by the Debugger, Console, and text messages.
CPrinter - Handles printing functions to any printer.
CRadioButton - Handles radio buttons used in Dialog boxes, Windows,
etc.
CScrollbar - Standard Mac Scroll bars.
CWindow - Main Window Class. Usually, it isn't necessary to
make a sub-class, because the window class makes NO assumptions
on the particular application. Windows come in 2 flavors:
Floating, and Standard. Floating is good for Tool Palettes,
or other cases where windows must remain active ALL the time.
CWorkSet - Eliminates the necessity for Multiple Inheritance. For
instance a Text Editor would be a WorkSet class. Usually,
workSet classes get all their messages from Menu actions. Each
main application window is an instance of a WorkSet.
There are 4 other modules containing the necessary subroutines, and
an assembly Language implementation of "SendMsg" to reduce the time
penalty for dispatching messages. Dispatcher functions can have
an arbitrary number of arguments.
Also included is an MDEF, and a WDEF used in the Tearoff Menu example.
Complete Source code included as a LightSpeed C Project. Souce code
is WELL COMMENTED, and at the top of each source file, is a summary
of the Messages/Methods each Object can handle.
The Crunched Shell is totally Multi-finder compatable and handles
resume and suspend events, so when you "Shut down" the shell makes
it VERY EASY to close all files. Also, when inter-process
communication ever becomes real, it would be very EASY to add
additional messages to the CApplication class.
ALL of the Crunched Shell will be in Source code form, including
the MDEF and WDEFs. It's also very easy to have Dynamic Binding by
implementing Object classes as special code type resources, that
can be read in as needed.
All Crunched Shell object classes have private internal instance
variables, and the Child class inherits ALL of the instance variables
maintained by the parent.
I plan on releasing a number of products that support this particular
format that Greg has used in it's implementation.
Also included is 3 "Templates" for creating the necessary Object
Source file, header file, and Instance variable template headers.
The Crunched Shell works on LightSpeed C Ver 2.1 or 3.0, and Mac
system 6.0. We are following the rules and guidelines imposed by Apple,
so there shouldn't be any future compatability problems. It uses
either GetNextEvent or WaitNextEvent, depending on system variables
provided by Apple.
Hats off for Mr Greg Dow for doing such a fine job in this project.
and I hope that this might give others the inspiration to build on these
tools other classes for useful Mac Programming.
I encourage every beginner to use it as an example of how to use the
Mac ToolBox.
I have been using it for 6 months now, and it has cut my development
time considerably. I have a collection of about 75 Object classes in
addition to the ones listed above. Perhaps I can get permission from
my employer to release a few into the publis domain. Plus I have added
Multiple Inheritance (Thanx to my Soviet friend who gave me a few "tricks")
John Draper - uunet!acad!well!crunch
Greg Dow - apple!bmug!greg.dow