From: Rico Tzschichholz Date: Sat, 30 Jan 2021 20:17:25 +0000 (+0100) Subject: girparser: Apply "type_get_function" metadata for classes and inferfaces X-Git-Tag: 0.51.1~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3626df869d911fec13263c03b16bbb6d0162f70a;p=thirdparty%2Fvala.git girparser: Apply "type_get_function" metadata for classes and inferfaces --- diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala index ca25d5508..fa6773f81 100644 --- a/vala/valagirparser.vala +++ b/vala/valagirparser.vala @@ -86,6 +86,7 @@ public class Vala.GirParser : CodeVisitor { FEATURE_TEST_MACRO, FLOATING, TYPE_ID, + TYPE_GET_FUNCTION, RETURN_VOID, RETURNS_MODIFIED_POINTER, DELEGATE_TARGET_CNAME, @@ -2947,6 +2948,9 @@ public class Vala.GirParser : CodeVisitor { cl = new Class (current.name, current.source_reference); cl.is_abstract = metadata.get_bool (ArgumentType.ABSTRACT, reader.get_attribute ("abstract") == "1"); cl.is_sealed = metadata.get_bool (ArgumentType.SEALED, false); + if (metadata.has_argument (ArgumentType.TYPE_GET_FUNCTION)) { + cl.set_attribute_string ("CCode", "type_get_function", metadata.get_string (ArgumentType.TYPE_GET_FUNCTION)); + } if (parent != null) { cl.add_base_type (parse_type_from_gir_name (parent)); @@ -3029,6 +3033,10 @@ public class Vala.GirParser : CodeVisitor { Interface iface; if (current.new_symbol) { iface = new Interface (current.name, current.source_reference); + if (metadata.has_argument (ArgumentType.TYPE_GET_FUNCTION)){ + iface.set_attribute_string ("CCode", "type_get_function", metadata.get_string (ArgumentType.TYPE_GET_FUNCTION)); + } + current.symbol = iface; } else { iface = (Interface) current.symbol;