library POA;

{ Primitive Object Animation :-P }

uses
  ShareMem,
  uPOA in 'uPOA.pas',
  uPOAObjects in 'uPOAObjects.pas',
  uGlobal in '..\uGlobal.pas';

type
  TCallState = (onGetProcsList, onInit, onDeInit, onProgress);
  TStringArray = array of string;

procedure Add(var SA: TStringArray; Name: string);
begin
  SetLength(SA,length(SA)+1);
  SA[length(SA)-1]:=Name;
end;

function MainProc(State: TCallState): TStringArray; stdcall;
begin
  case State of
    onGetProcsList:
      begin
        Add(Result,'POAAdd');
        Add(Result,'POAID');
        Add(Result,'POAReset');
        Add(Result,'POAObjectAdd');
        Add(Result,'POAObjectID');
        Add(Result,'POAAnimate');
        Add(Result,'POAFrameAdd');
        Add(Result,'POATime');
        Add(Result,'POAFrameTime');
        Add(Result,'POAFrameStart');
        Add(Result,'POAFrameEnd');
        Add(Result,'POAFrames');
        Add(Result,'POATransformAdd');

        Add(Result,'POAPosition');
        Add(Result,'POAScale');
        Add(Result,'POARotation');
        Add(Result,'POAVisible');

        Add(Result,'POALoad');
        Add(Result,'POASave');
      end;
    onInit:
      begin
      end;
    onDeInit:
      begin
      end;
  end;
end;

procedure SendHandles(Procs: array of pointer); stdcall;
begin
  Call:=Procs[0];
  PluginLoad:=Procs[1];
  PluginLoaded:=Procs[2];
end;

function poatest(Params: array of variant): variant; stdcall;
begin
  POAS[0].Animate(Params[0]);
end;

exports
  MainProc,
  SendHandles,

  POAAdd,
  POAID,
  POAReset,
  POAObjectAdd,
  POAObjectID,
  POAAnimate,
  POATime,
  POAFrames,
  POAFrameStart,
  POAFrameEnd,
  POAFrameTime,
  POATransformAdd,
  POAFrameAdd,

  POAPosition,
  POAScale,
  POARotation,
  POAVisible,

  POASave,
  POALoad;

begin
end.
