ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Temp/ColorMerge/Julia/MiscColorMerge.h

This is MiscColorMerge.h in view mode; [Download] [Up]

// -*- objc -*-

#import <appkit/appkit.h>

#import "Vector.h"

/*" Used for specifying the interpolation method. "*/
typedef enum
{
    MergeModeLinear = 1,
    MergeModeCatmullRom = 2
} MiscColorMergeMode;

/*" Used to internally store the pure colors along with their positions "*/
typedef struct _MiscColorAtPosition
{
    NXColor color;
    double position;
    struct _MiscColorAtPosition *next;
} MiscColorAtPosition;

@interface MiscColorMerge : View /*" Responder : Object "*/
{
    id delegate;                   /*" The object that is notified when the
				     MiscColorMerge is changed. "*/

    MiscColorMergeMode mergeMode;  /*" The interpolation method used. "*/

    MiscColorAtPosition *firstColor;  /*" A pointer to the first pure
					color. "*/
    int numColors;                /*" The number of pure colors. "*/

    Vector3D *vertices;           /*" An array of vectors, representing
				    the colors in the RGB-cube. "*/
    int numAllocedVertices;       /*" The size of the array. "*/

    int dragOperation;            /*" The currently performed drag
				    operation. "*/
    NXPoint draggingStart;        /*" The position where the user started
				    dragging. "*/
    int draggedColorIndex;        /*" The index of the dragged color. "*/
    int oldEventMask;             /*" The old event mask of the window. "*/
    NXEvent mouseDownEvent;       /*" The event that started dragging. "*/

    NXBitmapImageRep *bufferedLine;  /*" The currently buffered line. "*/
    float bufferedLinePos;           /*" The y-position of that line. "*/
}

/*" Creating and freeing instances "*/
- initFrame: (const NXRect*) frameRect;
- free;

/*" Assigning a delegate "*/
- delegate;
- setDelegate: newDelegate;

/*" Setting the interpolation method "*/
- (MiscColorMergeMode) mergeMode;
- setMergeMode: (MiscColorMergeMode) aMergeMode;

/*" Setting and getting pure colors "*/
- (int) numPureColors;

- addColor: (NXColor) theColor atPosition: (double) thePosition;
- getColor: (NXColor*) theColor andPosition: (double*) thePosition
   atIndex: (int) theIndex;

- removeColorAtIndex: (int) index;
- removeAllColors;

/*" Calculating blended colors "*/
- calcColor: (NXColor*) theColor atPosition: (double) thePosition;
- calcArray: (NXColor*) colors ofNumColors: (int) arraySize;

/*" Drawing "*/
- drawSelf: (const NXRect*) rects : (int) numRects;

/*" Event handling "*/
- (BOOL) acceptsFirstMouse;

- mouseDown: (NXEvent*) theEvent;
- mouseDragged: (NXEvent*) theEvent;
- mouseUp: (NXEvent*) theEvent;

/*" Archiving "*/
- read: (NXTypedStream*) theStream;
- write: (NXTypedStream*) theStream;

@end

@interface Object (ColorMergeDelegate)

- colorMergeDidChange: sender;

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.