]> git.ipfire.org Git - thirdparty/vala.git/commitdiff
girparser: Apply "delegate_target" metadata for methods and parameters
authorRico Tzschichholz <ricotz@ubuntu.com>
Mon, 25 Jan 2021 20:11:55 +0000 (21:11 +0100)
committerRico Tzschichholz <ricotz@ubuntu.com>
Mon, 25 Jan 2021 20:14:17 +0000 (21:14 +0100)
vala/valagirparser.vala

index c17658981414e916acedf396d4777d1680ba4c41..63cb7fc6c6a173c0cdfe27180545426e91a44655 100644 (file)
@@ -979,6 +979,9 @@ public class Vala.GirParser : CodeVisitor {
                                                        }
                                                }
                                        }
+                                       if (metadata.has_argument (ArgumentType.DELEGATE_TARGET)) {
+                                               m.set_attribute_bool ("CCode", "delegate_target", metadata.get_bool (ArgumentType.DELEGATE_TARGET));
+                                       }
                                        if (m.coroutine) {
                                                parser.process_async_method (this);
                                        }
@@ -2638,6 +2641,9 @@ public class Vala.GirParser : CodeVisitor {
                        } else if (direction == "inout") {
                                param.direction = ParameterDirection.REF;
                        }
+                       if (type is DelegateType && metadata.has_argument (ArgumentType.DELEGATE_TARGET)) {
+                               param.set_attribute_bool ("CCode", "delegate_target", metadata.get_bool (ArgumentType.DELEGATE_TARGET));
+                       }
                        if (type is ArrayType) {
                                if (metadata.has_argument (ArgumentType.ARRAY_LENGTH_IDX)) {
                                        array_length_idx = metadata.get_integer (ArgumentType.ARRAY_LENGTH_IDX);