/* executePostScriptData: treats the contents of the NSData it is given as a PostScript program and executes it.
For protection against errors, the PostScript code is interpreted in a context separate from the NSApplication's own context (which is created in the -init method of NSApplication). We first focus on the cache, note the various parameters (global window number, the transformation matrix, and the clip path), and then switch to the alternate context and reapply the parameters to establish a focus on the same area.
Protection against PostScript errors is provided through the use of NS_DURING/NS_HANDLER. If an error occurs, we immediately blast the second context and report the first error encountered. If no errors occur during the execution, then we hang on to the context as it can be reused.
Note that the NSXEPSImageRep class provides a similar (but more powerful) sort of functionality for EPS files. Use that class rather than the code here if you wish to make use of EPS files in your application. This code here is meant for unstructured, short pieces of PostScript code, exactly the kind that Yap encounters...