home *** CD-ROM | disk | FTP | other *** search
/ OpenStep 4.2J (Developer) / os42jdev.iso / NextDeveloper / OpenStepConversion / IntermediateFrameworks3 / AppKit.framework / Headers / NSGraphics.h < prev    next >
Text File  |  1995-01-16  |  5KB  |  89 lines

  1. /*
  2.     NSGraphics.h
  3.     Application Kit
  4.     Copyright (c) 1994, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <Foundation/Foundation.h> 
  8. #import "dpsclient.h"
  9.  
  10. @class NSColor;
  11.  
  12. /* Predefined colorspace names.
  13. */
  14. extern NSString *NSCalibratedWhiteColorSpace;    /* 1.0 == white */
  15. extern NSString *NSCalibratedBlackColorSpace;    /* 1.0 == black */
  16. extern NSString *NSCalibratedRGBColorSpace;
  17. extern NSString *NSDeviceWhiteColorSpace;    /* 1.0 == white */
  18. extern NSString *NSDeviceBlackColorSpace;    /* 1.0 == black */
  19. extern NSString *NSDeviceRGBColorSpace;
  20. extern NSString *NSDeviceCMYKColorSpace;
  21. extern NSString *NSNamedColorSpace;        /* Used for "catalog" colors */
  22. extern NSString *NSCustomColorSpace;        /* Used to indicate a custom gstate in images */
  23.  
  24.  
  25. /* NSWindowDepth defines the values used in setting window depth limits. "0" indicates default depth. Window depths should not be made persistent as they will not be the same across systems. Use the functions NSBPSFromDepth(), NSColorSpaceFromDepth(), NSBitsPerPixelFromDepth(), and NSPlanarFromDepth() to extract info from an NSWindowDepth. Use NSBestDepth() to compute window depths. NSBestDepth() will try to accomodate all the parameters (match or better); if there are multiple matches, it gives the closest, with matching colorSpace first, then bps, then planar, then bpp. bpp is "bits per pixel"; 0 indicates default (same as the number of bits per plane, either bps or bps * NSNumberOfColorComponents()); other values maybe used as hints to provide backing stores of different configuration; for instance, 8 bit color. exactMatch is optional and indicates whether all the parameters matched exactly.
  26. */
  27. typedef int NSWindowDepth;
  28. extern NSWindowDepth NSBestDepth (NSString *colorSpace, int bps, int bpp, BOOL planar, BOOL *exactMatch);
  29. extern BOOL NSPlanarFromDepth (NSWindowDepth depth);
  30. extern NSString *NSColorSpaceFromDepth (NSWindowDepth depth);
  31. extern int NSBitsPerSampleFromDepth (NSWindowDepth depth);
  32. extern int NSBitsPerPixelFromDepth (NSWindowDepth depth);
  33. extern int NSNumberOfColorComponents (NSString *colorSpaceName);
  34. extern const NSWindowDepth *NSAvailableWindowDepths (void); /* 0 terminated */
  35.  
  36.  
  37. /* Standard gray values for the 2-bit deep grayscale colorspace.
  38. */
  39. extern const float NSWhite;
  40. extern const float NSLightGray;
  41. extern const float NSDarkGray;
  42. extern const float NSBlack;
  43.  
  44.  
  45. /* Keys for deviceDictionary dictionaries.
  46. */
  47. extern NSString *NSDeviceResolution;        /* NSValue containing NSSize, basically dpi */
  48. extern NSString *NSDeviceColorSpaceName;    /* NSString */
  49. extern NSString *NSDeviceBitsPerSample;        /* NSValue containing int */
  50. extern NSString *NSDeviceIsScreen;        /* "YES" or not there */
  51. extern NSString *NSDeviceIsPrinter;        /* "YES" or not there */
  52. extern NSString *NSDeviceSize;            /* NSValue containing NSSize */
  53.  
  54.  
  55. /* Graphics functions
  56. */
  57. extern void NSRectFill(NSRect aRect);
  58. extern void NSRectFillList(const NSRect *rects, int count);
  59. extern void NSRectFillListWithGrays(const NSRect *rects, const float *grays, int num);
  60. extern void NSFrameRect(NSRect aRect);
  61. extern void NSFrameRectWithWidth(NSRect aRect, float frameWidth);
  62. extern void NSRectClip(NSRect aRect);
  63. extern void NSRectClipList(const NSRect *rects, int count);
  64. extern NSRect NSDrawTiledRects(NSRect boundsRect, NSRect clipRect, const NSRectEdge *sides, const float *grays, int count);
  65. extern void NSDrawGrayBezel(NSRect aRect, NSRect clipRect);
  66. extern void NSDrawGroove(NSRect aRect, NSRect clipRect);
  67. extern void NSDrawWhiteBezel(NSRect aRect, NSRect clipRect);
  68. extern void NSDrawButton(NSRect aRect, NSRect clipRect);
  69. extern void NSEraseRect(NSRect aRect);
  70. extern NSColor *NSReadPixel(NSPoint passedPoint);
  71. extern void NSDrawBitmap(NSRect rect, int width, int height, int bps, int spp, int bpp, int bpr, BOOL isPlanar, BOOL hasAlpha, NSString *colorSpaceName, const unsigned char *const data[5]);
  72. extern void NSCopyBitmapFromGState(int srcGState, NSRect srcRect, NSRect destRect);
  73. extern void NSCopyBits(int srcGState, NSRect srcRect, NSPoint destPoint);
  74. extern void NSHighlightRect(NSRect aRect);
  75. extern void NSBeep(void);
  76.  
  77.  
  78. #ifndef STRICT_OPENSTEP
  79.  
  80. extern void NSConvertWindowNumberToGlobal(int winNum, unsigned int *globalNum);
  81. extern void NSConvertGlobalToWindowNumber(int globalNum, unsigned int *winNum);
  82. extern void NSCountWindows(int *count);
  83. extern void NSWindowList(int size, int list[]);
  84.  
  85. /* gets performance stats about window server memory usage */
  86. extern int NSGetWindowServerMemory(DPSContext context, int *virtualMemory, int *windowBackingMemory, NSString **windowDumpString);
  87.  
  88. #endif
  89.