home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / Add-Ons / WebSTAR / PPSendPartial CGI / Source / LMainCGI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-06  |  2.6 KB  |  130 lines  |  [TEXT/CWIE]

  1. /***
  2.     File:        LMainCGI.h
  3.  
  4.  
  5.     Contains:    <contents>
  6.  
  7.  
  8.     Written by:    Ken Wieschhoff
  9.  
  10.  
  11.     Copyright:    ©1996 Siren Enterprises, All Rights Reserved.
  12.  
  13.  
  14.     Change History (most recent first):
  15.  
  16.  
  17.  
  18.        <1>     9/5/96  kw     Include file for main thread
  19.  
  20. ***/
  21.  
  22.  
  23. #include    <LApplication.h>
  24. #include     "LCGIStatusWindow.h"
  25.  
  26. class LThread;
  27.  
  28.  
  29. class LMainCGIThread : public UMainThread
  30. {
  31. public:
  32.             LMainCGIThread();
  33. protected:
  34.     void    SwapContext(Boolean swappingIn);
  35. };
  36.  
  37.  
  38. class LMainCGI : public LApplication
  39. {
  40.  
  41.     public:
  42.     
  43.                                 LMainCGI();
  44.         virtual                 ~LMainCGI();
  45.         
  46. //        void                RegisterClasses(void);
  47.         
  48.         Boolean                    ObeyCommand(CommandT inCommand, void *ioParam = nil);
  49.         void                    FindCommandStatus(CommandT inCommand,
  50.                                     Boolean &outEnabled, Boolean &outUsesMark,
  51.                                     Char16 &outMark, Str255 outName);
  52.         
  53.         virtual void            HandleAppleEvent(const AppleEvent &inAppleEvent,
  54.                                     AppleEvent &outAEReply, AEDesc &outResult,
  55.                                     Int32 inAENumber);
  56.  
  57.         void                    HandleCGIEvent(const AppleEvent &inAppleEvent,
  58.                                     AppleEvent &outAEReply, AEDesc &outResult );
  59.  
  60.         virtual void            ShowAboutBox();
  61.     
  62.         static LMainCGI            *GetApplication(void);
  63.         long                    GetSleepTime(void) const;
  64.         
  65.         
  66.         static AEIdleUPP        sIdleUPP;
  67.         static LCGIStatusThread    *sStatusThread;
  68.  
  69.  
  70.     protected:
  71.  
  72.         static LMainCGI            *sApplication;
  73.         static LThread            *sMainThread;
  74.     
  75. };
  76.  
  77. class LCreditThread : public LThread
  78. {
  79.     public:
  80.         LCreditThread ();
  81.         ~LCreditThread();
  82.  
  83.  
  84.     protected:
  85.  
  86.         // thread execution
  87.         virtual void*    Run();
  88.  
  89. };
  90.  
  91. static void                RunApplication(void);
  92. pascal void             ExitCGI();
  93. pascal void             DrawCredits(DialogPtr theDialog,PicHandle creditsPicture, short *textOffset);
  94. static pascal Boolean    AlertFilterProc(DialogPtr dlog, EventRecord *event, short *item);
  95. static pascal Boolean    AEIdleProc(EventRecord *theEvent, long *sleepTime, RgnHandle *mouseRgn);
  96.  
  97.  
  98.  
  99.  
  100. //•• Typedefs for the ExitToShell call
  101. typedef pascal void (*ExitToShellProcPtr)();
  102.  
  103. //•• Parameter descriptors for Universal Procedure Pointers (UPP)
  104. enum {
  105.     uppExitToShellProcInfo = kPascalStackBased
  106. };
  107.  
  108. //•• Universal ProcPtrs 
  109. #if GENERATINGCFM
  110.  
  111.     // PPC version
  112.     typedef UniversalProcPtr ExitToShellProcUPP;
  113.  
  114.     #define NewExitToShellProc(userRoutine)        \
  115.         (ExitToShellProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppExitToShellProcInfo, GetCurrentArchitecture())
  116.  
  117.     #define CallExitToShellProc(userRoutine)        \
  118.             CallUniversalProc((UniversalProcPtr)(userRoutine), uppExitToShellProcInfo)
  119. #else
  120.  
  121. // 68K version
  122.  
  123.     typedef ExitToShellProcPtr ExitToShellProcUPP;
  124.  
  125.     #define NewExitToShellProc(userRoutine)    ((ExitToShellProcUPP) (userRoutine))
  126.  
  127.     #define CallExitToShellProc(userRoutine)(*(userRoutine))()
  128.  
  129. #endif
  130.