diff --git a/ChangeLog b/ChangeLog index 97b4a429c..035b7b469 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-08-27 Mike Kestner + + * generator/ManagedCallString.cs: revert last change. There are a + lot of "broken" callback sigs out there which expose user data because + it's not in the last parameter in the list. I don't think we can + reasonably make a change to hide all those at this point. This change + at least hides all the user_data which comes right before a GError + param at the end of the list. I need to follow up with a change which + handles data parameters in any parameter position, but allows the user + to mark "exposed" data params for compatibility reasons. + * generator/Parameters.cs: hide data params which are at the end of a + list behind an error param. + * gtk/Gtk.metadata: mark an array parameter on + TextBufferDeserializeFunc. + 2008-08-27 Mike Kestner * glib/Signal.cs: multiple dispose guarding for closures. diff --git a/generator/ManagedCallString.cs b/generator/ManagedCallString.cs index 290ad86e5..2a9cdd20f 100644 --- a/generator/ManagedCallString.cs +++ b/generator/ManagedCallString.cs @@ -35,17 +35,15 @@ namespace GtkSharp.Generation { public ManagedCallString (Parameters parms, bool drop_first) { - bool has_cb = false; for (int i = drop_first ? 1 : 0; i < parms.Count; i ++) { Parameter p = parms [i]; if (p.IsLength && i > 0 && parms [i-1].IsString) continue; else if (p.Scope == "notified") { - has_cb = true; user_data_param = parms[i+1].Name; destroy_param = parms[i+2].Name; i += 2; - } else if (p.IsUserData && (parms.HideData || has_cb)) { + } else if (p.IsUserData && ((i == parms.Count - 1) || i == parms.Count - 2 && parms[parms.Count - 1] is ErrorParameter) && (parms.HideData || parms [i-1].Generatable is CallbackGen)) { user_data_param = p.Name; continue; } else if (p is ErrorParameter) { @@ -56,10 +54,9 @@ namespace GtkSharp.Generation { if (p.PassAs != String.Empty && (p.Name != p.FromNative (p.Name))) this.special.Add (true); - else if (p.Generatable is CallbackGen) { - has_cb = true; + else if (p.Generatable is CallbackGen) this.special.Add (true); - } else + else this.special.Add (false); } } diff --git a/generator/Parameters.cs b/generator/Parameters.cs index e9f894d26..75dd68f2c 100644 --- a/generator/Parameters.cs +++ b/generator/Parameters.cs @@ -554,6 +554,8 @@ namespace GtkSharp.Generation { if (HasCB || HideData) { if (p.IsUserData && (idx == Count - 1)) return true; + if (p.IsUserData && (idx == Count - 2) && this [Count - 1] is ErrorParameter) + return true; if (p.IsUserData && idx > 0 && this [idx - 1].Generatable is CallbackGen) return true; diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index b8ddc85df..e42f23059 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -53,6 +53,7 @@ true 1 1 + 1 ref 1 1