home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.0 / NeXTSTEP3.0.iso / NextDeveloper / Headers / appkit / NXImage.h < prev    next >
Text File  |  1992-06-19  |  5KB  |  137 lines

  1. /*
  2.     NXImage.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import <objc/Object.h>
  8. #import "color.h"
  9. #import "graphics.h"
  10. #import "NXImageRep.h"
  11. #import "Pasteboard.h"
  12. #import <objc/List.h>
  13. #import <objc/zone.h>
  14.  
  15. @interface NXImage : Object
  16. {
  17.     char               *name;
  18.     NXSize              _size;
  19.     struct __imageFlags {
  20.     unsigned int        scalable:1;
  21.     unsigned int        dataRetained:1;
  22.     unsigned int        flipDraw:1;
  23.     unsigned int        uniqueWindow:1;
  24.     unsigned int        uniqueWasExplicitlySet:1;
  25.     unsigned int        sizeWasExplicitlySet:1;
  26.     unsigned int        builtIn:1;
  27.     unsigned int        needsToExpand:1;
  28.     unsigned int        useEPSOnResolutionMismatch:1;
  29.     unsigned int        colorMatchPreferred:1;
  30.     unsigned int        multipleResolutionMatching:1;
  31.     unsigned int        dontFreeName:1;
  32.     unsigned int        subImage:1;
  33.     unsigned int        aSynch:1;
  34.     unsigned int        archiveByName:1;
  35.     unsigned int        unboundedCacheDepth:1;
  36.     }                   _flags;
  37.     short        _reservedShort;
  38.     void               *_reps;
  39.     List               *_repList;
  40.     NXColor            *_color;
  41.     int            _reservedInt;
  42. }
  43.  
  44. + findImageNamed:(const char *)name;
  45.  
  46. - init;
  47. - initSize:(const NXSize *)aSize;
  48. - initFromFile:(const char *)fileName;
  49. - initFromSection:(const char *)fileName;
  50. - initFromStream:(NXStream *)stream;
  51. - initFromPasteboard:(Pasteboard *)pasteboard;
  52. - initFromImage:(NXImage *)image rect:(const NXRect *)rect;
  53.  
  54. - getImage:(NXImage **)image rect:(NXRect *)rect;
  55. - setSize:(const NXSize *)aSize;
  56. - getSize:(NXSize *)aSize;
  57. - free;
  58. - copyFromZone:(NXZone *)zone;
  59. - (BOOL)setName:(const char *)string;
  60. - (const char *)name;
  61. - setFlipped:(BOOL)flag;
  62. - (BOOL)isFlipped;
  63. - setScalable:(BOOL)flag;
  64. - (BOOL)isScalable;
  65. - setDataRetained:(BOOL)flag;
  66. - (BOOL)isDataRetained;
  67. - setUnique:(BOOL)flag;
  68. - (BOOL)isUnique;
  69. - setCacheDepthBounded:(BOOL)flag;
  70. - (BOOL)isCacheDepthBounded;
  71. - setBackgroundColor:(NXColor)aColor;
  72. - (NXColor)backgroundColor;
  73. - setEPSUsedOnResolutionMismatch:(BOOL)flag;
  74. - (BOOL)isEPSUsedOnResolutionMismatch;
  75. - setColorMatchPreferred:(BOOL)flag;
  76. - (BOOL)isColorMatchPreferred;
  77. - setMatchedOnMultipleResolutiUEBOOL)flag;
  78. - (BOOL)isMatchedOnMultipleResolution;
  79. - dissolve:(float)delta toPoint:(const NXPoint *)point;
  80. - dissolve:(float)delta    fromRect:(const NXRect *)rect toPoint:(const NXPoint *)point;
  81. - composite:(int)op toPoint:(const NXPoint *)point;
  82. - composite:(int)op fromRect:(const NXRect *)rect toPoint:(const NXPoint *)point;
  83. - (BOOL)drawRepresentation:(NXImageRep *)imageRep inRect:(const NXRect *)rect;
  84. - recache;
  85. - writeTIFF:(NXStream *)stream;
  86. - writeTIFF:(NXStream *)stream allRepresentations:(BOOL)flag;
  87. - writeTIFF:(NXStream *)stream allRepresentations:(BOOL)flag usingCompression:(int)compression andFactor:(float)aFloat;
  88. - write:(NXTypedStream *)stream;
  89. - read:(NXTypedStream *)stream;
  90. - finishUnarchiving;
  91. - (BOOL)loadFromStream:(NXStream *)stream;
  92. - (BOOL)loadFromFile:(const char *)fileName;
  93. - (BOOL)useFromFile:(const char *)fileName;
  94. - (BOOL)useFromSection:(const char *)fileName;
  95. - (BOOL)useDrawMethod:(SEL)drawMethod inObject:anObject;
  96. - (BOOL)useRepresentation:(NXImageRep *)imageRepresentation;
  97. - (BOOL)useCacheWithDepth:(NXWindowDepth)depth;
  98. - removeRepresentation:(NXImageRep *)imageRepresentation;
  99. - (BOOL)lockFocus;
  100. - (BOOL)lockFocusOn:(NXImageRep *)imageRepresentation;
  101. - unlockFocus;
  102. - (NXImageRep *)lastRepresentation;
  103. - (NXImageRep *)bestRepresentation;
  104. - (List *)representationList;
  105. - setDelegate:(id)anObject;
  106. - delegate;
  107.  
  108.  
  109. + (void)registerImageRep:imageRepClass;
  110. + (void)unregisterImageRep:imageRepClass;
  111. + (Class)imageRepForFileType:(const char *)type;
  112. + (Class)imageRepForPasteboardType:(NXAtom)type;
  113. + (Class)imageRepForStream:(NXStream *)stream;
  114. + (const char *const *)imageUnfilteredFileTypes;
  115. + (const char *const *)imageFileTypes;
  116. + (const NXAtom *)imageUnfilteredPasteboardTypes;
  117. + (const NXAtom *)imagePasteboardTypes;
  118. + (BOOL)canInitFromPasteboard:(Pasteboard *)pasteboard;
  119.  
  120. /* 
  121.  * The following new... methods are now obsolete.  They remain in this  
  122.  * interface file for backward compatibility only.  Use Object's alloc method  
  123.  * and the init... methods defined in this class instead.
  124.  */
  125. + new;
  126. + newSize:(const NXSize *)aSize;
  127. + newFromFile:(const char *)fileName;
  128. + newFromSection:(const char *)fileName;
  129. + newFromStream:(NXStream *)stream;
  130. + newFromImage:(NXImage *)image rect:(const NXRect *)rect;
  131.  
  132. @end
  133.  
  134. @interface Object(NXImageDelegate)
  135. - (NXImage *)imageDidNotDraw:sender inRect:(const NXRect *)UEt;
  136. @end
  137.