Fix GdkDestroyNotify and GtkDestroyNotify bindings, fixes bug 525687
authorJürg Billeter <j@bitron.ch>
Thu, 9 Oct 2008 18:46:30 +0000 (18:46 +0000)
committerJürg Billeter <juergbi@src.gnome.org>
Thu, 9 Oct 2008 18:46:30 +0000 (18:46 +0000)
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

svn path=/trunk/; revision=1824

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

index 54f5004..1cb407a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+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
+
 2008-10-06  Jürg Billeter  <j@bitron.ch>
 
        * vapi/glib-2.0.vapi:
index 4c65b02..85ec0dd 100644 (file)
@@ -141,8 +141,9 @@ public class Vala.InterfaceWriter : CodeVisitor {
                        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;
index f449eda..4c7bccb 100644 (file)
@@ -1486,7 +1486,7 @@ namespace Gdk {
                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")]
index b8099b0..9849720 100644 (file)
@@ -6599,7 +6599,7 @@ namespace Gtk {
        [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")]
index f0b6ee8..06352a3 100644 (file)
@@ -9,6 +9,7 @@ gdk_colormap_alloc_colors.colors is_array="1"
 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"
index 8f0e594..abfd8c7 100644 (file)
@@ -91,6 +91,7 @@ GtkContainer::set_focus_child has_emitter="1"
 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"
index 830d371..79ff51f 100644 (file)
@@ -294,6 +294,8 @@ public class Vala.GIdlParser : CodeVisitor {
                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 @@ public class Vala.GIdlParser : CodeVisitor {
                                        }
                                } 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 @@ public class Vala.GIdlParser : CodeVisitor {
                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 {