diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1998-08-18 14:54:11 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1998-08-18 14:54:11 (GMT) |
commit | 7cc5735ef26a60df9d1bc3554c1912f951a90308 (patch) | |
tree | 5c391a5a9b8e4f6d1932205d9d8ff1283542caef /Mac/Contrib/osam | |
parent | 1d6a6ea1a819a645a3a8841205b10cf33eb04493 (diff) | |
download | cpython-7cc5735ef26a60df9d1bc3554c1912f951a90308.zip cpython-7cc5735ef26a60df9d1bc3554c1912f951a90308.tar.gz cpython-7cc5735ef26a60df9d1bc3554c1912f951a90308.tar.bz2 |
Initial revision
Diffstat (limited to 'Mac/Contrib/osam')
-rw-r--r-- | Mac/Contrib/osam/OSAm.c | 262 | ||||
-rw-r--r-- | Mac/Contrib/osam/OSAm.exp | 1 | ||||
-rw-r--r-- | Mac/Contrib/osam/OSAm.h | 30 | ||||
-rw-r--r-- | Mac/Contrib/osam/OSAm.prj.hqx | 358 | ||||
-rw-r--r-- | Mac/Contrib/osam/ScriptRunner.c | 289 | ||||
-rw-r--r-- | Mac/Contrib/osam/ScriptRunner.h | 30 |
6 files changed, 970 insertions, 0 deletions
diff --git a/Mac/Contrib/osam/OSAm.c b/Mac/Contrib/osam/OSAm.c new file mode 100644 index 0000000..a9c3445 --- /dev/null +++ b/Mac/Contrib/osam/OSAm.c @@ -0,0 +1,262 @@ +/* + * + * This is a simple module to allow the + * user to compile and execute an applescript + * which is passed in as a text item. + * + * Sean Hummel <seanh@prognet.com> + * 1/20/98 + * RealNetworks + * + * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com> + * + * + */ +#include "OSAm.h" +#include "ScriptRunner.h" +#include <AppleEvents.h> + + + +/* + * Boiler plate generated from "genmodule.py" + */ +static PyObject *ErrorObject; +static char OSAm_DoCommand__doc__[] = ""; + + + +static PyObject * +OSAm_RunCompiledScript (self, args) + PyObject *self; + PyObject *args; +{ + char *commandStr = NULL; + char *outpath = NULL; + OSErr myErr; + AEDesc temp; + EventRecord event; + + temp.dataHandle = NULL; + + if (!PyArg_ParseTuple (args, "s", &commandStr)) + return NULL; + + myErr = ExecuteScriptFile (commandStr, NULL, &temp); + + if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT') + { + char *line; + DescType typeCode; + long dataSize = 0; + + HLock (temp.dataHandle); + + dataSize = GetHandleSize (temp.dataHandle); + + if (dataSize > 0) + { + PyObject *result = PyString_FromStringAndSize ((*temp.dataHandle), + dataSize); + + AEDisposeDesc (&temp); + + if (!result) + { + printf ("OSAm.error Out of memory.\n"); + Py_INCREF (Py_None); + return Py_None; + } + + return result; + } + } + + if (myErr != noErr) + { + PyErr_Mac (ErrorObject, myErr); + return NULL; + } + + + Py_INCREF (Py_None); + return Py_None; +} + + + + +static PyObject * +OSAm_CompileAndSave (self, args) + PyObject *self; + PyObject *args; +{ + char *commandStr = NULL; + char *outpath = NULL; + OSErr myErr; + AEDesc temp; + EventRecord event; + + temp.dataHandle = NULL; + + if (!PyArg_ParseTuple (args, "ss", &commandStr, &outpath)) + return NULL; + + myErr = CompileAndSave (commandStr, outpath, NULL, &temp); + + + if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT') + { + char *line; + DescType typeCode; + long dataSize = 0; + + HLock (temp.dataHandle); + + dataSize = GetHandleSize (temp.dataHandle); + + if (dataSize > 0) + { + PyObject *result = PyString_FromStringAndSize ((*temp.dataHandle), + dataSize); + + AEDisposeDesc (&temp); + + if (!result) + { + printf ("OSAm.error Out of memory.\n"); + Py_INCREF (Py_None); + return Py_None; + } + + return result; + } + + } + + if (myErr != noErr) + { + + PyErr_Mac (ErrorObject, myErr); + return NULL; + } + + + Py_INCREF (Py_None); + return Py_None; +} + + + +static PyObject * +OSAm_CompileAndExecute (self, args) + PyObject *self; + PyObject *args; +{ + char *commandStr; + OSErr myErr; + AEDesc temp; + EventRecord event; + + temp.dataHandle = NULL; + + if (!PyArg_ParseTuple (args, "s", &commandStr)) + return NULL; + + myErr = CompileAndExecute (commandStr, &temp, NULL); + + if (temp.dataHandle != NULL && temp.descriptorType == 'TEXT') + { + char *line; + DescType typeCode; + long dataSize = 0; + + HLock (temp.dataHandle); + + dataSize = GetHandleSize (temp.dataHandle); + + if (dataSize > 0) + { + PyObject *result = PyString_FromStringAndSize ((*temp.dataHandle), + dataSize); + + AEDisposeDesc (&temp); + + if (!result) + { + printf ("OSAm.error Out of memory.\n"); + Py_INCREF (Py_None); + return Py_None; + } + + return result; + } + } + + if (myErr != noErr) + { + + PyErr_Mac (ErrorObject, myErr); + return NULL; + } + + + Py_INCREF (Py_None); + return Py_None; +} + + + +/* + * List of methods defined in the module + */ +static struct PyMethodDef OSAm_methods[] = +{ + {"CompileAndExecute", + (PyCFunction) OSAm_CompileAndExecute, + METH_VARARGS, + OSAm_DoCommand__doc__}, + + {"CompileAndSave", + (PyCFunction) OSAm_CompileAndSave, + METH_VARARGS, + OSAm_DoCommand__doc__}, + + {"RunCompiledScript", + (PyCFunction) OSAm_RunCompiledScript, + METH_VARARGS, + OSAm_DoCommand__doc__}, + + {NULL, (PyCFunction) NULL, 0, NULL} +}; + + + +static char OSAm_module_documentation[] = ""; + + +/* + * PYTHON Module Initalization + */ +void +initOSAm () +{ + PyObject *m, *d; + + /* Create the module and add the functions */ + m = Py_InitModule4 ("OSAm", + OSAm_methods, + OSAm_module_documentation, + (PyObject *) NULL, PYTHON_API_VERSION); + + + /* Add some symbolic constants to the module */ + d = PyModule_GetDict (m); + ErrorObject = PyString_FromString ("OSAm.error"); + PyDict_SetItemString (d, "error", ErrorObject); + + + /* Check for errors */ + if (PyErr_Occurred ()) + Py_FatalError ("can't initialize module OSAm"); +} diff --git a/Mac/Contrib/osam/OSAm.exp b/Mac/Contrib/osam/OSAm.exp new file mode 100644 index 0000000..d567a95 --- /dev/null +++ b/Mac/Contrib/osam/OSAm.exp @@ -0,0 +1 @@ +initOSAm diff --git a/Mac/Contrib/osam/OSAm.h b/Mac/Contrib/osam/OSAm.h new file mode 100644 index 0000000..2fd0469 --- /dev/null +++ b/Mac/Contrib/osam/OSAm.h @@ -0,0 +1,30 @@ +/* + * + * This is a simple module to allow the + * user to compile and execute an applescript + * which is passed in as a text item. + * + * Sean Hummel <seanh@prognet.com> + * 1/20/98 + * RealNetworks + * + * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com> + * + * + */ + +#pragma once + + +/* Python API */ +#include "Python.h" +#include "macglue.h" + + +/* Macintosh API */ +#include <Types.h> +#include <AppleEvents.h> +#include <Processes.h> +#include <Files.h> +#include <Gestalt.h> +#include <Events.h> diff --git a/Mac/Contrib/osam/OSAm.prj.hqx b/Mac/Contrib/osam/OSAm.prj.hqx new file mode 100644 index 0000000..a744952 --- /dev/null +++ b/Mac/Contrib/osam/OSAm.prj.hqx @@ -0,0 +1,358 @@ +(This file must be converted with BinHex 4.0) + +:#%p63@dZF(*U!%e08(*$9dP&!3!!!-f(!*!%llTMEfpX!!!!!`!!!5J!!--A!!$ +%2`!!#8J!!!"M!3)"!*!*3fpNC9GKFR*TEh)J8(*[DQ9MG!#3lJ3!N!N'!3$rr`# +3#2rr!C!&!*!%(J%"!*!)QCN!!$rr2rmrr`%!!!%!#3CYEfjKBfm!N"`%!#J!#J( +#!S!!+!!+!F)#J!#3%!%!!!%!V!&A!4N#HJ$J!!#XC3!!IV-!!!#4!!!!S!!!$1S +!!"!!N!54!'*KFf9XD@jP3DmM*@3!)MSJEA8"!!!'!3!!"`%!!!J"!!!*!3!!#J% +!!!X"!!!$!!!!"`!!!#3"!!!!!3!!#`)!!!-#!!!'!J!!"`)!!!J#!!!*!J!!#J) +!!!X!!!!(!!!!*!)!!!!#!!!,!!!!33!!!'!!!!0T!!!%!*!%33"K!*!%!@%!N!3 +"B3#3"!&K!*!(!3!!!!)!!!!$!!!!"!!!!!8!!!!'!*"d!3!!!`!!!!8!!!!N!3! +!!!%!!!P#Tb!%!!%"!!!"!3!"!!!"!3%!N!S%!*!*"J%!rrm!N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! +!!#*`FQ9Q!%!r(J!!!)d!N!BRK`!!!""`FQ9Q!$pS)J!!!)i!N!C&'3!!!"T`FQ9 +Q!%!J1`!!!)m!N!DK-`!!!**`FQ9Q!$paGJ!!!*!!!*!'4GJ!!!"+F(*PCJ!rGJ8 +!!!#4!*!%H3N!!!: diff --git a/Mac/Contrib/osam/ScriptRunner.c b/Mac/Contrib/osam/ScriptRunner.c new file mode 100644 index 0000000..7fd68f6 --- /dev/null +++ b/Mac/Contrib/osam/ScriptRunner.c @@ -0,0 +1,289 @@ +/* + * + * This is a simple module to allow the + * user to compile and execute an applescript + * which is passed in as a text item. + * + * Sean Hummel <seanh@prognet.com> + * 1/20/98 + * RealNetworks + * + * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com> + * + * + */ + +#include <Resources.h> +#include <Files.h> +#include <OSA.h> +#include <string.h> +#include "ScriptRunner.h" +#include <script.h> +#include <resources.h> + + + +OSAError LoadScriptingComponent (ComponentInstance * scriptingComponent); + + +/* + * store the script as a compile script so that OSA + * components may load and execute the script easily + */ +OSAError +CompileAndSave (const char *text, + const char *outfile, + OSAActiveUPP proc, + AEDesc * result) +{ + + OSAError err2 = 0; + AEDesc theScript; + OSAID compiledScriptID = 0; + ComponentInstance scriptingComponent; + FSSpec outfilespec; + AEDesc theCompiledScript; + OSAID scriptid = kOSANullScript; + short saveres = 0; + + + + /* Initialize theScript here because it is a struct */ + theScript.dataHandle = NULL; + theCompiledScript.dataHandle = NULL; + + + /* open the component manager */ + err2 = LoadScriptingComponent (&scriptingComponent); + if (err2) + return err2; /* <<< Fail quietly?? */ + + + /* construct the AppleEvent Descriptor to contain the text of script */ + AECreateDesc ('TEXT', text, strlen (text), &theScript); + + err2 = OSACompile (scriptingComponent, + &theScript, + kOSAModeCompileIntoContext, + &scriptid); + if (err2) + { + OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result); + goto CleanUp; + } + + + err2 = OSAStore (scriptingComponent, + scriptid, + typeOSAGenericStorage, + kOSAModeCompileIntoContext, + &theCompiledScript); + if (err2) + { + OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result); + goto CleanUp; + } + + + c2pstr (outfile); + FSMakeFSSpec (0, 0, (StringPtr) outfile, &outfilespec); + p2cstr ((StringPtr) outfile); + + FSpDelete (&outfilespec); + + FSpCreateResFile (&outfilespec, 'ToyS', 'osas', smRoman); + + saveres = CurResFile (); + + if (saveres) + { + short myres = 0; + myres = FSpOpenResFile (&outfilespec, fsWrPerm); + + UseResFile (myres); + AddResource (theCompiledScript.dataHandle, 'scpt', 128, "\p"); + CloseResFile (myres); + UseResFile (saveres); + } + + +CleanUp: + + if (theScript.dataHandle) + AEDisposeDesc (&theScript); + + if (theCompiledScript.dataHandle) + AEDisposeDesc (&theCompiledScript); + + if (scriptid) + OSADispose (scriptingComponent, scriptid); + + if (scriptingComponent != 0) + CloseComponent (scriptingComponent); + + + return err2; +} + + +OSAError +CompileAndExecute (const char *text, + AEDesc * result, + OSAActiveUPP proc) +{ + OSAError err2 = 0; + AEDesc theScript; + OSAID compiledScriptID = 0; + ComponentInstance scriptingComponent; + + + /* initialize theScript here because it is a struct */ + theScript.dataHandle = NULL; + + /* Open the component manager */ + err2 = LoadScriptingComponent (&scriptingComponent); + if (err2) + return err2; /* <<< Fail quietly?? */ + + + /* construct the AppleEvent Descriptor to contain the text of script */ + AECreateDesc ('TEXT', text, strlen (text), &theScript); + + + err2 = OSASetActiveProc (scriptingComponent, proc, NULL); + if (err2) + goto CleanUp; + + + err2 = OSADoScript (scriptingComponent, &theScript, kOSANullScript, 'TEXT', 0, result); + if (err2) + { + OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result); + goto CleanUp; + } + + +CleanUp: + + if (theScript.dataHandle) + AEDisposeDesc (&theScript); + + if (scriptingComponent != 0) + CloseComponent (scriptingComponent); + + + return err2; +} + + +/* + * This routine reads in a saved script file and executes + * the script contained within (from a 'scpt' resource.) + */ +OSAError +ExecuteScriptFile (const char *theFilePath, + OSAActiveUPP proc, + AEDesc * result) +{ + OSAError err2; + short resRefCon; + AEDesc theScript; + OSAID compiledScriptID, scriptResultID; + ComponentInstance scriptingComponent; + FSSpec theFile; + + + c2pstr (theFilePath); + FSMakeFSSpec (0, 0, (StringPtr) theFilePath, &theFile); + p2cstr ((StringPtr) theFilePath); + + + /* open a connection to the OSA */ + err2 = LoadScriptingComponent (&scriptingComponent); + if (err2) + return err2; /* <<< Fail quietly?? */ + + + err2 = OSASetActiveProc (scriptingComponent, proc, NULL); + if (err2) + goto error; + + + /* now, try and read in the script + * Open the script file and get the resource + */ + resRefCon = FSpOpenResFile (&theFile, fsRdPerm); + if (resRefCon == -1) + return ResError (); + + theScript.dataHandle = Get1IndResource (typeOSAGenericStorage, 1); + + if ((err2 = ResError ()) || (err2 = resNotFound, theScript.dataHandle == NULL)) + { + CloseResFile (resRefCon); + return err2; + } + + theScript.descriptorType = typeOSAGenericStorage; + DetachResource (theScript.dataHandle); + CloseResFile (resRefCon); + err2 = noErr; + + + /* give a copy of the script to AppleScript */ + err2 = OSALoad (scriptingComponent, + &theScript, + 0L, + &compiledScriptID); + if (err2) + goto error; + + AEDisposeDesc (&theScript); + theScript.dataHandle = NULL; + + + err2 = OSAExecute (scriptingComponent, + compiledScriptID, + kOSANullScript, + 0, + &scriptResultID); + + if (compiledScriptID) + OSAScriptError (scriptingComponent, kOSAErrorMessage, 'TEXT', result); + + if (err2) + goto error; + + /* If there was an error, return it. If there was a result, return it. */ + (void) OSADispose (scriptingComponent, compiledScriptID); + + if (err2) + goto error; + else + goto done; + +error: + if (theScript.dataHandle) + AEDisposeDesc (&theScript); + + +done: + + + return err2; +} + + +OSAError +LoadScriptingComponent (ComponentInstance * scriptingComponent) +{ + OSAError err2; + + /* Open a connection to the Open Scripting Architecture */ + *scriptingComponent = OpenDefaultComponent (kOSAComponentType, + kOSAGenericScriptingComponentSubtype); + + err2 = GetComponentInstanceError (*scriptingComponent); + + return err2; +} diff --git a/Mac/Contrib/osam/ScriptRunner.h b/Mac/Contrib/osam/ScriptRunner.h new file mode 100644 index 0000000..dda7bbb --- /dev/null +++ b/Mac/Contrib/osam/ScriptRunner.h @@ -0,0 +1,30 @@ +/* + * + * This is a simple module to allow the + * user to compile and execute an applescript + * which is passed in as a text item. + * + * Sean Hummel <seanh@prognet.com> + * 1/20/98 + * RealNetworks + * + * Jay Painter <jpaint@serv.net> <jpaint@gimp.org> <jpaint@real.com> + * + * + */ +#pragma once + +#include <OSA.h> + +OSAError CompileAndExecute (const char *text, + AEDesc *result, + OSAActiveUPP proc); + +OSAError CompileAndSave (const char *text, + const char *outfile, + OSAActiveUPP proc, + AEDesc *result); + +OSAError ExecuteScriptFile (const char *theFile, + OSAActiveUPP proc, + AEDesc *result); |