[vala] gdk-2.0: Fix gdk_property_get binding



commit b7a17e20e81d1d2fa14d01dfe451cc6fdad434e1
Author: Jürg Billeter <j bitron ch>
Date:   Mon Mar 22 23:55:08 2010 +0100

    gdk-2.0: Fix gdk_property_get binding
    
    Fixes bug 611250.

 vapi/gdk-2.0.vapi                      |    2 +-
 vapi/packages/gdk-2.0/gdk-2.0.metadata |    3 +++
 vapigen/valagidlparser.vala            |    6 +++++-
 3 files changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/vapi/gdk-2.0.vapi b/vapi/gdk-2.0.vapi
index 54406a4..49f6b26 100644
--- a/vapi/gdk-2.0.vapi
+++ b/vapi/gdk-2.0.vapi
@@ -1774,7 +1774,7 @@ namespace Gdk {
 	[CCode (cheader_filename = "gdk/gdk.h")]
 	public static void property_delete (Gdk.Window window, Gdk.Atom property);
 	[CCode (cheader_filename = "gdk/gdk.h")]
-	public static bool property_get (Gdk.Window window, Gdk.Atom property, Gdk.Atom type, ulong offset, ulong length, int pdelete, out Gdk.Atom actual_property_type, int actual_format, int actual_length, uchar[] data);
+	public static bool property_get (Gdk.Window window, Gdk.Atom property, Gdk.Atom type, ulong offset, ulong length, int pdelete, out Gdk.Atom actual_property_type, out int actual_format, [CCode (array_length_pos = 8.9)] out uchar[] data);
 	[CCode (cheader_filename = "gdk/gdk.h")]
 	public static void query_depths (int depths, int count);
 	[CCode (cheader_filename = "gdk/gdk.h")]
diff --git a/vapi/packages/gdk-2.0/gdk-2.0.metadata b/vapi/packages/gdk-2.0/gdk-2.0.metadata
index c9980df..4ee8531 100644
--- a/vapi/packages/gdk-2.0/gdk-2.0.metadata
+++ b/vapi/packages/gdk-2.0/gdk-2.0.metadata
@@ -80,6 +80,9 @@ gdk_pointer_grab.confine_to nullable="1"
 gdk_pointer_grab.cursor nullable="1"
 gdk_property_change.data no_array_length="1"
 gdk_property_get.actual_property_type is_out="1"
+gdk_property_get.actual_format is_out="1"
+gdk_property_get.actual_length hidden="1"
+gdk_property_get.data is_out="1" is_array="1" array_length_pos="8.9" transfer_ownership="1"
 GdkRectangle is_value_type="1"
 gdk_rectangle_union.dest is_out="1"
 gdk_region_copy transfer_ownership="1"
diff --git a/vapigen/valagidlparser.vala b/vapigen/valagidlparser.vala
index b686be2..8692441 100644
--- a/vapigen/valagidlparser.vala
+++ b/vapigen/valagidlparser.vala
@@ -1682,6 +1682,7 @@ public class Vala.GIdlParser : CodeVisitor {
 			bool set_delegate_target_pos = false;
 			double delegate_target_pos = 0;
 			bool array_requested = false;
+			bool out_requested = false;
 			attributes = get_attributes ("%s.%s".printf (symbol, param_node.name));
 			if (attributes != null) {
 				foreach (string attr in attributes) {
@@ -1690,12 +1691,15 @@ public class Vala.GIdlParser : CodeVisitor {
 						if (eval (nv[1]) == "1") {
 							param_type = new ArrayType (param_type, 1, param_type.source_reference);
 							p.parameter_type = param_type;
-							p.direction = ParameterDirection.IN;
+							if (!out_requested) {
+								p.direction = ParameterDirection.IN;
+							}
 							array_requested = true;
 						}
 					} else if (nv[0] == "is_out") {
 						if (eval (nv[1]) == "1") {
 							p.direction = ParameterDirection.OUT;
+							out_requested = true;
 							if (!array_requested && param_type is ArrayType) {
 								var array_type = (ArrayType) param_type;
 								param_type = array_type.element_type;



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