2008-08-27 Mike Kestner <mkestner@novell.com>

* 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.

svn path=/trunk/gtk-sharp/; revision=111716
This commit is contained in:
Mike Kestner 2008-08-27 16:23:32 +00:00
parent dee1e4f321
commit 2d0fc94e2f
4 changed files with 21 additions and 6 deletions

View File

@ -1,3 +1,18 @@
2008-08-27 Mike Kestner <mkestner@novell.com>
* 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 <mkestner@novell.com>
* glib/Signal.cs: multiple dispose guarding for closures.

View File

@ -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);
}
}

View File

@ -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;

View File

@ -53,6 +53,7 @@
<attr path="/api/namespace/boxed[@cname='GtkTreeRowReference']/method[@name='GetPath']/return-type" name="owned">true</attr>
<attr path="/api/namespace/callback[@cname='GtkClipboardRichTextReceivedFunc']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkItemFactoryCallback2']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkTextBufferDeserializeFunc']/*/*[@name='data']" name="array">1</attr>
<attr path="/api/namespace/callback[@cname='GtkTreeModelFilterModifyFunc']/parameters/parameter[@name='value']" name="pass_as">ref</attr>
<attr path="/api/namespace/callback[@cname='GtkModuleDisplayInitFunc']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkModuleInitFunc']" name="hidden">1</attr>