This is NSDPSContext.rtf in view mode; [Download] [Up]
paperh18648 margl-907 margr0 margt0 margb0 fi0 ri0 ql sb0 f1 fs24 Copyright f3 'e3f1 1994 by NeXT Computer, Inc. All Rights Reserved. s4 li100 fi0 ri0 ql gray409cf7f0 b fs84 fs20 fs84 3 fs48 fs84 s5 li0 fi756 fi0 ri1007 gray0cf0f1 b0 i fs88 Display PostScript fs120 fs88 s0 li100 fi-756 fi0 f0 b i0 fs52 Classes fs28 fs52 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs28 Classes listed here and the protocol in the following section constitute OpenStep'27s object-oriented interface to the Display PostScript System. As such, many of the argument and return types that appear below (specifically, those having a 'aaDPS'ba prefix) are not described in this document. Rather, they are detailed in the specification for the Display PostScript System itself, as found in the i Display PostScript System, Client Library Reference Manuali0 , by Adobe Systems Incorporated. fs16 fs28 pard s6 li100 fi0 ri1007 ql f0 b fs36 fs84 fs36 NSDPSContext pard s13 li2872 fi-2771 ri1007 ql tx2872 f1 b0 fs28 fs48 fs28 f0 b fs24 Inherits From:tab b0 fs28 f1 NSObject fs20 fs28 s8 f0 b fs24 Conforms To:tab b0 fs28 f1 NSObject (NSObject) fs20 fs28 s9 f0 b fs24 Declared In:tab b0 fs28 f1 DPSClient/NSDPSContext.h fs20 fs28 pard s18 li100 fi0 ri1007 ql f0 b fs28 fs20 fs28 Class Description fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 The NSDPSContext class is the programmatic interface to objects that represent Display PostScript System i contextsi0 . A context can be thought of as a i destinationi0 to which PostScript code is sent for execution. Each Display PostScript context contains its own complete PostScript environment including its own local VM (PostScript Virtual Memory). Every context has its own set of stacks, including an operand stack, graphics state stack, dictionary stack, and execution stack. Every context also contains a b FontDirectoryb0 which is local to that context, plus a b SharedFontDirectoryb0 that is shared across all contexts. There are three built-in dictionaries in the dictionary stack. From top to bottom, they are b userdictb0 , b globaldictb0 , and b systemdictb0 . b userdictb0 is private to the context, while b globaldictb0 and b systemdictb0 are shared by all contexts. b globaldictb0 is a modifiable dictionary containing information common to all contexts. b systemdictb0 is a read-only dictionary containing all the PostScript operators. fs16 fs28 At any time there is the notion of the i current contexti0 . The current context for the current thread may be set using b setCurrentContext:. fs16 fs28 b0 NSDPSContext objects by default write their output to a specified i datai0 destination. This is used for printing, FAXing, and for generation of saved EPS (Encapsulated PostScript) code. The means to create contexts that interact with displays are platform-specific. fs16 fs28 The NSApplication object creates a context by default. fs16 fs28 pard s18 li100 fi0 ri1007 ql f0 b fs24 fs28 NSDPSContext Objects and Display PostScript System Context Records fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 When an NSDPSContext object is created, it creates and manages a i DPSContexti0 record. Programmers familiar with the client side C function interface to the Display PostScript System can access the DPSContext record by sending a b contextb0 message to an NSDPSContext object. You can then operate on this context record using any of the functions or single operator functions defined in the Display PostScript System client library. Conversely, you can create an NSDPSContext object from a DPSContext record with the b DPSContextObject() b0 function, as defined in 'aaClient Library Functions'ba. You can then work with the created NSDPSContext object using any of the methods described here. fs16 fs28 pard s18 li100 fi0 ri1007 ql f0 b fs24 fs28 General Exception Conditions fs14 fs28 pard s1 li477 fi0 ri1007 ql tx2494 tx2872 tx3250 f1 b0 fs2 fs28 A variety of exceptions can be raised from NSDPSContext. In most cases, exceptions are raised because of errors returned from the Display PostScript Server. Exceptions are listed under 'aaTypes and Constants.'ba Also see the i Display PostScript System, Client Library Reference Manuali0 , by Adobe Systems Incorporated, for more details on Display PostScript System error names and their possible causes. fs16 fs28 pard s18 li100 fi0 ri1007 ql f0 b fs24 fs28 Initializing a Context fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} b initWithMutableData:b0 (NSMutableData *)i datai0 tab Initializes a newly allocated NSDPSContext that writes its s11 li7030 fi-6553 fi-5796 b forDebugging:b0 (BOOL)i debugi0 tab tab output to i datai0 using the language and name encodings b languageEncoding:b0 (DPSProgramEncoding)i langEnci0 tab b nameEcoding:b0 (DPSNameEncoding)i nameEnci0 tab tab specified by i langEnci0 and i nameEnci0 . The callback b textProc:b0 (DPSTextProc)i tProci0 tab tab functions i tProci0 and i errorProci0 handle text and errors b errorProc:b0 (DPSErrorProc)i errorProci0 tab tab generated by the context. If i debugi0 is YES, the output is given in human-readable form in which large structures fi0 (such as images) may be represented by comments. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Testing the Drawing Destination fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (BOOL)b isDrawingToScreenb0 tab Returns YES if the drawing destination is the screen. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Accessing Context Data fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (NSMutableData *)b mutableDatab0 tab Returns the receiver'27s data object. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Setting and Identifying the Current Context fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSDPSContext *)b currentContextb0 tab Returns the current context of the current thread. fi-6552 fs16 fs28 fi-6552 + (void)b setCurrentContext:b0 (NSDPSContext *)i context s11 li7030 fi-6553 fi-5796 i0 tab Installs i contexti0 as the current context of the current thread. s10 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (DPSContext)b DPSContextb0 tab Returns the corresponding DPScontext. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Controlling the Context fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b flushb0 tab Forces any buffered data to be sent to its destination. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b interruptExecutionb0 tab Interrupts execution in the receiver'27s context. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b notifyObjectWhenFinishedExecuting:b0 (id <NSDPSContextNotification>)i object s11 li7030 fi-6553 fi-5796 i0 tab Registers i objecti0 to receive a b contextFinishedExecutingb0 : message when the NSDPSContext'27s destination is ready to receive more input. s10 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b resetCommunicationb0 tab Discards any data that hasn'27t already been sent to its destination. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b waitb0 tab Waits until the NSDPSContext'27s destination is ready to receive more input. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing Returned Text and Errors fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (NSString *)b stringForDPSError:b0 (const DPSBinObjSeqRec *)i errori0 tab s11 li7030 fi-6553 fi-5796 tab Returns a string representation of i errori0 . s10 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (DPSErrorProc)b errorProcb0 tab Returns the context'27s error callback function. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setErrorProc:b0 (DPSErrorProc)i proci0 tab Sets the context'27s error callback function to i proci0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setTextProc:b0 (DPSTextProc)i proci0 tab Sets the context'27s text callback function to i proci0 . fi-6552 fs16 fs28 fi-6552 {f3 -} (DPSTextProc)b textProcb0 tab Returns the context'27s text callback function. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Sending Raw Data fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b printFormat:b0 (NSString *)i format,...i0 tab Constructs a string from i formati0 and following string objects (in the manner of b printf()b0 ) and sends it to the context'27s destination. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b printFormat:b0 (NSString *)i formati0 tab Constructs a string from i formati0 and i argListi0 (in the s11 li7030 fi-6553 fi-5796 b arguments:b0 (va_list)i argListi0 tab tab manner of b vprintf()b0 ) and sends it to the context'27s destination. s10 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b writeData:b0 (NSData *)i bufi0 tab Sends the PostScript data in i bufi0 to the context'27s destination. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b writePostScriptWithLanguageEncodingConversion:b0 (NSData *)i buf s11 li7030 fi-6553 fi-5796 i0 tab Writes the PostScript data in i bufi0 to the context'27s destination. The data, formatted as plain text, encoded tokens, or a binary object sequence, is converted as necessary depending on the language encoding of the receiving context. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing Binary Object Sequences fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b awaitReturnValuesb0 tab Waits for all return values from the result table. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b writeBOSArray:b0 (const void *)i datai0 tab Write an array to the context'27s destination as part of a s11 li7030 fi-6553 fi-5796 b count:b0 (unsigned int)i itemsi0 tab tab a binary object sequence. The array is taken from i datai0 b ofType:b0 (DPSDefinedType)i typei0 tab tab and consists of i itemsi0 items of type i typei0 . s10 li7029 fi-5794 fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b writeBOSNumString:b0 (const void *)i datai0 tab Write a number string to the context'27s destination as part of s11 li7030 fi-6553 fi-5796 b length:b0 (unsigned int)i counti0 tab tab a binary object sequence. The string is taken from i data i0 b ofType:b0 (DPSDefinedType)i typei0 tab tab as described by i counti0 , i type,i0 and i scale. i0 b scale:b0 (int)i scale s10 li7029 fi-5794 fi-6552 i0 fs16 fs28 fi-6552 {f3 -} (void)b writeBOSString:b0 (const void *)i datai0 tab Write a string to the context'27s destination as part of a s11 li7030 fi-6553 fi-5796 b length:b0 (unsigned int)i bytesi0 tab tab binary object sequence. The string is taken from i bytesi0 (a count)i i0 of i data. s10 li7029 fi-5794 fi-6552 i0 fs16 fs28 fi-6552 {f3 -} (void)b writeBinaryObjectSequence:b0 (const void *)i datai0 tab s11 li7030 fi-6553 fi-5796 b length:b0 (unsigned int)i bytesi0 tab Write a binary object sequence to the context'27s destination. The sequence consists of i bytesi0 (a count) of i data. s10 li7029 fi-5794 fi-6552 i0 fs16 fs28 fi-6552 {f3 -} (void)b updateNameMapb0 tab Updates the context'27s name map from the client library'27s name map. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Managing Chained Contexts fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 {f3 -} (void)b chainChildContext:b0 (NSDPSContext *)i childi0 tab Links i childi0 (and all of it'27s children) to the receiver as its chained context, a context that receives a copy of all PostScript code sent to the receiver. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSDPSContext *)b childContextb0 tab Returns the receiver'27s child context, or b nilb0 if none exists. fi-6552 fs16 fs28 fi-6552 {f3 -} (NSDPSContext *)b parentContextb0 tab Returns the receiver'27s parent context, or b nilb0 if none exists. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b unchainContextb0 tab Unlinks the child context (and all of it'27s children) from the receiver'27s list of chained contexts. pard s18 li100 fi0 ri1007 ql f0 b fs48 fs28 Debugging Aids fs14 fs28 pard s10 li7029 fi-6552 ri1007 ql tx6652 tx7030 f1 b0 fs2 fs28 fi-6552 + (BOOL)b areAllContextsOutputTracedb0 tab Returns YES if the data flowing between the application'27s contexts and their destinations is copied to diagnostic output. fi-6552 fs16 fs28 fi-6552 + (BOOL)b areAllContextsSynchronizedb0 tab Returns YES if all NSPDSContext objects invoke the b waitb0 method after sending each batch of output. fi-6552 fs16 fs28 fi-6552 + (void)b setAllContextsOutputTraced:b0 (BOOL)i flagi0 tab Causes the data (PostScript code, return values, etc.) flowing between the all the application'27s contexts and their destinations to be copied to diagnostic output. fi-6552 fs16 fs28 fi-6552 + (void)b setAllContextsSynchronized:b0 (BOOL)i flagi0 tab Causes the b waitb0 method to be invoked each time an NSDPSContext object sends a batch of output to its destination. fi-6552 fs16 fs28 fi-6552 {f3 -} (BOOL)b isOutputTracedb0 tab Returns YES if the data flowing between the application'27s single context and its destination is copied to diagnostic output. fi-6552 fs16 fs28 fi-6552 {f3 -} (BOOL)b isSynchronizedb0 tab Returns whether the b waitb0 method is invoked each time the receiver sends a batch of output to the server. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setOutputTraced:b0 (BOOL)i flagi0 tab Causes the data (PostScript code, return values, etc.) flowing between the application'27s single context and the Display PostScript server to be copied to diagnostic output. fi-6552 fs16 fs28 fi-6552 {f3 -} (void)b setSynchronized:b0 (BOOL)i flagi0 tab Sets whether the b waitb0 method is invoked each time the receiver sends a batch of output to its destination. fi-6552 fs16 fs28 fi-6552 }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.