mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-12 20:00:36 +01:00
h2pas wizard: added -C option from jpmugaas
git-svn-id: trunk@10027 -
This commit is contained in:
parent
f2088e4dab
commit
91502214ae
@ -161,6 +161,7 @@ type
|
|||||||
FUseProcVarsForImport: boolean;
|
FUseProcVarsForImport: boolean;
|
||||||
FVarParams: boolean;
|
FVarParams: boolean;
|
||||||
FWin32Header: boolean;
|
FWin32Header: boolean;
|
||||||
|
FUseCTypes : boolean;
|
||||||
function GetCHeaderFileCount: integer;
|
function GetCHeaderFileCount: integer;
|
||||||
function GetCHeaderFiles(Index: integer): TH2PasFile;
|
function GetCHeaderFiles(Index: integer): TH2PasFile;
|
||||||
procedure InternalAddCHeaderFile(AFile: TH2PasFile);
|
procedure InternalAddCHeaderFile(AFile: TH2PasFile);
|
||||||
@ -186,6 +187,7 @@ type
|
|||||||
procedure SetUseProcVarsForImport(const AValue: boolean);
|
procedure SetUseProcVarsForImport(const AValue: boolean);
|
||||||
procedure SetVarParams(const AValue: boolean);
|
procedure SetVarParams(const AValue: boolean);
|
||||||
procedure SetWin32Header(const AValue: boolean);
|
procedure SetWin32Header(const AValue: boolean);
|
||||||
|
procedure SetUseCTypes(const AValue: boolean);
|
||||||
public
|
public
|
||||||
constructor Create;
|
constructor Create;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
@ -235,6 +237,7 @@ type
|
|||||||
property UseProcVarsForImport: boolean read FUseProcVarsForImport write SetUseProcVarsForImport;
|
property UseProcVarsForImport: boolean read FUseProcVarsForImport write SetUseProcVarsForImport;
|
||||||
property VarParams: boolean read FVarParams write SetVarParams;
|
property VarParams: boolean read FVarParams write SetVarParams;
|
||||||
property Win32Header: boolean read FWin32Header write SetWin32Header;
|
property Win32Header: boolean read FWin32Header write SetWin32Header;
|
||||||
|
property UseCTypes: boolean read FUseCTypes write SetUseCTypes;
|
||||||
property OutputDirectory: string read FOutputDirectory write SetOutputDirectory;
|
property OutputDirectory: string read FOutputDirectory write SetOutputDirectory;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -452,6 +455,7 @@ begin
|
|||||||
if Project.UseProcVarsForImport then Add('-P');
|
if Project.UseProcVarsForImport then Add('-P');
|
||||||
if Project.VarParams then Add('-v');
|
if Project.VarParams then Add('-v');
|
||||||
if Project.Win32Header then Add('-w');
|
if Project.Win32Header then Add('-w');
|
||||||
|
if Project.UseCTypes then Add('-C');
|
||||||
if Project.Libname<>'' then Add('-l '+Project.Libname);
|
if Project.Libname<>'' then Add('-l '+Project.Libname);
|
||||||
Add('-o '+GetOutputFilename);
|
Add('-o '+GetOutputFilename);
|
||||||
if InputFilename<>'' then
|
if InputFilename<>'' then
|
||||||
@ -631,6 +635,13 @@ begin
|
|||||||
Modified:=true;
|
Modified:=true;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TH2PasProject.SetUseCTypes(const AValue: boolean);
|
||||||
|
begin
|
||||||
|
if FUseCTypes=AValue then exit;
|
||||||
|
FUseCTypes:=AValue;
|
||||||
|
Modified:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
constructor TH2PasProject.Create;
|
constructor TH2PasProject.Create;
|
||||||
begin
|
begin
|
||||||
FCHeaderFiles:=TFPList.Create;
|
FCHeaderFiles:=TFPList.Create;
|
||||||
@ -666,6 +677,7 @@ begin
|
|||||||
FUseProcVarsForImport:=false;
|
FUseProcVarsForImport:=false;
|
||||||
FVarParams:=false;
|
FVarParams:=false;
|
||||||
FWin32Header:=true;
|
FWin32Header:=true;
|
||||||
|
FUseCTypes:=false;
|
||||||
FOutputDirectory:='';
|
FOutputDirectory:='';
|
||||||
while CHeaderFileCount>0 do
|
while CHeaderFileCount>0 do
|
||||||
CHeaderFiles[CHeaderFileCount-1].Free;
|
CHeaderFiles[CHeaderFileCount-1].Free;
|
||||||
@ -726,6 +738,7 @@ begin
|
|||||||
FUseProcVarsForImport:=Src.FUseProcVarsForImport;
|
FUseProcVarsForImport:=Src.FUseProcVarsForImport;
|
||||||
FVarParams:=Src.FVarParams;
|
FVarParams:=Src.FVarParams;
|
||||||
FWin32Header:=Src.FWin32Header;
|
FWin32Header:=Src.FWin32Header;
|
||||||
|
FUseCTypes:=Src.FUseCTypes;
|
||||||
FOutputDirectory:=Src.FOutputDirectory;
|
FOutputDirectory:=Src.FOutputDirectory;
|
||||||
Clear(false);
|
Clear(false);
|
||||||
for i:=0 to Src.CHeaderFileCount-1 do begin
|
for i:=0 to Src.CHeaderFileCount-1 do begin
|
||||||
@ -764,6 +777,7 @@ begin
|
|||||||
and (FUseProcVarsForImport=AProject.FUseProcVarsForImport)
|
and (FUseProcVarsForImport=AProject.FUseProcVarsForImport)
|
||||||
and (FVarParams=AProject.FVarParams)
|
and (FVarParams=AProject.FVarParams)
|
||||||
and (FWin32Header=AProject.FWin32Header)
|
and (FWin32Header=AProject.FWin32Header)
|
||||||
|
and (FUseCTypes=AProject.FUseCTypes)
|
||||||
and (FOutputDirectory=AProject.FOutputDirectory);
|
and (FOutputDirectory=AProject.FOutputDirectory);
|
||||||
if not Result then exit;
|
if not Result then exit;
|
||||||
for i:=0 to CHeaderFileCount-1 do
|
for i:=0 to CHeaderFileCount-1 do
|
||||||
@ -825,6 +839,7 @@ begin
|
|||||||
FUseProcVarsForImport:=Config.GetValue('UseProcVarsForImport/Value',false);
|
FUseProcVarsForImport:=Config.GetValue('UseProcVarsForImport/Value',false);
|
||||||
FVarParams:=Config.GetValue('VarParams/Value',false);
|
FVarParams:=Config.GetValue('VarParams/Value',false);
|
||||||
FWin32Header:=Config.GetValue('Win32Header/Value',true);
|
FWin32Header:=Config.GetValue('Win32Header/Value',true);
|
||||||
|
FUseCTypes:=Config.GetValue('UseCTypes/Value',false);
|
||||||
FOutputDirectory:=NormalizeFilename(Config.GetValue('OutputDirectory/Value',''));
|
FOutputDirectory:=NormalizeFilename(Config.GetValue('OutputDirectory/Value',''));
|
||||||
|
|
||||||
// load CHeaderFiles
|
// load CHeaderFiles
|
||||||
@ -894,6 +909,7 @@ begin
|
|||||||
Config.SetDeleteValue('UseProcVarsForImport/Value',FUseProcVarsForImport,false);
|
Config.SetDeleteValue('UseProcVarsForImport/Value',FUseProcVarsForImport,false);
|
||||||
Config.SetDeleteValue('VarParams/Value',FVarParams,false);
|
Config.SetDeleteValue('VarParams/Value',FVarParams,false);
|
||||||
Config.SetDeleteValue('Win32Header/Value',FWin32Header,true);
|
Config.SetDeleteValue('Win32Header/Value',FWin32Header,true);
|
||||||
|
Config.SetDeleteValue('UseCTypes/Value',FUseCTypes,false);
|
||||||
Config.SetDeleteValue('OutputDirectory/Value',ShortenFilename(FOutputDirectory),'');
|
Config.SetDeleteValue('OutputDirectory/Value',ShortenFilename(FOutputDirectory),'');
|
||||||
|
|
||||||
// save CHeaderFiles
|
// save CHeaderFiles
|
||||||
|
|||||||
@ -232,6 +232,7 @@ begin
|
|||||||
Add('-v '+'Replace pointer parameters by var');
|
Add('-v '+'Replace pointer parameters by var');
|
||||||
Add('-w '+'Handle special win32 macros');
|
Add('-w '+'Handle special win32 macros');
|
||||||
Add('-x '+'Handle SYS__TRAP of the PalmOS header files');
|
Add('-x '+'Handle SYS__TRAP of the PalmOS header files');
|
||||||
|
Add('-C '+'Use types in ctypes unit');
|
||||||
end;
|
end;
|
||||||
OutputExtLabel.Caption:='Output extension of new file';
|
OutputExtLabel.Caption:='Output extension of new file';
|
||||||
OutputDirLabel.Caption:='Output directory';
|
OutputDirLabel.Caption:='Output directory';
|
||||||
@ -550,6 +551,7 @@ begin
|
|||||||
'v': Project.VarParams:=NewValue;
|
'v': Project.VarParams:=NewValue;
|
||||||
'w': Project.Win32Header:=NewValue;
|
'w': Project.Win32Header:=NewValue;
|
||||||
'x': Project.PalmOSSYSTrap:=NewValue;
|
'x': Project.PalmOSSYSTrap:=NewValue;
|
||||||
|
'C': Project.UseCTypes:=NewValue;
|
||||||
else
|
else
|
||||||
raise Exception.Create('TH2PasDialog.h2pasOptionsCheckGroupItemClick: Unknown option '+OptionStr);
|
raise Exception.Create('TH2PasDialog.h2pasOptionsCheckGroupItemClick: Unknown option '+OptionStr);
|
||||||
end;
|
end;
|
||||||
@ -739,6 +741,7 @@ begin
|
|||||||
Check('-v',Project.VarParams);
|
Check('-v',Project.VarParams);
|
||||||
Check('-w',Project.Win32Header);
|
Check('-w',Project.Win32Header);
|
||||||
Check('-x',Project.PalmOSSYSTrap);
|
Check('-x',Project.PalmOSSYSTrap);
|
||||||
|
Check('-C',Project.UseCTypes);
|
||||||
|
|
||||||
LibnameEdit.Text:=Project.Libname;
|
LibnameEdit.Text:=Project.Libname;
|
||||||
OutputExtEdit.Text:=Project.OutputExt;
|
OutputExtEdit.Text:=Project.OutputExt;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user