home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / errors.h < prev    next >
Encoding:
Text File  |  1992-01-09  |  1.3 GB  |  186 lines

Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
  1. /*
  2.     errors.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. /* Contains error numbers for the appkit. */
  8.  
  9. #ifndef APPKIT_ERROR_H
  10. #define APPKIT_ERROR_H
  11. #ifndef ERROR_H
  12. #import <objc/error.h>
  13. #endif ERROR_H
  14.  
  15. #define NX_APPKIT_ERROR_BASE 3000  /* Kit errors start here.  We get 1000 */
  16. #define NX_APPKITERRBASE 3000       /* historical synonym */
  17.  
  18. #define NX_APP_ERROR_BASE 10000000 /* app defined errors start here */
  19. #define NX_APPBASE 10000000       /* historical synonym */
  20.  
  21. typedef enum _NXAppkitErrorTokens {
  22.     NX_longLine    = NX_APPKIT_ERROR_BASE,  /* Text, line longer than 16384 chars */
  23.     NX_nullSel,        /* Text, operation attempted on empty selection */
  24.     NX_wordTablesWrite,        /* error while writing word tables */
  25.     NX_wordTablesRead,        /* error while reading word tables */
  26.     NX_textBadRead,        /* Text, error reading from file */
  27.     NX_textBadWrite,        /* Text, error writing to file */
  28.     NX_powerOff,        /* poweroff */
  29.     NX_pasteboardComm,        /* communications prob with pbUFrver */
  30.     NX_mallocError,        /* malloc problem */
  31.     NX_printingComm,        /* sending to npd problem */
  32.     NX_abortModal,        /* used to abort modal panels */
  33.     NX_abortPrinting,        /* used to abort printing */
  34.     NX_illegalSelector,        /* bogus selector passed to appkit */
  35.     NX_appkitVMError,        /* error from vm_ call */
  36.     NX_badRtfDirective,
  37.     NX_badRtfFontTable,
  38.     NX_badRtfStyleSheet,
  39.     NX_newerTypedStream,
  40.     NX_tiffError,
  41.     NX_printPackageError,    /* problem loading the print package */
  42.     NX_badRtfColorTable,
  43.     NX_journalAborted,
  44.     NX_draggingError,
  45.     NX_colorUnknown,        /* NXColorList, unknown color name or number */
  46.     NX_colorBadIO,        /* NXColorList file read/write error */
  47.     NX_colorNotEditable,    /* Attempt to change noneditable color list */
  48.     NX_badBitmapParams,        /* Inconsistent set of bitmap params */
  49.     NX_windowServerComm,    /* Communications prob with the window server */
  50.     NX_unavailableFont,        /* no default font could be found */
  51.     NX_PPDIncludeNotFound,    /* Include file in PPD file not found */
  52.     NX_PPDParseError,        /* PPD parsing error */
  53.     NX_PPDIncludeStackOverflow,    /* PPD include files nested too deep */
  54.     NX_PPDIncludeStackUnderflow,/* PPD include file nesting mismatched */
  55.     NX_rtfPropOverflow        /* Rtf property stack overflow */
  56. } NXAppkitErrorTokens;
  57.  
  58. /*
  59.  * The proc called when raised exceptions bubble up to the [Application run]
  60.  * level.
  61.  */
  62. typedef void NXTopLevelErrorHandler(NXHandler *errorState);
  63. extern NXTopLevelErrorHandler *_NXTopLevelErrorHandler;
  64. #define NXSetTopLevelErrorHandler( proc ) (_NXTopLevelErrorHandler = (proc))
  65. #define NXTopLevelErrorHandler() (_NXTopLevelErrorHandler)
  66. extern NXTopLevelErrorHandler NXDefaultTopLevelErrorHandler;
  67.  
  68. /*
  69.  * Mechanism for reporting information on errors.
  70.  */
  71. typedef void NXErrorReporter(NXHandler *errorState);
  72. extern void NXReportError(NXHandler *errorState); 
  73. extern void NXRegisterErrorReporter(int min, int max, NXErrorReporter *proc); 
  74. extern void NXRemoveErrorReporter(int code);
  75.  
  76. #endif APPKIT_ERROR_H
  77. UF/*
  78.     graphics.h
  79.     Application Kit, Release 2.0
  80.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  81. */
  82.  
  83. #import "color.h"
  84.  
  85. /* This file defines the most primitive client graphic structures. */
  86.  
  87. #ifndef GRAPHICS_H
  88. #define GRAPHICS_H
  89.  
  90. #ifndef EVENT_H
  91. #import <dpsclient/dpsfriends.h>
  92. #import <dpsclient/event.h>
  93. #endif EVENT_H
  94.  
  95. #ifndef OBJC_INCL
  96. #import <objc/objc.h>
  97. #endif OBJC_INCL
  98.  
  99. #import <objc/typedstream.h>
  100.  
  101. #define    NX_WHITE    (1.0)
  102. #define    NX_LTGRAY    (2.0/3.0)
  103. #define    NX_DKGRAY    (1.0/3.0)
  104. #define    NX_BLACK    (0.0)
  105.  
  106. typedef struct _NXRect {    /* rectangle */
  107.     NXPoint         origin;
  108.     NXSize          size;
  109. } NXRect;
  110.  
  111. #define    NX_X(aRect)    ((aRect)->origin.x)
  112. #define    NX_Y(aRect)    ((aRect)->origin.y)
  113. #define    NX_WIDTH(aRect)    ((aRect)->size.width)
  114. #define    NX_HEIGHT(aRect)    ((aRect)->size.height)
  115. #define    NX_MAXX(aRect)    ((aRect)->origin.x + (aRect)->size.width)
  116. #define    NX_MAXY(aRect)    ((aRect)->origin.y + (aRect)->size.height)
  117. #define    NX_MIDX(aRect)    (NX_X(aRect)+NX_WIDTH(aRect)/2.0)
  118. #define    NX_MIDY(aRect)    (NX_Y(aRect)+NX_HEIGHT(aRect)/2.0)
  119.  
  120. /* The sides of a rectangle */
  121. #define NX_XMIN    0
  122. #define NX_YMIN    1
  123. #define NX_XMAX    2
  124. #define NX_YMAX    3
  125.  
  126. /*
  127.  * The following values should be used in describing color space of bitmaps.
  128.  */
  129. typedef enum _NXColorSpace { 
  130.     NX_CustomColorSpace = -1,        /* color space from graphics state */
  131.     NX_OneIsBlackColorSpace = 0,    /* monochrome, 1 is black */
  132.     NX_OneIsWhiteColorSpace = 1,    /* monochrome, 1 is white */
  133.     NX_RGBColorSpace = 2,            
  134.     NX_CMYKColorSpace = 5
  135. } NXColorSpace;
  136.  
  137. /*
  138.  * NXWindowDepth defines the values used in setting window depth limits.
  139.  * Use the functions NXBPSFroUFth() and NXColorSpaceFromDepth()
  140.  * to extract colorspace/bps info from an NXWindowDepth.
  141.  */
  142. typedef enum _NXWindowDepth { 
  143.     NX_DefaultDepth = 0,
  144.     NX_TwoBitGrayDepth = 258,
  145.     NX_EightBitGrayDepth = 264,            
  146.     NX_TwelveBitRGBDepth = 516,
  147.     NX_TwentyFourBitRGBDepth = 520
  148. } NXWindowDepth;
  149.  
  150.  
  151. extern NXColor NXReadPixel(const NXPoint *p);
  152. extern void NXCopyBits(int sgnum, const NXRect *sRect, const NXPoint *dPoint);
  153. extern void NXDrawButton(const NXRect *aRect, const NXRect *clipRect);
  154. extern void NXDrawGrayBezel(const NXRect *aRect, const NXRect *clipRect);
  155. extern void NXDrawGroove(const NXRect *aRect, const NXRect *clipRect);
  156. extern NXRect *NXDrawTiledRects(NXRect *boundsRect, const NXRect *clipRect,
  157.         const int *sides, const float *grays, int count);
  158. extern void NXDrawWhiteBezel(const NXRect *aRect, const NXRect *clipRect);
  159. extern void NXEraseRect(const NXRect *aRect);
  160. extern void NXFrameRect(const NXRect *aRect);
  161. extern void NXFrameRectWithWidth(const NXRect *aRect, NXCoord frameWidth);
  162. extern void NXRectClip(const NXRect *aRect);
  163. extern void NXRectClipList(const NXRect *rects, int count);
  164. extern void NXRectFill(const NXRect *aRect);
  165. extern void NXRectFillList(const NXRect *rects, int count);
  166. extern void NXHighlightRect(const NXRect *aRect);
  167. extern void NXRectFillListWithGrays(const NXRect *rects, const float *grays, int count);
  168.  
  169. extern BOOL NXContainsRect(const NXRect *a, const NXRect *b);
  170. extern NXRect *NXDivideRect(NXRect *aRect, NXRect *bRect, NXCoord slice, int edge);
  171. extern BOOL NXEmptyRect(const NXRect *aRect);
  172. extern BOOL NXEqualRect(const NXRect *aRect, const NXRect *bRect);
  173. extern void NXInsetRect(NXRect *aRect, NXCoord dX, NXCoord dY);
  174. extern void NXIntegralRect(NXRect *aRect);
  175. extern NXRect *NXIntersectionRect(const NXRect *aRect, NXRect *bRect);
  176. extern BOOL NXIntersectsRect(const NXRect *aRect, const NXRect *bRect);
  177. extern void NXOffsetRect(NXRect *aRect, NXCoord dX, NXCoord dY);
  178. extern BOOL NXPointInRect(const NXPoint *aPoint, const NXRect *aRect);
  179. extern BOOL NXMouseInRect(const NXPoint *aPoint, const NXRect *aRect, BOOL flipped);
  180. extern void NXSetRect(NXRect *aRect, NXCoord x, NXCoord y, NXCoord w, NXCoord h);
  181. extern NXRect *NXUnionRect(const NXRect *aRect, NXRect *bRect);
  182.  
  183. extern NXColorSpace NXColorSpaceFromDepth (NXWindowDepth depth);
  184. extern int NXBPSFromDepth (NXWindowDepth depUF
  185. extern int NXNumberOfColorComponents (NXColorSpace colorSpace);
  186. extern BOOL NXGetBestDepth (NXW