Inherits From:
NSGraphicsContext : NSObject
Conforms To:
NSObject (NSObject)
Declared In:
AppKit/NSDPSContext.h
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.
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.
areAllContextsOutputTraced
Returns YES if the data flowing between the application's contexts and their destinations is copied to diagnostic output.
areAllContextsSynchronized
Returns YES if all NSPDSContext objects invoke the wait method after sending each batch of output.
currentContext
Returns the id
for the current context of the current thread.
setAllContextsOutputTraced:
(BOOL)flag
Causes the data (PostScript code, return values, and so forth) flowing between the all the application's contexts and their destinations to be copied to diagnostic output.
setAllContextsSynchronized:
(BOOL)flag
Causes the wait
method to be invoked each time an NSDPSContext object sends a batch of output to its destination.
setCurrentContext:
(NSGraphicsContext *)context
Installs context as the current context of the current thread.
stringForDPSError:
(const DPSBinObjSeqRec *)error
Returns a string representation of error.
DPSContext
Returns the corresponding DPScontext.
awaitReturnValues
Waits for all return values from the result table.
chainChildContext:
(NSDPSContext *)child
Links child (and all of it's children) to the receiver as its chained context, a context that receives a copy of all PostScript code sent to the receiver.
childContext
Returns the receiver's child context, or nil
if none exists.
errorProc
Returns the context's error callback function.
flush
Forces any buffered data to be sent to its destination.
initWithMutableData:
(NSMutableData *)dataforDebugging:
(BOOL)debuglanguageEncoding
(DPSProgramEncoding)langEncnameEncoding
(DPSNameEncoding)nameEnctextProc:
(DPSTextProc)tProcerrorProc:
(DPSErrorProc)errorProc
Initializes a newly allocated NSDPSContext that writes its output to data using the language and name encodings specified by langEnc and nameEnc. The callback functions tProc and errorProc handle text and errors generated by the context. If debug is YES, the output is given in human-readable form in which large structures (such as images) may be represented by comments.
interruptExecution
Interrupts execution in the receiver's context.
isDrawingToScreen
Returns YES if the drawing destination is the screen.
isOutputTraced
Returns YES if the data flowing between the application's single context and its destination is copied to diagnostic output.
isSynchronized
Returns whether the wait
method is invoked each time the receiver sends a batch of output to the server.
isWaitCursorEnabled
Returns whether the wait cursor is enabled.
mutableData
Returns the receiver's data object.
notifyObjectWhenFinishedExecuting:
(id)object
Registers object to receive a contextFinishedExecuting
: message when the NSDPSContext's destination is ready to receive more input.
parentContext
Returns the receiver's parent context, or nil
if none exists.
printFormat:
(NSString *)format,...
Constructs a string from format and following string objects (in the manner of printf
) and sends it to the context's destination.
printFormat:
(NSString *)format arguments:
(va_list)argList
Constructs a string from format and argList (in the manner of vprintf
) and sends it to the context's destination.
resetCommunication
Discards any data that hasn't already been sent to its destination.
setErrorProc:
(DPSErrorProc)proc
Sets the context's error callback function to proc.
setOutputTraced:
(BOOL)flag
Causes the data (PostScript code, return values, and so on) flowing between the application's single context and the Display PostScript server to be copied to diagnostic output.
setSynchronized:
(BOOL)flag
Sets whether the wait
method is invoked each time the receiver sends a batch of output to its destination.
setTextProc:
(DPSTextProc)proc
Sets the context's text callback function to proc.
setWaitCursorEnabled:
(BOOL)flag
Sets whether the wait cursor is enabled or disabled according to flag.
See also:
PSsetwaitcursorenabled
(function)
startWaitCursorTimer
Generates a pseudo-event to start wait cursor timer.
See also:
setWaitCursorEnabled:
textProc
Returns the context's text callback function.
unchainContext
Unlinks the child context (and all of it's children) from the receiver's list of chained contexts.
updateNameMap
Updates the context's name map from the client library's name map.
wait
Waits until the NSDPSContext's destination is ready to receive more input.
writeBOSArray:
(const void *)data count:
(unsigned int)items ofType:
(DPSDefinedType)type
Write an array to the context's destination as part of a binary object sequence. The array is taken from data and consists of items items of type type.
writeBOSNumString:
(const void *)data length:
(unsigned int)count ofType
(DPSDefinedType)type scale:
(int)scale
Write a number string to the context's destination as part of a binary object sequenc