home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2 / Openstep-4.2-Intel-Developer.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / NSDPSServerContext.h < prev    next >
Text File  |  1996-10-17  |  4KB  |  120 lines

  1. /*
  2.     NSDPSServerContext.h
  3.  
  4.     A DPSContext Object that talks to the NeXT Window Server
  5.     Copyright (c) 1994-1996, NeXT Software, Inc.
  6.     All rights reserved.
  7. */
  8.  
  9. #ifndef STRICT_OPENSTEP
  10.  
  11. #import <AppKit/NSDPSContext.h>
  12. #import <AppKit/AppKitDefines.h>
  13. #import <mach/mach.h>
  14.  
  15. @class NSEvent;
  16.  
  17. /* used with NSRunLoop's performSelector:target:argument:order:modes: */
  18. enum {
  19.     DPSFlushContextRunLoopOrdering = 800000
  20. };
  21.  
  22. typedef struct _DPSTaggedMsg {
  23.     msg_header_t header;
  24.     msg_type_t type;
  25.     int values[2];
  26. } DPSTaggedMsg;
  27.   /* Start of a message passed to DPSSendTaggedMsg. */
  28.  
  29. @interface NSDPSServerContext : NSDPSContext {
  30.  @private
  31.   /* data being parsed, NULL if no valid data */
  32.     char *bufStart;
  33.   /* size of buffer we're parsing if data was ooline, 0 if inline */
  34.     int oolineSize;
  35.   /* parsing ptrs into data buffer */
  36.     char *bufCurr;
  37.     char *bufEnd;
  38.   /* filter routine for events */
  39.     void *eventFunc;
  40.   /* dead key events */
  41.     void *deadDownEvent;
  42.     void *deadUpEvent;
  43.   /* port to get PS messages on */
  44.     NSPort *inPort;
  45.   /* port to send PS messages to */
  46.     NSPort *outPort;
  47.   /* set of flags */
  48.     struct {
  49.       /* do we need to get more data from PS? */
  50.     unsigned int needMoreData:1;
  51.       /* should we free the data pointed to by bufStart? */
  52.     unsigned int freeBufStart:1;
  53.       /* has someone called DPSStartWaitCursorTimer? */
  54.     unsigned int didStartWCTimer:1;
  55.       /* do we owe Window Server a wait cursor ack? */
  56.     unsigned int needsWCAck:1;
  57.       /* perf flag for monitoring Q size */
  58.     unsigned int evQGrowing:1;
  59.       /* pmon sending mode (used by send_data to make pmon events) */
  60.     unsigned int sendMode:4;
  61.     unsigned int reserved:23;
  62.     } flags;
  63.   /* port to receive Pings on */
  64.     NSPort *pingPort;
  65.   /* count of last ping we received */
  66.     int lastPingReceived;
  67.   /* the timestamp of the last event we've handed to the app */
  68.     int eventTimeToAckWC;
  69.   /* the timestamp of the last event we've recevied */
  70.     int lastEventTimeReceived;
  71.   /* ever incrementing count of pings */
  72.     int lastPingSent;
  73.   /* list of asynchronous ping handlers */
  74.     NSMutableArray *asyncPings;
  75.     NSString *hostName;
  76.     NSString *serverName;
  77.     unsigned int _reservedDPSServerContext;
  78. }
  79.  
  80. - initWithHostName:(NSString *)hostName serverName:(NSString *)serverName textProc:(DPSTextProc)textProc errorProc:(DPSErrorProc)errorProc timeout:(NSTimeInterval)timeout secure:(BOOL)secureFlag encapsulated:(BOOL)doEncapsulated;
  81.  
  82. - (NSString *)hostName;
  83. - (NSString *)serverName;
  84.  
  85. - (int)sendPort:(NSPort *)port withAllRights:(BOOL)flag;
  86.  
  87. - (int)sendTaggedMsg:(DPSTaggedMsg *)msg;
  88.  
  89. - (void)sendEOF;
  90.  
  91. - (NSEvent *)nextEventMatchingMask:(unsigned int)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag;
  92. + (NSEvent *)nextEventMatchingMask:(unsigned int)mask untilDate:(NSDate *)expiration inMode:(NSString *)mode dequeue:(BOOL)deqFlag;
  93.  
  94. + (void)setEventCoalescingEnabled:(BOOL)flag;
  95. + (BOOL)isEventCoalescingEnabled;
  96.  
  97. + (void)setDeadKeyProcessingEnabled:(BOOL)flag;
  98. + (BOOL)isDeadKeyProcessingEnabled;
  99.  
  100. + (void)setEventsTraced:(BOOL)flag;
  101. + (BOOL)areEventsTraced;
  102.  
  103. @end
  104.  
  105. APPKIT_EXTERN const char *DPSNameFromTypeAndIndex(short type, int index);
  106.  
  107. APPKIT_EXTERN int DPSDefineUserObject(int index);
  108.   /* Maps a PostScript object to a user object index.  If index is 0, a new
  109.      userobject index is allocated;  otherwise the supplied index is used.
  110.      In either case, the new index for the object is returned.  This index
  111.      can be passed to a pswrap generated function taking a "userobject"
  112.      parameter.  This routine should be called with the object that is
  113.      to be indexed on the top of the operand stack.
  114.   */
  115.  
  116. APPKIT_EXTERN void DPSUndefineUserObject(int index);
  117.   /* Unmaps a previously created user object. */
  118.  
  119. #endif STRICT_OPENSTEP
  120.