From 495cd714aca44534b1cec1fb71edb20a40ae47d0 Mon Sep 17 00:00:00 2001 From: Abderrahim Kitouni Date: Thu, 3 Dec 2009 21:10:28 +0100 Subject: [PATCH] GIR writer: Write user_data parameter for delegates --- codegen/valagirwriter.vala | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/codegen/valagirwriter.vala b/codegen/valagirwriter.vala index ee87ad48f..5d1ca71e9 100644 --- a/codegen/valagirwriter.vala +++ b/codegen/valagirwriter.vala @@ -509,7 +509,7 @@ public class Vala.GIRWriter : CodeVisitor { } } - private void write_params_and_return (List params, DataType? return_type, bool return_array_length, bool constructor = false, DataType? instance_type = null) { + private void write_params_and_return (List params, DataType? return_type, bool return_array_length, bool constructor = false, DataType? instance_type = null, bool user_data = false) { int last_index = 0; if (params.size != 0 || instance_type != null || (return_type is ArrayType && return_array_length) || (return_type is DelegateType)) { write_indent (); @@ -530,6 +530,17 @@ public class Vala.GIRWriter : CodeVisitor { last_index = index - 1; write_implicit_params (return_type, ref index, return_array_length, "result", ParameterDirection.OUT); + if (user_data) { + write_indent (); + stream.printf ("\n", index); + indent++; + write_indent (); + stream.printf ("\n"); + indent--; + write_indent (); + stream.printf ("\n"); + } + indent--; write_indent (); stream.printf ("\n"); @@ -560,7 +571,7 @@ public class Vala.GIRWriter : CodeVisitor { write_annotations (cb); - write_params_and_return (cb.get_parameters (), cb.return_type, !cb.no_array_length); + write_params_and_return (cb.get_parameters (), cb.return_type, !cb.no_array_length, false, null, cb.has_target); indent--; write_indent (); -- 2.47.3