home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / util / cscriptthread.sit.hqx / CScriptThread / CScriptThread.h < prev    next >
Text File  |  1997-08-13  |  2KB  |  107 lines

  1. /*---------------------------------------------------------------------------
  2.  
  3.     Copyright © 1996 CPTech Ltd. All rights reserved. 
  4.     
  5. -----------------------------------------------------------------------------
  6.  
  7.     PROGRAM DOCUMENTATION
  8.  
  9.     Program Name    : CScriptThread.cp
  10.     Module           : Script execution
  11.      Description        : This module runs an OSA script in a thread.
  12.                        In theory with out errorin on AESend because
  13.                        the events are suspended in communications.
  14.  
  15.     
  16. -----------------------------------------------------------------------------
  17.     REVISION HISTORY
  18. Rev        Date        Who    Description
  19. -----------------------------------------------------------------------------
  20. VCS01    23-OCT-96    CRP    Incept Date
  21.  
  22. -----------------------------------------------------------------------------
  23. */
  24. #ifndef _H_CScriptThread
  25. #define _H_CScriptThread
  26. #pragma once
  27.  
  28.  
  29.  
  30.  
  31. //---------------------------------------------------------------------------
  32. #pragma mark Includes
  33.  
  34. // System headers
  35. #include <OSA.h>
  36.  
  37. // PowerPlant headers
  38. #include <LThread.h>
  39.  
  40. /*
  41. ** If you want this stuff to compile on the PPC then you'll 
  42. ** need these headers and the appropriate libraries from DTS
  43. */
  44. #if GENERATINGCFM
  45. #include "Preserve68KRegsActiveProc.h"                // DTS PPC threaded OSA fudge.
  46. #include "Preserve68KRegsSendProc.h"                // DTS PPC threaded OSA fudge.
  47. #endif
  48.  
  49.  
  50.  
  51. // forward class declarations
  52.  
  53.  
  54. class CScriptThread : public LThread 
  55. {
  56. public:
  57.  
  58.                     CScriptThread(FSSpec &inSpec);
  59.     virtual            ~CScriptThread(void);
  60.     OSErr            CallOldActiveProc(void) const;
  61.  
  62.     OSErr            CallOldSendProc(const AppleEvent    *theAppleEvent,
  63.                                     AppleEvent            *reply,
  64.                                     AESendMode             sendMode,
  65.                                     AESendPriority        sendPriority,
  66.                                     long                timeOutInTicks,
  67.                                     AEIdleUPP            idleProc,
  68.                                     AEFilterUPP            filterProc);
  69.  
  70.     OSErr            TestAEReply(AppleEvent *reply);
  71.  
  72.  
  73.     
  74. protected:
  75.     
  76.     virtual void    *Run(void);
  77.     void            SwapContext(Boolean swappingIn);
  78.     OSErr            SetupOSACallBacks(void);
  79.  
  80.  
  81. private:
  82.     FSSpec                 mFileSpec;
  83.     ComponentInstance    mComponent;
  84.     OSAID                mScriptID;
  85.     OSAID                mResultID;
  86.  
  87.     OSASendUPP            mSendProc;
  88.     Int32                mSendProcRefCon;
  89.  
  90.     OSAActiveUPP        mActiveProc;
  91.     Int32                mActiveProcRefCon;
  92.  
  93.     AppleEvent            mContextAppleEvent;
  94.  
  95.  
  96. #if GENERATINGCFM
  97.     RefRec                    mActiveRefRec;
  98.     RefRec                    mSendRefRec;
  99. #endif
  100.     static OSAActiveUPP        sAEActiveProcUPP;
  101.     static OSASendUPP        sAESendProcUPP;
  102.  
  103.  
  104. };
  105.  
  106. #endif    // _H_CScriptThread
  107.