home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-03-19 | 3.8 KB | 75 lines | [TEXT/MMCC] |
- //------------------------------------------------------------------------------
- // File: main.cp
- // Date: 7/7/94
- // Author: Bretton Wade
- //
- // Description: this file contains the main function, and associated
- // initialization and shutdown functions
- //
- // Copyright: this program, and all the code modules comprising it,
- // are ©1994 Bretton Wade. All rights reserved. No part
- // may be used without the author's expressed written
- // consent.
- //
- //------------------------------------------------------------------------------
-
- #include "menu.h"
- #include "apple event.h"
- #include "event.h"
- #include "colors.h"
- #include "minimum system.h"
- #include "config.h"
-
- //------------------------------------------------------------------------------
- // variables
- //------------------------------------------------------------------------------
- bool gFinished = FALSE; // execution control
-
- //------------------------------------------------------------------------------
- // external functions
- //------------------------------------------------------------------------------
- void InitializeApplication (void); // declare the external function to call
-
- //------------------------------------------------------------------------------
- // StartUp
- //------------------------------------------------------------------------------
- static void StartUp (void) // startup/initialization
- { // begin
- MaxApplZone (); // initalize the heap zone
- InitGraf (&qd.thePort); // initialize quickdraw
- InitFonts (); // initialize fonts
- InitWindows (); // initialize windows
- InitMenus (); // initialize menus
- TEInit (); // initialize text editing
- InitDialogs (0); // initialize dialogs
- InitCursor (); // make the cursor visible, and make it an arrow
- MinimumSystem (); // be sure I have some minimum requirements
- gMouseRgn = NewRgn (); // create the mouse region handle, leave it empty
- InitAppMenus (); // set up the menu bar
- InstallAppleEvents (); // install my apple event handlers
- Configure (); // get the application configuration
- GetHiliteColors (); // get the system hilite colors
- InitializeApplication (); // call the function that initializes the aplication
- } // end
-
- //------------------------------------------------------------------------------
- // shutdown
- //------------------------------------------------------------------------------
- static void ShutDown (void) // cleanup
- { // begin
- ExitToShell (); // leave the application
- } // end
-
- //------------------------------------------------------------------------------
- // main
- //------------------------------------------------------------------------------
- void core_main (void) // main, of course
- { // begin
- StartUp (); // initlaize the application
- while (!gFinished) // until the application is finished
- ProcessOneEvent (); // process events
- ShutDown (); // cleanup after the application
- } // end
-
- //------------------------------------------------------------------------------
-