summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/cocoaint/src/appkit/NSGradient.inc
blob: 3285e50975c889492b4e0fb9ee8d6e3086f2ff42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ Parsed from Appkit.framework NSGradient.h }

{$ifdef TYPES}
{$ifndef NSGRADIENT_PAS_T}
{$define NSGRADIENT_PAS_T}

{ Types }
type
  NSGradientDrawingOptions = NSUInteger;
  NSGradientDrawingOptionsPtr = ^NSGradientDrawingOptions;

{ Constants }

const
  NSGradientDrawsBeforeStartingLocation = 1 shl 0;
  NSGradientDrawsAfterEndingLocation = 1 shl 1;

{$endif}
{$endif}

{$ifdef RECORDS}
{$ifndef NSGRADIENT_PAS_R}
{$define NSGRADIENT_PAS_R}

{$endif}
{$endif}

{$ifdef FUNCTIONS}
{$ifndef NSGRADIENT_PAS_F}
{$define NSGRADIENT_PAS_F}

{$endif}
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
{$ifndef NSGRADIENT_PAS_S}
{$define NSGRADIENT_PAS_S}

{$endif}
{$endif}

{$ifdef FORWARD}
  NSGradient = objcclass;
  NSGradientPointer = ^NSGradient;
  NSGradientPtr = NSGradientPointer;

{$endif}

{$ifdef CLASSES}
{$ifndef NSGRADIENT_PAS_C}
{$define NSGRADIENT_PAS_C}

{ NSGradient }
  NSGradient = objcclass external (NSObject, NSCopyingProtocol, NSCodingProtocol)
  private
    _colorArray: NSArray;
    _colorSpace: NSColorSpace;
    _functionRef: Pointer; {garbage collector: __strong }
    _componentArray: Pointer;
    _reserved1: Pointer;
    _reserved2: Pointer;
    _reserved3: Pointer;
    
  public
    function initWithStartingColor_endingColor(startingColor: NSColor; endingColor: NSColor): id; message 'initWithStartingColor:endingColor:';
    function initWithColors(colorArray: NSArray): id; message 'initWithColors:';
    function initWithColorsAndLocations(firstKey: id): id; varargs; message 'initWithColorsAndLocations:';
    function initWithColors_atLocations_colorSpace(colorArray: NSArray; locations: CGFloatPtr; colorSpace_: NSColorSpace): id; message 'initWithColors:atLocations:colorSpace:';
    procedure drawFromPoint_toPoint_options(startingPoint: NSPoint; endingPoint: NSPoint; options: NSGradientDrawingOptions); message 'drawFromPoint:toPoint:options:';
    procedure drawInRect_angle(rect: NSRect; angle: CGFloat); message 'drawInRect:angle:';
    procedure drawInBezierPath_angle(path: NSBezierPath; angle: CGFloat); message 'drawInBezierPath:angle:';
    procedure drawFromCenter_radius_toCenter_radius_options(startCenter: NSPoint; startRadius: CGFloat; endCenter: NSPoint; endRadius: CGFloat; options: NSGradientDrawingOptions); message 'drawFromCenter:radius:toCenter:radius:options:';
    procedure drawInRect_relativeCenterPosition(rect: NSRect; relativeCenterPosition: NSPoint); message 'drawInRect:relativeCenterPosition:';
    procedure drawInBezierPath_relativeCenterPosition(path: NSBezierPath; relativeCenterPosition: NSPoint); message 'drawInBezierPath:relativeCenterPosition:';
    function colorSpace: NSColorSpace; message 'colorSpace';
    function numberOfColorStops: NSInteger; message 'numberOfColorStops';
    procedure getColor_location_atIndex(color: NSColorPointer; location: CGFloatPtr; index: NSInteger); message 'getColor:location:atIndex:';
    function interpolatedColorAtLocation(location: CGFloat): NSColor; message 'interpolatedColorAtLocation:';

    { Adopted Protocols }
    function copyWithZone(zone_: NSZonePtr): id;
    procedure encodeWithCoder(aCoder: NSCoder);
    function initWithCoder(aDecoder: NSCoder): id;
  end;

{$endif}
{$endif}