summaryrefslogtreecommitdiff
path: root/packages/cocoaint/src/mapkit/MKGeometry.inc
blob: 8cf9d2c033c3a4934a7416f2869d546a85613626 (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
88
89
90
91
92
93
94
95
96
97
{ Parsed from MapKit.framework MKGeometry.h }

{$ifdef TYPES}
type
  MKCoordinateSpan = record
    latitudeDelta: CLLocationDegrees;
    longitudeDelta: CLLocationDegrees;
  end;
type
  MKCoordinateSpanPtr = ^MKCoordinateSpan;
type
  MKCoordinateRegion = record
    center: CLLocationCoordinate2D;
    span: MKCoordinateSpan;
  end;
type
  MKCoordinateRegionPtr = ^MKCoordinateRegion;
{$endif}

{$ifdef FUNCTIONS}
function MKCoordinateRegionMakeWithDistance(centerCoordinate: CLLocationCoordinate2D; latitudinalMeters: CLLocationDistance; longitudinalMeters: CLLocationDistance): MKCoordinateRegion; cdecl; external;
{$endif}

{$if ((__IPHONE_4_0 <= __IPHONE_OS_VERSION_MAX_ALLOWED) or (__MAC_10_9 <= __MAC_OS_X_VERSION_MAX_ALLOWED))}
{$ifdef TYPES}
type
  MKMapPoint = record
    x: double;
    y: double;
  end;
type
  MKMapPointPtr = ^MKMapPoint;
type
  MKMapSize = record
    width: double;
    height: double;
  end;
type
  MKMapSizePtr = ^MKMapSize;
type
  MKMapRect = record
    origin: MKMapPoint;
    size: MKMapSize;
  end;
type
  MKMapRectPtr = ^MKMapRect;

type
  MKZoomScale = CGFloat;
  MKZoomScalePtr = ^MKZoomScale;
{$endif}

{$endif}
{$ifdef EXTERNAL_SYMBOLS}
var
  MKMapSizeWorld: MKMapSize { available in 10_9, 4_0 }; cvar; external;
  MKMapRectWorld: MKMapRect { available in 10_9, 4_0 }; cvar; external;
{$endif}

{$ifdef FUNCTIONS}
function MKMapPointForCoordinate(coordinate: CLLocationCoordinate2D): MKMapPoint; cdecl; external; { available in 10_9, 4_0 }
function MKCoordinateForMapPoint(mapPoint: MKMapPoint): CLLocationCoordinate2D; cdecl; external; { available in 10_9, 4_0 }
function MKMetersPerMapPointAtLatitude(latitude: CLLocationDegrees): CLLocationDistance; cdecl; external; { available in 10_9, 4_0 }
function MKMapPointsPerMeterAtLatitude(latitude: CLLocationDegrees): double; cdecl; external; { available in 10_9, 4_0 }
function MKMetersBetweenMapPoints(a: MKMapPoint; b: MKMapPoint): CLLocationDistance; cdecl; external; { available in 10_9, 4_0 }
{$endif}

{$ifdef EXTERNAL_SYMBOLS}
var
  MKMapRectNull: MKMapRect { available in 10_9, 4_0 }; cvar; external;
{$endif}

{$ifdef FUNCTIONS}
function MKMapRectUnion(rect1: MKMapRect; rect2: MKMapRect): MKMapRect; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectIntersection(rect1: MKMapRect; rect2: MKMapRect): MKMapRect; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectInset(rect: MKMapRect; dx: double; dy: double): MKMapRect; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectOffset(rect: MKMapRect; dx: double; dy: double): MKMapRect; cdecl; external; { available in 10_9, 4_0 }
procedure MKMapRectDivide(rect: MKMapRect; slice: MKMapRectPtr; remainder: MKMapRectPtr; amount: double; edge: CGRectEdge); cdecl; external; { available in 10_9, 4_0 }
function MKMapRectContainsPoint(rect: MKMapRect; point: MKMapPoint): ObjCBOOL; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectContainsRect(rect1: MKMapRect; rect2: MKMapRect): ObjCBOOL; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectIntersectsRect(rect1: MKMapRect; rect2: MKMapRect): ObjCBOOL; cdecl; external; { available in 10_9, 4_0 }
function MKCoordinateRegionForMapRect(rect: MKMapRect): MKCoordinateRegion; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectSpans180thMeridian(rect: MKMapRect): ObjCBOOL; cdecl; external; { available in 10_9, 4_0 }
function MKMapRectRemainder(rect: MKMapRect): MKMapRect; cdecl; external; { available in 10_9, 4_0 }
{$endif}

{$ifdef CLASSES}

type
  NSValueMapKitGeometryExtensions = objccategory external (NSValue)
    class function valueWithMKCoordinate (coordinate: CLLocationCoordinate2D): NSValue; message 'valueWithMKCoordinate:';
    class function valueWithMKCoordinateSpan (span: MKCoordinateSpan): NSValue; message 'valueWithMKCoordinateSpan:';
    function MKCoordinateValue: CLLocationCoordinate2D; message 'MKCoordinateValue';
    function MKCoordinateSpanValue: MKCoordinateSpan; message 'MKCoordinateSpanValue';
  end;
{$endif}