2009-07-12 Mike Kestner <mkestner@novell.com>
* generator/ObjectBase.cs: add CallByName overload with ownership. * generator/Parameters.cs: support owned by callee parameters. Adapted from a patch by Maarten Bosmans. [Fixes #513680] svn path=/trunk/gtk-sharp/; revision=137754
This commit is contained in:
parent
53d7ae45e3
commit
0f10232e71
3 changed files with 15 additions and 2 deletions
|
@ -1,3 +1,9 @@
|
|||
2009-07-12 Mike Kestner <mkestner@novell.com>
|
||||
|
||||
* generator/ObjectBase.cs: add CallByName overload with ownership.
|
||||
* generator/Parameters.cs: support owned by callee parameters.
|
||||
Adapted from a patch by Maarten Bosmans. [Fixes #513680]
|
||||
|
||||
2009-07-10 Christian Hoff <christian_hoff@gmx.net>
|
||||
|
||||
* pango/Pango.metadata: Mark "ink_rect" and "logical_rect" parameters of Get*Extends
|
||||
|
|
|
@ -154,7 +154,12 @@ namespace GtkSharp.Generation {
|
|||
return base.IsNodeNameHandled (name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual string CallByName (string var, bool owned)
|
||||
{
|
||||
return String.Format ("{0} == null ? IntPtr.Zero : ({0} as GLib.Object).{1}", var, owned ? "OwnedHandle" : "Handle");
|
||||
}
|
||||
|
||||
public override string FromNative (string var, bool owned)
|
||||
{
|
||||
return "GLib.Object.GetObject(" + var + (owned ? ", true" : "") + ") as " + QualifiedName;
|
||||
|
|
|
@ -262,8 +262,10 @@ namespace GtkSharp.Generation {
|
|||
call_parm += CallName;
|
||||
} else if (gen is IManualMarshaler)
|
||||
call_parm = "native_" + CallName;
|
||||
else if (gen is ObjectBase)
|
||||
call_parm = (gen as ObjectBase).CallByName (CallName, Owned);
|
||||
else
|
||||
call_parm = SymbolTable.Table.CallByName(CType, CallName);
|
||||
call_parm = gen.CallByName (CallName);
|
||||
|
||||
return call_parm;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue