vala r1824 - in trunk: . vala vapi vapi/packages/gdk-2.0 vapi/packages/gtk+-2.0 vapigen



Author: juergbi
Date: Thu Oct  9 18:46:30 2008
New Revision: 1824
URL: http://svn.gnome.org/viewvc/vala?rev=1824&view=rev

Log:
2008-10-09  JÃrg Billeter  <j bitron ch>

	* vala/valainterfacewriter.vala:
	* vapigen/valagidlparser.vala:
	* vapi/packages/gdk-2.0/:
	* vapi/packages/gtk+-2.0/:

	Fix GdkDestroyNotify and GtkDestroyNotify bindings,
	fixes bug 525687

	* vapi/gdk-2.0.vapi:
	* vapi/gtk+-2.0.vapi:

	Regenerated


Modified:
   trunk/ChangeLog
   trunk/vala/valainterfacewriter.vala
   trunk/vapi/gdk-2.0.vapi
   trunk/vapi/gtk+-2.0.vapi
   trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata
   trunk/vapi/packages/gtk+-2.0/gtk+-2.0.metadata
   trunk/vapigen/valagidlparser.vala

Modified: trunk/vala/valainterfacewriter.vala
==============================================================================
--- trunk/vala/valainterfacewriter.vala	(original)
+++ trunk/vala/valainterfacewriter.vala	Thu Oct  9 18:46:30 2008
@@ -141,8 +141,9 @@
 			write_string ("type_check_function = \"%s\", ".printf (cl.type_check_function ));
 		}
 
-		if (cl.get_param_spec_function () != null) {
-			write_string ("param_spec_function = \"%s\", ".printf ( cl.get_param_spec_function () ));
+		if (cl.get_param_spec_function () != null
+		    && (cl.base_class == null || cl.get_param_spec_function () != cl.base_class.get_param_spec_function ())) {
+			write_string ("param_spec_function = \"%s\", ".printf (cl.get_param_spec_function ()));
 		}
 
 		bool first = true;

Modified: trunk/vapi/gdk-2.0.vapi
==============================================================================
--- trunk/vapi/gdk-2.0.vapi	(original)
+++ trunk/vapi/gdk-2.0.vapi	Thu Oct  9 18:46:30 2008
@@ -1486,7 +1486,7 @@
 		public void union (Gdk.Rectangle src2, out Gdk.Rectangle dest);
 	}
 	[CCode (cheader_filename = "gdk/gdk.h")]
-	public delegate void DestroyNotify ();
+	public static delegate void DestroyNotify (void* data);
 	[CCode (cheader_filename = "gdk/gdk.h")]
 	public delegate void EventFunc (Gdk.Event event);
 	[CCode (cheader_filename = "gdk/gdk.h")]

Modified: trunk/vapi/gtk+-2.0.vapi
==============================================================================
--- trunk/vapi/gtk+-2.0.vapi	(original)
+++ trunk/vapi/gtk+-2.0.vapi	Thu Oct  9 18:46:30 2008
@@ -6599,7 +6599,7 @@
 	[CCode (cheader_filename = "gtk/gtk.h")]
 	public static delegate void ColorSelectionChangePaletteWithScreenFunc (Gdk.Screen screen, Gdk.Color colors, int n_colors);
 	[CCode (cheader_filename = "gtk/gtk.h")]
-	public delegate void DestroyNotify ();
+	public static delegate void DestroyNotify (void* data);
 	[CCode (cheader_filename = "gtk/gtk.h")]
 	public delegate bool EntryCompletionMatchFunc (Gtk.EntryCompletion completion, string key, Gtk.TreeIter iter);
 	[CCode (cheader_filename = "gtk/gtk.h")]

Modified: trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata
==============================================================================
--- trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata	(original)
+++ trunk/vapi/packages/gdk-2.0/gdk-2.0.metadata	Thu Oct  9 18:46:30 2008
@@ -9,6 +9,7 @@
 gdk_colormap_free_colors.colors is_array="1"
 gdk_colormap_query_color.result is_out="1"
 GdkCursor is_value_type="0"
+GdkDestroyNotify has_target="0"
 GdkDevice.axes is_array="1"
 GdkDevice.keys is_array="1"
 GdkDeviceAxis is_value_type="1"

Modified: trunk/vapi/packages/gtk+-2.0/gtk+-2.0.metadata
==============================================================================
--- trunk/vapi/packages/gtk+-2.0/gtk+-2.0.metadata	(original)
+++ trunk/vapi/packages/gtk+-2.0/gtk+-2.0.metadata	Thu Oct  9 18:46:30 2008
@@ -91,6 +91,7 @@
 gtk_container_foreach.callback_data hidden="1"
 gtk_container_get_children type_arguments="Widget"
 GtkContainerClass name="pointer"
+GtkDestroyNotify has_target="0"
 gtk_dialog_new_with_buttons.title nullable="1"
 gtk_dialog_new_with_buttons.parent nullable="1"
 gtk_dialog_set_alternative_button_order sentinel="-1"

Modified: trunk/vapigen/valagidlparser.vala
==============================================================================
--- trunk/vapigen/valagidlparser.vala	(original)
+++ trunk/vapigen/valagidlparser.vala	Thu Oct  9 18:46:30 2008
@@ -294,6 +294,8 @@
 		var cb = new Delegate (node.name, parse_param (f_node.result), current_source_reference);
 		cb.access = SymbolAccessibility.PUBLIC;
 
+		bool check_has_target = true;
+
 		var attributes = get_attributes (node.name);
 		if (attributes != null) {
 			foreach (string attr in attributes) {
@@ -304,6 +306,10 @@
 					}
 				} else if (nv[0] == "cheader_filename") {
 					cb.add_cheader_filename (eval (nv[1]));
+				} else if (nv[0] == "has_target") {
+					if (eval (nv[1]) == "0") {
+						check_has_target = false;
+					}
 				}
 			}
 		}
@@ -312,7 +318,7 @@
 		foreach (weak IdlNodeParam param in f_node.parameters) {
 			weak IdlNode param_node = (IdlNode) param;
 
-			if (remaining_params == 1 && (param_node.name == "user_data" || param_node.name == "data")) {
+			if (check_has_target && remaining_params == 1 && (param_node.name == "user_data" || param_node.name == "data")) {
 				// hide user_data parameter for instance delegates
 				cb.has_target = true;
 			} else {



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