diff --git a/ChangeLog b/ChangeLog index 0d2f19599..074ac383c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-27 Mike Kestner + + * generator/ManagedCallString.cs: fixes for data parameter hiding + in native to managed callback generation. + 2008-08-20 Mike Kestner * glib/Object.cs: diff --git a/generator/ManagedCallString.cs b/generator/ManagedCallString.cs index 646caf444..290ad86e5 100644 --- a/generator/ManagedCallString.cs +++ b/generator/ManagedCallString.cs @@ -35,15 +35,17 @@ 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 && (i == parms.Count - 1) && (parms.HideData || parms [i-1].Generatable is CallbackGen)) { + } else if (p.IsUserData && (parms.HideData || has_cb)) { user_data_param = p.Name; continue; } else if (p is ErrorParameter) { @@ -54,9 +56,10 @@ namespace GtkSharp.Generation { if (p.PassAs != String.Empty && (p.Name != p.FromNative (p.Name))) this.special.Add (true); - else if (p.Generatable is CallbackGen) + else if (p.Generatable is CallbackGen) { + has_cb = true; this.special.Add (true); - else + } else this.special.Add (false); } }