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



commit a8df6a1320c4909f25e55e98545e6e6422a3c5dc
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 e28aaf362..c8af369d9 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);
                                        }
@@ -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);


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