type 
  TDateTime = Float; 
  Real      = Float; 
  Double    = Float; 
  Extended  = Float; 
  TColor    = Integer; 
  THandle   = Variant; 
  
  TObjArray   = array of TObject; 
  TIntArray   = array of Integer; 
  TStrArray   = array of String; 
  TFloatArray = array of Float; 
  
  
  TPoint = record 
    X: Integer; 
    Y: Integer; 
    class const NullPoint: TPoint = (X:0; Y:0); 
    class function Create(const aCol, aRow: Integer): TPoint; static; 
    function AngleTo(const aPoint: TPoint): Float; 
    function Compare(const aPoint: TPoint): Boolean; 
    function Displace(radius: Float; angle: Float): TPoint; 
    function Distance(const aPoint: TPoint): Float; 
    function Expand(const b: TPoint): TPoint; overload; 
    function Expand(const b: Float): TPoint; overload; 
    function Offset(const b: TPoint): TPoint; overload; 
    function Offset(const b: Integer): TPoint; overload; 
    function ToString: String; 
  
  TPointArray = array of TPoint; 
  function OffsetPoint(const a, b: TPoint): TPoint; overload; 
  function OffsetPoint(const a: TPoint; b: Integer): TPoint; overload; 
  function MinusPoint(const a, b: TPoint): TPoint; overload; 
  function MinusPoint(const a: TPoint; b: Integer): TPoint; overload; 
  function ExpandPoint(const a: TPoint; b: TPoint): TPoint; overload; 
  function ExpandPoint(const a: TPoint; b: Float): TPoint; overload; 
  function ExpandPoint(const a: TPoint; b: Integer): TPoint; overload; 
  
TPointF = record 
    X: Float; 
    Y: Float; 
    class const NullPoint: TPointF = (X:0; Y:0); 
    class function Create(const aCol, aRow: Float): TPointF; static; 
    function AngleTo(const aPoint: TPointF): Float; 
    function Compare(const aPoint: TPointF): Boolean; 
    function Displace(radius: Float; angle: Float): TPointF; 
    function Distance(const aPoint: TPointF): Float; 
    function Expand(const b: TPointF): TPointF; overload; 
    function Expand(const b: Float): TPointF; overload; 
    function Offset(const b: TPointF): TPointF; overload; 
    function Offset(const b: Float): TPointF; overload; 
    function ToString: String; 
  
TPointArrayF = array of TPointF; 
  function OffsetPoint(const a, b: TPointF): TPointF; overload; 
  function OffsetPoint(const a: TPointF; b: Float): TPointF; overload; 
  function OffsetPoint(const a: TPointF; b: Integer): TPointF; overload; 
  function MinusPoint(const a, b: TPointF): TPointF; overload; 
  function MinusPoint(const a: TPointF; b: Float): TPointF; overload; 
  function MinusPoint(const a: TPointF; b: Integer): TPointF; overload; 
  function ExpandPoint(const a: TPointF; b: TPointF): TPointF; overload; 
  function ExpandPoint(const a: TPointF; b: Float): TPointF; overload; 
  function ExpandPoint(const a: TPointF; b: Integer): TPointF; overload; 
  
TRect = record 
    Left:     Integer; 
    Top:      Integer; 
    Right:    Integer; 
    Bottom:   Integer; 
    function  Width: Integer; 
    function  Height: Integer; 
    function  ToString: String; 
    function  TopLeft: TPoint; 
    function  BottomRight: TPoint; 
    function  CenterPoint: TPoint; 
    function  Clip(const RectToClip: TRect): TRect; 
    function  Empty: Boolean; 
    function  Compare(const aRect: TRect): Boolean; 
    function  ContainsRow(const aRow: Integer): Boolean; 
    function  ContainsCol(const aCol: Integer): Boolean; 
    function  ContainsRect(const aRect: TRect): Boolean; 
    function  ContainsPos(const aLeft, aTop: Integer): Boolean; 
    function  ContainsPoint(const aPoint: TPoint): Boolean; 
    function  Extend(x, y : Integer): Boolean; overload; 
    function  Extend(const aPoint: TPoint): Boolean; overload; 
    function  Intersect(const aRect: TRect; var intersection: TRect): Boolean; 
    function  Expose(const aChildRect: TRect): TExposure; 
    function  FitWithin(const aChildRect: TRect): TRect; 
    procedure Move(const aCol, aRow: Integer; const Center: Boolean); 
    procedure MoveBy(dX, dY: Integer); 
    procedure SetBounds(aLeft, aTop, aRight, aBottom: Integer); 
    function  ToPolygon: TPointArray; 
    class const NullRect: TRect = (Left: 0; Top: 0; Right: 0; Bottom: 0); 
    class function CreateSized(const aLeft, aTop, aWidth, aHeight: Integer): TRect; overload; 
    class function CreateSized(const aWidth, aHeight: Integer): TRect; overload; 
    class function Create(const aLeft, aTop, aRight, aBottom: Integer): TRect; overload; 
    class function Create(const topLeft, bottomRight: TPoint): TRect; overload; 
