From 8a726f56c4dcdf6f8b9ca2a33b6544b36d3dca69 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Mon, 13 Mar 2023 05:28:09 +0400 Subject: [PATCH 01/12] changes to fix Lazarus and FreePascal compilation issues. --- Source/PythonEngine.pas | 6 +++++- Source/WrapDelphi.pas | 3 +++ Source/WrapDelphiClasses.pas | 19 +++++++++++++++++-- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index 4ce8aba2..c065676a 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -6066,7 +6066,11 @@ function TPythonEngine.PyUnicodeAsString(obj : PPyObject): UnicodeString; Exit; // The second argument is the size of the destination (Result) including #0 - NewSize := Utf8ToUnicode(PChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); + {$IFDEF FPC} + NewSize := Utf8ToUnicode(PUnicodeChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); + {$ELSE} + NewSize := Utf8ToUnicode(PChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); + {$ENDIF} // NewSize includes #0 SetLength(Result, NewSize - 1); end diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index a6fdbf05..a4f732d7 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -2571,6 +2571,9 @@ function TPyDelphiObject.Dir_Wrapper(args: PPyObject): PPyObject; var PyType: PPyTypeObject; + {$IFDEF FPC} + i: longint; + {$ENDIF} {$IFDEF EXTENDED_RTTI} Context: TRttiContext; RttiType: TRTTIType; diff --git a/Source/WrapDelphiClasses.pas b/Source/WrapDelphiClasses.pas index 23ca2d56..44ee1d17 100644 --- a/Source/WrapDelphiClasses.pas +++ b/Source/WrapDelphiClasses.pas @@ -5,7 +5,8 @@ interface uses - Classes, SysUtils, PythonEngine, WrapDelphi; + Classes, SysUtils, PythonEngine, WrapDelphi + {$IFDEF FPC}, bufstream{$ENDIF}; type { @@ -367,6 +368,7 @@ implementation uses TypInfo {$IFNDEF FPC}, System.Rtti{$ENDIF}; + {$IFNDEF FPC} type TPyReader = class(TReader) @@ -2223,7 +2225,12 @@ TBufferedFileStreamClass = class of TBufferedFileStream; DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LBufferSize); end else if (LArgCount = 3) then begin if (APythonType.Engine.PyArg_ParseTupleAndKeywords(args, kwds, 'sHI|i:Create', @LKwArgs2[0], @LFileName, @LMode, @LRights, @LBufferSize) <> 0) then - DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights, LBufferSize); + {$IFDEF FPC} + DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights); + DelphiObject.Size:= LBufferSize; + {$ELSE} + DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights, LBufferSize); + {$ENDIF} end; //Maybe it was created on the next attempt... @@ -2385,14 +2392,22 @@ TResourceStreamClass = class of TResourceStream; {$ELSE} if APythonType.Engine.PyArg_ParseTuple(args, 'Iss:Create', @LHandle, @LResName, @LResType) <> 0 then {$ENDIF} + {$IFDEF FPC} + DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PChar(String(LResType))) + {$ELSE} DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PWideChar(String(LResType))) + {$ENDIF} else {$IFDEF CPUX64} if APythonType.Engine.PyArg_ParseTuple(args, 'Kis:Create', @LHandle, @LResId, @LResType) <> 0 then {$ELSE} if APythonType.Engine.PyArg_ParseTuple(args, 'Iis:Create', @LHandle, @LResId, @LResType) <> 0 then {$ENDIF} + {$IFDEF FPC} + DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PChar(String(LResType))); + {$ELSE} DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PWideChar(String(LResType))); + {$ENDIF} except on E: Exception do with GetPythonEngine do From 62eab068cff182010034fde2de2b09bdc7597911 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 21 Mar 2023 05:10:33 +0400 Subject: [PATCH 02/12] addressed code review comments by pyscripter. --- Source/PythonEngine.pas | 7 ++----- Source/WrapDelphi.pas | 2 ++ Source/WrapDelphiClasses.pas | 12 ++---------- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index c065676a..64813974 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -6066,11 +6066,8 @@ function TPythonEngine.PyUnicodeAsString(obj : PPyObject): UnicodeString; Exit; // The second argument is the size of the destination (Result) including #0 - {$IFDEF FPC} - NewSize := Utf8ToUnicode(PUnicodeChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); - {$ELSE} - NewSize := Utf8ToUnicode(PChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); - {$ENDIF} + NewSize := Utf8ToUnicode(PWideChar(Result), Cardinal(Size + 1), Buffer, Cardinal(Size)); + // NewSize includes #0 SetLength(Result, NewSize - 1); end diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index a4f732d7..56daf4b0 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -2573,6 +2573,8 @@ function TPyDelphiObject.Dir_Wrapper(args: PPyObject): PPyObject; PyType: PPyTypeObject; {$IFDEF FPC} i: longint; + {$ELSE} + i: integer; {$ENDIF} {$IFDEF EXTENDED_RTTI} Context: TRttiContext; diff --git a/Source/WrapDelphiClasses.pas b/Source/WrapDelphiClasses.pas index 44ee1d17..7c1d8867 100644 --- a/Source/WrapDelphiClasses.pas +++ b/Source/WrapDelphiClasses.pas @@ -2392,22 +2392,14 @@ TResourceStreamClass = class of TResourceStream; {$ELSE} if APythonType.Engine.PyArg_ParseTuple(args, 'Iss:Create', @LHandle, @LResName, @LResType) <> 0 then {$ENDIF} - {$IFDEF FPC} - DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PChar(String(LResType))) - {$ELSE} - DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PWideChar(String(LResType))) - {$ENDIF} + DelphiObject := TResourceStreamClass(DelphiObjectClass).Create(LHandle, String(LResName), PChar(String(LResType))) else {$IFDEF CPUX64} if APythonType.Engine.PyArg_ParseTuple(args, 'Kis:Create', @LHandle, @LResId, @LResType) <> 0 then {$ELSE} if APythonType.Engine.PyArg_ParseTuple(args, 'Iis:Create', @LHandle, @LResId, @LResType) <> 0 then {$ENDIF} - {$IFDEF FPC} - DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PChar(String(LResType))); - {$ELSE} - DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PWideChar(String(LResType))); - {$ENDIF} + DelphiObject := TResourceStreamClass(DelphiObjectClass).CreateFromID(LHandle, LResId, PChar(String(LResType))); except on E: Exception do with GetPythonEngine do From 6b248612180b3fabeda0dcfa87e3741e171e8506 Mon Sep 17 00:00:00 2001 From: Norayr Chilingarian Date: Tue, 21 Mar 2023 14:52:25 +0400 Subject: [PATCH 03/12] These changes are in response to PR comments --- Source/WrapDelphi.pas | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index 56daf4b0..523f8c8d 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -2571,17 +2571,14 @@ function TPyDelphiObject.Dir_Wrapper(args: PPyObject): PPyObject; var PyType: PPyTypeObject; - {$IFDEF FPC} - i: longint; - {$ELSE} - i: integer; - {$ENDIF} + {$IFDEF EXTENDED_RTTI} Context: TRttiContext; RttiType: TRTTIType; {$ELSE} _PropList: PPropList; _propCount : Integer; + i: Integer; {$ENDIF} begin Adjust(@Self); From 3b1cf11757624a5c0c496f7a13b3fc64cd57b8fe Mon Sep 17 00:00:00 2001 From: pyscripter Date: Fri, 16 Jun 2023 15:58:55 +0300 Subject: [PATCH 04/12] Fix PR #413 --- Source/WrapDelphiClasses.pas | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Source/WrapDelphiClasses.pas b/Source/WrapDelphiClasses.pas index 7c1d8867..3f7e3ac7 100644 --- a/Source/WrapDelphiClasses.pas +++ b/Source/WrapDelphiClasses.pas @@ -368,7 +368,6 @@ implementation uses TypInfo {$IFNDEF FPC}, System.Rtti{$ENDIF}; - {$IFNDEF FPC} type TPyReader = class(TReader) @@ -2222,14 +2221,23 @@ TBufferedFileStreamClass = class of TBufferedFileStream; LArgCount := APythonType.Engine.PyTuple_Size(args); if (LArgCount = 2) then begin if (APythonType.Engine.PyArg_ParseTupleAndKeywords(args, kwds, 'sH|i:Create', @LKwArgs1[0], @LFileName, @LMode, @LBufferSize) <> 0) then + {$IFDEF FPC} + begin + DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode); + DelphiObject.Size:= LBufferSize; + end; + {$ELSE} DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LBufferSize); + {$ENDIF} end else if (LArgCount = 3) then begin if (APythonType.Engine.PyArg_ParseTupleAndKeywords(args, kwds, 'sHI|i:Create', @LKwArgs2[0], @LFileName, @LMode, @LRights, @LBufferSize) <> 0) then {$IFDEF FPC} - DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights); - DelphiObject.Size:= LBufferSize; + begin + DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights); + DelphiObject.Size:= LBufferSize; + end; {$ELSE} - DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights, LBufferSize); + DelphiObject := TBufferedFileStreamClass(DelphiObjectClass).Create(String(LFileName), LMode, LRights, LBufferSize); {$ENDIF} end; From 445de4ea48d67f5d95cb5f9fcc7d355c35f1314e Mon Sep 17 00:00:00 2001 From: pyscripter Date: Thu, 29 Jun 2023 19:06:08 +0300 Subject: [PATCH 05/12] Fix #426 --- Source/PythonEngine.pas | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index 64813974..0bf657dc 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -6371,6 +6371,10 @@ constructor TEngineClient.Create( AOwner : TComponent ); destructor TEngineClient.Destroy; begin + // if the client is destroyed before the Python Engine then + // we need to finalize it. Otherwise it will already be finalized + if FInitialized then + Finalize; Engine := nil; // This detaches the client from the Engine. if Assigned( FOnDestroy ) then FOnDestroy( Self ); @@ -8647,7 +8651,8 @@ procedure TPythonType.Initialize; procedure TPythonType.Finalize; begin - Engine.Py_CLEAR(FCreateFunc); + if Assigned(Engine) then + Engine.Py_CLEAR(FCreateFunc); FCreateFunc := nil; inherited; end; From 0b97a5a481417508266ec3e083a061c4dcbd295e Mon Sep 17 00:00:00 2001 From: pyscripter Date: Sun, 2 Jul 2023 15:20:04 +0300 Subject: [PATCH 06/12] Promoted GetSequenceItem to public --- Source/PythonEngine.pas | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index 0bf657dc..b6d7d1b5 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -1956,8 +1956,9 @@ TPythonEngine = class(TPythonInterface) function ArrayToPyDict( const items : array of const) : PPyObject; function StringsToPyList( strings : TStrings ) : PPyObject; function StringsToPyTuple( strings : TStrings ) : PPyObject; - procedure PyListToStrings(list: PPyObject; Strings: TStrings; ClearStrings: Boolean = True); + procedure PyListToStrings(list: PPyObject; Strings: TStrings; ClearStrings: Boolean = True); procedure PyTupleToStrings( tuple: PPyObject; strings : TStrings ); + function GetSequenceItem( sequence : PPyObject; idx : Integer ) : Variant; function ReturnNone : PPyObject; function ReturnTrue : PPyObject; function ReturnFalse : PPyObject; @@ -4785,6 +4786,19 @@ function TPythonEngine.GetPythonPath: UnicodeString; {$ENDIF} end; +function TPythonEngine.GetSequenceItem(sequence: PPyObject; + idx: Integer): Variant; + var + val : PPyObject; + begin + val := PySequence_GetItem( sequence, idx ); + try + Result := PyObjectAsVariant( val ); + finally + Py_XDecRef( val ); + end; +end; + function TPythonEngine.GetProgramName: UnicodeString; begin {$IFDEF POSIX} @@ -5742,18 +5756,6 @@ function TPythonEngine.PyObjectAsVariant( obj : PPyObject ) : Variant; end; end; - function GetSequenceItem( sequence : PPyObject; idx : Integer ) : Variant; - var - val : PPyObject; - begin - val := PySequence_GetItem( sequence, idx ); - try - Result := PyObjectAsVariant( val ); - finally - Py_XDecRef( val ); - end; - end; - var i, seq_length : Integer; begin From 98aa85dd8bef82512da4032c91da6411f81013ea Mon Sep 17 00:00:00 2001 From: pyscripter Date: Fri, 14 Jul 2023 04:53:47 +0300 Subject: [PATCH 07/12] Fix #428 --- Source/vcl/WrapVclGrids.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/vcl/WrapVclGrids.pas b/Source/vcl/WrapVclGrids.pas index 46410f66..3f52bbe7 100644 --- a/Source/vcl/WrapVclGrids.pas +++ b/Source/vcl/WrapVclGrids.pas @@ -717,7 +717,7 @@ function TPyDelphiStringGrid.SetCell(args: PPyObject): PPyObject; with GetPythonEngine do begin // adjust the transmitted self argument Adjust(@Self); - if PyArg_ParseTuple( args, 'iiO:GetCell',@col, @row, @value ) <> 0 then + if PyArg_ParseTuple( args, 'iiO:SetCell',@col, @row, @value ) <> 0 then begin DelphiObject.Cells[col, row]:= PyObjectAsString(value); result:=ReturnNone; From 76ef1594c3eb31555ad9aebe3319b79d04f1d9d1 Mon Sep 17 00:00:00 2001 From: pyscripter Date: Tue, 1 Aug 2023 00:21:05 +0300 Subject: [PATCH 08/12] Partial sync with the Embarcadero fork. --- Modules/DelphiVCL/DelphiVCL.dpr | 47 +- Packages/Delphi/Delphi 10.4+/PythonFmx.dpk | 3 +- Packages/Delphi/Delphi 10.4+/PythonFmx.dproj | 1 + .../Delphi/Delphi 10.4+/PythonFmxLinux.dpk | 125 +- .../Delphi/Delphi 10.4+/PythonFmxLinux.dproj | 1935 +++++++++-------- Source/Definition.Inc | 2 +- Source/PythonEngine.pas | 46 +- Source/WrapDelphi.pas | 10 +- Source/WrapDelphiClasses.pas | 16 +- Source/WrapDelphiTypes.pas | 48 +- Source/fmx/WrapDelphiFmx.pas | 3 +- Source/fmx/WrapFmxDateTime.pas | 238 ++ Source/fmx/WrapFmxDialogs.pas | 102 +- Source/fmx/WrapFmxEdit.pas | 31 +- Source/fmx/WrapFmxTypes.pas | 724 +++++- Source/vcl/WrapVclExtCtrls.pas | 120 +- Tests/FMX/Android/NumberServicesTest.pas | 12 +- Tests/FMX/Android/WrapDelphiTest.pas | 1068 ++++----- 18 files changed, 2871 insertions(+), 1660 deletions(-) create mode 100644 Source/fmx/WrapFmxDateTime.pas diff --git a/Modules/DelphiVCL/DelphiVCL.dpr b/Modules/DelphiVCL/DelphiVCL.dpr index 0275789e..ffbaabae 100644 --- a/Modules/DelphiVCL/DelphiVCL.dpr +++ b/Modules/DelphiVCL/DelphiVCL.dpr @@ -1,25 +1,22 @@ -library DelphiVCL; - -uses - SysUtils, - Classes, - uMain in 'uMain.pas'; - -{$I ..\..\Source\Definition.Inc} - -exports - // This must match the pattern "PyInit_[ProjectName]" - // So if the project is named DelphiVCL then - // the export must be PyInit_DelphiVCL - PyInit_DelphiVCL; -{$IFDEF MSWINDOWS} -{$E pyd} -{$ENDIF} -{$IFDEF LINUX} -{$SONAME 'DelphiVCL'} - -{$ENDIF} - -begin -end. - +library DelphiVCL; + +uses + SysUtils, + Classes, + uMain in 'uMain.pas'; + +{$I ..\..\Source\Definition.Inc} + +exports + // This must match the pattern "PyInit_[ProjectName]" + // So if the project is named DelphiVCL then + // the export must be PyInit_DelphiVCL + PyInit_DelphiVCL; + +{$IFDEF MSWINDOWS} +{$E pyd} +{$ENDIF} + +begin +end. + diff --git a/Packages/Delphi/Delphi 10.4+/PythonFmx.dpk b/Packages/Delphi/Delphi 10.4+/PythonFmx.dpk index ddc2ec03..8167888e 100644 --- a/Packages/Delphi/Delphi 10.4+/PythonFmx.dpk +++ b/Packages/Delphi/Delphi 10.4+/PythonFmx.dpk @@ -58,6 +58,7 @@ contains WrapFmxStdActns in '..\..\..\Source\fmx\WrapFmxStdActns.pas', WrapFmxStdCtrls in '..\..\..\Source\fmx\WrapFmxStdCtrls.pas', WrapFmxStyles in '..\..\..\Source\fmx\WrapFmxStyles.pas', - WrapFmxTypes in '..\..\..\Source\fmx\WrapFmxTypes.pas'; + WrapFmxTypes in '..\..\..\Source\fmx\WrapFmxTypes.pas', + WrapFmxDateTime in '..\..\..\Source\fmx\WrapFmxDateTime.pas'; end. diff --git a/Packages/Delphi/Delphi 10.4+/PythonFmx.dproj b/Packages/Delphi/Delphi 10.4+/PythonFmx.dproj index ecfd8d6b..f3da3849 100644 --- a/Packages/Delphi/Delphi 10.4+/PythonFmx.dproj +++ b/Packages/Delphi/Delphi 10.4+/PythonFmx.dproj @@ -158,6 +158,7 @@ + Base diff --git a/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dpk b/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dpk index 8e416898..9525324e 100644 --- a/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dpk +++ b/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dpk @@ -1,62 +1,63 @@ -package PythonFmxLinux; - -{$R *.res} -{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} -{$ALIGN 8} -{$ASSERTIONS ON} -{$BOOLEVAL OFF} -{$DEBUGINFO OFF} -{$EXTENDEDSYNTAX ON} -{$IMPORTEDDATA ON} -{$IOCHECKS ON} -{$LOCALSYMBOLS OFF} -{$LONGSTRINGS ON} -{$OPENSTRINGS ON} -{$OPTIMIZATION ON} -{$OVERFLOWCHECKS OFF} -{$RANGECHECKS OFF} -{$REFERENCEINFO OFF} -{$SAFEDIVIDE OFF} -{$STACKFRAMES OFF} -{$TYPEDADDRESS OFF} -{$VARSTRINGCHECKS ON} -{$WRITEABLECONST OFF} -{$MINENUMSIZE 1} -{$DEFINE RELEASE} -{$ENDIF IMPLICITBUILDING} -{$DESCRIPTION 'Python4Delphi - Run-time Engine Package for FMXLinux'} -{$LIBSUFFIX AUTO} -{$RUNONLY} -{$IMPLICITBUILD ON} - -requires - rtl, - python, - fmx; - -contains - FMX.PythonGUIInputOutput in '..\..\..\Source\fmx\FMX.PythonGUIInputOutput.pas', - WrapDelphiFmx in '..\..\..\Source\fmx\WrapDelphiFmx.pas', - WrapFmxActnList in '..\..\..\Source\fmx\WrapFmxActnList.pas', - WrapFmxColors in '..\..\..\Source\fmx\WrapFmxColors.pas', - WrapFmxComCtrls in '..\..\..\Source\fmx\WrapFmxComCtrls.pas', - WrapFmxControls in '..\..\..\Source\fmx\WrapFmxControls.pas', - WrapFmxDialogs in '..\..\..\Source\fmx\WrapFmxDialogs.pas', - WrapFmxEdit in '..\..\..\Source\fmx\WrapFmxEdit.pas', - WrapFmxForms in '..\..\..\Source\fmx\WrapFmxForms.pas', - WrapFmxGrids in '..\..\..\Source\fmx\WrapFmxGrids.pas', - WrapFmxLayouts in '..\..\..\Source\fmx\WrapFmxLayouts.pas', - WrapFmxListBox in '..\..\..\Source\fmx\WrapFmxListBox.pas', - WrapFmxListView in '..\..\..\Source\fmx\WrapFmxListView.pas', - WrapFmxMedia in '..\..\..\Source\fmx\WrapFmxMedia.pas', - WrapFmxMemo in '..\..\..\Source\fmx\WrapFmxMemo.pas', - WrapFmxMenus in '..\..\..\Source\fmx\WrapFmxMenus.pas', - WrapFmxScrollBox in '..\..\..\Source\fmx\WrapFmxScrollBox.pas', - WrapFmxShapes in '..\..\..\Source\fmx\WrapFmxShapes.pas', - WrapFmxStdActns in '..\..\..\Source\fmx\WrapFmxStdActns.pas', - WrapFmxStdCtrls in '..\..\..\Source\fmx\WrapFmxStdCtrls.pas', - WrapFmxStyles in '..\..\..\Source\fmx\WrapFmxStyles.pas', - WrapFmxTypes in '..\..\..\Source\fmx\WrapFmxTypes.pas'; - -end. - +package PythonFmxLinux; + +{$R *.res} +{$IFDEF IMPLICITBUILDING This IFDEF should not be used by users} +{$ALIGN 8} +{$ASSERTIONS ON} +{$BOOLEVAL OFF} +{$DEBUGINFO OFF} +{$EXTENDEDSYNTAX ON} +{$IMPORTEDDATA ON} +{$IOCHECKS ON} +{$LOCALSYMBOLS OFF} +{$LONGSTRINGS ON} +{$OPENSTRINGS ON} +{$OPTIMIZATION ON} +{$OVERFLOWCHECKS OFF} +{$RANGECHECKS OFF} +{$REFERENCEINFO OFF} +{$SAFEDIVIDE OFF} +{$STACKFRAMES OFF} +{$TYPEDADDRESS OFF} +{$VARSTRINGCHECKS ON} +{$WRITEABLECONST OFF} +{$MINENUMSIZE 1} +{$DEFINE RELEASE} +{$ENDIF IMPLICITBUILDING} +{$DESCRIPTION 'Python4Delphi - Run-time Engine Package for FMXLinux'} +{$LIBSUFFIX AUTO} +{$RUNONLY} +{$IMPLICITBUILD ON} + +requires + rtl, + python, + fmx; + +contains + FMX.PythonGUIInputOutput in '..\..\..\Source\fmx\FMX.PythonGUIInputOutput.pas', + WrapDelphiFmx in '..\..\..\Source\fmx\WrapDelphiFmx.pas', + WrapFmxActnList in '..\..\..\Source\fmx\WrapFmxActnList.pas', + WrapFmxColors in '..\..\..\Source\fmx\WrapFmxColors.pas', + WrapFmxComCtrls in '..\..\..\Source\fmx\WrapFmxComCtrls.pas', + WrapFmxControls in '..\..\..\Source\fmx\WrapFmxControls.pas', + WrapFmxDialogs in '..\..\..\Source\fmx\WrapFmxDialogs.pas', + WrapFmxEdit in '..\..\..\Source\fmx\WrapFmxEdit.pas', + WrapFmxForms in '..\..\..\Source\fmx\WrapFmxForms.pas', + WrapFmxGrids in '..\..\..\Source\fmx\WrapFmxGrids.pas', + WrapFmxLayouts in '..\..\..\Source\fmx\WrapFmxLayouts.pas', + WrapFmxListBox in '..\..\..\Source\fmx\WrapFmxListBox.pas', + WrapFmxListView in '..\..\..\Source\fmx\WrapFmxListView.pas', + WrapFmxMedia in '..\..\..\Source\fmx\WrapFmxMedia.pas', + WrapFmxMemo in '..\..\..\Source\fmx\WrapFmxMemo.pas', + WrapFmxMenus in '..\..\..\Source\fmx\WrapFmxMenus.pas', + WrapFmxScrollBox in '..\..\..\Source\fmx\WrapFmxScrollBox.pas', + WrapFmxShapes in '..\..\..\Source\fmx\WrapFmxShapes.pas', + WrapFmxStdActns in '..\..\..\Source\fmx\WrapFmxStdActns.pas', + WrapFmxStdCtrls in '..\..\..\Source\fmx\WrapFmxStdCtrls.pas', + WrapFmxStyles in '..\..\..\Source\fmx\WrapFmxStyles.pas', + WrapFmxTypes in '..\..\..\Source\fmx\WrapFmxTypes.pas', + WrapFmxDateTime in '..\..\..\Source\fmx\WrapFmxDateTime.pas'; + +end. + diff --git a/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dproj b/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dproj index 85456f05..445f21ac 100644 --- a/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dproj +++ b/Packages/Delphi/Delphi 10.4+/PythonFmxLinux.dproj @@ -1,967 +1,968 @@ - - - {B0F48139-24FB-42F3-93E8-05DA2E142904} - PythonFmxLinux.dpk - True - Release - 128 - Package - None - 19.5 - Linux64 - - - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Base - true - - - true - Cfg_1 - true - true - - - true - Base - true - - - true - Cfg_2 - true - true - - - true - Cfg_2 - true - true - - - true - Cfg_2 - true - true - - - true - Cfg_2 - true - true - - - false - false - false - false - false - 00400000 - true - true - PythonFmxLinux - Python4Delphi - Run-time Engine Package for FMXLinux - $(Auto) - true - 1046 - CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= - System;Xml;Data;Datasnap;Web;Soap;REST.Authenticator.OAuth.WebForm;$(DCC_Namespace) - $(BDSCatalogRepositoryAllUsers)\FmxLinux-1.71\redist;$(DCC_UnitSearchPath) - - - package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= - Debug - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar - - - $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png - annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar - - - $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png - - - Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) - Debug - true - CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) - 1033 - - - RELEASE;$(DCC_Define) - 0 - false - 0 - - - /usr/bin/gnome-terminal -- "%debuggee%" - - - DEBUG;$(DCC_Define) - false - true - true - true - - - Debug - - - Debug - - - Debug - - - Debug - - - - MainSource - - - - - - - - - - - - - - - - - - - - - - - - - - - - Base - - - Cfg_1 - Base - - - Cfg_2 - Base - - - - Delphi.Personality.12 - Package - - - - PythonFmxLinux.dpk - - - Embarcadero C++Builder Office 2000 Servers Package - Embarcadero C++Builder Office XP Servers Package - Microsoft Office 2000 Sample Automation Server Wrapper Components - Microsoft Office XP Sample Automation Server Wrapper Components - - - - False - False - False - False - True - False - False - False - False - - - - - true - - - - - true - - - - - true - - - - - bplPythonFmxLinux.so - true - - - - - PythonFmxLinux.bpl - true - - - - - 1 - - - 0 - - - - - classes - 64 - - - classes - 64 - - - - - res\xml - 1 - - - res\xml - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\armeabi - 1 - - - library\lib\armeabi - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - library\lib\mips - 1 - - - library\lib\mips - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - - - library\lib\armeabi-v7a - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\values-v21 - 1 - - - res\values-v21 - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - res\drawable - 1 - - - res\drawable - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-ldpi - 1 - - - res\drawable-ldpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-mdpi - 1 - - - res\drawable-mdpi - 1 - - - - - res\drawable-hdpi - 1 - - - res\drawable-hdpi - 1 - - - - - res\drawable-xhdpi - 1 - - - res\drawable-xhdpi - 1 - - - - - res\drawable-xxhdpi - 1 - - - res\drawable-xxhdpi - 1 - - - - - res\drawable-xxxhdpi - 1 - - - res\drawable-xxxhdpi - 1 - - - - - res\drawable-small - 1 - - - res\drawable-small - 1 - - - - - res\drawable-normal - 1 - - - res\drawable-normal - 1 - - - - - res\drawable-large - 1 - - - res\drawable-large - 1 - - - - - res\drawable-xlarge - 1 - - - res\drawable-xlarge - 1 - - - - - res\values - 1 - - - res\values - 1 - - - - - 1 - - - 1 - - - 0 - - - - - 1 - .framework - - - 1 - .framework - - - 1 - .framework - - - 0 - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .dll;.bpl - - - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 1 - .dylib - - - 0 - .bpl - - - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - 0 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset - 1 - - - - - 1 - - - 1 - - - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF - 1 - - - - - - - - 1 - - - 1 - - - 1 - - - - - - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - Contents\Resources - 1 - - - - - library\lib\armeabi-v7a - 1 - - - library\lib\arm64-v8a - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 1 - - - 0 - - - - - library\lib\armeabi-v7a - 1 - - - - - 1 - - - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - Assets - 1 - - - Assets - 1 - - - - - - - - - - - - - - - - 12 - - - - - + + + {B0F48139-24FB-42F3-93E8-05DA2E142904} + PythonFmxLinux.dpk + True + Release + 128 + Package + FMX + 19.5 + Linux64 + + + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Base + true + + + true + Cfg_1 + true + true + + + true + Base + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + true + Cfg_2 + true + true + + + false + false + false + false + false + 00400000 + true + true + PythonFmxLinux + Python4Delphi - Run-time Engine Package for FMXLinux + $(Auto) + true + 1046 + CompanyName=;FileDescription=;FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=;ProductVersion=1.0.0.0;Comments=;CFBundleName= + System;Xml;Data;Datasnap;Web;Soap;REST.Authenticator.OAuth.WebForm;$(DCC_Namespace) + $(BDSCatalogRepositoryAllUsers)\FmxLinux-1.71\redist;$(DCC_UnitSearchPath) + + + package=com.embarcadero.$(MSBuildProjectName);label=$(MSBuildProjectName);versionCode=1;versionName=1.0.0;persistent=False;restoreAnyVersion=False;installLocation=auto;largeHeap=False;theme=TitleBar;hardwareAccelerated=true;apiKey= + Debug + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + $(BDS)\bin\Artwork\Android\FM_LauncherIcon_192x192.png + annotation-1.2.0.dex.jar;asynclayoutinflater-1.0.0.dex.jar;billing-4.0.0.dex.jar;browser-1.0.0.dex.jar;cloud-messaging.dex.jar;collection-1.0.0.dex.jar;coordinatorlayout-1.0.0.dex.jar;core-1.5.0-rc02.dex.jar;core-common-2.0.1.dex.jar;core-runtime-2.0.1.dex.jar;cursoradapter-1.0.0.dex.jar;customview-1.0.0.dex.jar;documentfile-1.0.0.dex.jar;drawerlayout-1.0.0.dex.jar;firebase-annotations-16.0.0.dex.jar;firebase-common-20.0.0.dex.jar;firebase-components-17.0.0.dex.jar;firebase-datatransport-18.0.0.dex.jar;firebase-encoders-17.0.0.dex.jar;firebase-encoders-json-18.0.0.dex.jar;firebase-iid-interop-17.1.0.dex.jar;firebase-installations-17.0.0.dex.jar;firebase-installations-interop-17.0.0.dex.jar;firebase-measurement-connector-19.0.0.dex.jar;firebase-messaging-22.0.0.dex.jar;fmx.dex.jar;fragment-1.0.0.dex.jar;google-play-licensing.dex.jar;interpolator-1.0.0.dex.jar;javax.inject-1.dex.jar;legacy-support-core-ui-1.0.0.dex.jar;legacy-support-core-utils-1.0.0.dex.jar;lifecycle-common-2.0.0.dex.jar;lifecycle-livedata-2.0.0.dex.jar;lifecycle-livedata-core-2.0.0.dex.jar;lifecycle-runtime-2.0.0.dex.jar;lifecycle-service-2.0.0.dex.jar;lifecycle-viewmodel-2.0.0.dex.jar;listenablefuture-1.0.dex.jar;loader-1.0.0.dex.jar;localbroadcastmanager-1.0.0.dex.jar;play-services-ads-20.1.0.dex.jar;play-services-ads-base-20.1.0.dex.jar;play-services-ads-identifier-17.0.0.dex.jar;play-services-ads-lite-20.1.0.dex.jar;play-services-base-17.5.0.dex.jar;play-services-basement-17.6.0.dex.jar;play-services-cloud-messaging-16.0.0.dex.jar;play-services-drive-17.0.0.dex.jar;play-services-games-21.0.0.dex.jar;play-services-location-18.0.0.dex.jar;play-services-maps-17.0.1.dex.jar;play-services-measurement-base-18.0.0.dex.jar;play-services-measurement-sdk-api-18.0.0.dex.jar;play-services-places-placereport-17.0.0.dex.jar;play-services-stats-17.0.0.dex.jar;play-services-tasks-17.2.0.dex.jar;print-1.0.0.dex.jar;room-common-2.1.0.dex.jar;room-runtime-2.1.0.dex.jar;slidingpanelayout-1.0.0.dex.jar;sqlite-2.0.1.dex.jar;sqlite-framework-2.0.1.dex.jar;swiperefreshlayout-1.0.0.dex.jar;transport-api-3.0.0.dex.jar;transport-backend-cct-3.0.0.dex.jar;transport-runtime-3.0.0.dex.jar;user-messaging-platform-1.0.0.dex.jar;versionedparcelable-1.1.1.dex.jar;viewpager-1.0.0.dex.jar;work-runtime-2.1.0.dex.jar + + + $(BDS)\bin\Artwork\iOS\iPhone\FM_ApplicationIcon_1024x1024.png + + + Winapi;System.Win;Data.Win;Datasnap.Win;Web.Win;Soap.Win;Xml.Win;Bde;$(DCC_Namespace) + Debug + true + CompanyName=;FileDescription=$(MSBuildProjectName);FileVersion=1.0.0.0;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName) + 1033 + + + RELEASE;$(DCC_Define) + 0 + false + 0 + + + /usr/bin/gnome-terminal -- "%debuggee%" + + + DEBUG;$(DCC_Define) + false + true + true + true + + + Debug + + + Debug + + + Debug + + + Debug + + + + MainSource + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Base + + + Cfg_1 + Base + + + Cfg_2 + Base + + + + Delphi.Personality.12 + Package + + + + PythonFmxLinux.dpk + + + Embarcadero C++Builder Office 2000 Servers Package + Embarcadero C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + + + + False + False + False + False + True + False + False + False + False + + + + + true + + + + + true + + + + + true + + + + + bplPythonFmxLinux.so + true + + + + + PythonFmxLinux.bpl + true + + + + + 1 + + + 0 + + + + + classes + 64 + + + classes + 64 + + + + + res\xml + 1 + + + res\xml + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\armeabi + 1 + + + library\lib\armeabi + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + library\lib\mips + 1 + + + library\lib\mips + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + + + library\lib\armeabi-v7a + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\values-v21 + 1 + + + res\values-v21 + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + res\drawable + 1 + + + res\drawable + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-ldpi + 1 + + + res\drawable-ldpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-mdpi + 1 + + + res\drawable-mdpi + 1 + + + + + res\drawable-hdpi + 1 + + + res\drawable-hdpi + 1 + + + + + res\drawable-xhdpi + 1 + + + res\drawable-xhdpi + 1 + + + + + res\drawable-xxhdpi + 1 + + + res\drawable-xxhdpi + 1 + + + + + res\drawable-xxxhdpi + 1 + + + res\drawable-xxxhdpi + 1 + + + + + res\drawable-small + 1 + + + res\drawable-small + 1 + + + + + res\drawable-normal + 1 + + + res\drawable-normal + 1 + + + + + res\drawable-large + 1 + + + res\drawable-large + 1 + + + + + res\drawable-xlarge + 1 + + + res\drawable-xlarge + 1 + + + + + res\values + 1 + + + res\values + 1 + + + + + 1 + + + 1 + + + 0 + + + + + 1 + .framework + + + 1 + .framework + + + 1 + .framework + + + 0 + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .dll;.bpl + + + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 1 + .dylib + + + 0 + .bpl + + + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + 0 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + ..\$(PROJECTNAME).launchscreen\Assets\AppIcon.appiconset + 1 + + + + + 1 + + + 1 + + + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + ..\$(PROJECTNAME).app.dSYM\Contents\Resources\DWARF + 1 + + + + + + + + 1 + + + 1 + + + 1 + + + + + + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + Contents\Resources + 1 + + + + + library\lib\armeabi-v7a + 1 + + + library\lib\arm64-v8a + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 1 + + + 0 + + + + + library\lib\armeabi-v7a + 1 + + + + + 1 + + + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + Assets + 1 + + + Assets + 1 + + + + + + + + + + + + + + + + 12 + + + + + diff --git a/Source/Definition.Inc b/Source/Definition.Inc index 5c2723b7..826b61a9 100644 --- a/Source/Definition.Inc +++ b/Source/Definition.Inc @@ -108,7 +108,7 @@ {$DEFINE DELPHIXE6_OR_HIGHER} {$DEFINE DELPHIXE7_OR_HIGHER} {$DEFINE DELPHIXE8_OR_HIGHER} - {$DEFINE DELPHIX10_OR_HIGHER} + {$DEFINE DELPHI10_OR_HIGHER} {$ENDIF} {$IFDEF VER310} // Delphi 10.1 {$DEFINE DELPHI10_1} diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index b6d7d1b5..dbc139e2 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -1237,7 +1237,8 @@ TDynamicDll = class(TComponent) procedure LoadPythonInfoFromModule; function GetPythonModuleFromProcess(): NativeUInt; - function HasHostSymbols(): boolean; + // Check for Python symbols in the current loaded library (FDLLHandle) + function HasPythonSymbolsInLibrary(): boolean; procedure LoadFromHostSymbols(); //Loading strategies function TryLoadFromHostSymbols(): boolean; @@ -1612,6 +1613,7 @@ TPythonInterface=class(TDynamicDll) PyBytes_Size:function (ob:PPyObject):NativeInt; cdecl; PyBytes_DecodeEscape:function(s:PAnsiChar; len:NativeInt; errors:PAnsiChar; unicode:NativeInt; recode_encoding:PAnsiChar):PPyObject; cdecl; PyBytes_Repr:function(ob:PPyObject; smartquotes:integer):PPyObject; cdecl; + PyBytes_FromObject: function(ob:PPyObject): PPyObject; cdecl; PyByteArray_Concat: procedure(var ob1: PPyObject; ob2: PPyObject); cdecl; PyByteArray_Resize: procedure(var ob1: PPyObject; len: Py_ssize_t); cdecl; PyByteArray_FromObject: function(ob:PPyObject): PPyObject; cdecl; @@ -1987,6 +1989,7 @@ TPythonEngine = class(TPythonInterface) function PyUnicodeAsString( obj : PPyObject ) : UnicodeString; function PyUnicodeAsUTF8String( obj : PPyObject ) : RawByteString; function PyBytesAsAnsiString( obj : PPyObject ) : AnsiString; + function PyByteArrayAsAnsiString( obj : PPyObject ) : AnsiString; // Public Properties property ClientCount : Integer read GetClientCount; @@ -3093,16 +3096,10 @@ function TDynamicDll.GetPythonModuleFromProcess(): NativeUInt; {$IFNDEF FPC} function HasSymbols(const AModule: NativeUInt): boolean; - var - LPy_GetBuildInfo: function : PAnsiChar; cdecl; - LPy_IsInitialized: function: integer; cdecl; begin FDLLHandle := AModule; try - LPy_GetBuildInfo := Import('Py_GetBuildInfo', false); - LPy_IsInitialized := Import('Py_IsInitialized', false); - Result := Assigned(LPy_GetBuildInfo) and Assigned(LPy_GetBuildInfo()) - and Assigned(LPy_IsInitialized) and (LPy_IsInitialized() <> 0); + Result := HasPythonSymbolsInLibrary(); finally FDLLHandle := 0; end; @@ -3308,10 +3305,16 @@ function TDynamicDll.TryLoadFromCurrentProcess: boolean; function TDynamicDll.TryLoadFromHostSymbols: boolean; begin //We want to look in for host symbols at first + {$IFNDEF FPC} + FDLLHandle := LoadLibrary(''); + {$ELSE} FDLLHandle := 0; - Result := HasHostSymbols(); + {$ENDIF} + Result := HasPythonSymbolsInLibrary(); if Result then - LoadFromHostSymbols(); + LoadFromHostSymbols() + else + FDLLHandle := 0; end; procedure TDynamicDll.LoadFromHostSymbols; @@ -3412,12 +3415,15 @@ function TDynamicDll.GetQuitMessage : string; Result := Format( 'Dll %s could not be loaded. We must quit.', [DllName]); end; -function TDynamicDll.HasHostSymbols: boolean; +function TDynamicDll.HasPythonSymbolsInLibrary: boolean; var + LPy_GetBuildInfo: function: PAnsiChar; cdecl; LPy_IsInitialized: function: integer; cdecl; begin + LPy_GetBuildInfo := Import('Py_GetBuildInfo', false); LPy_IsInitialized := Import('Py_IsInitialized', false); - Result := Assigned(LPy_IsInitialized) and (LPy_IsInitialized() <> 0); + Result := Assigned(LPy_GetBuildInfo) and Assigned(LPy_GetBuildInfo()) + and Assigned(LPy_IsInitialized) and (LPy_IsInitialized() <> 0); end; procedure TDynamicDll.Quit; @@ -3808,6 +3814,7 @@ procedure TPythonInterface.MapDll; PyBytes_DecodeEscape := Import('PyBytes_DecodeEscape'); PyBytes_Repr := Import('PyBytes_Repr'); _PyBytes_Resize := Import('_PyBytes_Resize'); + PyBytes_FromObject := Import('PyBytes_FromObject'); PyByteArray_AsString := Import('PyByteArray_AsString'); PyByteArray_Concat := Import('PyByteArray_Concat'); PyByteArray_Resize := Import('PyByteArray_Resize'); @@ -6039,6 +6046,21 @@ procedure TPythonEngine.PyTupleToStrings( tuple: PPyObject; strings : TStrings ) strings.Add( PyObjectAsString( PyTuple_GetItem( tuple, i ) ) ); end; +function TPythonEngine.PyByteArrayAsAnsiString(obj: PPyObject): AnsiString; +var + LBuffer: PAnsiChar; + LSize: Py_ssize_t; +begin + if PyByteArray_Check(obj) then + begin + LSize := PyByteArray_Size(obj); + LBuffer := PyByteArray_AsString(obj); + SetString(Result, LBuffer, LSize); + end + else + raise EPythonError.CreateFmt(SPyConvertionError, ['PyByteArrayAsAnsiString', 'ByteArray']); +end; + function TPythonEngine.PyBytesAsAnsiString(obj: PPyObject): AnsiString; var buffer: PAnsiChar; diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index 523f8c8d..3eb9aba0 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -2043,8 +2043,11 @@ function RttiCall(ParentAddress: pointer; PythonType: TPythonType; try if ParentRtti is TRttiInstanceType then - if meth.IsClassMethod then - Addr := TValue.From(TObject(ParentAddress).ClassType) + if meth.IsClassMethod or meth.IsStatic then + if AParentAddrIsClass then + Addr := TValue.From(TClass(ParentAddress)) + else + Addr := TValue.From(TObject(ParentAddress).ClassType) else Addr := TValue.From(TObject(ParentAddress)) else if ParentRtti is TRttiInterfaceType then @@ -2571,7 +2574,6 @@ function TPyDelphiObject.Dir_Wrapper(args: PPyObject): PPyObject; var PyType: PPyTypeObject; - {$IFDEF EXTENDED_RTTI} Context: TRttiContext; RttiType: TRTTIType; @@ -2688,7 +2690,6 @@ procedure TPyDelphiObject.Notify(ADeletedObject: TObject); class procedure TPyDelphiObject.RegisterGetSets(PythonType: TPythonType); begin inherited; - // then register TObject + custom getters/setters. with PythonType do begin @@ -4022,4 +4023,3 @@ finalization {$ENDIF} FreeAndNil(gRegisteredUnits); end. - diff --git a/Source/WrapDelphiClasses.pas b/Source/WrapDelphiClasses.pas index 3f7e3ac7..2e2ae482 100644 --- a/Source/WrapDelphiClasses.pas +++ b/Source/WrapDelphiClasses.pas @@ -1927,7 +1927,7 @@ class procedure TPyDelphiStream.RegisterMethods(PythonType: TPythonType); begin inherited; PythonType.AddMethod('ReadBytes', @TPyDelphiStream.ReadBytes_Wrapper, - 'TPyDelphiStream.ReadBytes()' + #10 + 'Read content as bytearray.'); + 'TPyDelphiStream.ReadBytes()' + #10 + 'Read content as bytes.'); PythonType.AddMethod('ReadInt', @TPyDelphiStream.ReadInt_Wrapper, 'TPyDelphiStream.ReadInt()' + #10 + 'Read content as integer.'); PythonType.AddMethod('ReadString', @TPyDelphiStream.ReadString_Wrapper, @@ -1936,7 +1936,7 @@ class procedure TPyDelphiStream.RegisterMethods(PythonType: TPythonType); 'TPyDelphiStream.ReadFloat()' + #10 + 'Read content as float.'); PythonType.AddMethod('WriteBytes', @TPyDelphiStream.WriteBytes_Wrapper, - 'TPyDelphiStream.WriteBytes()' + #10 + 'Write content as bytearray.'); + 'TPyDelphiStream.WriteBytes()' + #10 + 'Write content as bytes.'); PythonType.AddMethod('WriteInt', @TPyDelphiStream.WriteInt_Wrapper, 'TPyDelphiStream.WriteInt()' + #10 + 'Write content as integer.'); PythonType.AddMethod('WriteString', @TPyDelphiStream.WriteString_Wrapper, @@ -1978,7 +1978,7 @@ function TPyDelphiStream.ReadBytes_Wrapper(const AArgs: PPyObject): PPyObject; Py_XDecRef(LItem); end; //The content - LItem := PyByteArray_FromObject(LBytes); + LItem := PyBytes_FromObject(LBytes); Py_XDecRef(LBytes); PyList_Append(Result, LItem); Py_XDecRef(LItem); @@ -2060,9 +2060,9 @@ function TPyDelphiStream.WriteBytes_Wrapper(const AArgs: PPyObject): PPyObject; Adjust(@Self); Result := nil; with GetPythonEngine() do begin - if PyArg_ParseTuple(AArgs, 'Yi:Create', @LValue, @LCount) <> 0 then - if PyByteArray_Check(LValue) then begin - LBuffer := TEncoding.Default.GetBytes(String(PyByteArray_AsString(LValue))); + if PyArg_ParseTuple(AArgs, 'Si:Create', @LValue, @LCount) <> 0 then + if PyBytes_Check(LValue) then begin + LBuffer := TEncoding.Default.GetBytes(String(PyBytesAsAnsiString(LValue))); Result := PyLong_FromLong(DelphiObject.Write(LBuffer, LCount)); end; end; @@ -2315,13 +2315,13 @@ TBytesStreamClass = class of TBytesStream; if APythonType.Engine.PyByteArray_Check(LBytes) then begin DelphiObject := TBytesStreamClass(DelphiObjectClass).Create( TEncoding.Default.GetBytes( - String(APythonType.Engine.PyByteArray_AsString(LBytes)))); + String(APythonType.Engine.PyByteArrayAsAnsiString(LBytes)))); end; end else if APythonType.Engine.PyArg_ParseTuple(args, 'S:Create', @LBytes) <> 0 then begin if APythonType.Engine.PyBytes_Check(LBytes) then begin DelphiObject := TBytesStreamClass(DelphiObjectClass).Create( TEncoding.Default.GetBytes( - String(APythonType.Engine.PyBytes_AsString(LBytes)))); + String(APythonType.Engine.PyBytesAsAnsiString(LBytes)))); end; end; diff --git a/Source/WrapDelphiTypes.pas b/Source/WrapDelphiTypes.pas index 55ef30aa..12f7718c 100644 --- a/Source/WrapDelphiTypes.pas +++ b/Source/WrapDelphiTypes.pas @@ -9,7 +9,11 @@ interface SysUtils, PythonEngine, Types, - WrapDelphi; + WrapDelphi + {$IFNDEF FPC} + , System.UITypes + {$ENDIF FPC} + ; type TPyDelphiPoint = class(TPyObject) @@ -95,10 +99,14 @@ TPyDelphiSize = class(TPyObject) function CheckRectAttribute(AAttribute : PPyObject; const AAttributeName : string; out AValue : TRect) : Boolean; function CheckSizeAttribute(AAttribute : PPyObject; const AAttributeName : string; out AValue : TSize) : Boolean; + {$IFNDEF FPC} + function MouseButtonToPython(const AMouseButton: TMouseButton): PPyObject; + {$ENDIF FPC} + implementation uses - Math; + Math, Rtti; { Register the wrappers, the globals and the constants } type @@ -114,6 +122,31 @@ TTypesRegistration = class(TRegisteredUnit) procedure TTypesRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper); begin inherited; + {$IFNDEF FPC} + APyDelphiWrapper.DefineVar('crDefault', crDefault); + APyDelphiWrapper.DefineVar('crNone', crNone); + APyDelphiWrapper.DefineVar('crArrow', crArrow); + APyDelphiWrapper.DefineVar('crCross', crCross); + APyDelphiWrapper.DefineVar('crIBeam', crIBeam); + APyDelphiWrapper.DefineVar('crSize', crSize); + APyDelphiWrapper.DefineVar('crSizeNESW', crSizeNESW); + APyDelphiWrapper.DefineVar('crSizeNS', crSizeNS); + APyDelphiWrapper.DefineVar('crSizeNWSE', crSizeNWSE); + APyDelphiWrapper.DefineVar('crSizeWE', crSizeWE); + APyDelphiWrapper.DefineVar('crUpArrow', crUpArrow); + APyDelphiWrapper.DefineVar('crHourGlass', crHourGlass); + APyDelphiWrapper.DefineVar('crDrag', crDrag); + APyDelphiWrapper.DefineVar('crNoDrop', crNoDrop); + APyDelphiWrapper.DefineVar('crHSplit', crHSplit); + APyDelphiWrapper.DefineVar('crVSplit', crVSplit); + APyDelphiWrapper.DefineVar('crMultiDrag', crMultiDrag); + APyDelphiWrapper.DefineVar('crSQLWait', crSQLWait); + APyDelphiWrapper.DefineVar('crNo', crNo); + APyDelphiWrapper.DefineVar('crAppStart', crAppStart); + APyDelphiWrapper.DefineVar('crHelp', crHelp); + APyDelphiWrapper.DefineVar('crHandPoint', crHandPoint); + APyDelphiWrapper.DefineVar('crSizeAll', crSizeAll); + {$ENDIF FPC} end; function TTypesRegistration.Name: string; @@ -129,7 +162,16 @@ procedure TTypesRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrapper APyDelphiWrapper.RegisterHelperType(TPyDelphiSize); end; +{$IFNDEF FPC} +function MouseButtonToPython(const AMouseButton: TMouseButton): PPyObject; +begin + Result := GetPythonEngine.PyUnicodeFromString( + TRttiEnumerationType.GetName(AMouseButton)); +end; +{$ENDIF FPC} + { Helper functions } + function WrapPoint(APyDelphiWrapper : TPyDelphiWrapper; const APoint : TPoint) : PPyObject; var _type : TPythonType; @@ -509,7 +551,6 @@ class procedure TPyDelphiRect.SetupType(PythonType: TPythonType); PythonType.Services.Basic := [bsGetAttrO, bsSetAttrO, bsRepr, bsStr, bsRichCompare]; end; - { TPyDelphiSize } function TPyDelphiSize.Compare(obj: PPyObject): Integer; @@ -612,4 +653,5 @@ function TPyDelphiSize.Set_CY(AValue: PPyObject; initialization RegisteredUnits.Add(TTypesRegistration.Create); + end. diff --git a/Source/fmx/WrapDelphiFmx.pas b/Source/fmx/WrapDelphiFmx.pas index 558ea03d..4e1505e1 100644 --- a/Source/fmx/WrapDelphiFmx.pas +++ b/Source/fmx/WrapDelphiFmx.pas @@ -33,6 +33,7 @@ implementation WrapFmxMenus, WrapFmxStyles, WrapFmxMemo, - WrapFmxColors; + WrapFmxColors, + WrapFmxDateTime; end. diff --git a/Source/fmx/WrapFmxDateTime.pas b/Source/fmx/WrapFmxDateTime.pas new file mode 100644 index 00000000..1fc12e31 --- /dev/null +++ b/Source/fmx/WrapFmxDateTime.pas @@ -0,0 +1,238 @@ +unit WrapFmxDateTime; + +interface + +uses + Classes, + FMX.DateTimeCtrls, FMX.Calendar, + PythonEngine, WrapDelphi, WrapFmxControls; + +type + {|||| FMX.DateTimeCtrls ||||} + + TPyDelphiCustomDateTimeEdit = class(TPyDelphiTextControl) + private + function GetDelphiObject: TCustomDateTimeEdit; + procedure SetDelphiObject(const Value: TCustomDateTimeEdit); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TCustomDateTimeEdit read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiCustomTimeEdit = class(TPyDelphiCustomDateTimeEdit) + private + function GetDelphiObject: TCustomTimeEdit; + procedure SetDelphiObject(const Value: TCustomTimeEdit); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TCustomTimeEdit read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiTimeEdit = class(TPyDelphiCustomTimeEdit) + private + function GetDelphiObject: TTimeEdit; + procedure SetDelphiObject(const Value: TTimeEdit); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TTimeEdit read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiCustomDateEdit = class(TPyDelphiCustomDateTimeEdit) + private + function GetDelphiObject: TCustomDateEdit; + procedure SetDelphiObject(const Value: TCustomDateEdit); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TCustomDateEdit read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiDateEdit = class(TPyDelphiCustomDateEdit) + private + function GetDelphiObject: TDateEdit; + procedure SetDelphiObject(const Value: TDateEdit); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TDateEdit read GetDelphiObject write SetDelphiObject; + end; + + {|||| FMX.Calendar ||||} + + TPyDelphiCustomCalendar = class(TPyDelphiPresentedControl) + private + function GetDelphiObject: TCustomCalendar; + procedure SetDelphiObject(const Value: TCustomCalendar); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TCustomCalendar read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiCalendar = class(TPyDelphiCustomCalendar) + private + function GetDelphiObject: TCalendar; + procedure SetDelphiObject(const Value: TCalendar); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TCalendar read GetDelphiObject write SetDelphiObject; + end; + +implementation + +type +{ Register the wrappers, the globals and the constants } + TDateTimeRegistration = class(TRegisteredUnit) + public + function Name : string; override; + procedure RegisterWrappers(APyDelphiWrapper : TPyDelphiWrapper); override; + end; + +{ TDateTimeRegistration } + +function TDateTimeRegistration.Name: string; +begin + Result := 'DateTimeCtrls'; +end; + +procedure TDateTimeRegistration.RegisterWrappers( + APyDelphiWrapper: TPyDelphiWrapper); +begin + inherited; + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomDateTimeEdit); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomTimeEdit); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTimeEdit); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomDateEdit); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiDateEdit); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomCalendar); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCalendar); +end; + +{ TPyDelphiCustomDateTimeEdit } + +class function TPyDelphiCustomDateTimeEdit.DelphiObjectClass: TClass; +begin + Result := TCustomDateTimeEdit; +end; + +function TPyDelphiCustomDateTimeEdit.GetDelphiObject: TCustomDateTimeEdit; +begin + Result := TCustomDateTimeEdit(inherited DelphiObject); +end; + +procedure TPyDelphiCustomDateTimeEdit.SetDelphiObject( + const Value: TCustomDateTimeEdit); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiCustomTimeEdit } + +class function TPyDelphiCustomTimeEdit.DelphiObjectClass: TClass; +begin + Result := TCustomTimeEdit; +end; + +function TPyDelphiCustomTimeEdit.GetDelphiObject: TCustomTimeEdit; +begin + Result := TCustomTimeEdit(inherited DelphiObject); +end; + +procedure TPyDelphiCustomTimeEdit.SetDelphiObject(const Value: TCustomTimeEdit); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiTimeEdit } + +class function TPyDelphiTimeEdit.DelphiObjectClass: TClass; +begin + Result := TTimeEdit; +end; + +function TPyDelphiTimeEdit.GetDelphiObject: TTimeEdit; +begin + Result := TTimeEdit(inherited DelphiObject); +end; + +procedure TPyDelphiTimeEdit.SetDelphiObject(const Value: TTimeEdit); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiCustomDateEdit } + +class function TPyDelphiCustomDateEdit.DelphiObjectClass: TClass; +begin + Result := TCustomDateEdit; +end; + +function TPyDelphiCustomDateEdit.GetDelphiObject: TCustomDateEdit; +begin + Result := TCustomDateEdit(inherited DelphiObject); +end; + +procedure TPyDelphiCustomDateEdit.SetDelphiObject(const Value: TCustomDateEdit); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiDateEdit } + +class function TPyDelphiDateEdit.DelphiObjectClass: TClass; +begin + Result := TDateEdit; +end; + +function TPyDelphiDateEdit.GetDelphiObject: TDateEdit; +begin + Result := TDateEdit(inherited DelphiObject); +end; + +procedure TPyDelphiDateEdit.SetDelphiObject(const Value: TDateEdit); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiCustomCalendar } + +class function TPyDelphiCustomCalendar.DelphiObjectClass: TClass; +begin + Result := TCustomCalendar; +end; + +function TPyDelphiCustomCalendar.GetDelphiObject: TCustomCalendar; +begin + Result := TCustomCalendar(inherited DelphiObject); +end; + +procedure TPyDelphiCustomCalendar.SetDelphiObject(const Value: TCustomCalendar); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiCalendar } + +class function TPyDelphiCalendar.DelphiObjectClass: TClass; +begin + Result := TCalendar; +end; + +function TPyDelphiCalendar.GetDelphiObject: TCalendar; +begin + Result := TCalendar(inherited DelphiObject); +end; + +procedure TPyDelphiCalendar.SetDelphiObject(const Value: TCalendar); +begin + inherited DelphiObject := Value; +end; + +initialization + RegisteredUnits.Add(TDateTimeRegistration.Create); + +end. diff --git a/Source/fmx/WrapFmxDialogs.pas b/Source/fmx/WrapFmxDialogs.pas index 8e9ae53c..059dcd66 100644 --- a/Source/fmx/WrapFmxDialogs.pas +++ b/Source/fmx/WrapFmxDialogs.pas @@ -5,7 +5,8 @@ interface uses - FMX.Dialogs, WrapFmxTypes, PythonEngine; + FMX.Dialogs, FMX.DialogService, + WrapDelphi, WrapFmxTypes, PythonEngine; type @@ -27,10 +28,36 @@ TPyDelphiOpenDialog = class(TPyDelphiFmxObject) write SetDelphiObject; end; -implementation + TPyDelphiSaveDialog = class(TPyDelphiFmxObject) + private + function GetDelphiObject: TSaveDialog; + procedure SetDelphiObject(const Value: TSaveDialog); + protected + // Exposed Methods + function Execute_Wrapper(args: PPyObject): PPyObject; cdecl; + // Property Getters + function Get_filename(AContext: Pointer): PPyObject; cdecl; + public + class function DelphiObjectClass: TClass; override; + class procedure RegisterGetSets(PythonType: TPythonType); override; + class procedure RegisterMethods(PythonType: TPythonType); override; + // Properties + property DelphiObject: TSaveDialog read GetDelphiObject + write SetDelphiObject; + end; -uses - WrapDelphi; + TPyDelphiDialogService = class(TPyDelphiObject) + private + function GetDelphiObject: TDialogService; + procedure SetDelphiObject(const Value: TDialogService); + public + class function DelphiObjectClass: TClass; override; + public + property DelphiObject: TDialogService read GetDelphiObject + write SetDelphiObject; + end; + +implementation { Register the wrappers, the globals and the constants } type @@ -58,6 +85,8 @@ procedure TDialogRegistration.RegisterWrappers( begin inherited; APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiOpenDialog); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSaveDialog); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiDialogService); end; { TPyDelphiOpenDialog } @@ -108,6 +137,71 @@ procedure TPyDelphiOpenDialog.SetDelphiObject(const Value: TOpenDialog); inherited DelphiObject := Value; end; +{ TPyDelphiSaveDialog } + +class function TPyDelphiSaveDialog.DelphiObjectClass: TClass; +begin + Result := TSaveDialog; +end; + +function TPyDelphiSaveDialog.Execute_Wrapper(args: PPyObject): PPyObject; +begin + // We adjust the transmitted self argument + Adjust(@Self); + with GetPythonEngine do begin + if PyArg_ParseTuple( args, ':Execute') <> 0 then + Result := VariantAsPyObject(DelphiObject.Execute()) + else + Result := nil; + end; +end; + +function TPyDelphiSaveDialog.GetDelphiObject: TSaveDialog; +begin + Result := TSaveDialog(inherited DelphiObject); +end; + +function TPyDelphiSaveDialog.Get_filename(AContext: Pointer): PPyObject; +begin + Adjust(@self); + Result := GetPythonEngine.VariantAsPyObject(DelphiObject.FileName); +end; + +class procedure TPyDelphiSaveDialog.RegisterGetSets(PythonType: TPythonType); +begin + PythonType.AddGetSet('FileName', @TPyDelphiOpenDialog.Get_filename, + nil, '', nil); +end; + +class procedure TPyDelphiSaveDialog.RegisterMethods(PythonType: TPythonType); +begin + PythonType.AddMethod('Execute', @TPyDelphiOpenDialog.Execute_Wrapper, + 'TOpenDialog.Execute()'#10 + + 'Displays the dialog'); +end; + +procedure TPyDelphiSaveDialog.SetDelphiObject(const Value: TSaveDialog); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiDialogService } + +class function TPyDelphiDialogService.DelphiObjectClass: TClass; +begin + Result := TDialogService; +end; + +function TPyDelphiDialogService.GetDelphiObject: TDialogService; +begin + Result := TDialogService(inherited DelphiObject); +end; + +procedure TPyDelphiDialogService.SetDelphiObject(const Value: TDialogService); +begin + inherited DelphiObject := Value; +end; + initialization RegisteredUnits.Add(TDialogRegistration.Create); diff --git a/Source/fmx/WrapFmxEdit.pas b/Source/fmx/WrapFmxEdit.pas index 74f60fd9..05a0cee5 100644 --- a/Source/fmx/WrapFmxEdit.pas +++ b/Source/fmx/WrapFmxEdit.pas @@ -5,7 +5,7 @@ interface uses - FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox, + FMX.Edit, FMX.SearchBox, FMX.ComboEdit, FMX.EditBox, FMX.SpinBox, FMX.NumberBox, PythonEngine, WrapFmxTypes, WrapFmxControls; @@ -98,6 +98,17 @@ TPyDelphiSpinBox = class(TPyDelphiCustomEditBox) write SetDelphiObject; end; + TPyDelphiNumberBox = class(TPyDelphiCustomEditBox) + private + function GetDelphiObject: TNumberBox; + procedure SetDelphiObject(const Value: TNumberBox); + public + class function DelphiObjectClass: TClass; override; + // Properties + property DelphiObject: TNumberBox read GetDelphiObject + write SetDelphiObject; + end; + implementation uses @@ -136,6 +147,7 @@ procedure TEditRegistration.RegisterWrappers( APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiComboEdit); APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomEditBox); APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiSpinBox); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiNumberBox); end; { TPyDelphiCustomEdit } @@ -275,6 +287,23 @@ procedure TPyDelphiSpinBox.SetDelphiObject(const Value: TSpinBox); inherited DelphiObject := Value; end; +{ TPyDelphiNumberBox } + +class function TPyDelphiNumberBox.DelphiObjectClass: TClass; +begin + Result := TNumberBox; +end; + +function TPyDelphiNumberBox.GetDelphiObject: TNumberBox; +begin + Result := TNumberBox(inherited DelphiObject); +end; + +procedure TPyDelphiNumberBox.SetDelphiObject(const Value: TNumberBox); +begin + inherited DelphiObject := Value; +end; + initialization RegisteredUnits.Add(TEditRegistration.Create); diff --git a/Source/fmx/WrapFmxTypes.pas b/Source/fmx/WrapFmxTypes.pas index 5ab014a4..efc3c7f4 100644 --- a/Source/fmx/WrapFmxTypes.pas +++ b/Source/fmx/WrapFmxTypes.pas @@ -4,7 +4,8 @@ interface uses - System.Types, FMX.Types, PythonEngine, WrapDelphi, WrapDelphiClasses; + System.Types, FMX.Types, PythonEngine, WrapDelphi, WrapDelphiClasses, + System.TypInfo, System.UITypes, System.Classes; type { @@ -72,6 +73,25 @@ TPyDelphiRectF = class(TPyObject) property Value: TRectF read FValue write FValue; end; + TPyDelphiTouch = class(TPyObject) + private + FValue: TTouch; + FPyDelphiWrapper: TPyDelphiWrapper; + protected + // Exposed Getters + function Get_Location(AContext: Pointer): PPyObject; cdecl; + // Exposed Setters + function Set_Location(AValue: PPyObject; AContext: Pointer): integer; cdecl; + public + constructor Create(APythonType: TPythonType); override; + constructor CreateWith(APythonType: TPythonType; args: PPyObject); override; + function Compare(obj: PPyObject): Integer; override; + function Repr: PPyObject; override; + class procedure RegisterGetSets(PythonType: TPythonType); override; + class procedure SetupType(PythonType: TPythonType); override; + property Value : TTouch read FValue write FValue; + end; + TPyDelphiFmxObject = class(TPyDelphiComponent) private function GetDelphiObject: TFmxObject; @@ -158,18 +178,100 @@ TPyDelphiTimer = class (TPyDelphiComponent) property DelphiObject: TTimer read GetDelphiObject write SetDelphiObject; end; + TMouseEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TMouseMoveEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; Shift: TShiftState; X, Y: Single); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TMouseWheelEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; Shift: TShiftState; WheelDelta: Integer; var Handled: Boolean); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TKeyEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; var Key: Word; var KeyChar: WideChar; Shift: TShiftState); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TProcessTickEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; time, deltaTime: Single); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TVirtualKeyboardEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; KeyboardVisible: Boolean; const Bounds : TRect); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TTapEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; const Point: TPointF); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TTouchEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; const Touches: TTouches; const Action: TTouchAction); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + {Helper functions} + function WrapPointF(APyDelphiWrapper: TPyDelphiWrapper; const APoint : TPointF) : PPyObject; function WrapSizeF(APyDelphiWrapper: TPyDelphiWrapper; const ASize : TSizeF) : PPyObject; function WrapRectF(APyDelphiWrapper: TPyDelphiWrapper; const ARect : TRectF) : PPyObject; + function WrapTouch(APyDelphiWrapper: TPyDelphiWrapper; const ATouch: TTouch): PPyObject; + function WrapTouches(APyDelphiWrapper: TPyDelphiWrapper; const ATouches: TTouches): PPyObject; function CheckPointFAttribute(AAttribute: PPyObject; const AAttributeName: string; out AValue: TPointF): Boolean; function CheckSizeFAttribute(AAttribute: PPyObject; const AAttributeName: string; out AValue: TSizeF): Boolean; function CheckRectFAttribute(AAttribute: PPyObject; const AAttributeName: string; out AValue: TRectF): Boolean; + function CheckTouchAttribute(AAttribute: PPyObject; const AAttributeName: string; out AValue: TTouch): Boolean; + + function TouchActionToPython(ATouchAction: TTouchAction): PPyObject; + implementation + uses - System.Math, System.SysUtils; + System.Math, System.SysUtils, System.Rtti, + WrapDelphiTypes; { Register the wrappers, the globals and the constants } + type TTypesRegistration = class(TRegisteredUnit) public @@ -178,7 +280,47 @@ TTypesRegistration = class(TRegisteredUnit) procedure DefineVars(APyDelphiWrapper : TPyDelphiWrapper); override; end; +{ TTypesRegistration } + +procedure TTypesRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper); +begin + inherited; +end; + +function TTypesRegistration.Name: string; +begin + Result := 'FMX Types'; +end; + +procedure TTypesRegistration.RegisterWrappers( + APyDelphiWrapper: TPyDelphiWrapper); +begin + inherited; + APyDelphiWrapper.RegisterHelperType(TPyDelphiPointF); + APyDelphiWrapper.RegisterHelperType(TPyDelphiSizeF); + APyDelphiWrapper.RegisterHelperType(TPyDelphiRectF); + APyDelphiWrapper.RegisterHelperType(TPyDelphiTouch); + + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiFmxObject); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPosition); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomPopupMenu); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiBounds); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControlSize); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTimer); + + //Event handlers + APyDelphiWrapper.EventHandlers.RegisterHandler(TMouseEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TMouseMoveEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TMouseWheelEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TKeyEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TProcessTickEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TVirtualKeyboardEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TTapEventHandler); + APyDelphiWrapper.EventHandlers.RegisterHandler(TTouchEventHandler); +end; + { TPyDelphiPointF } + function TPyDelphiPointF.Compare(obj: PPyObject): Integer; var _other : TPyDelphiPointF; @@ -276,33 +418,8 @@ function TPyDelphiPointF.Set_Y(AValue: PPyObject; AContext: Pointer): integer; Result := -1; end; -{ TTypesRegistration } -procedure TTypesRegistration.DefineVars(APyDelphiWrapper: TPyDelphiWrapper); -begin - inherited; -end; - -function TTypesRegistration.Name: string; -begin - Result := 'FMX Types'; -end; - -procedure TTypesRegistration.RegisterWrappers( - APyDelphiWrapper: TPyDelphiWrapper); -begin - inherited; - APyDelphiWrapper.RegisterHelperType(TPyDelphiPointF); - APyDelphiWrapper.RegisterHelperType(TPyDelphiSizeF); - APyDelphiWrapper.RegisterHelperType(TPyDelphiRectF); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiFmxObject); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiPosition); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomPopupMenu); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiBounds); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiControlSize); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiTimer); -end; - { Helper functions } + function WrapPointF(APyDelphiWrapper : TPyDelphiWrapper; const APoint : TPointF) : PPyObject; var _type : TPythonType; @@ -330,6 +447,37 @@ function WrapRectF(APyDelphiWrapper: TPyDelphiWrapper; const ARect : TRectF) : P (PythonToDelphi(Result) as TPyDelphiRectF).Value := ARect; end; +function WrapTouch(APyDelphiWrapper: TPyDelphiWrapper; const ATouch: TTouch): PPyObject; +var + LType : TPythonType; +begin + LType := APyDelphiWrapper.GetHelperType('TouchType'); + Result := LType.CreateInstance; + (PythonToDelphi(Result) as TPyDelphiTouch).Value := ATouch; +end; + +function WrapTouches(APyDelphiWrapper: TPyDelphiWrapper; const ATouches: TTouches): PPyObject; + + procedure Append(AList : PPyObject; const ATouch : TTouch); + var + LPyItem : PPyObject; + begin + with GetPythonEngine do + begin + LPyItem := WrapTouch(APyDelphiWrapper, ATouch); + PyList_Append(AList, LPyItem); + Py_XDecRef(LPyItem); + end; + end; + +var + LTouch: TTouch; +begin + Result := GetPythonEngine.PyList_New(0); + for LTouch in ATouches do + Append(Result, LTouch); +end; + function CheckPointFAttribute(AAttribute : PPyObject; const AAttributeName : string; out AValue : TPointF) : Boolean; begin with GetPythonEngine do @@ -387,7 +535,33 @@ function CheckRectFAttribute(AAttribute: PPyObject; const AAttributeName: string end; end; +function CheckTouchAttribute(AAttribute: PPyObject; const AAttributeName: string; out AValue: TTouch): Boolean; +begin + with GetPythonEngine do + begin + if IsDelphiObject(AAttribute) and (PythonToDelphi(AAttribute) is TPyDelphiTouch) then + begin + AValue := TPyDelphiTouch(PythonToDelphi(AAttribute)).Value; + Result := True; + end + else + begin + Result := False; + with GetPythonEngine do + PyErr_SetString (PyExc_AttributeError^, + PAnsiChar(AnsiString(Format('%s receives only Touch objects', [AAttributeName])))); + end; + end; +end; + +function TouchActionToPython(ATouchAction: TTouchAction): PPyObject; +begin + Result := GetPythonEngine.PyUnicodeFromString( + TRttiEnumerationType.GetName(ATouchAction)); +end; + { TPyDelphiFmxObject } + class function TPyDelphiFmxObject.DelphiObjectClass: TClass; begin Result := TFmxObject; @@ -407,7 +581,7 @@ function TPyDelphiFmxObject.Get_Parent(AContext: Pointer): PPyObject; class procedure TPyDelphiFmxObject.RegisterGetSets(PythonType: TPythonType); begin PythonType.AddGetSet('Parent', @TPyDelphiFmxObject.Get_Parent, @TPyDelphiFmxObject.Set_Parent, - 'Returns/Sets the Control Visibility', nil); + 'Returns/Sets the Control Visibility', nil); end; class procedure TPyDelphiFmxObject.RegisterMethods(PythonType: TPythonType); @@ -540,6 +714,7 @@ function TPyDelphiPosition.Set_Y(AValue: PPyObject; AContext: Pointer): integer; end; { TPyDelphiSizeF } + function TPyDelphiSizeF.Compare(obj: PPyObject): Integer; var LOther : TPyDelphiSizeF; @@ -640,6 +815,7 @@ function TPyDelphiSizeF.Set_Width(AValue: PPyObject; end; { TPyDelphiCustomPopupMenu } + class function TPyDelphiCustomPopupMenu.DelphiObjectClass: TClass; begin Result := TCustomPopupMenu; @@ -657,6 +833,7 @@ procedure TPyDelphiCustomPopupMenu.SetDelphiObject( end; { TPyDelphiBounds } + constructor TPyDelphiBounds.CreateWith(APythonType: TPythonType; args: PPyObject); var @@ -714,6 +891,7 @@ function TPyDelphiBounds.Set_Rect(AValue: PPyObject; end; { TPyDelphiControlSize } + constructor TPyDelphiControlSize.CreateWith(APythonType: TPythonType; args: PPyObject); var @@ -770,6 +948,7 @@ function TPyDelphiControlSize.Set_SizeF(AValue: PPyObject; end; { TPyDelphiRectF } + function TPyDelphiRectF.Compare(obj: PPyObject): Integer; var LOther : TPyDelphiRectF; @@ -916,6 +1095,92 @@ function TPyDelphiRectF.Set_Top(AValue: PPyObject; AContext: Pointer): integer; Result := -1; end; +{ TPyDelphiTouch } + +function TPyDelphiTouch.Compare(obj: PPyObject): Integer; +var + LOther : TPyDelphiTouch; +begin + if IsDelphiObject(obj) and (PythonToDelphi(obj) is TPyDelphiPointF) then + begin + LOther := TPyDelphiTouch(PythonToDelphi(obj)); + Result := CompareValue(Value.Location.X, LOther.Value.Location.X); + if Result = 0 then + Result := CompareValue(Value.Location.Y, LOther.Value.Location.Y); + end + else + Result := 1; +end; + +constructor TPyDelphiTouch.Create(APythonType: TPythonType); +begin + inherited; + if Assigned(PythonType) and (PythonType.Owner is TPyDelphiWrapper) then + FPyDelphiWrapper := TPyDelphiWrapper(PythonType.Owner); +end; + +constructor TPyDelphiTouch.CreateWith(APythonType: TPythonType; + args: PPyObject); +var + LPointF : TPointF; + LPyPointF : PPyObject; +begin + inherited; + with GetPythonEngine do + if PyArg_ParseTuple(args, 'O:Create', @LPyPointF) <> 0 then + if CheckPointFAttribute(LPyPointF, 'pointf', LPointF) then begin + FValue.Location := LPointF + end; +end; + +function TPyDelphiTouch.Get_Location(AContext: Pointer): PPyObject; +begin + Adjust(@Self); + Result := WrapPointF(FPyDelphiWrapper, Value.Location); +end; + +class procedure TPyDelphiTouch.RegisterGetSets(PythonType: TPythonType); +begin + inherited; + with PythonType do + begin + AddGetSet('Location', @TPyDelphiTouch.Get_Location, @TPyDelphiTouch.Set_Location, + 'Provides access to the location of a touch', nil); + end; +end; + +function TPyDelphiTouch.Repr: PPyObject; +begin + Result := GetPythonEngine.PyUnicodeFromString(Format('', + [Value.Location.X, Value.Location.Y])); +end; + +class procedure TPyDelphiTouch.SetupType(PythonType: TPythonType); +begin + inherited; + PythonType.TypeName := 'Touch'; + PythonType.Name := string(PythonType.TypeName) + TPythonType.TYPE_COMP_NAME_SUFFIX; + PythonType.TypeFlags := PythonType.TypeFlags + [tpfBaseType]; + PythonType.GenerateCreateFunction := False; + PythonType.DocString.Text := 'wrapper for Delphi FMX TTouch type'; + PythonType.Services.Basic := [bsGetAttrO, bsSetAttrO, bsRepr, bsStr, bsRichCompare]; +end; + +function TPyDelphiTouch.Set_Location(AValue: PPyObject; + AContext: Pointer): integer; +var + LValue: TPointF; +begin + if CheckPointFAttribute(AValue, 'Location', LValue) then + with GetPythonEngine do begin + Adjust(@Self); + FValue.Location := LValue; + Result := 0; + end + else + Result := -1; +end; + { TPyDelphiTimer } class function TPyDelphiTimer.DelphiObjectClass: TClass; @@ -933,6 +1198,407 @@ procedure TPyDelphiTimer.SetDelphiObject(const Value: TTimer); inherited DelphiObject := Value; end; +{ TMouseEventHandler } + +constructor TMouseEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TMouseEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TMouseEventHandler.DoEvent(Sender: TObject; Button: TMouseButton; + Shift: TShiftState; X, Y: Single); +var + LPyObject, LPyTuple, LPyButton, LPyX, LPyY, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyButton := MouseButtonToPython(Button); + LPyX := PyFloat_FromDouble(X); + LPyY := PyFloat_FromDouble(Y); + LPyTuple := PyTuple_New(5); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyButton); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, ShiftToPython(Shift)); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 3, LPyX); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 4, LPyY); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TMouseEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TMouseEvent); +end; + +{ TMouseMoveEventHandler } + +constructor TMouseMoveEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TMouseMoveEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TMouseMoveEventHandler.DoEvent(Sender: TObject; Shift: TShiftState; X, + Y: Single); +var + LPyObject, LPyTuple, LPyX, LPyY, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyX := PyFloat_FromDouble(X); + LPyY := PyFloat_FromDouble(Y); + LPyTuple := PyTuple_New(4); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, ShiftToPython(Shift)); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyX); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 3, LPyY); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TMouseMoveEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TMouseMoveEvent); +end; + +{ TMouseWheelEventHandler } + +constructor TMouseWheelEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TMouseWheelEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TMouseWheelEventHandler.DoEvent(Sender: TObject; Shift: TShiftState; + WheelDelta: Integer; var Handled: Boolean); +var + LPyObject, LPyTuple, LPyShift, LPyWheelDelta, LPyHandled, LPyResult: PPyObject; + LVarParam: TPyDelphiVarParameter; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyShift := ShiftToPython(Shift); + LPyWheelDelta := PyLong_FromLong(WheelDelta); + LPyHandled := CreateVarParam(PyDelphiWrapper, Handled); + LVarParam := PythonToDelphi(LPyHandled) as TPyDelphiVarParameter; + LPyTuple := PyTuple_New(4); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyShift); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyWheelDelta); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 3, LPyHandled); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + if LVarParam.Value = Py_None then + Handled := false + else if PyBool_Check(LVarParam.Value) then + Handled := Boolean(PyLong_AsLong(LVarParam.Value)); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TMouseWheelEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TMouseWheelEvent); +end; + +{ TKeyEventHandler } + +constructor TKeyEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TKeyEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TKeyEventHandler.DoEvent(Sender: TObject; var Key: Word; + var KeyChar: WideChar; Shift: TShiftState); +var + LPyObject, LPyTuple, LPyKey, LPyKeyChar, LPyShift, LPyResult: PPyObject; + LKeyVarParam: TPyDelphiVarParameter; + LKeyCharVarParam: TPyDelphiVarParameter; + LKeyChar: string; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyKey := CreateVarParam(PyDelphiWrapper, Key); + LPyKeyChar := CreateVarParam(PyDelphiWrapper, KeyChar); + LPyShift := ShiftToPython(Shift); + LKeyVarParam := PythonToDelphi(LPyKey) as TPyDelphiVarParameter; + LKeyCharVarParam := PythonToDelphi(LPyKeyChar) as TPyDelphiVarParameter; + LPyTuple := PyTuple_New(4); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyKey); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyKeyChar); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 3, LPyShift); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + //Key var arg + if LKeyVarParam.Value = Py_None then + Key := 0 + else if PyLong_Check(LKeyVarParam.Value) then + Key := Word(PyLong_AsLong(LKeyVarParam.Value)); + + //KeyChar var arg + if LKeyCharVarParam.Value = Py_None then + LKeyChar := #0 + else if PyUnicode_Check(LKeyCharVarParam.Value) then + begin + LKeyChar := PyUnicodeAsString(LKeyCharVarParam.Value); + if Length(LKeyChar) > 0 then + KeyChar := LKeyChar[1]; + end; + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TKeyEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TKeyEvent); +end; + +{ TProcessTickEventHandler } + +constructor TProcessTickEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TProcessTickEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TProcessTickEventHandler.DoEvent(Sender: TObject; time, + deltaTime: Single); +var + LPyObject, LPyTuple, LPyTime, LPyDeltaTime, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyTime := PyFloat_FromDouble(time); + LPyDeltaTime := PyFloat_FromDouble(deltaTime); + LPyTuple := PyTuple_New(3); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyTime); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyDeltaTime); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TProcessTickEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TProcessTickEvent); +end; + +{ TVirtualKeyboardEventHandler } + +constructor TVirtualKeyboardEventHandler.Create( + PyDelphiWrapper: TPyDelphiWrapper; Component: TObject; + PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TVirtualKeyboardEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TVirtualKeyboardEventHandler.DoEvent(Sender: TObject; + KeyboardVisible: Boolean; const Bounds: TRect); +var + LPyObject, LPyTuple, LPyKeyboardVisible, LPyBounds, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyKeyboardVisible := PyBool_FromLong(Ord(KeyboardVisible)); + LPyBounds := WrapRect(PyDelphiWrapper, Bounds); + LPyTuple := PyTuple_New(3); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyKeyboardVisible); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyBounds); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TVirtualKeyboardEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TVirtualKeyboardEvent); +end; + +{ TTapEventHandler } + +constructor TTapEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TTapEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TTapEventHandler.DoEvent(Sender: TObject; const Point: TPointF); +var + LPyObject, LPyTuple, LPyPoint, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyPoint := WrapPointF(PyDelphiWrapper, Point); + LPyTuple := PyTuple_New(2); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyPoint); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TTapEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TTapEvent); +end; + +{ TTouchEventHandler } + +constructor TTouchEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TTouchEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TTouchEventHandler.DoEvent(Sender: TObject; const Touches: TTouches; + const Action: TTouchAction); +var + LPyObject, LPyTuple, LPyTouches, LPyTouchAction, LPyResult : PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPyObject := PyDelphiWrapper.Wrap(Sender); + LPyTouches := WrapTouches(PyDelphiWrapper, Touches); + LPyTouchAction := TouchActionToPython(Action); + LPyTuple := PyTuple_New(3); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPyObject); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyTouches); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyTouchAction); + try + LPyResult := PyObject_CallObject(Callable, LPyTuple); + if Assigned(LPyResult) then + begin + Py_DECREF(LPyResult); + end; + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TTouchEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TTouchEvent); +end; + initialization RegisteredUnits.Add(TTypesRegistration.Create); + end. diff --git a/Source/vcl/WrapVclExtCtrls.pas b/Source/vcl/WrapVclExtCtrls.pas index 887e1ae3..8fcbae88 100644 --- a/Source/vcl/WrapVclExtCtrls.pas +++ b/Source/vcl/WrapVclExtCtrls.pas @@ -6,7 +6,7 @@ interface uses Classes, SysUtils, PythonEngine, WrapDelphi, WrapDelphiClasses, WrapVclControls, - Windows, ExtCtrls; + Windows, ExtCtrls, TypInfo, Rtti; type TPyDelphiShape = class (TPyDelphiGraphicControl) @@ -169,6 +169,37 @@ TPyDelphiColorBox = class (TPyDelphiWinControl) end; {$ENDIF FPC} + TSysLinkEventHandler = class(TEventHandler) + protected + procedure DoEvent(Sender: TObject; const Link: string; LinkType: TSysLinkType); + public + constructor Create(PyDelphiWrapper : TPyDelphiWrapper; Component : TObject; + PropertyInfo : PPropInfo; Callable : PPyObject); override; + class function GetTypeInfo : PTypeInfo; override; + end; + + TPyDelphiCustomLinkLabel = class (TPyDelphiWinControl) + private + function GetDelphiObject: TCustomLinkLabel; + procedure SetDelphiObject(const Value: TCustomLinkLabel); + public + class function DelphiObjectClass : TClass; override; + // Properties + property DelphiObject: TCustomLinkLabel read GetDelphiObject write SetDelphiObject; + end; + + TPyDelphiLinkLabel = class (TPyDelphiCustomLinkLabel) + private + function GetDelphiObject: TLinkLabel; + procedure SetDelphiObject(const Value: TLinkLabel); + public + class function DelphiObjectClass : TClass; override; + // Properties + property DelphiObject: TLinkLabel read GetDelphiObject write SetDelphiObject; + end; + + function SysLinkTypeToPython(const ASysLinkType: TSysLinkType): PPyObject; + implementation { Register the wrappers, the globals and the constants } @@ -216,8 +247,18 @@ procedure TExtCtrlsRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrap {$IFNDEF FPC} APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiColorBox); {$ENDIF FPC} + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomLinkLabel); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiLinkLabel); + + // Event handlers + APyDelphiWrapper.EventHandlers.RegisterHandler(TSysLinkEventHandler); end; +function SysLinkTypeToPython(const ASysLinkType: TSysLinkType): PPyObject; +begin + Result := GetPythonEngine.PyUnicodeFromString( + TRttiEnumerationType.GetName(ASysLinkType)); +end; { TPyDelphiShape } @@ -493,6 +534,83 @@ procedure TPyDelphiColorBox.SetDelphiObject(const Value: TColorBox); end; {$ENDIF FPC} +{ TSysLinkEventHandler } + +constructor TSysLinkEventHandler.Create(PyDelphiWrapper: TPyDelphiWrapper; + Component: TObject; PropertyInfo: PPropInfo; Callable: PPyObject); +var + LMethod : TMethod; +begin + inherited; + LMethod.Code := @TSysLinkEventHandler.DoEvent; + LMethod.Data := Self; + SetMethodProp(Component, PropertyInfo, LMethod); +end; + +procedure TSysLinkEventHandler.DoEvent(Sender: TObject; const Link: string; + LinkType: TSysLinkType); +var + LPyTuple, LPySender, LPyLink, LPyLinkType, PyResult: PPyObject; +begin + Assert(Assigned(PyDelphiWrapper)); + if Assigned(Callable) and PythonOK then + with GetPythonEngine do begin + LPySender := PyDelphiWrapper.Wrap(Sender); + LPyLink := PyUnicodeFromString(Link); + LPyLinkType := SysLinkTypeToPython(LinkType); + LPyTuple := PyTuple_New(3); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 0, LPySender); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 1, LPyLink); + GetPythonEngine.PyTuple_SetItem(LPyTuple, 2, LPyLinkType); + try + PyResult := PyObject_CallObject(Callable, LPyTuple); + Py_XDECREF(PyResult); + finally + Py_DECREF(LPyTuple); + end; + CheckError; + end; +end; + +class function TSysLinkEventHandler.GetTypeInfo: PTypeInfo; +begin + Result := System.TypeInfo(TSysLinkEvent); +end; + +{ TPyDelphiCustomLinkLabel } + +class function TPyDelphiCustomLinkLabel.DelphiObjectClass: TClass; +begin + Result := TCustomLinkLabel; +end; + +function TPyDelphiCustomLinkLabel.GetDelphiObject: TCustomLinkLabel; +begin + Result := TCustomLinkLabel(inherited DelphiObject); +end; + +procedure TPyDelphiCustomLinkLabel.SetDelphiObject( + const Value: TCustomLinkLabel); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiLinkLabel } + +class function TPyDelphiLinkLabel.DelphiObjectClass: TClass; +begin + Result := TLinkLabel; +end; + +function TPyDelphiLinkLabel.GetDelphiObject: TLinkLabel; +begin + Result := TLinkLabel(inherited DelphiObject); +end; + +procedure TPyDelphiLinkLabel.SetDelphiObject(const Value: TLinkLabel); +begin + inherited DelphiObject := Value; +end; initialization RegisteredUnits.Add( TExtCtrlsRegistration.Create ); diff --git a/Tests/FMX/Android/NumberServicesTest.pas b/Tests/FMX/Android/NumberServicesTest.pas index 1fb9cbc8..9494a5a0 100644 --- a/Tests/FMX/Android/NumberServicesTest.pas +++ b/Tests/FMX/Android/NumberServicesTest.pas @@ -85,7 +85,7 @@ TTestNumberServices = class(TObject) private PythonType_TRndInt: TPythonType; FPythonModule : TPythonModule; - PythonEngine : TPythonEngine; + FPythonEngine : TPythonEngine; pdvainteger: integer; pdvbinteger: integer; pdvc : TPythonDelphiVar; @@ -186,10 +186,10 @@ procedure TTestNumberServices.SetupFixture; valpy: TPyObject; val: PyTRandomInteger; begin - PythonEngine := TPythonEngine.Create(nil); - PythonEngine.Name := 'PythonEngine'; - TPythonLoad.Configure(PythonEngine); - PythonEngine.LoadDll; + FPythonEngine := TPythonEngine.Create(nil); + FPythonEngine.Name := 'PythonEngine'; + TPythonLoad.Configure(FPythonEngine); + FPythonEngine.LoadDll; // python module FPythonModule := TPythonModule.Create(GetPythonEngine); FPythonModule.Engine := GetPythonEngine; @@ -486,7 +486,7 @@ procedure TRandomInteger.SetValue(const Value: Integer); end; procedure TTestNumberServices.TearDownFixture; begin - PythonEngine.Free; + FPythonEngine.Free; pdvc.Free; end; // nsAdd diff --git a/Tests/FMX/Android/WrapDelphiTest.pas b/Tests/FMX/Android/WrapDelphiTest.pas index 453b6dda..6e73312e 100644 --- a/Tests/FMX/Android/WrapDelphiTest.pas +++ b/Tests/FMX/Android/WrapDelphiTest.pas @@ -1,534 +1,534 @@ -(**************************************************************************) -(* *) -(* Module: Unit 'WrapDelphiTest' Copyright (c) 2021 *) -(* *) -(* Lucas Moura Belo - lmbelo *) -(* lucas.belo@live.com *) -(* BH, Brazil *) -(* *) -(* PyScripter *) -(* e-mail: pyscripter@gmail.com *) -(* *) -(* Project pages: https://github.com/Embarcadero/python4delphi *) -(* https://github.com/pyscripter/python4delphi *) -(**************************************************************************) -(* Functionality: Test unit for WrapDelphi module *) -(* *) -(* *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free for his own tasks *) -(* and projects, as long as this header and its copyright text is intact. *) -(* For changed versions of this code, which are public distributed the *) -(* following additional conditions have to be fullfilled: *) -(* 1) The header has to contain a comment on the change and the author of *) -(* it. *) -(* 2) A copy of the changed source has to be sent to the above E-Mail *) -(* address or my then valid address, if this is possible to the *) -(* author. *) -(* The second condition has the target to maintain an up to date central *) -(* version of the component. If this condition is not acceptable for *) -(* confidential or legal reasons, everyone is free to derive a component *) -(* or to generate a diff file to my or other original sources. *) -(**************************************************************************) - -unit WrapDelphiTest; - -interface - -uses - Types, - DUnitX.TestFramework, - PythonEngine, - WrapDelphi; - -type - TFruit = (Apple, Banana, Orange); - TFruits = set of TFruit; - - {$M+} - ITestInterface = interface(IInterface) - ['{AD50ADF2-2691-47CA-80AB-07AF1EDA8C89}'] - procedure SetString(const S: string); - function GetString: string; - end; - {$M-} - - TSubRecord = record - DoubleField: double; - end; - - TTestRecord = record - StringField: string; - SubRecord: TSubRecord; - procedure SetStringField(S: string); - end; - - TFruitDynArray = TArray; - TStaticArray = array[0..999] of Int64; - TTestRttiAccess = class - private - FFruit: TFruit; - FFruits: TFruits; - public - FruitField :TFruit; - FruitsField: TFruits; - StringField: string; - DoubleField: double; - ObjectField: TObject; - RecordField: TTestRecord; - InterfaceField: ITestInterface; - function GetData: TObject; - procedure BuyFruits(AFruits: TFruits); - procedure SellFruits(const AFruits: TFruitDynArray); - procedure SellFruitsInt(const AFruits:TIntegerDynArray); - function GetDynArray: TInt64DynArray; - function GetStaticArray: TStaticArray; - property Fruit: TFruit read FFruit write FFruit; - property Fruits: TFruits read FFruits write FFruits; - function SetStringField(var Value: Integer): string; overload; - function SetStringField(const Value: string): string; overload; - procedure PassVariantArray(const Value: Variant); - end; - - TTestInterfaceImpl = class(TInterfacedObject, ITestInterface) - private - FString: string; - procedure SetString(const S: string); - function GetString: string; - end; - - [TestFixture] - TTestWrapDelphi = class(TObject) - private - PythonEngine: TPythonEngine; - DelphiModule: TPythonModule; - PyDelphiWrapper: TPyDelphiWrapper; - Rtti_Var: Variant; - TestRttiAccess: TTestRttiAccess; - Rec: TTestRecord; - Rtti_Rec: Variant; - FTestInterface: ITestInterface; - Rtti_Interface: Variant; - public - [SetupFixture] - procedure SetupFixture; - [TearDownFixture] - procedure TearDownFixture; - [Test] - procedure TestEnumProperty; - [Test] - procedure TestSetProperty; - [Test] - procedure TestDoubleField; - [Test] - procedure TestEnumField; - [Test] - procedure TestSetField; - [Test] - procedure TestStringField; - [Test] - procedure TestSetProps; - [Test] - procedure TestObjectField; - [Test] - procedure TestMethodCall; - [Test] - procedure TestRecord; - [Test] - procedure TestRecordField; - [Test] - procedure TestInterface; - [Test] - procedure TestInterfaceField; - [Test] - procedure TestDynArrayParameters; - [Test] - procedure TestGetDynArray; - [Test] - procedure TestGetStaticArray; - [Test] - procedure TestMethodWithVarAndOverload; - [Test] - procedure TestFreeReturnedObject; - [Test] - procedure TestPassVariantArray; - end; - -implementation - -Uses - System.SysUtils, - System.Variants, - System.Classes, - System.Rtti, - VarPyth, - WrapDelphiClasses, - PythonLoad; - - -{ TTestRTTIAccess } - -procedure TTestRttiAccess.BuyFruits(AFruits: TFruits); -begin - Fruits := AFruits; -end; - -{ TTestWrapDelphi } - -procedure TTestWrapDelphi.TestFreeReturnedObject; -begin - PythonEngine.ExecString( - 'from delphi import rtti_var' + sLineBreak + - 'obj = rtti_var.GetData()' + sLineBreak + - 'obj.Free()' - ); - Assert.Pass; -end; - -procedure TTestWrapDelphi.SetupFixture; -var - Py : PPyObject; -begin - PythonEngine := TPythonEngine.Create(nil); - PythonEngine.Name := 'PythonEngine'; - TPythonLoad.Configure(PythonEngine); - - DelphiModule := TPythonModule.Create(nil); - - DelphiModule.Name := 'DelphiModule'; - DelphiModule.Engine := PythonEngine; - DelphiModule.ModuleName := 'delphi'; - - PyDelphiWrapper := TPyDelphiWrapper.Create(nil); - - PyDelphiWrapper.Name := 'PyDelphiWrapper'; - PyDelphiWrapper.Engine := PythonEngine; - PyDelphiWrapper.Module := DelphiModule; - - PythonEngine.LoadDll; - // Then wrap the an instance our TTestRTTIAccess - // It will allow us to to test access to public fields and methods as well - // public (as well as published) properties. - // This time we would like the object to be destroyed when the PyObject - // is destroyed, so we need to set its Owned property to True; - TestRttiAccess := TTestRTTIAccess.Create; - TestRttiAccess.InterfaceField := TTestInterfaceImpl.Create; - Py := PyDelphiWrapper.Wrap(TestRttiAccess, TObjectOwnership.soReference); - DelphiModule.SetVar('rtti_var', Py); - PythonEngine.Py_DecRef(Py); - Py := PyDelphiWrapper.WrapRecord(@Rec, TRttiContext.Create.GetType(TypeInfo(TTestRecord)) as TRttiStructuredType); - DelphiModule.SetVar('rtti_rec', Py); - PythonEngine.Py_DecRef(Py); - FTestInterface := TTestInterfaceImpl.Create; - Py := PyDelphiWrapper.WrapInterface(TValue.From(FTestInterface)); - DelphiModule.SetVar('rtti_interface', Py); - PythonEngine.Py_DecRef(Py); - PythonEngine.ExecString('from delphi import rtti_var, rtti_rec, rtti_interface'); - Rtti_Var := MainModule.rtti_var; - Rtti_Rec := MainModule.rtti_rec; - Rtti_Interface := MainModule.rtti_interface; -end; - -procedure TTestWrapDelphi.TearDownFixture; -begin - VarClear(Rtti_Var); - VarClear(Rtti_Rec); - VarClear(Rtti_Interface); - PythonEngine.Free; - PyDelphiWrapper.Free; - DelphiModule.Free; - TestRttiAccess.Free; -end; - -procedure TTestWrapDelphi.TestDoubleField; -begin - TestRttiAccess.DoubleField := 3.14; - Assert.AreEqual(double(TestRttiAccess.DoubleField), double(3.14)); - Rtti_Var.DoubleField := variant(double(1.23)); //implicitly cast to a variant to avoid a bug present in 10.4.2 - Assert.AreEqual(double(Rtti_Var.DoubleField), double(1.23)); -end; - -procedure TTestWrapDelphi.TestEnumField; -begin - TestRttiAccess.FruitField := Apple; - Assert.IsTrue(RTTI_var.FruitField = 'Apple'); - Rtti_Var.FruitField := 'Banana'; - Assert.IsTrue(TestRttiAccess.FruitField = Banana); -end; - -procedure TTestWrapDelphi.TestEnumProperty; -// Enumeration values are converted to/from strings -begin - TestRttiAccess.Fruit := Apple; - Assert.IsTrue(RTTI_var.Fruit = 'Apple'); - Rtti_Var.Fruit := 'Banana'; - Assert.IsTrue(TestRttiAccess.Fruit = Banana); -end; - -procedure TTestWrapDelphi.TestGetDynArray; -var - List: Variant; -begin - List := Rtti_Var.GetDynArray(); - Assert.IsTrue(VarIsPythonList(List)); - Assert.AreEqual(1000000, Integer(len(List))); - Assert.AreEqual(Int64(999999), Int64(PythonEngine.PyObjectAsVariant(PythonEngine.PyList_GetItem(ExtractPythonObjectFrom(List), 999999)))); -end; - -procedure TTestWrapDelphi.TestGetStaticArray; -var - List: Variant; -begin - List := Rtti_Var.GetStaticArray(); - Assert.IsTrue(VarIsPythonList(List)); - Assert.AreEqual(1000, Integer(len(List))); - Assert.AreEqual(Int64(999), Int64(PythonEngine.PyObjectAsVariant(PythonEngine.PyList_GetItem(ExtractPythonObjectFrom(List), 999)))); -end; - -procedure TTestWrapDelphi.TestInterface; -begin - Rtti_Interface.SetString('Test'); - Assert.IsTrue(Rtti_Interface.GetString() = 'Test'); -end; - -procedure TTestWrapDelphi.TestInterfaceField; -begin - Rtti_Interface.SetString('New Value'); - Assert.IsTrue(Rtti_Interface.GetString() = 'New Value'); - Rtti_Var.InterfaceField.SetString('Old Value'); - Assert.IsTrue(Rtti_Var.InterfaceField.GetString() = 'Old Value'); - // Assign interface - Rtti_Var.InterfaceField := Rtti_Interface; - Assert.IsTrue(Rtti_Var.InterfaceField.GetString() = 'New Value'); - Rtti_Var.InterfaceField := None; - Assert.IsTrue(VarIsNone(Rtti_Var.InterfaceField)); -end; - -procedure TTestWrapDelphi.TestMethodCall; -begin - TestRttiAccess.Fruits := []; - Assert.AreEqual(string(Rtti_Var.Fruits), '[]'); - Rtti_Var.BuyFruits(VarPythonCreate(['Apple', 'Banana'], stList)); - Assert.AreEqual(string(Rtti_Var.Fruits), '[''Apple'', ''Banana'']'); -end; - -procedure TTestWrapDelphi.TestObjectField; -{ - Demonstrating and testing: - Subclassing Delphi components in Python - Creating Delphi objects in Python - Assigning objects to object fields -} -Var - Script: AnsiString; - myComp: Variant; -begin - Script := - 'from delphi import Component' + sLineBreak + - 'class MyComponent(Component):' + SLineBreak + - ' def __init__(self, Owner):' + SLineBreak + - ' self._x = None' + SLineBreak + - '' + SLineBreak + - ' @property' + SLineBreak + - ' def x(self):' + SLineBreak + - ' return self._x' + SLineBreak + - '' + SLineBreak + - ' @x.setter' + SLineBreak + - ' def x(self, value):' + SLineBreak + - ' self._x = value' + SLineBreak + - '' + SLineBreak + - 'myComp = MyComponent(None)'; - ; - - PythonEngine.ExecString(Script); - myComp := MainModule.myComp; - // accessing inherited property - Assert.IsTrue(myComp.Name = ''); - myComp.Name := 'NoName'; - Assert.IsTrue(myComp.Name = 'NoName'); - // accessing subclass property - myComp.x := variant(double(3.14)); //implicitly cast to a variant to avoid a bug present in 10.4.2 - Assert.IsTrue(myComp.x = 3.14); - - // Setting an object field - rtti_var.ObjectField := myComp; - Assert.IsTrue(rtti_var.ObjectField.Name = 'NoName'); - Assert.AreEqual(TComponent(TestRttiAccess.ObjectField).Name, 'NoName'); - rtti_var.ObjectField := None; - Assert.IsTrue(rtti_var.ObjectField = None); -end; - -procedure TTestWrapDelphi.TestPassVariantArray; -begin - PythonEngine.ExecString( - 'from delphi import rtti_var' + sLineBreak + - 'rtti_var.PassVariantArray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])' - ); - Assert.Pass; -end; - -procedure TTestWrapDelphi.TestRecord; -begin - Rtti_rec.StringField := 'abcd'; - Assert.IsTrue(rtti_rec.StringField = 'abcd'); - Rtti_rec.SetStringField('1234'); - Assert.IsTrue(rtti_rec.StringField = '1234'); - Assert.AreEqual(Rec.StringField, '1234'); - Rtti_rec.SubRecord.DoubleField := variant(double(3.14)); //implicitly cast to a variant to avoid a bug present in 10.4.2 - Assert.IsTrue(rtti_rec.SubRecord.DoubleField = 3.14); - Assert.AreEqual(Rec.SubRecord.DoubleField, 3.14); -end; - -procedure TTestWrapDelphi.TestRecordField; -Var - RecValue: Variant; -begin - RecValue := rtti_var.RecordField; - RecValue.StringField := 'abc'; - rtti_var.RecordField := RecValue; - Assert.IsTrue(rtti_var.RecordField.StringField = 'abc'); -end; - -procedure TTestWrapDelphi.TestSetField; -// Sets are converted to/from list of strings -begin - TestRttiAccess.FruitsField := []; - Assert.AreEqual(string(Rtti_Var.FruitsField), '[]'); - Rtti_Var.FruitsField := VarPythonCreate(['Apple', 'Banana'], stList); - Assert.AreEqual(string(Rtti_Var.FruitsField), '[''Apple'', ''Banana'']'); - Assert.IsTrue(TestRttiAccess.FruitsField = [Apple, Banana]); -end; - -procedure TTestWrapDelphi.TestSetProperty; -begin - TestRttiAccess.Fruits := []; - Assert.AreEqual(string(Rtti_Var.Fruits), '[]'); - Rtti_Var.Fruits := VarPythonCreate(['Apple', 'Banana'], stList); - Assert.AreEqual(string(Rtti_Var.Fruits), '[''Apple'', ''Banana'']'); - Assert.IsTrue(TestRttiAccess.Fruits = [Apple, Banana]); -end; - -procedure TTestWrapDelphi.TestSetProps; -begin - rtti_var.SetProps(StringField := 'abc', DoubleField := 1.234); - Assert.AreEqual(TestRttiAccess.StringField, 'abc'); - Assert.AreEqual(TestRttiAccess.DoubleField, 1.234); -end; - -procedure TTestWrapDelphi.TestStringField; -begin - TestRttiAccess.StringField := 'Hi'; - Assert.AreEqual(string(Rtti_Var.StringField), 'Hi'); - Rtti_Var.StringField := 'P4D'; - Assert.AreEqual(TestRttiAccess.StringField, 'P4D'); -end; - -procedure TTestWrapDelphi.TestDynArrayParameters; -{var - rc: TRttiContext; - rt: TRttiType; - rm: TRttiMethod; - rp: TArray; - ra: TArray;} -begin -{ rc := TRttiContext.Create; - rt := rc.GetType(TypeInfo(TTestRttiAccess)); - rm := rt.GetMethod('SellFruitsInt'); - rp := rm.GetParameters; - SetLength(ra, 1); - ra[0] := TValue.FromArray(TypeInfo(TIntegerDynArray), [TValue.From(0)]); - rm.Invoke(TestRttiAccess, ra);} - TestRttiAccess.Fruits := [TFruit.Apple, TFruit.Banana, TFruit.Orange]; - Rtti_Var.SellFruitsInt(VarPythonCreate([0, 1], stList)); - Assert.IsTrue(TestRttiAccess.Fruits = [Orange]); - TestRttiAccess.Fruits := [TFruit.Apple, TFruit.Banana, TFruit.Orange]; - Rtti_Var.SellFruits(VarPythonCreate([Ord(TFruit.Apple), Ord(TFruit.Banana)], stList)); - Assert.IsTrue(TestRttiAccess.Fruits = [Orange]); -end; - -procedure TTestWrapDelphi.TestMethodWithVarAndOverload; -begin - Rtti_Var.SetStringField('test'); - Assert.AreEqual('test', TestRttiAccess.StringField); -end; - -function TTestRttiAccess.SetStringField(const Value: string): string; -begin - StringField := Value; - Result := StringField; -end; - -function TTestRttiAccess.SetStringField(var Value: Integer): string; -begin - StringField := IntToStr(Value); - Result := StringField; -end; - -function TTestRttiAccess.GetData: TObject; -begin - Result := TStringList.Create; -end; - -function TTestRttiAccess.GetDynArray: TInt64DynArray; -var - I: Integer; -begin - SetLength(Result, 1000000); - for I := 0 to Length(Result) - 1 do - Result[I] := I; -end; - -function TTestRttiAccess.GetStaticArray: TStaticArray; -var - I: Integer; -begin - for I := 0 to Length(Result) - 1 do - Result[I] := I; -end; - -procedure TTestRttiAccess.PassVariantArray(const Value: Variant); -begin - Assert.IsTrue(VarIsArray(Value) and (VarArrayHighBound(Value, 1) = 9)); -end; - -procedure TTestRttiAccess.SellFruits(const AFruits: TFruitDynArray); -var - Fruit: TFruit; -begin - for Fruit in AFruits do - Exclude(FFruits, Fruit); -end; - -procedure TTestRttiAccess.SellFruitsInt(const AFruits:TIntegerDynArray); -var - Fruit: Integer; -begin - for Fruit in AFruits do - Exclude(FFruits, TFruit(Fruit)); -end; - -{ TTestRecord } - -procedure TTestRecord.SetStringField(S: string); -begin - Self.StringField := S; -end; - -{ TTestInterfaceImpl } - -function TTestInterfaceImpl.GetString: string; -begin - Result := FString; -end; - -procedure TTestInterfaceImpl.SetString(const S: string); -begin - FString := S; -end; - -initialization - TDUnitX.RegisterTestFixture(TTestWrapDelphi); - ReportMemoryLeaksOnShutdown := True; - -end. +(**************************************************************************) +(* *) +(* Module: Unit 'WrapDelphiTest' Copyright (c) 2021 *) +(* *) +(* Lucas Moura Belo - lmbelo *) +(* lucas.belo@live.com *) +(* BH, Brazil *) +(* *) +(* PyScripter *) +(* e-mail: pyscripter@gmail.com *) +(* *) +(* Project pages: https://github.com/Embarcadero/python4delphi *) +(* https://github.com/pyscripter/python4delphi *) +(**************************************************************************) +(* Functionality: Test unit for WrapDelphi module *) +(* *) +(* *) +(**************************************************************************) +(* This source code is distributed with no WARRANTY, for no reason or use.*) +(* Everyone is allowed to use and change this code free for his own tasks *) +(* and projects, as long as this header and its copyright text is intact. *) +(* For changed versions of this code, which are public distributed the *) +(* following additional conditions have to be fullfilled: *) +(* 1) The header has to contain a comment on the change and the author of *) +(* it. *) +(* 2) A copy of the changed source has to be sent to the above E-Mail *) +(* address or my then valid address, if this is possible to the *) +(* author. *) +(* The second condition has the target to maintain an up to date central *) +(* version of the component. If this condition is not acceptable for *) +(* confidential or legal reasons, everyone is free to derive a component *) +(* or to generate a diff file to my or other original sources. *) +(**************************************************************************) + +unit WrapDelphiTest; + +interface + +uses + Types, + DUnitX.TestFramework, + PythonEngine, + WrapDelphi; + +type + TFruit = (Apple, Banana, Orange); + TFruits = set of TFruit; + + {$M+} + ITestInterface = interface(IInterface) + ['{AD50ADF2-2691-47CA-80AB-07AF1EDA8C89}'] + procedure SetString(const S: string); + function GetString: string; + end; + {$M-} + + TSubRecord = record + DoubleField: double; + end; + + TTestRecord = record + StringField: string; + SubRecord: TSubRecord; + procedure SetStringField(S: string); + end; + + TFruitDynArray = TArray; + TStaticArray = array[0..999] of Int64; + TTestRttiAccess = class + private + FFruit: TFruit; + FFruits: TFruits; + public + FruitField :TFruit; + FruitsField: TFruits; + StringField: string; + DoubleField: double; + ObjectField: TObject; + RecordField: TTestRecord; + InterfaceField: ITestInterface; + function GetData: TObject; + procedure BuyFruits(AFruits: TFruits); + procedure SellFruits(const AFruits: TFruitDynArray); + procedure SellFruitsInt(const AFruits:TIntegerDynArray); + function GetDynArray: TInt64DynArray; + function GetStaticArray: TStaticArray; + property Fruit: TFruit read FFruit write FFruit; + property Fruits: TFruits read FFruits write FFruits; + function SetStringField(var Value: Integer): string; overload; + function SetStringField(const Value: string): string; overload; + procedure PassVariantArray(const Value: Variant); + end; + + TTestInterfaceImpl = class(TInterfacedObject, ITestInterface) + private + FString: string; + procedure SetString(const S: string); + function GetString: string; + end; + + [TestFixture] + TTestWrapDelphi = class(TObject) + private + FPythonEngine: TPythonEngine; + DelphiModule: TPythonModule; + PyDelphiWrapper: TPyDelphiWrapper; + Rtti_Var: Variant; + TestRttiAccess: TTestRttiAccess; + Rec: TTestRecord; + Rtti_Rec: Variant; + FTestInterface: ITestInterface; + Rtti_Interface: Variant; + public + [SetupFixture] + procedure SetupFixture; + [TearDownFixture] + procedure TearDownFixture; + [Test] + procedure TestEnumProperty; + [Test] + procedure TestSetProperty; + [Test] + procedure TestDoubleField; + [Test] + procedure TestEnumField; + [Test] + procedure TestSetField; + [Test] + procedure TestStringField; + [Test] + procedure TestSetProps; + [Test] + procedure TestObjectField; + [Test] + procedure TestMethodCall; + [Test] + procedure TestRecord; + [Test] + procedure TestRecordField; + [Test] + procedure TestInterface; + [Test] + procedure TestInterfaceField; + [Test] + procedure TestDynArrayParameters; + [Test] + procedure TestGetDynArray; + [Test] + procedure TestGetStaticArray; + [Test] + procedure TestMethodWithVarAndOverload; + [Test] + procedure TestFreeReturnedObject; + [Test] + procedure TestPassVariantArray; + end; + +implementation + +Uses + System.SysUtils, + System.Variants, + System.Classes, + System.Rtti, + VarPyth, + WrapDelphiClasses, + PythonLoad; + + +{ TTestRTTIAccess } + +procedure TTestRttiAccess.BuyFruits(AFruits: TFruits); +begin + Fruits := AFruits; +end; + +{ TTestWrapDelphi } + +procedure TTestWrapDelphi.TestFreeReturnedObject; +begin + FPythonEngine.ExecString( + 'from delphi import rtti_var' + sLineBreak + + 'obj = rtti_var.GetData()' + sLineBreak + + 'obj.Free()' + ); + Assert.Pass; +end; + +procedure TTestWrapDelphi.SetupFixture; +var + Py : PPyObject; +begin + FPythonEngine := TPythonEngine.Create(nil); + FPythonEngine.Name := 'PythonEngine'; + TPythonLoad.Configure(FPythonEngine); + + DelphiModule := TPythonModule.Create(nil); + + DelphiModule.Name := 'DelphiModule'; + DelphiModule.Engine := FPythonEngine; + DelphiModule.ModuleName := 'delphi'; + + PyDelphiWrapper := TPyDelphiWrapper.Create(nil); + + PyDelphiWrapper.Name := 'PyDelphiWrapper'; + PyDelphiWrapper.Engine := FPythonEngine; + PyDelphiWrapper.Module := DelphiModule; + + FPythonEngine.LoadDll; + // Then wrap the an instance our TTestRTTIAccess + // It will allow us to to test access to public fields and methods as well + // public (as well as published) properties. + // This time we would like the object to be destroyed when the PyObject + // is destroyed, so we need to set its Owned property to True; + TestRttiAccess := TTestRTTIAccess.Create; + TestRttiAccess.InterfaceField := TTestInterfaceImpl.Create; + Py := PyDelphiWrapper.Wrap(TestRttiAccess, TObjectOwnership.soReference); + DelphiModule.SetVar('rtti_var', Py); + FPythonEngine.Py_DecRef(Py); + Py := PyDelphiWrapper.WrapRecord(@Rec, TRttiContext.Create.GetType(TypeInfo(TTestRecord)) as TRttiStructuredType); + DelphiModule.SetVar('rtti_rec', Py); + FPythonEngine.Py_DecRef(Py); + FTestInterface := TTestInterfaceImpl.Create; + Py := PyDelphiWrapper.WrapInterface(TValue.From(FTestInterface)); + DelphiModule.SetVar('rtti_interface', Py); + FPythonEngine.Py_DecRef(Py); + FPythonEngine.ExecString('from delphi import rtti_var, rtti_rec, rtti_interface'); + Rtti_Var := MainModule.rtti_var; + Rtti_Rec := MainModule.rtti_rec; + Rtti_Interface := MainModule.rtti_interface; +end; + +procedure TTestWrapDelphi.TearDownFixture; +begin + VarClear(Rtti_Var); + VarClear(Rtti_Rec); + VarClear(Rtti_Interface); + FPythonEngine.Free; + PyDelphiWrapper.Free; + DelphiModule.Free; + TestRttiAccess.Free; +end; + +procedure TTestWrapDelphi.TestDoubleField; +begin + TestRttiAccess.DoubleField := 3.14; + Assert.AreEqual(double(TestRttiAccess.DoubleField), double(3.14)); + Rtti_Var.DoubleField := variant(double(1.23)); //implicitly cast to a variant to avoid a bug present in 10.4.2 + Assert.AreEqual(double(Rtti_Var.DoubleField), double(1.23)); +end; + +procedure TTestWrapDelphi.TestEnumField; +begin + TestRttiAccess.FruitField := Apple; + Assert.IsTrue(RTTI_var.FruitField = 'Apple'); + Rtti_Var.FruitField := 'Banana'; + Assert.IsTrue(TestRttiAccess.FruitField = Banana); +end; + +procedure TTestWrapDelphi.TestEnumProperty; +// Enumeration values are converted to/from strings +begin + TestRttiAccess.Fruit := Apple; + Assert.IsTrue(RTTI_var.Fruit = 'Apple'); + Rtti_Var.Fruit := 'Banana'; + Assert.IsTrue(TestRttiAccess.Fruit = Banana); +end; + +procedure TTestWrapDelphi.TestGetDynArray; +var + List: Variant; +begin + List := Rtti_Var.GetDynArray(); + Assert.IsTrue(VarIsPythonList(List)); + Assert.AreEqual(1000000, Integer(len(List))); + Assert.AreEqual(Int64(999999), Int64(FPythonEngine.PyObjectAsVariant(FPythonEngine.PyList_GetItem(ExtractPythonObjectFrom(List), 999999)))); +end; + +procedure TTestWrapDelphi.TestGetStaticArray; +var + List: Variant; +begin + List := Rtti_Var.GetStaticArray(); + Assert.IsTrue(VarIsPythonList(List)); + Assert.AreEqual(1000, Integer(len(List))); + Assert.AreEqual(Int64(999), Int64(FPythonEngine.PyObjectAsVariant(FPythonEngine.PyList_GetItem(ExtractPythonObjectFrom(List), 999)))); +end; + +procedure TTestWrapDelphi.TestInterface; +begin + Rtti_Interface.SetString('Test'); + Assert.IsTrue(Rtti_Interface.GetString() = 'Test'); +end; + +procedure TTestWrapDelphi.TestInterfaceField; +begin + Rtti_Interface.SetString('New Value'); + Assert.IsTrue(Rtti_Interface.GetString() = 'New Value'); + Rtti_Var.InterfaceField.SetString('Old Value'); + Assert.IsTrue(Rtti_Var.InterfaceField.GetString() = 'Old Value'); + // Assign interface + Rtti_Var.InterfaceField := Rtti_Interface; + Assert.IsTrue(Rtti_Var.InterfaceField.GetString() = 'New Value'); + Rtti_Var.InterfaceField := None; + Assert.IsTrue(VarIsNone(Rtti_Var.InterfaceField)); +end; + +procedure TTestWrapDelphi.TestMethodCall; +begin + TestRttiAccess.Fruits := []; + Assert.AreEqual(string(Rtti_Var.Fruits), '[]'); + Rtti_Var.BuyFruits(VarPythonCreate(['Apple', 'Banana'], stList)); + Assert.AreEqual(string(Rtti_Var.Fruits), '[''Apple'', ''Banana'']'); +end; + +procedure TTestWrapDelphi.TestObjectField; +{ + Demonstrating and testing: + Subclassing Delphi components in Python + Creating Delphi objects in Python + Assigning objects to object fields +} +Var + Script: AnsiString; + myComp: Variant; +begin + Script := + 'from delphi import Component' + sLineBreak + + 'class MyComponent(Component):' + SLineBreak + + ' def __init__(self, Owner):' + SLineBreak + + ' self._x = None' + SLineBreak + + '' + SLineBreak + + ' @property' + SLineBreak + + ' def x(self):' + SLineBreak + + ' return self._x' + SLineBreak + + '' + SLineBreak + + ' @x.setter' + SLineBreak + + ' def x(self, value):' + SLineBreak + + ' self._x = value' + SLineBreak + + '' + SLineBreak + + 'myComp = MyComponent(None)'; + ; + + FPythonEngine.ExecString(Script); + myComp := MainModule.myComp; + // accessing inherited property + Assert.IsTrue(myComp.Name = ''); + myComp.Name := 'NoName'; + Assert.IsTrue(myComp.Name = 'NoName'); + // accessing subclass property + myComp.x := variant(double(3.14)); //implicitly cast to a variant to avoid a bug present in 10.4.2 + Assert.IsTrue(myComp.x = 3.14); + + // Setting an object field + rtti_var.ObjectField := myComp; + Assert.IsTrue(rtti_var.ObjectField.Name = 'NoName'); + Assert.AreEqual(TComponent(TestRttiAccess.ObjectField).Name, 'NoName'); + rtti_var.ObjectField := None; + Assert.IsTrue(rtti_var.ObjectField = None); +end; + +procedure TTestWrapDelphi.TestPassVariantArray; +begin + FPythonEngine.ExecString( + 'from delphi import rtti_var' + sLineBreak + + 'rtti_var.PassVariantArray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])' + ); + Assert.Pass; +end; + +procedure TTestWrapDelphi.TestRecord; +begin + Rtti_rec.StringField := 'abcd'; + Assert.IsTrue(rtti_rec.StringField = 'abcd'); + Rtti_rec.SetStringField('1234'); + Assert.IsTrue(rtti_rec.StringField = '1234'); + Assert.AreEqual(Rec.StringField, '1234'); + Rtti_rec.SubRecord.DoubleField := variant(double(3.14)); //implicitly cast to a variant to avoid a bug present in 10.4.2 + Assert.IsTrue(rtti_rec.SubRecord.DoubleField = 3.14); + Assert.AreEqual(Rec.SubRecord.DoubleField, 3.14); +end; + +procedure TTestWrapDelphi.TestRecordField; +Var + RecValue: Variant; +begin + RecValue := rtti_var.RecordField; + RecValue.StringField := 'abc'; + rtti_var.RecordField := RecValue; + Assert.IsTrue(rtti_var.RecordField.StringField = 'abc'); +end; + +procedure TTestWrapDelphi.TestSetField; +// Sets are converted to/from list of strings +begin + TestRttiAccess.FruitsField := []; + Assert.AreEqual(string(Rtti_Var.FruitsField), '[]'); + Rtti_Var.FruitsField := VarPythonCreate(['Apple', 'Banana'], stList); + Assert.AreEqual(string(Rtti_Var.FruitsField), '[''Apple'', ''Banana'']'); + Assert.IsTrue(TestRttiAccess.FruitsField = [Apple, Banana]); +end; + +procedure TTestWrapDelphi.TestSetProperty; +begin + TestRttiAccess.Fruits := []; + Assert.AreEqual(string(Rtti_Var.Fruits), '[]'); + Rtti_Var.Fruits := VarPythonCreate(['Apple', 'Banana'], stList); + Assert.AreEqual(string(Rtti_Var.Fruits), '[''Apple'', ''Banana'']'); + Assert.IsTrue(TestRttiAccess.Fruits = [Apple, Banana]); +end; + +procedure TTestWrapDelphi.TestSetProps; +begin + rtti_var.SetProps(StringField := 'abc', DoubleField := 1.234); + Assert.AreEqual(TestRttiAccess.StringField, 'abc'); + Assert.AreEqual(TestRttiAccess.DoubleField, 1.234); +end; + +procedure TTestWrapDelphi.TestStringField; +begin + TestRttiAccess.StringField := 'Hi'; + Assert.AreEqual(string(Rtti_Var.StringField), 'Hi'); + Rtti_Var.StringField := 'P4D'; + Assert.AreEqual(TestRttiAccess.StringField, 'P4D'); +end; + +procedure TTestWrapDelphi.TestDynArrayParameters; +{var + rc: TRttiContext; + rt: TRttiType; + rm: TRttiMethod; + rp: TArray; + ra: TArray;} +begin +{ rc := TRttiContext.Create; + rt := rc.GetType(TypeInfo(TTestRttiAccess)); + rm := rt.GetMethod('SellFruitsInt'); + rp := rm.GetParameters; + SetLength(ra, 1); + ra[0] := TValue.FromArray(TypeInfo(TIntegerDynArray), [TValue.From(0)]); + rm.Invoke(TestRttiAccess, ra);} + TestRttiAccess.Fruits := [TFruit.Apple, TFruit.Banana, TFruit.Orange]; + Rtti_Var.SellFruitsInt(VarPythonCreate([0, 1], stList)); + Assert.IsTrue(TestRttiAccess.Fruits = [Orange]); + TestRttiAccess.Fruits := [TFruit.Apple, TFruit.Banana, TFruit.Orange]; + Rtti_Var.SellFruits(VarPythonCreate([Ord(TFruit.Apple), Ord(TFruit.Banana)], stList)); + Assert.IsTrue(TestRttiAccess.Fruits = [Orange]); +end; + +procedure TTestWrapDelphi.TestMethodWithVarAndOverload; +begin + Rtti_Var.SetStringField('test'); + Assert.AreEqual('test', TestRttiAccess.StringField); +end; + +function TTestRttiAccess.SetStringField(const Value: string): string; +begin + StringField := Value; + Result := StringField; +end; + +function TTestRttiAccess.SetStringField(var Value: Integer): string; +begin + StringField := IntToStr(Value); + Result := StringField; +end; + +function TTestRttiAccess.GetData: TObject; +begin + Result := TStringList.Create; +end; + +function TTestRttiAccess.GetDynArray: TInt64DynArray; +var + I: Integer; +begin + SetLength(Result, 1000000); + for I := 0 to Length(Result) - 1 do + Result[I] := I; +end; + +function TTestRttiAccess.GetStaticArray: TStaticArray; +var + I: Integer; +begin + for I := 0 to Length(Result) - 1 do + Result[I] := I; +end; + +procedure TTestRttiAccess.PassVariantArray(const Value: Variant); +begin + Assert.IsTrue(VarIsArray(Value) and (VarArrayHighBound(Value, 1) = 9)); +end; + +procedure TTestRttiAccess.SellFruits(const AFruits: TFruitDynArray); +var + Fruit: TFruit; +begin + for Fruit in AFruits do + Exclude(FFruits, Fruit); +end; + +procedure TTestRttiAccess.SellFruitsInt(const AFruits:TIntegerDynArray); +var + Fruit: Integer; +begin + for Fruit in AFruits do + Exclude(FFruits, TFruit(Fruit)); +end; + +{ TTestRecord } + +procedure TTestRecord.SetStringField(S: string); +begin + Self.StringField := S; +end; + +{ TTestInterfaceImpl } + +function TTestInterfaceImpl.GetString: string; +begin + Result := FString; +end; + +procedure TTestInterfaceImpl.SetString(const S: string); +begin + FString := S; +end; + +initialization + TDUnitX.RegisterTestFixture(TTestWrapDelphi); + ReportMemoryLeaksOnShutdown := True; + +end. From 824cf1e0c1857734fd3ae971d93f318ee8f2a1d6 Mon Sep 17 00:00:00 2001 From: pyscripter Date: Tue, 1 Aug 2023 14:19:53 +0300 Subject: [PATCH 09/12] Fix crash in Demo31. Accessing DelphiObject properties without calling Adjust(@Self) in WrapVclComCtrls.pas. --- Source/vcl/WrapVclComCtrls.pas | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/vcl/WrapVclComCtrls.pas b/Source/vcl/WrapVclComCtrls.pas index aec2033b..dfedeb0b 100644 --- a/Source/vcl/WrapVclComCtrls.pas +++ b/Source/vcl/WrapVclComCtrls.pas @@ -351,6 +351,7 @@ function TPyDelphiPageControl.GetHitTestInfoAt_Wrapper( function TPyDelphiPageControl.Get_ActivePage(AContext: Pointer): PPyObject; begin + Adjust(@Self); Result := Wrap(DelphiObject.ActivePage); end; @@ -364,6 +365,7 @@ function TPyDelphiPageControl.Get_ActivePageIndex( {$IFNDEF FPC} function TPyDelphiPageControl.Get_Canvas(AContext: Pointer): PPyObject; begin + Adjust(@Self); Result := Wrap(DelphiObject.Canvas); end; {$ENDIF FPC} From ef4172079bb7a3bfda40c267ddf9182a29cdb98e Mon Sep 17 00:00:00 2001 From: pyscripter Date: Wed, 2 Aug 2023 16:20:05 +0300 Subject: [PATCH 10/12] Fix #337 Uniform unit headers. --- Contributors.md | 20 +++ Source/MethodCallBack.pas | 26 ++-- Source/PythonAction.pas | 13 ++ Source/PythonEngine.pas | 58 ++------- Source/PythonVersions.pas | 22 ++-- Source/VarPyth.pas | 40 ++---- Source/WrapActions.pas | 13 ++ Source/WrapDelphi.pas | 21 ++- Source/WrapDelphiClasses.pas | 13 ++ Source/WrapDelphiDataBind.pas | 13 ++ Source/WrapDelphiTypes.pas | 13 ++ Source/WrapDelphiWindows.pas | 13 ++ Source/WrapFireDAC.pas | 22 +++- Source/fmx/FMX.PythonGUIInputOutput.pas | 13 ++ Source/fmx/WrapDelphiFmx.pas | 13 ++ Source/fmx/WrapFmxActnList.pas | 13 ++ Source/fmx/WrapFmxColors.pas | 13 ++ Source/fmx/WrapFmxComCtrls.pas | 13 ++ Source/fmx/WrapFmxControls.pas | 13 ++ Source/fmx/WrapFmxDataBind.pas | 13 ++ Source/fmx/WrapFmxDateTime.pas | 13 ++ Source/fmx/WrapFmxDialogs.pas | 13 ++ Source/fmx/WrapFmxEdit.pas | 13 ++ Source/fmx/WrapFmxForms.pas | 13 ++ Source/fmx/WrapFmxGrids.pas | 13 ++ Source/fmx/WrapFmxLayouts.pas | 13 ++ Source/fmx/WrapFmxListBox.pas | 13 ++ Source/fmx/WrapFmxListView.pas | 13 ++ Source/fmx/WrapFmxMedia.pas | 13 ++ Source/fmx/WrapFmxMemo.pas | 13 ++ Source/fmx/WrapFmxMenus.pas | 13 ++ Source/fmx/WrapFmxScrollBox.pas | 13 ++ Source/fmx/WrapFmxShapes.pas | 13 ++ Source/fmx/WrapFmxStdActns.pas | 13 ++ Source/fmx/WrapFmxStdCtrls.pas | 13 ++ Source/fmx/WrapFmxStyles.pas | 13 ++ Source/fmx/WrapFmxTypes.pas | 13 ++ Source/lcl/Lcl.PythonGUIInputOutput.pas | 51 ++------ Source/vcl/Vcl.PythonGUIInputOutput.pas | 51 ++------ Source/vcl/WrapDelphiVCL.pas | 13 ++ Source/vcl/WrapVclActnList.pas | 165 +++++++++++++----------- Source/vcl/WrapVclButtons.pas | 13 ++ Source/vcl/WrapVclComCtrls.pas | 15 ++- Source/vcl/WrapVclControls.pas | 13 ++ Source/vcl/WrapVclDialogs.pas | 13 ++ Source/vcl/WrapVclExtCtrls.pas | 13 ++ Source/vcl/WrapVclForms.pas | 15 ++- Source/vcl/WrapVclGraphics.pas | 13 ++ Source/vcl/WrapVclGrids.pas | 13 ++ Source/vcl/WrapVclMedia.pas | 13 ++ Source/vcl/WrapVclMenus.pas | 13 ++ Source/vcl/WrapVclSamplesSpin.pas | 13 ++ Source/vcl/WrapVclStdCtrls.pas | 13 ++ Source/vcl/WrapVclThemes.pas | 13 ++ Source/vcl/WrapVclWinXCtrls.pas | 13 ++ 55 files changed, 790 insertions(+), 275 deletions(-) create mode 100644 Contributors.md diff --git a/Contributors.md b/Contributors.md new file mode 100644 index 00000000..f6cce9d7 --- /dev/null +++ b/Contributors.md @@ -0,0 +1,20 @@ +## Contributors + +### Fpc and Lazarus support: +- Alexey-T (https://github.com/Alexey-T) +### Early Contributors: +- Grzegorz Makarewicz (mak@mikroplan.com.pl) +- Samuel Iseli (iseli@vertec.ch) +- Andrew Robinson (andy@hps1.demon.co.uk) +- Mark Watts(mark_watts@hotmail.com) +- Olivier Deckmyn (olivier.deckmyn@mail.dotcom.fr) +- Sigve Tjora (public@tjora.no) +- Mark Derricutt (mark@talios.com) +- Igor E. Poteryaev (jah@mail.ru) +- Yuri Filimonov (fil65@mail.ru) +- Stefan Hoffmeister (Stefan.Hoffmeister@Econos.de) +- Michiel du Toit (micdutoit@hsbfn.com) - Lazarus Port +- Chris Nicolai (nicolaitanes@gmail.com) +- Andrey Gruzdev (andrey.gruzdev@gmail.com) + +More recent contributors can be seen at the [project contributors graph](https://github.com/pyscripter/python4delphi/graphs/contributors). diff --git a/Source/MethodCallBack.pas b/Source/MethodCallBack.pas index f5eaec11..82b25a8e 100644 --- a/Source/MethodCallBack.pas +++ b/Source/MethodCallBack.pas @@ -1,28 +1,18 @@ (**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) (* *) -(* Module: Unit 'MethodCallback' Copyright (c) 1998 *) -(* *) -(* Version: 0.0 Dr. Dietmar Budelsky *) -(* Sub-Version: 0.3 dbudelsky@web.de *) -(* Germany *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) (* *) +(* LICENCE and Copyright: MIT (see project home) *) (**************************************************************************) (* Functionality: Generates synthetic callback functions which calls *) (* DELPHI Class Methods. A callback mechanism (DDE, PYTHON, TCL) can now *) (* use DELPHI objects. *) -(* *) -(**************************************************************************) -(* Contributors: *) -(* Grzegorz Makarewicz (mak@mikroplan.com.pl) *) -(* Morgan Martinet (p4d@mmm-experts.com) *) -(* Samuel Iseli (iseli@vertec.ch) *) -(* Andrey Gruzdev (andrey.gruzdev@gmail.com) *) -(* Lucas Belo (lucas.belo@live.com) *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free, as long as this *) -(* header and its copyright text is intact. *) -(* Dr. Dietmar Budelsky, 1998-01-07 *) (**************************************************************************) {$I Definition.Inc} diff --git a/Source/PythonAction.pas b/Source/PythonAction.pas index c1532fab..60af65e5 100644 --- a/Source/PythonAction.pas +++ b/Source/PythonAction.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit PythonAction; interface diff --git a/Source/PythonEngine.pas b/Source/PythonEngine.pas index dbc139e2..3ceeaa91 100644 --- a/Source/PythonEngine.pas +++ b/Source/PythonEngine.pas @@ -1,56 +1,14 @@ (**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) (* *) -(* Module: Unit 'PythonEngine' Copyright (c) 1997 *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) (* *) -(* Dr. Dietmar Budelsky *) -(* dbudelsky@web.de *) -(* Germany *) -(* *) -(* Morgan Martinet *) -(* 4723 rue Brebeuf *) -(* H2J 3L2 MONTREAL (QC) *) -(* CANADA *) -(* e-mail: p4d@mmm-experts.com *) -(* *) -(* PyScripter *) -(* e-mail: pyscripter@gmail.com *) -(* *) -(* Project page: https://github.com/pyscripter/python4delphi *) -(**************************************************************************) -(* Functionality: Delphi Components that provide an interface to the *) -(* Python language (see python.txt for more infos on *) -(* Python itself). *) -(* *) -(**************************************************************************) -(* Contributors: *) -(* Grzegorz Makarewicz (mak@mikroplan.com.pl) *) -(* Andrew Robinson (andy@hps1.demon.co.uk) *) -(* Mark Watts(mark_watts@hotmail.com) *) -(* Olivier Deckmyn (olivier.deckmyn@mail.dotcom.fr) *) -(* Sigve Tjora (public@tjora.no) *) -(* Mark Derricutt (mark@talios.com) *) -(* Igor E. Poteryaev (jah@mail.ru) *) -(* Yuri Filimonov (fil65@mail.ru) *) -(* Stefan Hoffmeister (Stefan.Hoffmeister@Econos.de) *) -(* Michiel du Toit (micdutoit@hsbfn.com) - Lazarus Port *) -(* Chris Nicolai (nicolaitanes@gmail.com) *) -(* Andrey Gruzdev (andrey.gruzdev@gmail.com) *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free for his own tasks *) -(* and projects, as long as this header and its copyright text is intact. *) -(* For changed versions of this code, which are public distributed the *) -(* following additional conditions have to be fullfilled: *) -(* 1) The header has to contain a comment on the change and the author of *) -(* it. *) -(* 2) A copy of the changed source has to be sent to the above E-Mail *) -(* address or my then valid address, if this is possible to the *) -(* author. *) -(* The second condition has the target to maintain an up to date central *) -(* version of the component. If this condition is not acceptable for *) -(* confidential or legal reasons, everyone is free to derive a component *) -(* or to generate a diff file to my or other original sources. *) -(* Dr. Dietmar Budelsky, 1997-11-17 *) +(* LICENCE and Copyright: MIT (see project home) *) (**************************************************************************) {$I Definition.Inc} diff --git a/Source/PythonVersions.pas b/Source/PythonVersions.pas index 2a596d5d..569ba52f 100644 --- a/Source/PythonVersions.pas +++ b/Source/PythonVersions.pas @@ -1,11 +1,17 @@ -{----------------------------------------------------------------------------- - Unit Name: PythonVersions - Author: PyScripter - Purpose: Discover and get info about Python versions - Part of the Python for Delphi library - - History: ------------------------------------------------------------------------------} +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) +(* Purpose: Discover and get info about Python versions *) +(**************************************************************************) unit PythonVersions; diff --git a/Source/VarPyth.pas b/Source/VarPyth.pas index ab9f170a..ae953b48 100644 --- a/Source/VarPyth.pas +++ b/Source/VarPyth.pas @@ -1,17 +1,14 @@ -{$I Definition.Inc} - -unit VarPyth; - (**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) (* *) -(* Module: Unit 'VarPyth' Copyright (c) 2001 *) -(* *) -(* Version: 1.0 Morgan Martinet *) -(* Sub-Version: 0.7 4723 rue Brebeuf *) -(* H2J 3L2 MONTREAL (QC) *) -(* CANADA *) -(* e-mail: p4d@mmm-experts.com *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) (* *) +(* LICENCE and Copyright: MIT (see project home) *) (**************************************************************************) (* Functionality: This allows you to use Python objects like COM *) (* automation objects, inside your Delphi source code. *) @@ -19,23 +16,10 @@ (* that uses the new custom variant types introduced *) (* in Delphi6. *) (**************************************************************************) -(* Contributors: *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free for his own tasks *) -(* and projects, as long as this header and its copyright text is intact. *) -(* For changed versions of this code, which are public distributed the *) -(* following additional conditions have to be fullfilled: *) -(* 1) The header has to contain a comment on the change and the author of *) -(* it. *) -(* 2) A copy of the changed source has to be sent to the above E-Mail *) -(* address or my then valid address, if this is possible to the *) -(* author. *) -(* The second condition has the target to maintain an up to date central *) -(* version of the component. If this condition is not acceptable for *) -(* confidential or legal reasons, everyone is free to derive a component *) -(* or to generate a diff file to my or other original sources. *) -(**************************************************************************) + +{$I Definition.Inc} + +unit VarPyth; interface diff --git a/Source/WrapActions.pas b/Source/WrapActions.pas index ff7ac700..3e527f52 100644 --- a/Source/WrapActions.pas +++ b/Source/WrapActions.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapActions; interface diff --git a/Source/WrapDelphi.pas b/Source/WrapDelphi.pas index 3eb9aba0..27448707 100644 --- a/Source/WrapDelphi.pas +++ b/Source/WrapDelphi.pas @@ -1,12 +1,19 @@ -(*----------------------------------------------------------------------------- - Unit Name: WrapDelphi - Author: Kiriakos Vlahos - Date: 24-Feb-2005 +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + +(*----------------------------------------------------------------------------- Purpose: Provide automatic wrapping of Delphi variables utilising RTTI - Contributors: - Morgan Martinet (mmm@free.fr) - Features: Published properties and methods compiled with {$METHODINFO ON} are handled automatically (Note that METHODINFO can be used only with Delphi7 diff --git a/Source/WrapDelphiClasses.pas b/Source/WrapDelphiClasses.pas index 2e2ae482..5a00f9aa 100644 --- a/Source/WrapDelphiClasses.pas +++ b/Source/WrapDelphiClasses.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I Definition.Inc} unit WrapDelphiClasses; diff --git a/Source/WrapDelphiDataBind.pas b/Source/WrapDelphiDataBind.pas index 01dd5fb3..2d2938cb 100644 --- a/Source/WrapDelphiDataBind.pas +++ b/Source/WrapDelphiDataBind.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapDelphiDataBind; interface diff --git a/Source/WrapDelphiTypes.pas b/Source/WrapDelphiTypes.pas index 12f7718c..76c22c85 100644 --- a/Source/WrapDelphiTypes.pas +++ b/Source/WrapDelphiTypes.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I Definition.Inc} unit WrapDelphiTypes; diff --git a/Source/WrapDelphiWindows.pas b/Source/WrapDelphiWindows.pas index 34c02eaf..86845816 100644 --- a/Source/WrapDelphiWindows.pas +++ b/Source/WrapDelphiWindows.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I Definition.Inc} unit WrapDelphiWindows; diff --git a/Source/WrapFireDAC.pas b/Source/WrapFireDAC.pas index 195a1e45..eefa7af9 100644 --- a/Source/WrapFireDAC.pas +++ b/Source/WrapFireDAC.pas @@ -1,9 +1,19 @@ -{$REGION 'Licence'} -{ - Wrapper classes for FireDAC TFDTable and TFDQuery - Original Code by https://github.com/hartmutdavid -==============================================================================} -{$ENDREGION} +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) +(* Wrapper classes for FireDAC TFDTable and TFDQuery *) +(* Original Code by https://github.com/hartmutdavid *) +(**************************************************************************) + unit WrapFireDAC; interface diff --git a/Source/fmx/FMX.PythonGUIInputOutput.pas b/Source/fmx/FMX.PythonGUIInputOutput.pas index 36aa61c1..2d90884f 100644 --- a/Source/fmx/FMX.PythonGUIInputOutput.pas +++ b/Source/fmx/FMX.PythonGUIInputOutput.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit FMX.PythonGUIInputOutput; diff --git a/Source/fmx/WrapDelphiFmx.pas b/Source/fmx/WrapDelphiFmx.pas index 4e1505e1..1fd2cd29 100644 --- a/Source/fmx/WrapDelphiFmx.pas +++ b/Source/fmx/WrapDelphiFmx.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapDelphiFmx; interface diff --git a/Source/fmx/WrapFmxActnList.pas b/Source/fmx/WrapFmxActnList.pas index 0083be93..bc7278b0 100644 --- a/Source/fmx/WrapFmxActnList.pas +++ b/Source/fmx/WrapFmxActnList.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxActnList; diff --git a/Source/fmx/WrapFmxColors.pas b/Source/fmx/WrapFmxColors.pas index bef6dad8..6a2f90e7 100644 --- a/Source/fmx/WrapFmxColors.pas +++ b/Source/fmx/WrapFmxColors.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxColors; interface diff --git a/Source/fmx/WrapFmxComCtrls.pas b/Source/fmx/WrapFmxComCtrls.pas index 0093e614..84b92dfa 100644 --- a/Source/fmx/WrapFmxComCtrls.pas +++ b/Source/fmx/WrapFmxComCtrls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxComCtrls; diff --git a/Source/fmx/WrapFmxControls.pas b/Source/fmx/WrapFmxControls.pas index 3ae4a506..ac177c02 100644 --- a/Source/fmx/WrapFmxControls.pas +++ b/Source/fmx/WrapFmxControls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxControls; diff --git a/Source/fmx/WrapFmxDataBind.pas b/Source/fmx/WrapFmxDataBind.pas index 3ad2eef4..6bc3b8b7 100644 --- a/Source/fmx/WrapFmxDataBind.pas +++ b/Source/fmx/WrapFmxDataBind.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxDataBind; interface diff --git a/Source/fmx/WrapFmxDateTime.pas b/Source/fmx/WrapFmxDateTime.pas index 1fc12e31..7da8b56a 100644 --- a/Source/fmx/WrapFmxDateTime.pas +++ b/Source/fmx/WrapFmxDateTime.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxDateTime; interface diff --git a/Source/fmx/WrapFmxDialogs.pas b/Source/fmx/WrapFmxDialogs.pas index 059dcd66..6a9b06be 100644 --- a/Source/fmx/WrapFmxDialogs.pas +++ b/Source/fmx/WrapFmxDialogs.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxDialogs; diff --git a/Source/fmx/WrapFmxEdit.pas b/Source/fmx/WrapFmxEdit.pas index 05a0cee5..ac9a11b0 100644 --- a/Source/fmx/WrapFmxEdit.pas +++ b/Source/fmx/WrapFmxEdit.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxEdit; diff --git a/Source/fmx/WrapFmxForms.pas b/Source/fmx/WrapFmxForms.pas index 1dc5fb31..0c63147e 100644 --- a/Source/fmx/WrapFmxForms.pas +++ b/Source/fmx/WrapFmxForms.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxForms; diff --git a/Source/fmx/WrapFmxGrids.pas b/Source/fmx/WrapFmxGrids.pas index 841c75b6..85b680a8 100644 --- a/Source/fmx/WrapFmxGrids.pas +++ b/Source/fmx/WrapFmxGrids.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxGrids; interface diff --git a/Source/fmx/WrapFmxLayouts.pas b/Source/fmx/WrapFmxLayouts.pas index f3433d99..ea7c5178 100644 --- a/Source/fmx/WrapFmxLayouts.pas +++ b/Source/fmx/WrapFmxLayouts.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxLayouts; diff --git a/Source/fmx/WrapFmxListBox.pas b/Source/fmx/WrapFmxListBox.pas index c2c390e4..9bce17f6 100644 --- a/Source/fmx/WrapFmxListBox.pas +++ b/Source/fmx/WrapFmxListBox.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxListBox; diff --git a/Source/fmx/WrapFmxListView.pas b/Source/fmx/WrapFmxListView.pas index bcd49632..10270d4c 100644 --- a/Source/fmx/WrapFmxListView.pas +++ b/Source/fmx/WrapFmxListView.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxListView; interface diff --git a/Source/fmx/WrapFmxMedia.pas b/Source/fmx/WrapFmxMedia.pas index b884f697..7b1d3fd2 100644 --- a/Source/fmx/WrapFmxMedia.pas +++ b/Source/fmx/WrapFmxMedia.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxMedia; diff --git a/Source/fmx/WrapFmxMemo.pas b/Source/fmx/WrapFmxMemo.pas index 5dcf7295..462f383e 100644 --- a/Source/fmx/WrapFmxMemo.pas +++ b/Source/fmx/WrapFmxMemo.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxMemo; interface diff --git a/Source/fmx/WrapFmxMenus.pas b/Source/fmx/WrapFmxMenus.pas index 84096ef4..e34bfb62 100644 --- a/Source/fmx/WrapFmxMenus.pas +++ b/Source/fmx/WrapFmxMenus.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxMenus; diff --git a/Source/fmx/WrapFmxScrollBox.pas b/Source/fmx/WrapFmxScrollBox.pas index 8b73b4bf..bb46808e 100644 --- a/Source/fmx/WrapFmxScrollBox.pas +++ b/Source/fmx/WrapFmxScrollBox.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapFmxScrollBox; interface diff --git a/Source/fmx/WrapFmxShapes.pas b/Source/fmx/WrapFmxShapes.pas index 08607a8f..b098b750 100644 --- a/Source/fmx/WrapFmxShapes.pas +++ b/Source/fmx/WrapFmxShapes.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxShapes; diff --git a/Source/fmx/WrapFmxStdActns.pas b/Source/fmx/WrapFmxStdActns.pas index 7f7eaeed..e28cea86 100644 --- a/Source/fmx/WrapFmxStdActns.pas +++ b/Source/fmx/WrapFmxStdActns.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxStdActns; diff --git a/Source/fmx/WrapFmxStdCtrls.pas b/Source/fmx/WrapFmxStdCtrls.pas index e1af1763..5711db8b 100644 --- a/Source/fmx/WrapFmxStdCtrls.pas +++ b/Source/fmx/WrapFmxStdCtrls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxStdCtrls; diff --git a/Source/fmx/WrapFmxStyles.pas b/Source/fmx/WrapFmxStyles.pas index 36965919..8bd2a761 100644 --- a/Source/fmx/WrapFmxStyles.pas +++ b/Source/fmx/WrapFmxStyles.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxStyles; diff --git a/Source/fmx/WrapFmxTypes.pas b/Source/fmx/WrapFmxTypes.pas index efc3c7f4..68023bf3 100644 --- a/Source/fmx/WrapFmxTypes.pas +++ b/Source/fmx/WrapFmxTypes.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapFmxTypes; diff --git a/Source/lcl/Lcl.PythonGUIInputOutput.pas b/Source/lcl/Lcl.PythonGUIInputOutput.pas index d29e9cbb..f6390ec8 100644 --- a/Source/lcl/Lcl.PythonGUIInputOutput.pas +++ b/Source/lcl/Lcl.PythonGUIInputOutput.pas @@ -1,47 +1,18 @@ -{$I ..\Definition.Inc} -unit Lcl.PythonGUIInputOutput; - (**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) (* *) -(* Module: Unit 'PythonGUIInputOutput' Copyright (c) 1997 *) -(* *) -(* Dr. Dietmar Budelsky *) -(* dbudelsky@web.de *) -(* Germany *) -(* *) -(* Morgan Martinet *) -(* 4723 rue Brebeuf *) -(* H2J 3L2 MONTREAL (QC) *) -(* CANADA *) -(* e-mail: p4d@mmm-experts.com *) -(* *) -(* look our page at: http://mmm-experts.com/ *) -(**************************************************************************) -(* Functionality: Delphi Components that provide an interface to the *) -(* Python language (see python.txt for more infos on *) -(* Python itself). *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) (* *) +(* LICENCE and Copyright: MIT (see project home) *) (**************************************************************************) -(* Contributors: *) -(* Mark Watts(mark_watts@hotmail.com) *) -(* Michiel du Toit (micdutoit@hsbfn.com) *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free for his own tasks *) -(* and projects, as long as this header and its copyright text is intact. *) -(* For changed versions of this code, which are public distributed the *) -(* following additional conditions have to be fullfilled: *) -(* 1) The header has to contain a comment on the change and the author of *) -(* it. *) -(* 2) A copy of the changed source has to be sent to the above E-Mail *) -(* address or my then valid address, if this is possible to the *) -(* author. *) -(* The second condition has the target to maintain an up to date central *) -(* version of the component. If this condition is not acceptable for *) -(* confidential or legal reasons, everyone is free to derive a component *) -(* or to generate a diff file to my or other original sources. *) -(* Dr. Dietmar Budelsky, 1997-11-17 *) -(**************************************************************************) + +{$I ..\Definition.Inc} +unit Lcl.PythonGUIInputOutput; interface diff --git a/Source/vcl/Vcl.PythonGUIInputOutput.pas b/Source/vcl/Vcl.PythonGUIInputOutput.pas index 4eddaee3..5f800346 100644 --- a/Source/vcl/Vcl.PythonGUIInputOutput.pas +++ b/Source/vcl/Vcl.PythonGUIInputOutput.pas @@ -1,47 +1,18 @@ -{$I ..\Definition.Inc} -unit Vcl.PythonGUIInputOutput; - (**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) (* *) -(* Module: Unit 'PythonGUIInputOutput' Copyright (c) 1997 *) -(* *) -(* Dr. Dietmar Budelsky *) -(* dbudelsky@web.de *) -(* Germany *) -(* *) -(* Morgan Martinet *) -(* 4723 rue Brebeuf *) -(* H2J 3L2 MONTREAL (QC) *) -(* CANADA *) -(* e-mail: p4d@mmm-experts.com *) -(* *) -(* look our page at: http://mmm-experts.com/ *) -(**************************************************************************) -(* Functionality: Delphi Components that provide an interface to the *) -(* Python language (see python.txt for more infos on *) -(* Python itself). *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) (* *) +(* LICENCE and Copyright: MIT (see project home) *) (**************************************************************************) -(* Contributors: *) -(* Mark Watts(mark_watts@hotmail.com) *) -(* Michiel du Toit (micdutoit@hsbfn.com) *) -(**************************************************************************) -(* This source code is distributed with no WARRANTY, for no reason or use.*) -(* Everyone is allowed to use and change this code free for his own tasks *) -(* and projects, as long as this header and its copyright text is intact. *) -(* For changed versions of this code, which are public distributed the *) -(* following additional conditions have to be fullfilled: *) -(* 1) The header has to contain a comment on the change and the author of *) -(* it. *) -(* 2) A copy of the changed source has to be sent to the above E-Mail *) -(* address or my then valid address, if this is possible to the *) -(* author. *) -(* The second condition has the target to maintain an up to date central *) -(* version of the component. If this condition is not acceptable for *) -(* confidential or legal reasons, everyone is free to derive a component *) -(* or to generate a diff file to my or other original sources. *) -(* Dr. Dietmar Budelsky, 1997-11-17 *) -(**************************************************************************) + +{$I ..\Definition.Inc} +unit Vcl.PythonGUIInputOutput; interface diff --git a/Source/vcl/WrapDelphiVCL.pas b/Source/vcl/WrapDelphiVCL.pas index ea9f5392..1178ebb9 100644 --- a/Source/vcl/WrapDelphiVCL.pas +++ b/Source/vcl/WrapDelphiVCL.pas @@ -1,3 +1,16 @@ + +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + unit WrapDelphiVCL; { diff --git a/Source/vcl/WrapVclActnList.pas b/Source/vcl/WrapVclActnList.pas index f15e2a88..fde9ac6b 100644 --- a/Source/vcl/WrapVclActnList.pas +++ b/Source/vcl/WrapVclActnList.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclActnList; @@ -17,15 +30,15 @@ interface the types and allows the use of the constructors e.g. ActionList() } TPyDelphiCustomActionList = class(TPyDelphiContainedActionList) - private - function GetDelphiObject: TCustomActionList; - procedure SetDelphiObject(const Value: TCustomActionList); - public - class function DelphiObjectClass: TClass; override; - property DelphiObject: TCustomActionList read GetDelphiObject - write SetDelphiObject; - end; - + private + function GetDelphiObject: TCustomActionList; + procedure SetDelphiObject(const Value: TCustomActionList); + public + class function DelphiObjectClass: TClass; override; + property DelphiObject: TCustomActionList read GetDelphiObject + write SetDelphiObject; + end; + TPyDelphiActionList = class (TPyDelphiCustomActionList) private function GetDelphiObject: TActionList; @@ -38,23 +51,23 @@ TPyDelphiActionList = class (TPyDelphiCustomActionList) end; TPyDelphiCustomAction = class(TPyDelphiContainedAction) - private - function GetDelphiObject: TCustomAction; - procedure SetDelphiObject(const Value: TCustomAction); - public - class function DelphiObjectClass: TClass; override; - property DelphiObject: TCustomAction read GetDelphiObject - write SetDelphiObject; - end; - - TPyDelphiAction = class(TPyDelphiContainedAction) - private - function GetDelphiObject: TAction; - procedure SetDelphiObject(const Value: TAction); - public - class function DelphiObjectClass: TClass; override; - property DelphiObject: TAction read GetDelphiObject write SetDelphiObject; - end; + private + function GetDelphiObject: TCustomAction; + procedure SetDelphiObject(const Value: TCustomAction); + public + class function DelphiObjectClass: TClass; override; + property DelphiObject: TCustomAction read GetDelphiObject + write SetDelphiObject; + end; + + TPyDelphiAction = class(TPyDelphiContainedAction) + private + function GetDelphiObject: TAction; + procedure SetDelphiObject(const Value: TAction); + public + class function DelphiObjectClass: TClass; override; + property DelphiObject: TAction read GetDelphiObject write SetDelphiObject; + end; implementation @@ -79,26 +92,26 @@ procedure TActnListRegistration.RegisterWrappers(APyDelphiWrapper: TPyDelphiWrap APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomActionList); APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiActionList); APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiCustomAction); - APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiAction); + APyDelphiWrapper.RegisterDelphiWrapper(TPyDelphiAction); end; { TPyDelphiCustomActionList } -class function TPyDelphiCustomActionList.DelphiObjectClass: TClass; -begin - Result := TCustomActionList; -end; - -function TPyDelphiCustomActionList.GetDelphiObject: TCustomActionList; -begin - Result := TCustomActionList(inherited DelphiObject); -end; - -procedure TPyDelphiCustomActionList.SetDelphiObject - (const Value: TCustomActionList); -begin - inherited DelphiObject := Value; -end; - +class function TPyDelphiCustomActionList.DelphiObjectClass: TClass; +begin + Result := TCustomActionList; +end; + +function TPyDelphiCustomActionList.GetDelphiObject: TCustomActionList; +begin + Result := TCustomActionList(inherited DelphiObject); +end; + +procedure TPyDelphiCustomActionList.SetDelphiObject + (const Value: TCustomActionList); +begin + inherited DelphiObject := Value; +end; + { TPyDelphiActionList } class function TPyDelphiActionList.DelphiObjectClass: TClass; @@ -118,39 +131,39 @@ procedure TPyDelphiActionList.SetDelphiObject( end; { TPyDelphiCustomAction } - -class function TPyDelphiCustomAction.DelphiObjectClass: TClass; -begin - Result := TCustomAction; -end; - -function TPyDelphiCustomAction.GetDelphiObject: TCustomAction; -begin - Result := TCustomAction(inherited DelphiObject); -end; - -procedure TPyDelphiCustomAction.SetDelphiObject(const Value: TCustomAction); -begin - inherited DelphiObject := Value; -end; - -{ TPyDelphiAction } - -class function TPyDelphiAction.DelphiObjectClass: TClass; -begin - Result := TAction; -end; - -function TPyDelphiAction.GetDelphiObject: TAction; -begin - Result := TAction(inherited DelphiObject); -end; - -procedure TPyDelphiAction.SetDelphiObject(const Value: TAction); -begin - inherited DelphiObject := Value; -end; - + +class function TPyDelphiCustomAction.DelphiObjectClass: TClass; +begin + Result := TCustomAction; +end; + +function TPyDelphiCustomAction.GetDelphiObject: TCustomAction; +begin + Result := TCustomAction(inherited DelphiObject); +end; + +procedure TPyDelphiCustomAction.SetDelphiObject(const Value: TCustomAction); +begin + inherited DelphiObject := Value; +end; + +{ TPyDelphiAction } + +class function TPyDelphiAction.DelphiObjectClass: TClass; +begin + Result := TAction; +end; + +function TPyDelphiAction.GetDelphiObject: TAction; +begin + Result := TAction(inherited DelphiObject); +end; + +procedure TPyDelphiAction.SetDelphiObject(const Value: TAction); +begin + inherited DelphiObject := Value; +end; + initialization RegisteredUnits.Add(TActnListRegistration.Create); end. diff --git a/Source/vcl/WrapVclButtons.pas b/Source/vcl/WrapVclButtons.pas index cf4e7801..26ebf124 100644 --- a/Source/vcl/WrapVclButtons.pas +++ b/Source/vcl/WrapVclButtons.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclButtons; diff --git a/Source/vcl/WrapVclComCtrls.pas b/Source/vcl/WrapVclComCtrls.pas index dfedeb0b..a38d3505 100644 --- a/Source/vcl/WrapVclComCtrls.pas +++ b/Source/vcl/WrapVclComCtrls.pas @@ -1,4 +1,17 @@ -{$I ..\Definition.Inc} +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + +{$I ..\Definition.Inc} unit WrapVclComCtrls; diff --git a/Source/vcl/WrapVclControls.pas b/Source/vcl/WrapVclControls.pas index 07494a3d..c8171dc0 100644 --- a/Source/vcl/WrapVclControls.pas +++ b/Source/vcl/WrapVclControls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclControls; diff --git a/Source/vcl/WrapVclDialogs.pas b/Source/vcl/WrapVclDialogs.pas index 1e37942b..ed205e7c 100644 --- a/Source/vcl/WrapVclDialogs.pas +++ b/Source/vcl/WrapVclDialogs.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclDialogs; diff --git a/Source/vcl/WrapVclExtCtrls.pas b/Source/vcl/WrapVclExtCtrls.pas index 8fcbae88..85c5b4d3 100644 --- a/Source/vcl/WrapVclExtCtrls.pas +++ b/Source/vcl/WrapVclExtCtrls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclExtCtrls; diff --git a/Source/vcl/WrapVclForms.pas b/Source/vcl/WrapVclForms.pas index cd9bd33a..ad62a6cf 100644 --- a/Source/vcl/WrapVclForms.pas +++ b/Source/vcl/WrapVclForms.pas @@ -1,4 +1,17 @@ -{$I ..\Definition.Inc} +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + +{$I ..\Definition.Inc} unit WrapVclForms; diff --git a/Source/vcl/WrapVclGraphics.pas b/Source/vcl/WrapVclGraphics.pas index 55f7b2d7..cde54ed6 100644 --- a/Source/vcl/WrapVclGraphics.pas +++ b/Source/vcl/WrapVclGraphics.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclGraphics; diff --git a/Source/vcl/WrapVclGrids.pas b/Source/vcl/WrapVclGrids.pas index 3f52bbe7..0d74cf7e 100644 --- a/Source/vcl/WrapVclGrids.pas +++ b/Source/vcl/WrapVclGrids.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclGrids; diff --git a/Source/vcl/WrapVclMedia.pas b/Source/vcl/WrapVclMedia.pas index 30f5706d..f8ee1d55 100644 --- a/Source/vcl/WrapVclMedia.pas +++ b/Source/vcl/WrapVclMedia.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclMedia; diff --git a/Source/vcl/WrapVclMenus.pas b/Source/vcl/WrapVclMenus.pas index 8a755c75..30e49f1b 100644 --- a/Source/vcl/WrapVclMenus.pas +++ b/Source/vcl/WrapVclMenus.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclMenus; diff --git a/Source/vcl/WrapVclSamplesSpin.pas b/Source/vcl/WrapVclSamplesSpin.pas index 98d9b0e7..859ad414 100644 --- a/Source/vcl/WrapVclSamplesSpin.pas +++ b/Source/vcl/WrapVclSamplesSpin.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclSamplesSpin; diff --git a/Source/vcl/WrapVclStdCtrls.pas b/Source/vcl/WrapVclStdCtrls.pas index 07e11f57..c0e9e234 100644 --- a/Source/vcl/WrapVclStdCtrls.pas +++ b/Source/vcl/WrapVclStdCtrls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclStdCtrls; diff --git a/Source/vcl/WrapVclThemes.pas b/Source/vcl/WrapVclThemes.pas index f77b49ee..a5c3a850 100644 --- a/Source/vcl/WrapVclThemes.pas +++ b/Source/vcl/WrapVclThemes.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclThemes; diff --git a/Source/vcl/WrapVclWinXCtrls.pas b/Source/vcl/WrapVclWinXCtrls.pas index fd027c70..5d7c4bc6 100644 --- a/Source/vcl/WrapVclWinXCtrls.pas +++ b/Source/vcl/WrapVclWinXCtrls.pas @@ -1,3 +1,16 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) + {$I ..\Definition.Inc} unit WrapVclWinXCtrls; From 800dc5380af0ce2e091dc6b28fe61999f0b19e5d Mon Sep 17 00:00:00 2001 From: lmbelo Date: Tue, 29 Aug 2023 20:13:58 -0300 Subject: [PATCH 11/12] Project files update --- Packages/Delphi/Delphi 10.4+/Python.dproj | 1 + Packages/Delphi/Delphi 10.4+/PythonVcl.dproj | 1 + Packages/Delphi/P4DComponentSuite.groupproj | 192 +++++++++---------- 3 files changed, 98 insertions(+), 96 deletions(-) diff --git a/Packages/Delphi/Delphi 10.4+/Python.dproj b/Packages/Delphi/Delphi 10.4+/Python.dproj index 33ce2c07..b56abb83 100644 --- a/Packages/Delphi/Delphi 10.4+/Python.dproj +++ b/Packages/Delphi/Delphi 10.4+/Python.dproj @@ -178,6 +178,7 @@ + Base diff --git a/Packages/Delphi/Delphi 10.4+/PythonVcl.dproj b/Packages/Delphi/Delphi 10.4+/PythonVcl.dproj index 5e059dc0..3f40f175 100644 --- a/Packages/Delphi/Delphi 10.4+/PythonVcl.dproj +++ b/Packages/Delphi/Delphi 10.4+/PythonVcl.dproj @@ -118,6 +118,7 @@ + Base diff --git a/Packages/Delphi/P4DComponentSuite.groupproj b/Packages/Delphi/P4DComponentSuite.groupproj index 4995cf22..0811f31e 100644 --- a/Packages/Delphi/P4DComponentSuite.groupproj +++ b/Packages/Delphi/P4DComponentSuite.groupproj @@ -1,96 +1,96 @@ - - - {8BE1193B-E609-445D-9BA3-F57DBEA042F5} - - - - - - - Delphi 10.4+\Python.dproj - - - Delphi 10.4+\Python.dproj - - - Delphi 10.4+\PythonVcl.dproj - - - - - - - - - - Default.Personality.12 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + {8BE1193B-E609-445D-9BA3-F57DBEA042F5} + + + + + + + Delphi 10.4+\Python.dproj + + + Delphi 10.4+\Python.dproj + + + Delphi 10.4+\PythonVcl.dproj + + + + + + + + + + Default.Personality.12 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 267b68e4bb4b111830a50e794755de1bbb6e850c Mon Sep 17 00:00:00 2001 From: lmbelo Date: Wed, 30 Aug 2023 08:45:29 -0300 Subject: [PATCH 12/12] Adding unit headers --- Source/WrapDelphiImageList.pas | 12 ++++++++++++ Source/fmx/WrapFmxImgList.pas | 12 ++++++++++++ Source/vcl/WrapVclImgList.pas | 12 ++++++++++++ 3 files changed, 36 insertions(+) diff --git a/Source/WrapDelphiImageList.pas b/Source/WrapDelphiImageList.pas index 29f2635c..0017847c 100644 --- a/Source/WrapDelphiImageList.pas +++ b/Source/WrapDelphiImageList.pas @@ -1,3 +1,15 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) {$I Definition.Inc} unit WrapDelphiImageList; diff --git a/Source/fmx/WrapFmxImgList.pas b/Source/fmx/WrapFmxImgList.pas index c270d456..c9b4c736 100644 --- a/Source/fmx/WrapFmxImgList.pas +++ b/Source/fmx/WrapFmxImgList.pas @@ -1,3 +1,15 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) {$I Definition.Inc} unit WrapFmxImgList; diff --git a/Source/vcl/WrapVclImgList.pas b/Source/vcl/WrapVclImgList.pas index d10ab0d8..5b807953 100644 --- a/Source/vcl/WrapVclImgList.pas +++ b/Source/vcl/WrapVclImgList.pas @@ -1,3 +1,15 @@ +(**************************************************************************) +(* This unit is part of the Python for Delphi (P4D) library *) +(* Project home: https://github.com/pyscripter/python4delphi *) +(* *) +(* Project Maintainer: PyScripter (pyscripter@gmail.com) *) +(* Original Authors: Dr. Dietmar Budelsky (dbudelsky@web.de) *) +(* Morgan Martinet (https://github.com/mmm-experts) *) +(* Core developer: Lucas Belo (lucas.belo@live.com) *) +(* Contributors: See contributors.md at project home *) +(* *) +(* LICENCE and Copyright: MIT (see project home) *) +(**************************************************************************) {$I Definition.Inc} unit WrapVclImgList;