Inherits from: NSGraphicsContext : NSObject
Conforms to: NSObject
(NSObject)
Declared in: AppKit/NSDPSContext.h
The NSDPSContext class is the programmatic interface to objects
that represent Display PostScript System contexts. A context can
be thought of as a destination 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 FontDirectory
which
is local to that context, plus a SharedFontDirectory
that
is shared across all contexts. There are three built-in dictionaries
in the dictionary stack. From top to bottom, they are userdict, globaldict,
and systemdict. userdict is private to the context, while globaldict
and systemdict are shared by all contexts. globaldict is a modifiable
dictionary containing information common to all contexts. systemdict
is a read-only dictionary containing all the PostScript operators.
At any time there is the notion of the current context. The current context for the current thread may be set using setCurrentContext:.
NSDPSContext objects by default write their output to a specified data 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.
The NSApplication object creates an NSDPSContext by default.
When an NSDPSContext object is created, it creates and manages a DPSContext record. Programmers familiar with the client side C function interface to the Display PostScript System can access the DPSContext record by sending a context 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 DPSContextObject function, as defined in "Client Library Functions". You can then work with the created NSDPSContext object using any of the methods described here.
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 "Types and Constants." Also see the Display PostScript System, Client Library Reference Manual, by Adobe Systems Incorporated, for more details on Display PostScript System error names and their possible causes.
- Initializing a context
- - initWithMutableData:forDebugging:languageEncoding:nameEncoding:textProc:errorProc:
- Testing the drawing destination
- - isDrawingToScreen
- Accessing context data
- - mutableData
- Setting and identifying the current context
- + currentContext
- + setCurrentContext:
- - DPSContext
- Controlling the context
- - flush
- - interruptExecution
- - notifyObjectWhenFinishedExecuting:
- - resetCommunication
- - wait
- Managing returned text and errors
- + stringForDPSError:
- - errorProc
- - setErrorProc:
- - setTextProc:
- - textProc
- Sending raw data
- - printFormat:
- - printFormat:arguments:
- - writeData:
- - writePostScriptWithLanguageEncodingConversion:
- Managing binary object sequences
- - awaitReturnValues
- - writeBOSArray:count:ofType:
- - writeBOSNumString:length:ofType:scale:
- - writeBOSString:length:
- - writeBinaryObjectSequence:length:
- - updateNameMap
- Managing chained contexts
- - chainChildContext:
- - childContext
- - parentContext
- - unchainContext
- Controlling the wait cursor
- - startWaitCursorTimer
- - setWaitCursorEnabled:
- - isWaitCursorEnabled
- Debugging aids
- + areAllContextsOutputTraced
- + areAllContextsSynchronized
- + setAllContextsOutputTraced:
- + setAllContextsSynchronized:
- - isOutputTraced
- - isSynchronized
- - setOutputTraced:
- - setSynchronized:
+ (BOOL)areAllContextsOutputTraced
+ (BOOL)areAllContextsSynchronized
+ (id)currentContext
+ (void)setAllContextsOutputTraced:(BOOL)flag
+ (void)setAllContextsSynchronized:(BOOL)flag
+ (void)setCurrentContext:(NSGraphicsContext *)context
+ (NSString *)stringForDPSError:(const DPSBinObjSeqRec
*)error
- (DPSContext)DPSContext
- (void)awaitReturnValues
- (void)chainChildContext:(NSDPSContext *)child
- (NSDPSContext *)childContext
nil
if none exists.- (DPSErrorProc)errorProc
- (void)flush
- initWithMutableData:(NSMutableData *)data
forDebugging:(BOOL)debug
languageEncoding(DPSProgramEncoding)langEnc
nameEncoding(DPSNameEncoding)nameEnc
textProc:(DPSTextProc)tProc
errorProc:(DPSErrorProc)errorProc
- (void)interruptExecution
- (BOOL)isDrawingToScreen
- (BOOL)isOutputTraced
- (BOOL)isSynchronized
- (BOOL)isWaitCursorEnabled
See Also: PScurrentwaitcursorenabled (function)
- (NSMutableData *)mutableData
- (void)notifyObjectWhenFinishedExecuting:(id <NSDPSContextNotification>)object
- (NSDPSContext *)parentContext
nil
if none exists.- (void)printFormat:(NSString *)format,...
printf
)
and sends it to the context's destination.- (void)printFormat:(NSString *)format
arguments:(va_list)argList
vprintf
)
and sends it to the context's destination.- (void)resetCommunication
- (void)setErrorProc:(DPSErrorProc)proc
- (void)setOutputTraced:(BOOL)flag
- (void)setSynchronized:(BOOL)flag
- (void)setTextProc:(DPSTextProc)proc
- (void)setWaitCursorEnabled:(BOOL)flag
See Also: PSsetwaitcursorenabled (function)
- (void)startWaitCursorTimer
See Also: - setWaitCursorEnabled:
- (DPSTextProc)textProc
- (void)unchainContext
- (void)updateNameMap
- (void)wait
- (void)writeBOSArray:(const void *)data
count:(unsigned int)items
ofType:(DPSDefinedType)type
- (void)writeBOSNumString:(const void *)data
length:(unsigned int)count
ofType(DPSDefinedType)type
scale:(int)scale
- (void)writeBOSString:(const void *)data length:(unsigned
int)bytes
- (void)writeBinaryObjectSequence:(const void
*)data
length:(unsigned int)bytes
- (void)writeData:(NSData *)buf
- (void)writePostScriptWithLanguageEncodingConversion:(NSData
*)buf