TRectF = record 
    Left, Top, Right, Bottom: Float; 
    function Width: Float; 
    function Height: Float; 
    function ToString: String; 
    function TopLeft: TPointF; 
    function BottomRight: TPointF; 
    function CenterPoint: TPointF; 
    function Clip(const RectToClip: TRectF): TRectF; 
    function Empty: Boolean; 
    function Compare(const aRect: TRectF): Boolean; 
    function ContainsRow(const aRow: Float): Boolean; 
    function ContainsCol(const aCol: Float): Boolean; 
    function ContainsRect(const aRect: TRectF): Boolean; 
    function ContainsPos(const aLeft, aTop: Float): Boolean; 
    function ContainsPoint(const aPoint: TPointF): Boolean; 
    function Intersect(const aRect: TRectF; var intersection: TRectF): Boolean; 
    function Extend(const aPoint: TPointF) : Boolean; overload; 
    function Extend(x, y: Float): Boolean; overload; 
    function Expose(const aChildRect: TRectF): TExposure; 
    function FitWithin(const aChildRect: TRectF): TRectF; 
    procedure Move(const aCol, aRow: Float; const Center: Boolean); 
    procedure MoveBy(x, y: Float); 
    procedure SetBounds(aLeft, aTop, aRight, aBottom: Float); 
    function ToPolygon: TPointArrayF; 
    class const NullRect: TRectF = (Left: 0; Top: 0; Right: 0; Bottom: 0); 
    class function CreateSized(const aLeft, aTop, aWidth, aHeight: Float): TRectF; overload; 
    class function CreateSized(const aWidth, aHeight: Float): TRectF; overload; 
    class function Create(const aLeft, aTop, aRight, aBottom: Float): TRectF; overload; 
    class function Create(const topLeft, bottomRight: TPointF): TRectF; overload; 
    class function CreateBounded(x1, y1, x2, y2: Float): TRectF;         
  
TInteger = class 
    public 
      class function ToPxStr(const aValue: Integer): String; static; 
      class function ToHex(const aValue: Integer): String; static; deprecated "Use .ToHex"; 
      class procedure Swap(var Primary, Secondary: Integer); static; 
      class function Sum(const anArray: TIntArray): Integer; static; 
      class function Average(const anArray: TIntArray): Float; static; 
      class function PercentOfValue(const Value, Total: Integer): Integer; static; 
      class function Middle(const Primary, Secondary: Integer): Integer; static; 
      class function Sign(const Value: Integer): Integer; deprecated; 
      class function Diff(const Primary, Secondary: Integer): Integer; static; 
      class function ToNearestSigned(const Value, Factor: Integer): Integer; static; 
      class function ToNearest(const Value, Factor: Integer): Integer; static; 
      class function Largest(const Primary, Secondary: Integer): Integer; overload; 
      class function Largest(const anArray: TIntArray): Integer; overload; 
      class function Smallest(const Primary, Secondary: Integer): Integer; overload; 
      class function Smallest(const anArray: TIntArray): Integer; overload; 
      class function WrapRange(const aValue, aLowRange, aHighRange: Integer): Integer; static; 
      class procedure Sort(var Domain: TIntArray); deprecated "Use .Sort"; 
      class function EnsureRange(const aValue, aMin, aMax: Integer): Integer; static; 
      class procedure SetBit(index: Integer; aValue: Boolean; var buffer: Integer); static; 
      class function GetBit(index: Integer; const buffer: Integer): Boolean; static;         
  
TFloat = class 
    public 
      class function PercentOfValue(const Value: Double; Total: Double): Double; static; 
  
TVariant = class 
    public 
      class function AsInteger(const aValue: Variant): Integer; static; 
      class function AsString(const aValue: Variant): String; static; 
      class function AsFloat(const aValue: Variant): Float; static; 
      class function AsObject(const aValue: Variant): TObject; static; 
      class function AsBool(const aValue: Variant): Boolean; static; 
      class function IsNull(const aValue: Variant): Boolean; static; 
      class function IsString(const aValue: Variant): Boolean; static; 
      class function IsNumber(const aValue: Variant): Boolean; static; 
      class function IsInteger(const aValue: Variant): Boolean; static; 
      class function IsBool(const aValue: Variant): Boolean; static; 
      class function IsNAN(const aValue: Variant): Boolean; static; 
      class function Properties(const aValue: Variant): TStrArray; static; 
      class function OwnProperties(const aValue: Variant): TStrArray; static; 
      class function CreateObject: Variant; static; 
      class function CreateArray: Variant; static; 
  
{ Variant management } 
function VarIsValidRef(const aRef: Variant): Boolean; 
function ObjToVariant(value: TObject): Variant; 
function VariantToObj(const Value: Variant): TObject; 
function VariantExtend(const target, prop: Variant) : Variant; overload; 
function VariantExtend(target: JObject; const prop: Variant): JObject; overload; 
 |