GtkSharp/generator/ManagedCallString.cs
Mike Kestner ba1d3996a4 2003-12-10 Mike Kestner <mkestner@ximian.com>
* generator/CallbackGen.cs : kill ref_owned generation
	* generator/ClassBase.cs : use simple GetObject w/o ref_owned
	* generator/ManagedCallString.cs : new class to generate native
	to managed method calls.
	* generator/Method.cs : kill ref_owned generation
	* generator/MethodBody.cs : kill ref_owned generation
	* generator/Property.cs : kill ref_owned generation
	* generator/Signal.cs : generate delegates and vtable connect
	methods for all signals. Mark VMs with new attr.
	* generator/StructBase.cs : kill ref_owned generation
	* glib/DefaultSignalHandlerAttribute.cs : new attr to mark
	virtual methods.
	* glib/Object.cs : add overload for GetObject that defaults
	to ref_owned=false. Add extern for VM override glue.

svn path=/trunk/gtk-sharp/; revision=21005
2003-12-10 22:56:49 +00:00

45 lines
980 B
C#

// GtkSharp.Generation.ManagedCallString.cs - The ManagedCallString Class.
//
// Author: Mike Kestner <mkestner@speakeasy.net>
//
// (c) 2003 Mike Kestner
namespace GtkSharp.Generation {
using System;
using System.Collections;
using System.IO;
public class ManagedCallString {
ArrayList parms = new ArrayList ();
public ManagedCallString (Parameters parms)
{
for (int i = 1; i < parms.Count; i ++) {
Parameter p = parms [i];
if (p.IsLength && parms [i-1].IsString)
continue;
this.parms.Add (p);
}
}
public override string ToString ()
{
if (parms.Count < 1)
return "";
string[] result = new string [parms.Count];
for (int i = 0; i < parms.Count; i ++) {
Parameter p = parms [i] as Parameter;
IGeneratable igen = p.Generatable;
result [i] = igen is StructGen ? "ref " : (p.PassAs == "" ? "" : p.PassAs + " ");
result [i] += igen.FromNative (p.Name);
}
return String.Join (", ", result);
}
}
}