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 >
Wrap
Text File
|
1997-08-13
|
2KB
|
107 lines
/*---------------------------------------------------------------------------
Copyright © 1996 CPTech Ltd. All rights reserved.
-----------------------------------------------------------------------------
PROGRAM DOCUMENTATION
Program Name : CScriptThread.cp
Module : Script execution
Description : This module runs an OSA script in a thread.
In theory with out errorin on AESend because
the events are suspended in communications.
-----------------------------------------------------------------------------
REVISION HISTORY
Rev Date Who Description
-----------------------------------------------------------------------------
VCS01 23-OCT-96 CRP Incept Date
-----------------------------------------------------------------------------
*/
#ifndef _H_CScriptThread
#define _H_CScriptThread
#pragma once
//---------------------------------------------------------------------------
#pragma mark Includes
// System headers
#include <OSA.h>
// PowerPlant headers
#include <LThread.h>
/*
** If you want this stuff to compile on the PPC then you'll
** need these headers and the appropriate libraries from DTS
*/
#if GENERATINGCFM
#include "Preserve68KRegsActiveProc.h" // DTS PPC threaded OSA fudge.
#include "Preserve68KRegsSendProc.h" // DTS PPC threaded OSA fudge.
#endif
// forward class declarations
class CScriptThread : public LThread
{
public:
CScriptThread(FSSpec &inSpec);
virtual ~CScriptThread(void);
OSErr CallOldActiveProc(void) const;
OSErr CallOldSendProc(const AppleEvent *theAppleEvent,
AppleEvent *reply,
AESendMode sendMode,
AESendPriority sendPriority,
long timeOutInTicks,
AEIdleUPP idleProc,
AEFilterUPP filterProc);
OSErr TestAEReply(AppleEvent *reply);
protected:
virtual void *Run(void);
void SwapContext(Boolean swappingIn);
OSErr SetupOSACallBacks(void);
private:
FSSpec mFileSpec;
ComponentInstance mComponent;
OSAID mScriptID;
OSAID mResultID;
OSASendUPP mSendProc;
Int32 mSendProcRefCon;
OSAActiveUPP mActiveProc;
Int32 mActiveProcRefCon;
AppleEvent mContextAppleEvent;
#if GENERATINGCFM
RefRec mActiveRefRec;
RefRec mSendRefRec;
#endif
static OSAActiveUPP sAEActiveProcUPP;
static OSASendUPP sAESendProcUPP;
};
#endif // _H_CScriptThread