home *** CD-ROM | disk | FTP | other *** search
- /*
- File: BigEasy.h
-
- Contains: Prototypes for BigEasy
-
- Written by: The Utility Muffin Research Kitchen
-
- Copyright: © 1991-1992 by Apple Computer, Inc., all rights reserved.
-
- Change History (most recent first):
-
- <10> 4/11/92 JDR Removed anything necessary for the SADISM project, and added
- other things from the file Utilities.h which was removed from
- the project.
- <9> 3/26/92 JDR Added the AssertErr macro.
- <8> 3/24/92 JDR Corrected the names of the exception macros.
- <7> 2/16/92 JDR Conditional for the Think C MacHeaders or MPW's MacHeaders.
- Created the exception macros.
- <6> 1/16/92 JDR Using MacHeaders instead of all those includes to make builds go
- faster. Adding the debugging macros.
- <5> 12/19/91 JDR Don't need to add the define for DEBUG here, but using the
- prefix page of ThinkC instead.
- <4> 12/4/91 JDR Need to add the define for DEBUG
- <3> 11/15/91 JDR Changed the event loop to call idle procs. Made a global sleep
- parameter to adjust the idle time.
- <2> 10/16/91 JDR Added a WIND version of InstallWindow, and change the parameters
- to the event handlers.
- <1> 9/17/91 KIP first checked in
- To Do:
- */
-
- #pragma once
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // contants
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- // this is the standard sleep value for typical event loop
- #define kStandardSleep 1
-
- // this is the faster sleep value for tight and fast event looping
- #define kFastEventPolling 0
-
- #define kButtonFrameSize 3 /* button frame’s pen size */
- #define kButtonFrameInset (-4) /* inset rectangle adjustment around button */
-
- #define kControlInvisible 0
- #define kControlVisible 0xFF
- #define kCntlActivate 0 /* enabled control’s hilite state */
- #define kCntlDeactivate 0xFF /* disabled control’s hilite state */
- #define kCntlOn 1 /* control’s value when truned on */
- #define kCntlOff 0 /* control’s value when truned off */
- #define kSelect 1 /* select the control */
- #define kDeselect 0 /* deselect the control */
-
- #define kDelayTime 8 /* For the delay time when flashing the
- menubar and highlighting a button.
- 8/60ths of a second*/
-
- #define kSelectionDelay 30 /* number of ticks the icon is being selected
- before we condiser it being a mode switch */
-
- #define charBackspace '\b' /* ASCII code for Backspace character */
- #define charClear '\033' /* ASCII code for Clear key (aka ESC) */
- #define charDown '\037' /* ASCII code for down arrow */
- #define charEnd '\004' /* ASCII code for the End key */
- #define charEnter '\003' /* ASCII code for Enter character */
- #define charEscape '\033' /* ASCII code for Escape (aka Clear) key */
- #define charFunction '\020' /* ASCII code for any function key */
- #define charFwdDelete '\177' /* ASCII code for forward delete */
- #define charHelp '\005' /* ASCII code for Help key */
- #define charHome '\001' /* ASCII code for the Home key */
- #define charLeft '\034' /* ASCII code for left arrow */
- #define charPageDown '\f' /* ASCII code for Page Down key */
- #define charPageUp '\013' /* ASCII code for Page Up key */
- #define charReturn '\r' /* ASCII code for Return character */
- #define charRight '\035' /* ASCII code for right arrow */
- #define charSpace ' ' /* ASCII code for Space character */
- #define charTab '\t' /* ASCII code for Tab character */
- #define charUp '\036' /* ASCII code for up arrow */
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // types
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
- struct WindowTemplate { /*template to a WIND resource*/
- Rect boundsRect;
- short procID;
- Boolean visible;
- Boolean filler1;
- Boolean goAwayFlag;
- Boolean filler2;
- long refCon;
- Str255 title;
- };
- typedef struct WindowTemplate WindowTemplate;
- typedef WindowTemplate *WindowTPtr, **WindowTHndl;
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // applications globals
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- extern Boolean gQuitApp;
- extern long gSleepTime;
- extern long gLastMenuSelect;
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Macros
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- // this is much better than the toolbox calls
- #define HiWrd(aLong) (((aLong) >> 16) & 0xFFFF)
- #define LoWrd(aLong) ((aLong) & 0xFFFF)
-
-
-
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- // Method Defintions
- //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
- typedef void (*IFP)(void); /* Integer Function Pointer */
-
- typedef void (*UpdateProc)(Ptr globals);
- typedef void (*ClickProc)(Ptr globals, Point p, short mods, long when);
- typedef void (*GrowProc)(Ptr globals, Point p, short mods);
- typedef void (*KeyProc)(Ptr globals, long k, short mods);
- typedef void (*CloseProc)(Ptr globals);
- typedef void (*DeathProc)(Ptr globals);
- typedef void (*ActivateProc)(Ptr globals);
- typedef void (*DeactivateProc)(Ptr globals);
- typedef void (*LoopyProc)(Ptr globals);
-
- /* Default Methods */
-
- void DefaultUpdate(Ptr globals);
- void DefaultClick(Ptr globals, Point p, short mods, long when);
- void DefaultGrow(Ptr globals, Point p, short mods);
- void DefaultKey(Ptr globals, long k, short mods);
- void DefaultClose(Ptr globals);
- void DefaultDeath(Ptr globals);
- void DefaultActivate(Ptr globals);
- void DefaultDeactivate(Ptr globals);
- void DefaultLoopy(Ptr globals);
- void pnull(void);
-
- Ptr InstallWindow(Rect *iRect, short iType, Boolean iGoway, unsigned char *iTitle,
- UpdateProc iUpdate, ClickProc iClick, GrowProc iGrow, KeyProc iKey, CloseProc iClose, DeathProc iDeath,
- ActivateProc iActivate, DeactivateProc iDeactive, LoopyProc iLoopy, long iGlobalsSize,
- WindowPtr *thisWindowPtr);
- Ptr GetInstallWindow(short windID, UpdateProc iUpdate, ClickProc iClick, GrowProc iGrow,
- KeyProc iKey, CloseProc iClose, DeathProc iDeath, ActivateProc iActivate, DeactivateProc iDeactive,
- LoopyProc iLoopy, long iGlobalsSize, WindowPtr *thisWindowPtr);
- Ptr InstallDialog(short iResID, ClickProc iClick, CloseProc iClose, long iGlobalsSize,
- DialogPtr *thisWindowPtr);
- void UninstallWindow(WindowPtr uWindow);
- void UninstallDialog(DialogPtr uDialog);
- void DoCloseWindow(void);
- void DoQuit(void);
-
- void InstallMenu(Str255 s);
- void InstallItem(Str255 s, IFP action);
- void InstallEditMenu(IFP Xundo, IFP Xcut, IFP Xcopy, IFP Xpaste, IFP Xclear);
-
-
- void Bootstrap(void);
- void CopyStr(Str255 source, Str255 dest);
- void AppendStr(Str255 source, Str255 dest);
- void TrapError(Str255 s, OSErr err, Boolean breakIt, Boolean fatal);
- Ptr GetWindowStorage(WindowPtr w);
-