You've already forked lazarus-ccr
Latest fixes. Fixed bug where params that were pointers to types were not recognized
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2086 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -30,7 +30,7 @@
|
|||||||
<RunParams>
|
<RunParams>
|
||||||
<local>
|
<local>
|
||||||
<FormatVersion Value="1"/>
|
<FormatVersion Value="1"/>
|
||||||
<CommandLineParams Value="-i /usr/share/gir-1.0/Gtk-3.0.gir -o /tmp/gir-out -w -D"/>
|
<CommandLineParams Value="-i /usr/share/gir-1.0/WebKit-3.0.gir -o /home/andrew/programming/lazarus-ccr/bindings/gtk3/ -w"/>
|
||||||
<LaunchingApplication PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/>
|
<LaunchingApplication PathPlusParams="/usr/bin/gnome-terminal -t 'Lazarus Run Output' -e '$(LazarusDir)/tools/runwait.sh $(TargetCmdLine)'"/>
|
||||||
</local>
|
</local>
|
||||||
</RunParams>
|
</RunParams>
|
||||||
|
@ -822,6 +822,7 @@ begin
|
|||||||
gtDoc:;
|
gtDoc:;
|
||||||
gtType: begin
|
gtType: begin
|
||||||
C_Type := Node.GetAttribute('c:type');
|
C_Type := Node.GetAttribute('c:type');
|
||||||
|
FCType:= C_Type;
|
||||||
VarTypeName:=Node.GetAttribute('name');
|
VarTypeName:=Node.GetAttribute('name');
|
||||||
if VarTypeName = '' then
|
if VarTypeName = '' then
|
||||||
VarTypeName:= StringReplace(C_Type, '*', '', [rfReplaceAll]);
|
VarTypeName:= StringReplace(C_Type, '*', '', [rfReplaceAll]);
|
||||||
|
@ -993,7 +993,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Result := '';
|
Result := '';
|
||||||
// we skip deprecated functions
|
// we skip deprecated functions
|
||||||
if AFunction.Deprecated and (CompareStr(AFunction.DeprecatedVersion, NameSpace.Version) >= 0) then
|
if AFunction.Deprecated then //and (CompareStr(AFunction.DeprecatedVersion, NameSpace.Version) >= 0) then
|
||||||
Exit;
|
Exit;
|
||||||
|
|
||||||
// some abstract functions that are to be implemented by a module and shouldn't be declared. There is no indicator in the gir file that this is so :(
|
// some abstract functions that are to be implemented by a module and shouldn't be declared. There is no indicator in the gir file that this is so :(
|
||||||
@ -1454,7 +1454,7 @@ begin
|
|||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
AFunctionType:='function';
|
AFunctionType:='function';
|
||||||
AFunctionReturnType:= ': '+TypeAsString(AItem.Returns.VarType, AItem.Returns.PointerLevel)+'; cdecl;' ;
|
AFunctionReturnType:= ': '+TypeAsString(AItem.Returns.VarType, AItem.Returns.PointerLevel, AItem.Returns.CType)+'; cdecl;' ;
|
||||||
|
|
||||||
// will skip if written
|
// will skip if written
|
||||||
ProcessType(AItem.Returns.VarType);
|
ProcessType(AItem.Returns.VarType);
|
||||||
@ -1488,11 +1488,19 @@ end;
|
|||||||
function TPascalUnit.TypeAsString(AType: TGirBaseType; APointerLevel: Integer; ACTypeAsBackup: String = ''): String;
|
function TPascalUnit.TypeAsString(AType: TGirBaseType; APointerLevel: Integer; ACTypeAsBackup: String = ''): String;
|
||||||
var
|
var
|
||||||
BackupNoPointers: String;
|
BackupNoPointers: String;
|
||||||
|
TranslatedName: String;
|
||||||
begin
|
begin
|
||||||
ResolveTypeTranslation(AType);
|
ResolveTypeTranslation(AType);
|
||||||
|
TranslatedName := AType.TranslatedName;
|
||||||
|
|
||||||
BackupNoPointers := StringReplace(ACTypeAsBackup, '*', '', [rfReplaceAll]);
|
BackupNoPointers := StringReplace(ACTypeAsBackup, '*', '', [rfReplaceAll]);
|
||||||
|
|
||||||
|
// some types are pointers but contain no "*" so it thinks it has a pointer level 0 when really it's 1
|
||||||
|
if (APointerLevel = 0) and (ACTypeAsBackup = 'gpointer') and (TranslatedName <> '') and (TranslatedName <> 'gpointer') then
|
||||||
|
begin
|
||||||
|
APointerLevel := 1;
|
||||||
|
end;
|
||||||
|
|
||||||
if APointerLevel = 0 then
|
if APointerLevel = 0 then
|
||||||
begin
|
begin
|
||||||
Result := AType.TranslatedName;
|
Result := AType.TranslatedName;
|
||||||
@ -1868,9 +1876,16 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TPascalUnit.ResolveTypeTranslation(ABaseType: TGirBaseType);
|
procedure TPascalUnit.ResolveTypeTranslation(ABaseType: TGirBaseType);
|
||||||
|
var
|
||||||
|
RawName: String;
|
||||||
begin
|
begin
|
||||||
if ABaseType.TranslatedName = '' then
|
if ABaseType.TranslatedName = '' then
|
||||||
ABaseType.TranslatedName:=MakePascalTypeFromCType(ABaseType.CType, 0);
|
begin
|
||||||
|
RawName := ABaseType.CType;
|
||||||
|
if RawName = '' then
|
||||||
|
RawName:= ABaseType.Name;
|
||||||
|
ABaseType.TranslatedName:=MakePascalTypeFromCType(RawName, 0);
|
||||||
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
constructor TPascalUnit.Create(ANameSpace: TgirNamespace; ALinkDynamic: Boolean; AWantTest: Boolean);
|
constructor TPascalUnit.Create(ANameSpace: TgirNamespace; ALinkDynamic: Boolean; AWantTest: Boolean);
|
||||||
|
Reference in New Issue
Block a user