/packages/cocoaint/src/Foundation.pas

https://github.com/slibre/freepascal · Pascal · 81 lines · 29 code · 18 blank · 34 comment · 0 complexity · 19dea1be81cc3094f92187c8454d7dbd MD5 · raw file

  1. unit Foundation;
  2. {$mode objfpc}
  3. {$modeswitch objectivec1}
  4. {$define NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES}
  5. interface
  6. uses
  7. ctypes, MacOSAll;
  8. {$linkframework Foundation}
  9. {$include UndefinedTypes.inc}
  10. {$define HEADER}
  11. {$include foundation/Foundation.inc}
  12. {$undef HEADER}
  13. {$define TYPES}
  14. {$include foundation/Foundation.inc}
  15. {$undef TYPES}
  16. {$define RECORDS}
  17. {$include foundation/Foundation.inc}
  18. {$undef RECORDS}
  19. type
  20. {$define FORWARD}
  21. {$include foundation/Foundation.inc}
  22. {$undef FORWARD}
  23. {$define CLASSES}
  24. {$include foundation/Foundation.inc}
  25. {$undef CLASSES}
  26. {$define PROTOCOLS}
  27. {$include foundation/Foundation.inc}
  28. {$undef PROTOCOLS}
  29. {$define FUNCTIONS}
  30. {$include foundation/Foundation.inc}
  31. {$undef FUNCTIONS}
  32. {$define EXTERNAL_SYMBOLS}
  33. {$include foundation/Foundation.inc}
  34. {$undef EXTERNAL_SYMBOLS}
  35. {$define USER_PATCHES}
  36. {$include foundation/Foundation.inc}
  37. {$undef USER_PATCHES}
  38. { Inline functions }
  39. function NSSTR (inString: PChar): NSString;
  40. function NSMakeRange (loc: NSUInteger; len: NSUInteger): NSRange;
  41. function NSMaxRange (range: NSRange): NSUInteger;
  42. function NSLocationInRange (loc: NSUInteger; range: NSRange): boolean;
  43. function NSEqualRanges (range1, range2: NSRange): boolean;
  44. function NSMakePoint (x: CGFloat; y: CGFloat): NSPoint;
  45. function NSMakeSize(w: CGFloat; h: CGFloat): NSSize;
  46. function NSMakeRect(x, y: CGFloat; w, h: CGFloat): NSRect;
  47. function NSMaxX (aRect: NSRect): CGFloat;
  48. function NSMaxY (aRect: NSRect): CGFloat;
  49. function NSMidX (aRect: NSRect): CGFloat;
  50. function NSMidY (aRect: NSRect): CGFloat;
  51. function NSMinX (aRect: NSRect): CGFloat;
  52. function NSMinY (aRect: NSRect): CGFloat;
  53. function NSWidth (aRect: NSRect): CGFloat;
  54. function NSHeight (aRect: NSRect): CGFloat;
  55. function NSRectFromCGRect (aRect: CGRect): NSRect;
  56. function NSRectToCGRect (aRect: NSRect): CGRect;
  57. function NSPointFromCGPoint (aPoint: CGPoint): NSPoint;
  58. function NSPointToCGPoint (aPoint: NSPoint): CGPoint;
  59. function NSSizeFromCGSize(aSize: CGSize): NSSize;
  60. function NSSizeToCGSize(aSize: NSSize): CGSize;
  61. implementation
  62. {$include InlineFunctions.inc}
  63. end.