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