unit uDdeServerConv;

interface

uses
{$IFDEF VCL}
  ComCtrls,
{$ELSE}
  QComCtrls,
{$ENDIF}
  DdeMan,
  DDEml,
  Rubies;

var
  cDdeServerConv: Tvalue;

function ap_cDdeServerConv: Tvalue;
function ap_iDdeServerConv(real: TDdeServerConv; owner: Tvalue): Tvalue;
procedure Init_DdeServerConv;

implementation

uses
  SysUtils, Classes,
  uDefUtils, uIntern, uHandle, uAlloc, uProp, uPhi,
  uSizeConstraints,
  uConv,
  uIndexer,
  Graphics,
  uPersistent, uComponent, uControl;

function ap_cDdeServerConv: Tvalue;
begin
  result := cDdeServerConv;
end;

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

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

function DdeServerConv_alloc(This: Tvalue; real: TDdeServerConv): Tvalue;
begin
  result := ChildAlloc(This, real);
  DdeServerConv_setup(result, real);
end;

function ap_iDdeServerConv(real: TDdeServerConv; owner: Tvalue): Tvalue;
begin
  result := DdeServerConv_alloc(cDdeServerConv, real);
  ap_owner(result, owner);
end;

function ap_iDdeServerConv_v(var AControl; owner: Tvalue): Tvalue;
begin
  result := ap_iDdeServerConv(TDdeServerConv(AControl), owner);
end;

function DdeServerConv_allocate(This: Tvalue): Tvalue; cdecl;
var
  real: TDdeServerConv;
begin
  real := TDdeServerConv.Create(nil);
  result := CompoAlloc(This, real);
  DdeServerConv_setup(result, real);
end;

(**** str_method made by ap_src_maker ****)

function DdeServerConv_execute_macro(This, Data : Tvalue): Tvalue; cdecl;
var
  real: TDdeServerConv;
  dlv_Data : HDdeData;
begin
  real := ap_data_get_struct(This);
  dlv_Data := HDdeData(dl_Handle(Data));
  result := ap_Integer(real.ExecuteMacro( dlv_Data ));
end;
(**** made by ap_src_maker ****)

procedure Init_DdeServerConv;
begin
  cDdeServerConv := OutputPersistentClass(mPhi, TDdeServerConv, cComponent, ap_iDdeServerConv_v);
  rb_define_method(cDdeServerConv, 'event_handle', @DdeServerConv_event_handle, 1);
  rb_define_alloc_func(cDdeServerConv, @DdeServerConv_allocate);

(**** str_init made by ap_src_maker ****)
  rb_define_method(cDdeServerConv, 'execute_macro', @DdeServerConv_execute_macro, 1);
(**** made by ap_src_maker ****)

end;

end.
