home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-03 | 3.4 KB | 163 lines | [TEXT/CWIE] |
- /*
- * Project: SimpleApp
- *
- * Filename: SimpleApp.h
- *
- * Author: Marco Piovanelli
- *
- * Revision History:
- *
- * 1996.05.24 MP created this file
- *
- */
-
-
- // conditional macros
-
- #ifndef SystemSevenOrLater
- #define SystemSevenOrLater 1
- #endif
-
- #ifndef OLDROUTINENAMES
- #define OLDROUTINENAMES 0
- #endif
-
- #ifndef OLDROUTINELOCATIONS
- #define OLDROUTINELOCATIONS 0
- #endif
-
- #ifndef CGLUESUPPORTED
- #define CGLUESUPPORTED 0
- #endif
-
- #ifndef STRICT_WINDOWS
- #define STRICT_WINDOWS 1
- #endif
-
- #ifndef STRICT_MENUS
- #define STRICT_MENUS 1
- #endif
-
- // toolbox #includes
-
- #ifndef __CONDITIONALMACROS__
- #include <ConditionalMacros.h>
- #endif
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
-
- #ifndef __RESOURCES__
- #include <Resources.h>
- #endif
-
- #ifndef __MEMORY__
- #include <Memory.h>
- #endif
-
- #ifndef __WINDOWS__
- #include <Windows.h>
- #endif
-
- #ifndef __MENUS__
- #include <Menus.h>
- #endif
-
- #ifndef __TEXTEDIT__
- #include <TextEdit.h>
- #endif
-
- #ifndef __DIALOGS__
- #include <Dialogs.h>
- #endif
-
- #ifndef __SCRAP__
- #include <Scrap.h>
- #endif
-
- #ifndef __DISKINIT__
- #include <DiskInit.h>
- #endif
-
- #ifndef __APPLEEVENTS__
- #include <AppleEvents.h>
- #endif
-
- #ifndef __AEREGISTRY__
- #include <AERegistry.h>
- #endif
-
- // resource IDs
-
- const SInt16 kMenuBarID = 128 ;
- const SInt16 kWindowTemplateID = 128 ;
-
- // menu IDs
-
- const SInt16 kMenuApple = 1 ;
- const SInt16 kMenuFile = 2 ;
-
- // menu item IDs
-
- const SInt16 kItemAbout = 1 ;
- const SInt16 kItemNew = 1 ;
- const SInt16 kItemOpen = 2 ;
- const SInt16 kItemClose = 4 ;
- const SInt16 kItemSave = 5 ;
- const SInt16 kItemQuit = 7 ;
-
- // other miscellaneous constants
-
- const SInt32 kMoreMasters = 5 ;
- const SInt32 kScrapThreshold = 16 * 1024 ; // 16 KB
- const UInt32 kDefaultSleep = 5 * 60 ; // 5 seconds
-
- // globals
-
- extern Boolean gExiting ;
-
- void main ( ) ;
- OSErr Initialize ( ) ;
- OSErr Finalize ( ) ;
-
- // defined in SimpleAppEvents.c
-
- OSErr InitializeEvents ( ) ;
- void ProcessEvent ( ) ;
- void DoNullEvent ( EventRecord & event ) ;
- void DoMouseDownEvent ( EventRecord & event ) ;
- void DoKeyDownEvent ( EventRecord & event ) ;
- void DoWindowEvent ( EventRecord & event ) ;
- void DoDiskEvent ( EventRecord & event ) ;
- void DoOSEvent ( EventRecord & event ) ;
- void DoHighLevelEvent ( EventRecord & event ) ;
-
- // defined in SimpleAppAEHandlers.c
-
- OSErr GotRequiredParams ( const AppleEvent * ae ) ;
- pascal OSErr HandleOpenApp ( const AppleEvent * ae, AppleEvent * reply, SInt32 refCon ) ;
- pascal OSErr HandleOpenDoc ( const AppleEvent * ae, AppleEvent * reply, SInt32 refCon ) ;
- pascal OSErr HandleQuit ( const AppleEvent * ae, AppleEvent * reply, SInt32 refCon ) ;
-
- // defined in SimpleAppMenus.c
-
- OSErr InitializeMenus ( ) ;
- OSErr PrepareMenus ( ) ;
- OSErr DoMenuChoice ( SInt32 menuChoice ) ;
- OSErr DoDeskAccessory ( SInt16 menuItem ) ;
- OSErr DoAppleChoice ( SInt16 menuItem ) ;
- OSErr DoFileChoice ( SInt16 menuItem ) ;
-
- // defined in SimpleAppWindows.c
-
- OSErr CreateWindow ( const FSSpec * fileSpec ) ;
- OSErr DestroyWindow ( WindowRef macWindow ) ;
- void DoContent ( WindowRef macWindow, Point hitPt, const EventRecord & event ) ;
- void DoDrag ( WindowRef macWindow, Point hitPt, const EventRecord & event ) ;
- void DoGoAway ( WindowRef macWindow, const EventRecord & event ) ;
- void DoZoom ( WindowRef macWindow, SInt16 partCode, const EventRecord & event ) ;
- void DoGrow ( WindowRef macWindow, Point hitPt, const EventRecord & event ) ;
- void DoUpdate ( WindowRef macWindow, RgnHandle invalidRgn ) ;
- void DoActivate ( WindowRef macWindow, Boolean isActivating ) ;
-