[vala/0.48] girparser: Apply "delegate_target" metadata for methods and parameters



commit 40ae6fc47dafeb73965d8d4f52cac35191f2b345
Author: Rico Tzschichholz <ricotz ubuntu com>
Date:   Mon Jan 25 21:11:55 2021 +0100

    girparser: Apply "delegate_target" metadata for methods and parameters

 vala/valagirparser.vala | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/vala/valagirparser.vala b/vala/valagirparser.vala
index 6dd921ebf..41f323237 100644
--- a/vala/valagirparser.vala
+++ b/vala/valagirparser.vala
@@ -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);
                                        }
@@ -2612,6 +2615,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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]