home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextLibrary / Frameworks / AppKit.framework / Versions / B / Headers / dpsOpenStep.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  5.1 KB  |  195 lines

  1. /*
  2.     dpsOpenStep.h
  3.     
  4.     DPS routines specific to the OpenStep implementation of DPSClient.
  5.     This API is part of OpenStep.
  6.     
  7.     Copyright (c) 1994-1996, NeXT Software, Inc.
  8.     All rights reserved.
  9. */
  10.  
  11. #ifndef DPSOPENSTEP_H
  12. #define DPSOPENSTEP_H
  13.  
  14. #import <AppKit/dpsclient.h>
  15. #import <AppKit/AppKitDefines.h>
  16. #import <Foundation/Foundation.h>
  17.  
  18. /* === Exception names === */
  19.  
  20. APPKIT_EXTERN NSString *DPSPostscriptErrorException;
  21. APPKIT_EXTERN NSString *DPSNameTooLongException;
  22. APPKIT_EXTERN NSString *DPSResultTagCheckException;
  23. APPKIT_EXTERN NSString *DPSResultTypeCheckException;
  24. APPKIT_EXTERN NSString *DPSInvalidContextException;
  25. APPKIT_EXTERN NSString *DPSSelectException;
  26. APPKIT_EXTERN NSString *DPSConnectionClosedException;
  27. APPKIT_EXTERN NSString *DPSReadException;
  28. APPKIT_EXTERN NSString *DPSWriteException;
  29. APPKIT_EXTERN NSString *DPSInvalidFDException;
  30. APPKIT_EXTERN NSString *DPSInvalidTEException;
  31. APPKIT_EXTERN NSString *DPSInvalidPortException;
  32. APPKIT_EXTERN NSString *DPSOutOfMemoryException;
  33. APPKIT_EXTERN NSString *DPSCantConnectException;
  34.  
  35. // DPS exceptions may have two keys in their user info:
  36. //     @"DPSContextExceptionInfo" = An NSValue holding a nonretained 
  37. //            NSDPSContext object for the context involved.
  38. //    @"DPSArg1ExceptionUserInfo" = An NSValue holding a pointer
  39. //            which is actually whatever the first argument 
  40. //            to the dps error proc is for the specific type 
  41. //            of error.
  42.  
  43.  
  44. /*=== CONSTANTS ===*/
  45.  
  46. /* operation types for composite operators */
  47. typedef enum _NSCompositingOperation {
  48.     NSCompositeClear        = 0,
  49.     NSCompositeCopy        = 1,
  50.     NSCompositeSourceOver    = 2,
  51.     NSCompositeSourceIn        = 3,
  52.     NSCompositeSourceOut    = 4,
  53.     NSCompositeSourceAtop    = 5,
  54.     NSCompositeDestinationOver    = 6,
  55.     NSCompositeDestinationIn    = 7,
  56.     NSCompositeDestinationOut    = 8,
  57.     NSCompositeDestinationAtop    = 9,
  58.     NSCompositeXOR        = 10,
  59.     NSCompositePlusDarker    = 11,
  60.     NSCompositeHighlight    = 12,
  61.     NSCompositePlusLighter    = 13
  62. } NSCompositingOperation;
  63.  
  64. /* special values for alpha */
  65. enum {
  66.     NSAlphaEqualToData        = 1,
  67.     NSAlphaAlwaysOne        = 2
  68. };
  69.  
  70. /* types of window backing store */
  71. typedef enum _NSBackingStoreType {
  72.     NSBackingStoreRetained     = 0,
  73.     NSBackingStoreNonretained     = 1,
  74.     NSBackingStoreBuffered     = 2
  75. } NSBackingStoreType;
  76.  
  77. /* ways to order windows */
  78. typedef enum _NSWindowOrderingMode {
  79.     NSWindowAbove         =  1,
  80.     NSWindowBelow         = -1,
  81.     NSWindowOut             =  0
  82. } NSWindowOrderingMode;
  83.  
  84.  
  85. typedef enum _DPSNumberFormat {
  86. #ifdef __BIG_ENDIAN__
  87.     dps_float = 48,
  88.     dps_long = 0,
  89.     dps_short = 32
  90. #else
  91.     dps_float = 48+128,
  92.     dps_long = 0+128,
  93.     dps_short = 32+128
  94. #endif
  95. } DPSNumberFormat;
  96.   /* Constants for DPSDoUserPath describing what type of coordinates are
  97.      being used.  Other legal values are:
  98.  
  99.      For 32-bit fixed point numbers, use dps_long plus the number of bits
  100.      in the fractional part.
  101.  
  102.      For 16-bit fixed point numbers, use dps_short plus the number of bits
  103.      in the fractional part.
  104.   */
  105.  
  106. typedef unsigned char DPSUserPathOp;
  107. enum {
  108.     dps_setbbox = 0,
  109.     dps_moveto,
  110.     dps_rmoveto,
  111.     dps_lineto,
  112.     dps_rlineto,
  113.     dps_curveto,
  114.     dps_rcurveto,
  115.     dps_arc,
  116.     dps_arcn,
  117.     dps_arct,
  118.     dps_closepath,
  119.     dps_ucache
  120. };
  121.   /* Constants for constructing operator array parameter of DPSDoUserPath. */
  122.  
  123. typedef enum _DPSUserPathAction {
  124.     dps_uappend = 176,
  125.     dps_ufill = 179,
  126.     dps_ueofill = 178,
  127.     dps_ustroke = 183,
  128.     dps_ustrokepath = 364,
  129.     dps_inufill = 93,
  130.     dps_inueofill = 92,
  131.     dps_inustroke = 312,
  132.     dps_def = 51,
  133.     dps_put = 120
  134. } DPSUserPathAction;
  135.   /* Constants for the action of DPSDoUserPath.  In addition to these, any
  136.      other system name index may be used.
  137.    */
  138.  
  139. /* a userobject that can be used to pass a PostScript "null" */
  140. enum {
  141.     DPSNullObject = 1
  142. };
  143.  
  144. /*=== PROCEDURES ===*/
  145.  
  146. APPKIT_EXTERN void PSFlush(void);
  147.   /* Flushes the current connection */
  148.  
  149. APPKIT_EXTERN void PSWait(void);
  150.   /* Flushes the current connection, waits for acknowledgement */
  151.  
  152. APPKIT_EXTERN void PSDoUserPath(  
  153.     const void *coords,
  154.     int numCoords,
  155.     DPSNumberFormat numType,
  156.     const DPSUserPathOp *ops,
  157.     int numOps,
  158.     const void *bbox,
  159.     DPSUserPathAction action);
  160. APPKIT_EXTERN void DPSDoUserPath(
  161.     DPSContext context,
  162.     const void *coords,
  163.     int numCoords,
  164.     DPSNumberFormat numType,
  165.     const DPSUserPathOp *ops,
  166.     int numOps,
  167.     const void *bbox,
  168.     DPSUserPathAction action);
  169. APPKIT_EXTERN void PSDoUserPathWithMatrix(  
  170.     const void *coords,
  171.     int numCoords,
  172.     DPSNumberFormat numType,
  173.     const DPSUserPathOp *ops,
  174.     int numOps,
  175.     const void *bbox,
  176.     DPSUserPathAction action,
  177.     float matrix[6]);
  178. APPKIT_EXTERN void DPSDoUserPathWithMatrix(
  179.     DPSContext context,
  180.     const void *coords,
  181.     int numCoords,
  182.     DPSNumberFormat numType,
  183.     const DPSUserPathOp *ops,
  184.     int numOps,
  185.     const void *bbox,
  186.     DPSUserPathAction action,
  187.     float matrix[6]);
  188.   /* Sends a user path to the window server and one other operator.  See DPS
  189.      extensions documentation on encoded user paths.
  190.      Matrix represents the optional matrix argument used by the ustroke,
  191.      inustroke and ustrokepath operators. If matrix is NULL, it is ignored.
  192.    */
  193.  
  194. #endif DPSOPENSTEP_H
  195.