Andre1 0 Posted June 28, 2022 Hi, I have written a library to make use of Firemonkey from the programming language D. Therefore I need to generate D wrapper classes / structures / enumerations for the Delphi classes / records /.... Sample: alias TCloseEvent = void delegate(TObject sender, ref TCloseAction action); alias TCloseQueryEvent = void delegate (TObject sender, ref bool canClose); enum TDeviceKind { Desktop, iPhone, iPad }; enum TFormPosition {Designed, Default, DefaultPosOnly, DefaultSizeOnly, ScreenCenter, DesktopCenter, MainFormCenter, OwnerFormCenter}; alias TDeviceKinds = TDeviceKind[]; // TODO Set of TDeviceKinds class TFormFactor: TPersistent { mixin(GenSetProperty!("Devices", TDeviceKind)); mixin(GenIntProperty!("Height")); mixin(GenIntProperty!("Width")); this(int reference) { super(reference); } } This is a manual and error prone effort. I wonder whether there is maybe a tool included in Delphi which gives me the info about the classes / records / ... for a given Delphi unit source code file like FMX.Forms.pas. Best solution would be if I can get the info as JSON / XML after the IFDEFs are sorted out by the compiler... Based on the JSON then I could easily generate the D artifacts. Is there something like this available? Kind regards André Share this post Link to post
Fr0sT.Brutal 900 Posted June 29, 2022 Try DelphiAST (link in my signature). Or you can try to find some pas-to-h converters (not sure they exist at all) which D should eat as well. 1 Share this post Link to post
Roger Cigol 103 Posted July 1, 2022 If you have RAD Studio (ie you also have C++ Builder) then the C++ FMX header files may be useful here.... Not sure about copyright / license restrictions on their use though.... Share this post Link to post