home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEV / DEV.Z / CompositeView.h < prev    next >
Text File  |  1996-04-17  |  2KB  |  77 lines

  1. /*
  2.    CompositeView.h
  3. */
  4.  
  5. #import <AppKit/NSView.h>
  6. #import <AppKit/NSColor.h>
  7.  
  8. // The possible draw modes for the source.
  9.  
  10. typedef enum {    // Various pictures that can be drawn in the source (or even destination) areas
  11.   TrianglePicture = 0,
  12.   CirclePicture,
  13.   DiamondPicture,
  14.   HeartPicture,
  15.   FlowerPicture,
  16.   CustomPicture
  17. } Picture;
  18.  
  19. @interface CompositeView:NSView {
  20.     id source, destination, result, customImage;
  21.     NSRect sRect, dRect, rRect;
  22.     NSCompositingOperation operator;
  23.     Picture sourcePicture;
  24.     NSColor *sourceColor, *destColor, *backgroundColor;
  25.  
  26.     // Outlets...
  27.     id sourceColorWell;
  28.     id destColorWell;
  29.     id backColorWell;
  30.     id sourcePictureMatrix;
  31. }
  32.  
  33. // Init/dealloc
  34. - (id)initWithFrame:(NSRect)rect;
  35. - (void)dealloc;
  36.  
  37. // Target-action methods
  38. - (void)setSourcePicture:(id)sender;
  39. - (void)setOperator:(id)sender;
  40. - (void)changeCustomImage:(id)sender;
  41. - (void)changeSourceColor:(id)sender;
  42. - (void)changeDestColor:(id)sender;
  43. - (void)changeBackgroundColor:(id)sender;
  44.  
  45. // Outlet-setting methods (we need these to set the initial colors)
  46. - (void)setSourceColorWell:(id)anObject;
  47. - (void)setDestColorWell:(id)anObject;
  48. - (void)setBackColorWell:(id)anObject;
  49.  
  50. // Methods to change the colors and display
  51. - (void)changeSourceColorTo:(NSColor *)color andDisplay:(BOOL)flag;
  52. - (void)changeDestColorTo:(NSColor *)color andDisplay:(BOOL)flag;
  53. - (void)changeBackgroundColorTo:(NSColor *)color andDisplay:(BOOL)flag;
  54. - (BOOL)changeCustomImageTo:(NSImage *)newImage;
  55.  
  56. // Callbacks from NSImage drawing methods
  57. - (void)drawSource:(NSCustomImageRep *)imageRep;
  58. - (void)drawDestination:(NSCustomImageRep *)imageRep;
  59. - (void)drawResult:(NSCustomImageRep *)imageRep;
  60.  
  61. // Other methods
  62. - (void)drawRect:(NSRect)rect;
  63. - (NSCompositingOperation)operator;
  64.  
  65. // Dragging methods
  66. - (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender;
  67. - (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender;
  68. - (void)draggingExited:(id <NSDraggingInfo>)sender;
  69. - (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
  70. - (void)concludeDragOperation:(id <NSDraggingInfo>)sender;
  71. - (void)doColorDrag:(id <NSDraggingInfo>)sender;
  72.  
  73. @end
  74.  
  75.  
  76.  
  77.