unit Pythia;

interface

uses
{$IFDEF LINUX}
  Types,
{$ENDIF}
{$IFDEF MSWINDOWS}
  Windows,
{$ENDIF}
  SysUtils, Classes,
{$IFDEF VCL}
  ActnList,
  Controls, Forms, StdCtrls, ExtCtrls,
  Graphics, Menus, ComCtrls, Buttons, Mask,
{$ELSE}
  QActnList,
  QControls, QForms, QStdCtrls, QExtCtrls,
  QGraphics, QMenus, QComCtrls, QButtons, QMask,
{$ENDIF}
  contnrs,
  TypInfo, Rubies, PhiHandle;

const
  PhiDLL = 'phi.so';

procedure PhiTerminate; external PhiDLL;
procedure PhiAliveTest; external PhiDLL;
function PhiAlive: Boolean; external PhiDLL;
procedure PhiBackTrace; external PhiDLL;
function PhiCallProtect(data: Tvalue): Tvalue; external PhiDLL;
function PhiExport(S: string): Tvalue; external PhiDLL;
procedure PhiSetStdoutProc(proc: TGetStrProc); external PhiDLL;
procedure PhiSetGetsFunc(func: TRetStrFunc); external PhiDLL;
procedure PhiSetGetcFunc(func: TRetChrFunc); external PhiDLL;
procedure PhiSetInitProc(proc: TProcedure); external PhiDLL;
procedure PhiLoadProtect(name: PChar; done: TNotifyEvent); external PhiDLL;
procedure PhiStart; external PhiDLL;
function UpperCase1(const S: string): string; external PhiDLL;
function LowerCase1(const S: string): string; external PhiDLL;
function ap_owner(obj, owner: Tvalue): Tvalue; external PhiDLL;
{$IFDEF VCL}
procedure ap_dispose(p: Pointer); cdecl; external PhiDLL;
procedure ObjFree(real: TObject); cdecl; external PhiDLL;
procedure ChildFree(real: TComponent); cdecl; external PhiDLL;
procedure CompoFree(real: TComponent); cdecl; external PhiDLL;
procedure FormRelease(real: TForm); cdecl; external PhiDLL;
{$ENDIF}
function CompoAlloc(klass: Tvalue; real: TComponent): Tvalue; external PhiDLL;
function FormAlloc(klass: Tvalue; real: TComponent): Tvalue; external PhiDLL;
function ChildAlloc(klass: Tvalue; real: TComponent): Tvalue; external PhiDLL;
function ObjAlloc(klass: Tvalue; real: TObject): Tvalue; external PhiDLL;
function TmpAlloc(klass: Tvalue; real: TObject): Tvalue; external PhiDLL;
{$IFDEF VCL}
function CreateParams_alloc(real: TCreateParams): Tvalue; external PhiDLL;
procedure CreateParams_assign(var real: TCreateParams; v: Tvalue); external PhiDLL;
{$ENDIF}
procedure DefineIndexer(klass: Tvalue; name: PChar; reader, writer: TFunc1); external PhiDLL;
function ap_iBasicAction(real: TBasicAction; owner: Tvalue): Tvalue; external PhiDLL;
function ap_iAction(real: TAction; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cApplication: Tvalue; external PhiDLL;
function ap_vApplication: Tvalue; external PhiDLL;
function ap_cGraphic: Tvalue; external PhiDLL;
function ap_cBitmap: Tvalue; external PhiDLL;
function ap_iBitmap(real: TBitmap; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cBrush: Tvalue; external PhiDLL;
function ap_iBrush(real: TBrush; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cButton: Tvalue; external PhiDLL;
function ap_iButton(real: TButton; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cCanvas: Tvalue; external PhiDLL;
function ap_iCanvas(real: TCanvas; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cCheckBox: Tvalue; external PhiDLL;
function ap_iCheckBox(real: TCheckBox; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cClipboard: Tvalue; external PhiDLL;
function ap_cComboBox: Tvalue; external PhiDLL;
function ap_iComboBox(real: TComboBox; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPersistent: Tvalue; external PhiDLL;
function ap_cCollectionItem: Tvalue; external PhiDLL;
function ap_cCollection: Tvalue; external PhiDLL;
procedure SetCollectionItemClass(klass: Tvalue; name: string); external PhiDLL;
procedure Collection_setup(obj: Tvalue; real: TCollection); external PhiDLL;
function Collection_aref(This, index: Tvalue): Tvalue; cdecl; external PhiDLL;
function Collection_aset(This, index, obj: Tvalue): Tvalue; cdecl; external PhiDLL;
procedure RemoveParentAttr(real: TComponent); external PhiDLL;
function ap_cComponent: Tvalue; external PhiDLL;
procedure CompoSetup(argc: integer; argv: Pointer; real: TComponent); external PhiDLL;
function DefinePersistentClass(module: Tvalue; AClass: TPersistentClass; super: Tvalue; func: TAllocFunc): Tvalue; external PhiDLL;
procedure ClearEvents(AControl: TControl); external PhiDLL;
function ap_cControl: Tvalue; external PhiDLL;
function ap_cWinControl: Tvalue; external PhiDLL;
function ap_cControlScrollBar: Tvalue; external PhiDLL;
function ap_iControlScrollBar(real: TControlScrollBar; owner: Tvalue): Tvalue; external PhiDLL;
function dl_Boolean(v: Tvalue): Boolean; external PhiDLL;
function ap_Fixnum(v: Integer): Tvalue; external PhiDLL;
function ap_Integer(v: Integer): Tvalue; external PhiDLL;
function dl_Integer(v: Tvalue): Integer; external PhiDLL;
function ap_Float(v: Double): Tvalue; external PhiDLL;
function dl_Double(v: Tvalue): Double; external PhiDLL;
function ap_String(S: string): Tvalue; external PhiDLL;
function dl_String(v: Tvalue): string; external PhiDLL;
function ap_Variant(A: Variant): Tvalue; external PhiDLL;
function dl_Variant(v: Tvalue): Variant; external PhiDLL;
function ap_set_to_ary(var v): Tvalue; deprecated; external PhiDLL;
function dl_ary_to_set(ary: Tvalue): Integer; deprecated; external PhiDLL;
function ap_Set(var v): Tvalue; external PhiDLL;
function dl_Set(ary: Tvalue): Integer; external PhiDLL;
function dl_class2name(This: Tvalue): string; external PhiDLL;
function dl_class_name_of(This: Tvalue): string; external PhiDLL;
function ap_Path(S: string): Tvalue; external PhiDLL;
function dl_Path(v: Tvalue): string; external PhiDLL;
function dl_Handle(v: Tvalue): THandle; external PhiDLL;
function ap_Handle(h: THandle): Tvalue; external PhiDLL;
procedure dl_StringArray(v: Tvalue; var ret: array of String); external PhiDLL;
function ap_StringArray(const v: array of String): Tvalue; external PhiDLL;
function dl_Point(v: Tvalue): TPoint; external PhiDLL;
function ap_DateTime(real: TDateTime): Tvalue; external PhiDLL;
function dl_DateTime(v: Tvalue): TDateTime; external PhiDLL;
function ap_cDateTime: Tvalue; external PhiDLL;
function ap_cDragObject: Tvalue; external PhiDLL;
function ap_cDragDockObject: Tvalue; external PhiDLL;
{$IFDEF VCL}
function ap_iDragDockObject(real: TDragDockObject; owner: Tvalue): Tvalue; external PhiDLL;
{$ENDIF}
function ap_iDragObject(real: TDragObject; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cEdit: Tvalue; external PhiDLL;
function ap_iEdit(real: TEdit; owner: Tvalue): Tvalue; external PhiDLL;
function PhiErrorFile: string; external PhiDLL;
function PhiErrorLine: Integer; external PhiDLL;
function ap_eDelphiError: Tvalue; external PhiDLL;
function ap_cFont: Tvalue; external PhiDLL;
function ap_iFont(real: TFont; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cForm: Tvalue; external PhiDLL;
function ap_iForm(real: TForm; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cCustomGrid: Tvalue; external PhiDLL;
function ap_cDrawGrid: Tvalue; external PhiDLL;
function ap_cStringGrid: Tvalue; external PhiDLL;
function ap_cGroupBox: Tvalue; external PhiDLL;
function ap_iGroupBox(real: TGroupBox; owner: Tvalue): Tvalue; external PhiDLL;
{$IFDEF VCL}
function retnil(argc: Integer; argv: Pointer; This: Tvalue): Tvalue; cdecl; external PhiDLL;
function retval(argc: Integer; argv: Pointer; This: Tvalue): Tvalue; cdecl; external PhiDLL;
{$ENDIF}
function PhiExtentList: TObjectList; external PhiDLL;
function PhiObjectList: TObjectList; external PhiDLL;
function PhiAllocFuncList: TStringList; external PhiDLL;
function PhiEventFuncList: TStringList; external PhiDLL;
function PhiGetHandle: TPhiHandle; external PhiDLL;
function ap_cIcon: Tvalue; external PhiDLL;
function ap_iIcon(real: TIcon; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cImage: Tvalue; external PhiDLL;
function ap_iImage(real: TImage; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cImageList: Tvalue; external PhiDLL;
function ap_cLabel: Tvalue; external PhiDLL;
function ap_iLabel(real: TLabel; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListBox: Tvalue; external PhiDLL;
function ap_iListBox(real: TListBox; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListColumn: Tvalue; external PhiDLL;
function ap_iListColumn(real: TListColumn; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListColumns: Tvalue; external PhiDLL;
function ap_iListColumns(real: TListColumns; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListItem: Tvalue; external PhiDLL;
function ap_iListItem(real: TListItem; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListItems: Tvalue; external PhiDLL;
function ap_iListItems(real: TListItems; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cListView: Tvalue; external PhiDLL;
function ap_iListView(real: TListView; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cMemo: Tvalue; external PhiDLL;
function ap_iMemo(real: TMemo; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cMainMenu: Tvalue; external PhiDLL;
function ap_iMainMenu(real: TMainMenu; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPopupMenu: Tvalue; external PhiDLL;
function ap_iPopupMenu(real: TPopupMenu; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cMenuItem: Tvalue; external PhiDLL;
function ap_iMenuItem(real: TMenuItem; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPageControl: Tvalue; external PhiDLL;
function ap_iPageControl(real: TPageControl; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPaintBox: Tvalue; external PhiDLL;
function ap_iPaintBox(real: TPaintBox; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPanel: Tvalue; external PhiDLL;
function ap_iPanel(real: TPanel; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPen: Tvalue; external PhiDLL;
function ap_iPen(real: TPen; owner: Tvalue): Tvalue; external PhiDLL;
function ap_mPhi: Tvalue; external PhiDLL;
procedure ap_obj_call_init(obj: Tvalue; argc: Integer; argv: Pvalue); external PhiDLL;
function ap_define_method(klass: Tvalue; name: PChar; func: Pointer; argc: integer): Tvalue; external PhiDLL;
procedure ap_set_child_attr_module(This: Tvalue); external PhiDLL;
function dl_caption(v: Tvalue): String; external PhiDLL;
procedure ap_loaderror(S: string); external PhiDLL;
function ap_cPicture: Tvalue; external PhiDLL;
function ap_iPicture(real: TPicture; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPoint: Tvalue; external PhiDLL;
function ap_iPoint(real: TPoint; owner: Tvalue): Tvalue; external PhiDLL;
procedure DefineAttrMethod(klass: Tvalue; name: PChar); external PhiDLL;
procedure DefineAttrMethod_retval(klass: Tvalue; name: PChar); external PhiDLL;
procedure DefineModuleAttrMethod(module: Tvalue; name: PChar); external PhiDLL;
function GetEnumName0(TypeInfo: PTypeInfo; v: Integer): string; external PhiDLL;
function GetEnumProp0(obj: TObject; PropInfo: PPropInfo): string; external PhiDLL;
function GetEnumProp1(obj: TObject; const PropName: string): string; external PhiDLL;
function GetSetProp0(obj: TObject; PropInfo: PPropInfo; Brackets: Boolean): string; external PhiDLL;
function GetSetProp1(obj: TObject; const PropName: string; Brackets: Boolean): string; external PhiDLL;
function ap_get_str_prop(obj: TObject; const PropName: string; c: Char): Tvalue; external PhiDLL;
procedure EventHandle(This, event_name: Tvalue; Handles: array of TObject); external PhiDLL;
// no intf: AssignPropMethod
procedure DefineProp(cClass: Tvalue; AClass: TClass); external PhiDLL;
procedure DefineConstSetType(module: Tvalue; TypeInfo: PTypeInfo); external PhiDLL;
function ap_cRadioButton: Tvalue; external PhiDLL;
function ap_iRadioButton(real: TRadioButton; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cRadioGroup: Tvalue; external PhiDLL;
function ap_iRadioGroup(real: TRadioGroup; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cRect: Tvalue; external PhiDLL;
function ap_iRect(real: TRect; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cScreen: Tvalue; external PhiDLL;
function ap_vScreen: Tvalue; external PhiDLL;
function ap_cScrollBar: Tvalue; external PhiDLL;
function ap_iScrollBar(real: TScrollBar; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cScrollBox: Tvalue; external PhiDLL;
function ap_iScrollBox(real: TScrollBox; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cShape: Tvalue; external PhiDLL;
function ap_iShape(real: TShape; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cSize: Tvalue; external PhiDLL;
function ap_iSize(real: TSize; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cSizeConstraints: Tvalue; external PhiDLL;
function ap_iSizeConstraints(real: TSizeConstraints; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cSpeedButton: Tvalue; external PhiDLL;
function ap_iSpeedButton(real: TSpeedButton; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cSplitter: Tvalue; external PhiDLL;
function ap_iSplitter(real: TSplitter; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cStatusBar: Tvalue; external PhiDLL;
function ap_iStatusBar(real: TStatusBar; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cToolBar: Tvalue; external PhiDLL;
function ap_iToolBar(real: TToolBar; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cToolButton: Tvalue; external PhiDLL;
function ap_iToolButton(real: TToolButton; owner: Tvalue): Tvalue; external PhiDLL;
{$IFDEF VCL}
function ap_cPageScroller: Tvalue; external PhiDLL;
function ap_iPageScroller(real: TPageScroller; owner: Tvalue): Tvalue; external PhiDLL;
{$ENDIF}
function ap_cStream: Tvalue; external PhiDLL;
function ap_iStream(real: TStream; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cStrings: Tvalue; external PhiDLL;
function ap_iStrings(real: TStrings; owner: Tvalue): Tvalue; external PhiDLL;
function dl_Strings(strings: Tvalue): TStrings; external PhiDLL;
function ap_StringList_new: Tvalue; external PhiDLL;
function ap_cTabSheet: Tvalue; external PhiDLL;
function ap_iTabSheet(real: TTabSheet; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cProgressBar: Tvalue; external PhiDLL;
function ap_iProgressBar(real: TProgressBar; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cTrackBar: Tvalue; external PhiDLL;
function ap_iTrackBar(real: TTrackBar; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cPhiThread: Tvalue; external PhiDLL;
function ap_iPhiThread(real: TThread; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cTimer: Tvalue; external PhiDLL;
function ap_iTimer(real: TTimer; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cTreeNode: Tvalue; external PhiDLL;
function ap_iTreeNode(real: TTreeNode; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cTreeNodes: Tvalue; external PhiDLL;
function ap_iTreeNodes(real: TTreeNodes; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cTreeView: Tvalue; external PhiDLL;
function ap_iTreeView(real: TTreeView; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cMaskEdit: Tvalue; external PhiDLL;
function ap_iMaskEdit(real: TMaskEdit; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cBevel: Tvalue; external PhiDLL;
function ap_iBevel(real: TBevel; owner: Tvalue): Tvalue; external PhiDLL;
function ap_vTypeInfo: Tvalue; external PhiDLL;
function ap_cBitBtn: Tvalue; external PhiDLL;
function ap_iBitBtn(real: TBitBtn; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cDataModule: Tvalue; external PhiDLL;
function ap_iDataModule(real: TDataModule; owner: Tvalue): Tvalue; external PhiDLL;
{$IFDEF VCL}
function ap_cMetafile: Tvalue; external PhiDLL;
function ap_iMetafile(real: TMetafile; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cRichEdit: Tvalue; external PhiDLL;
function ap_iRichEdit(real: TRichEdit; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cStaticText: Tvalue; external PhiDLL;
function ap_iStaticText(real: TStaticText; owner: Tvalue): Tvalue; external PhiDLL;
{$ENDIF}
{$IFDEF VCL}
function ap_cAnimate: Tvalue; external PhiDLL;
function ap_iAnimate(real: TAnimate; owner: Tvalue): Tvalue; external PhiDLL;
{$ENDIF}
{$IFDEF VCL}
function ap_cLabeledEdit: Tvalue; external PhiDLL;
function ap_iLabeledEdit(real: TLabeledEdit; owner: Tvalue): Tvalue; external PhiDLL;
function ap_cBoundLabel: Tvalue; external PhiDLL;
function ap_iBoundLabel(real: TBoundLabel; owner: Tvalue): Tvalue; external PhiDLL;
{$ENDIF}

implementation

end.
