Use NSInteger where absolutely required.
[MacTF.git] / iLifeControls / CTGradient.h
blobf81fe74b02ab0fc7c95b6c6a5c24985a4d96c7d1
1 //
2 // CTGradient.h
3 //
4 // Created by Chad Weider on 12/3/05.
5 // Copyright (c) 2006 Cotingent.
6 // Some rights reserved: <http://creativecommons.org/licenses/by/2.5/>
7 //
8 // Version: 1.5
10 #import <Cocoa/Cocoa.h>
12 typedef struct _CTGradientElement
14 float red, green, blue, alpha;
15 float position;
17 struct _CTGradientElement *nextElement;
18 } CTGradientElement;
20 typedef enum _CTBlendingMode
22 CTLinearBlendingMode,
23 CTChromaticBlendingMode,
24 CTInverseChromaticBlendingMode
25 } CTGradientBlendingMode;
28 @interface CTGradient : NSObject <NSCopying, NSCoding>
30 CTGradientElement* elementList;
31 CTGradientBlendingMode blendingMode;
33 CGFunctionRef gradientFunction;
36 + (id)gradientWithBeginningColor:(NSColor *)begin endingColor:(NSColor *)end;
38 + (id)aquaSelectedGradient;
39 + (id)aquaNormalGradient;
40 + (id)aquaPressedGradient;
42 + (id)unifiedSelectedGradient;
43 + (id)unifiedNormalGradient;
44 + (id)unifiedPressedGradient;
45 + (id)unifiedDarkGradient;
47 + (id)sourceListSelectedGradient;
48 + (id)sourceListUnselectedGradient;
50 - (CTGradient *)gradientWithAlphaComponent:(float)alpha;
52 - (CTGradient *)addColorStop:(NSColor *)color atPosition:(float)position; //positions given relative to [0,1]
53 - (CTGradient *)removeColorStopAtIndex:(unsigned)index;
54 - (CTGradient *)removeColorStopAtPosition:(float)position;
56 - (CTGradientBlendingMode)blendingMode;
57 - (NSColor *)colorStopAtIndex:(unsigned)index;
58 - (NSColor *)colorAtPosition:(float)position;
61 - (void)drawSwatchInRect:(NSRect)rect;
62 - (void)fillRect:(NSRect)rect angle:(float)angle; //fills rect with axial gradient
63 // angle in degrees
64 - (void)radialFillRect:(NSRect)rect; //fills rect with radial gradient
65 // gradient from center outwards
66 @end