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
  uCustomBarSeries,
  uChartSeries,
  Classes,
  uDefUtils, 
  Pythia;

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

procedure BarSeries_setup(obj: Tvalue; real: TBarSeries);
begin
  ap_set_child_attr_module(obj);
//    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_new(argc: integer; argv: Pointer; This: Tvalue): Tvalue; cdecl;
var
  real: TBarSeries;
begin
  real := TBarSeries.Create(nil);
  result := CompoAlloc(This, real);
  CompoSetup(argc, argv, real);
  BarSeries_setup(result, real);
  ap_obj_call_init(result, argc, argv);
end;

procedure Init_BarSeries;
begin
  cBarSeries := DefinePersistentClass(ap_mPhi, TBarSeries, cCustomBarSeries, ap_iBarSeries_v);
  rb_define_method(cBarSeries, 'event_handle', @BarSeries_event_handle, 1);
  DefineSingletonMethod(cBarSeries, 'new', BarSeries_new);
end;

end.
