home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Graphics / Misc / aa_m68k_Only / NDCamera.0.21 / Source / SimpleImageView.m < prev   
Encoding:
Text File  |  1995-07-03  |  1.6 KB  |  82 lines

  1. //        Written by Thomas Engel Copyright (c) 1995 by Thomas Engel.
  2. //                Version 1.0.  All rights reserved.
  3. //
  4. //        This notice may not be removed from this source code.
  5. //
  6. //    This object is included in the MiscKit by permission from the author
  7. //    and its use is governed by the MiscKit license, found in the file
  8. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  9. //    for a list of all applicable permissions and restrictions.
  10. //    
  11.  
  12. #import "SimpleImageView.h"
  13.  
  14. #define SIMPLEIMAGEVIEW_VERSION 0
  15. #define SIMPLEIMAGEVIEW_CLASSNAME "SimpleImageView"
  16.  
  17.  
  18. @implementation  SimpleImageView
  19.  
  20. + initialize
  21. {
  22.     // Initialize the current version number which is used when archiving 
  23.     // objects. This way we will be able to read all versions if we are 
  24.     // careful.
  25.  
  26.     if( self == [SimpleImageView class] )
  27.         [self setVersion:SIMPLEIMAGEVIEW_VERSION];
  28.         
  29.     return self;
  30. }
  31.  
  32. - setImage:anImage
  33. {
  34.     theImage = anImage;
  35.     [self display];
  36.     return self;
  37. }
  38.  
  39. - drawSelf:(const NXRect *)rects :(int)rectCount
  40. {
  41.     NXPoint    lowerLeft = {0, 0};
  42.  
  43.     if( theImage )
  44.         [theImage composite:NX_COPY toPoint:&lowerLeft];
  45.  
  46.     return self;
  47. }
  48.  
  49. - read:(NXTypedStream *)stream
  50. {
  51.     int  version;
  52.   
  53.     [super read:stream];
  54. /*        
  55.     version = NXTypedStreamClassVersion( stream, SIMPLEIMAGEVIEW_CLASSNAME );
  56.  
  57.     switch( version )
  58.     {
  59.         case 0:
  60.             backgroundColor = NXReadColor( stream );
  61.             NXReadType( stream, "c", &sameColorAsDesktop );
  62.             break;
  63.         
  64.         default:
  65.             break;
  66.     }
  67. */
  68.     return self;
  69. }
  70.  
  71. - write:(NXTypedStream *)stream
  72. {
  73.     [super write:stream];
  74. /*
  75.     NXWriteColor( stream, backgroundColor );
  76.     NXWriteType( stream, "c", &sameColorAsDesktop );
  77. */
  78.     return self;
  79. }
  80.  
  81. @end
  82.