unit uBarSeries;

interface

uses
  TeEngine,
  Chart,
  Series,
  Rubies;

var
  cBarSeries: Tvalue;

function ap_cBarSeries: Tvalue;
function ap_iBarSeries(real: TBarSeries; owner: Tvalue): Tvalue;
procedure Init_BarSeries;

implementation

uses
  uChartSeries,
  Classes,
  uDefUtils, 
  Pythia;

function ap_cBarSeries: Tvalue;
begin
  result := cBarSeries;
end;

procedure BarSeries_setup(obj: Tvalue; real: TBarSeries);
begin
//    AssignPropMethod(real, [Handle]);
end;

function BarSeries_event_handle(This, name: Tvalue): Tvalue; cdecl;
begin
  //EventHandle(This, name, [Handle]);
  result := Qnil;
end;

function BarSeries_alloc(This: Tvalue; real: TBarSeries): Tvalue;
begin
  result := ChildAlloc(This, real);
  BarSeries_setup(result, real);
end;

function ap_iBarSeries(real: TBarSeries; owner: Tvalue): Tvalue;
begin
  result := BarSeries_alloc(cBarSeries, real);
  ap_owner(result, owner);
end;

function ap_iBarSeries_v(var AControl; owner: Tvalue): Tvalue;
begin
  result := ap_iBarSeries(TBarSeries(AControl), owner);
end;

function BarSeries_allocate(This: Tvalue): Tvalue; cdecl;
var
  real: TBarSeries;
begin
  real := TBarSeries.Create(nil);
  result := CompoAlloc(This, real);
  BarSeries_setup(result, real);
end;

procedure Init_BarSeries;
begin
  cBarSeries := DefinePersistentClass(ap_mPhi, TBarSeries, cChartSeries, ap_iBarSeries_v);
  rb_define_method(cBarSeries, 'event_handle', @BarSeries_event_handle, 1);
  rb_define_alloc_func(cBarSeries, @BarSeries_allocate);
end;

end.
