home *** CD-ROM | disk | FTP | other *** search
- /***
- File: LMainCGI.h
-
-
- Contains: <contents>
-
-
- Written by: Ken Wieschhoff
-
-
- Copyright: ©1996 Siren Enterprises, All Rights Reserved.
-
-
- Change History (most recent first):
-
-
-
- <1> 9/5/96 kw Include file for main thread
-
- ***/
-
-
- #include <LApplication.h>
- #include "LCGIStatusWindow.h"
-
- class LThread;
-
-
- class LMainCGIThread : public UMainThread
- {
- public:
- LMainCGIThread();
- protected:
- void SwapContext(Boolean swappingIn);
- };
-
-
- class LMainCGI : public LApplication
- {
-
- public:
-
- LMainCGI();
- virtual ~LMainCGI();
-
- // void RegisterClasses(void);
-
- Boolean ObeyCommand(CommandT inCommand, void *ioParam = nil);
- void FindCommandStatus(CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName);
-
- virtual void HandleAppleEvent(const AppleEvent &inAppleEvent,
- AppleEvent &outAEReply, AEDesc &outResult,
- Int32 inAENumber);
-
- void HandleCGIEvent(const AppleEvent &inAppleEvent,
- AppleEvent &outAEReply, AEDesc &outResult );
-
- virtual void ShowAboutBox();
-
- static LMainCGI *GetApplication(void);
- long GetSleepTime(void) const;
-
-
- static AEIdleUPP sIdleUPP;
- static LCGIStatusThread *sStatusThread;
-
-
- protected:
-
- static LMainCGI *sApplication;
- static LThread *sMainThread;
-
- };
-
- class LCreditThread : public LThread
- {
- public:
- LCreditThread ();
- ~LCreditThread();
-
-
- protected:
-
- // thread execution
- virtual void* Run();
-
- };
-
- static void RunApplication(void);
- pascal void ExitCGI();
- pascal void DrawCredits(DialogPtr theDialog,PicHandle creditsPicture, short *textOffset);
- static pascal Boolean AlertFilterProc(DialogPtr dlog, EventRecord *event, short *item);
- static pascal Boolean AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
-
-
-
-
- //•• Typedefs for the ExitToShell call
- typedef pascal void (*ExitToShellProcPtr)();
-
- //•• Parameter descriptors for Universal Procedure Pointers (UPP)
- enum {
- uppExitToShellProcInfo = kPascalStackBased
- };
-
- //•• Universal ProcPtrs
- #if GENERATINGCFM
-
- // PPC version
- typedef UniversalProcPtr ExitToShellProcUPP;
-
- #define NewExitToShellProc(userRoutine) \
- (ExitToShellProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppExitToShellProcInfo, GetCurrentArchitecture())
-
- #define CallExitToShellProc(userRoutine) \
- CallUniversalProc((UniversalProcPtr)(userRoutine), uppExitToShellProcInfo)
- #else
-
- // 68K version
-
- typedef ExitToShellProcPtr ExitToShellProcUPP;
-
- #define NewExitToShellProc(userRoutine) ((ExitToShellProcUPP) (userRoutine))
-
- #define CallExitToShellProc(userRoutine)(*(userRoutine))()
-
- #endif
-