2004-04-16 Rachel Hestilow <rachel@nullenvoid.com>

* generator/GObjectGen.cs: Added new generatable to handle
	plain GObjects the same way we do subclasses.
	* generator/ManualGen.cs: Make FromNative/FromNativeReturn virtual
	to allow overriding.
	* generator/SymbolTable.cs: Use GObjectGen instead of
	ManualGen for GObject.
	* generator/Makefile.am: Add GObjectGen.cs.

svn path=/trunk/gtk-sharp/; revision=25651
This commit is contained in:
Rachel Hestilow 2004-04-18 03:19:15 +00:00
parent ed507416b2
commit aee0a1f894
5 changed files with 36 additions and 3 deletions

View file

@ -1,3 +1,13 @@
2004-04-16 Rachel Hestilow <rachel@nullenvoid.com>
* generator/GObjectGen.cs: Added new generatable to handle
plain GObjects the same way we do subclasses.
* generator/ManualGen.cs: Make FromNative/FromNativeReturn virtual
to allow overriding.
* generator/SymbolTable.cs: Use GObjectGen instead of
ManualGen for GObject.
* generator/Makefile.am: Add GObjectGen.cs.
2004-04-16 Boyd Timothy <btimothy@novell.com>
* gdk/Global.custom : properties to expose window manager spec

22
generator/GObjectGen.cs Normal file
View file

@ -0,0 +1,22 @@
// GtkSharp.Generation.GObjectGen.cs - The GObject generatable
//
// Note: This generatable only handles GObject* values. GObject subclasses
// are handled by ObjectGen.
//
// Author: Rachel Hestilow <rachel@nullenvoid.com>
//
// (c) 2004 Rachel Hestilow
namespace GtkSharp.Generation {
public class GObjectGen : ManualGen {
public GObjectGen () : base ("GObject", "GLib.Object") {}
public override string FromNative(string var)
{
return "GLib.Object.GetObject (" + var + ")";
}
}
}

View file

@ -21,6 +21,7 @@ sources = \
Field.cs \
GenBase.cs \
GenerationInfo.cs \
GObjectGen.cs \
IGeneratable.cs \
ImportSignature.cs \
InterfaceGen.cs \

View file

@ -68,12 +68,12 @@ namespace GtkSharp.Generation {
return var_name + "." + handle;
}
public string FromNative(string var)
public virtual string FromNative(string var)
{
return "new " + QualifiedName + "(" + var + ")";
}
public string FromNativeReturn(string var)
public virtual string FromNativeReturn(string var)
{
return FromNative (var);
}

View file

@ -94,7 +94,7 @@ namespace GtkSharp.Generation {
AddType (new ManualGen ("GSList", "GLib.SList"));
AddType (new ManualGen ("GList", "GLib.List"));
AddType (new ByRefGen ("GValue", "GLib.Value"));
AddType (new ManualGen ("GObject", "GLib.Object"));
AddType (new GObjectGen ());
}
public void AddType (IGeneratable gen)