mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-11-19 10:39:30 +01:00
gir2pascal: Updated to support generating Gtk4 bindings. Patch from theo222, issue #40196.
This commit is contained in:
parent
b2afc1b1cf
commit
debb889759
@ -451,6 +451,8 @@ begin
|
|||||||
gtClass: HandleClass(ANode);
|
gtClass: HandleClass(ANode);
|
||||||
gtInterface: HandleInterface(ANode);
|
gtInterface: HandleInterface(ANode);
|
||||||
gtMethod: HandleFunction(ANode);
|
gtMethod: HandleFunction(ANode);
|
||||||
|
gtFunctionMacro:; // ignore
|
||||||
|
gtDocSection: ; // ignore
|
||||||
else
|
else
|
||||||
girError(geError, 'Unknown NodeType: '+ANode.NodeName);
|
girError(geError, 'Unknown NodeType: '+ANode.NodeName);
|
||||||
end;
|
end;
|
||||||
|
|||||||
@ -568,7 +568,8 @@ begin
|
|||||||
begin
|
begin
|
||||||
FIsArray:=True;
|
FIsArray:=True;
|
||||||
FPropType := TgirNamespace(Owner).LookupTypeByName(TDomElement(Node.FindNode('type')).GetAttribute('name'), Node.GetAttribute('c:type'));
|
FPropType := TgirNamespace(Owner).LookupTypeByName(TDomElement(Node.FindNode('type')).GetAttribute('name'), Node.GetAttribute('c:type'));
|
||||||
end
|
end;
|
||||||
|
gtAttribute:; // ignore
|
||||||
else
|
else
|
||||||
WriteLn('Unknown Node Type for property : ', Node.NodeName);
|
WriteLn('Unknown Node Type for property : ', Node.NodeName);
|
||||||
halt(1);
|
halt(1);
|
||||||
|
|||||||
@ -2198,11 +2198,11 @@ end;
|
|||||||
|
|
||||||
function TPascalUnit.SanitizeName(AName: String; AExistingUsedNames: TStringList = nil): String;
|
function TPascalUnit.SanitizeName(AName: String; AExistingUsedNames: TStringList = nil): String;
|
||||||
var
|
var
|
||||||
PascalReservedWords : array[0..30] of String =
|
PascalReservedWords : array[0..32] of String =
|
||||||
('begin', 'end', 'type', 'of', 'in', 'out', 'function', 'string','file', 'default',
|
('begin', 'end', 'type', 'of', 'in', 'out', 'function', 'string','file', 'default',
|
||||||
'procedure', 'string', 'boolean', 'array', 'set', 'destructor', 'destroy', 'program',
|
'procedure', 'string', 'boolean', 'array', 'set', 'destructor', 'destroy', 'program',
|
||||||
'property', 'object', 'private', 'constructor', 'inline', 'result', 'interface',
|
'property', 'object', 'private', 'constructor', 'inline', 'result', 'interface',
|
||||||
'const', 'raise', 'unit', 'label', 'xor', 'implementation');
|
'const', 'raise', 'unit', 'label', 'xor', 'implementation','var','to');
|
||||||
Name: String;
|
Name: String;
|
||||||
Sanity: Integer = 0;
|
Sanity: Integer = 0;
|
||||||
Sucess: Boolean;
|
Sucess: Boolean;
|
||||||
|
|||||||
@ -34,7 +34,7 @@ type
|
|||||||
gtGlibSignal, gtImplements, gtPrerequisite,gtVarArgs, gtObject, gtClassStruct, gtGType,
|
gtGlibSignal, gtImplements, gtPrerequisite,gtVarArgs, gtObject, gtClassStruct, gtGType,
|
||||||
// Direction for parameters. in is default = no pointer. out and inout means one pointer level.
|
// Direction for parameters. in is default = no pointer. out and inout means one pointer level.
|
||||||
// If subnode is array then increase pointer level.
|
// If subnode is array then increase pointer level.
|
||||||
gtIn, gtOut, gtInOut, gtSourcePosition
|
gtIn, gtOut, gtInOut, gtSourcePosition, gtFunctionMacro, gtDocSection, gtAttribute
|
||||||
);
|
);
|
||||||
|
|
||||||
TGirVersion = object
|
TGirVersion = object
|
||||||
@ -89,7 +89,11 @@ var
|
|||||||
'in',
|
'in',
|
||||||
'out',
|
'out',
|
||||||
'inout',
|
'inout',
|
||||||
'source-position'
|
'source-position',
|
||||||
|
'function-macro',
|
||||||
|
'docsection',
|
||||||
|
'attribute'
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
function GirTokenNameToToken(AName: String): TGirToken;
|
function GirTokenNameToToken(AName: String): TGirToken;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user