Basic plugin architecture
[MacVim.git] / src / MacVim / CTGradient.h
blob68f3a4b1066d3245af0a25e85a95a3e485419c6c
1 //
2 // CTGradient.h
3 //
4 // Created by Chad Weider on 2/14/07.
5 // Writtin by Chad Weider.
6 //
7 // Released into public domain on 4/10/08.
8 //
9 // Version: 1.8
11 #import <Cocoa/Cocoa.h>
13 typedef struct _CTGradientElement
15 float red, green, blue, alpha;
16 float position;
18 struct _CTGradientElement *nextElement;
19 } CTGradientElement;
21 typedef enum _CTBlendingMode
23 CTLinearBlendingMode,
24 CTChromaticBlendingMode,
25 CTInverseChromaticBlendingMode
26 } CTGradientBlendingMode;
29 @interface CTGradient : NSObject <NSCopying, NSCoding>
31 CTGradientElement* elementList;
32 CTGradientBlendingMode blendingMode;
34 CGFunctionRef gradientFunction;
37 + (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
39 + (id)aquaSelectedGradient;
40 + (id)aquaNormalGradient;
41 + (id)aquaPressedGradient;
43 + (id)unifiedSelectedGradient;
44 + (id)unifiedNormalGradient;
45 + (id)unifiedPressedGradient;
46 + (id)unifiedDarkGradient;
48 + (id)sourceListSelectedGradient;
49 + (id)sourceListUnselectedGradient;
51 + (id)rainbowGradient;
52 + (id)hydrogenSpectrumGradient;
54 - (CTGradient *)gradientWithAlphaComponent:(float)alpha;
56 - (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
57 - (CTGradient *)removeColorStopAtIndex:(unsigned)index;
58 - (CTGradient *)removeColorStopAtPosition:(float)position;
60 - (CTGradientBlendingMode)blendingMode;
61 - (NSColor *)colorStopAtIndex:(unsigned)index;
62 - (NSColor *)colorAtPosition:(float)position;
65 - (void)drawSwatchInRect:(NSRect)rect;
66 - (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient
67 // angle in degrees
68 - (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient
69 // gradient from center outwards
70 - (void)fillBezierPath:(NSBezierPath *)path angle:(float)angle;
71 - (void)radialFillBezierPath:(NSBezierPath *)path;
73 @end