2004-06-01 Mike Kestner <mkestner@ximian.com>

* generator/ObjectGen.cs : generate protected ctor () for all
	GLib.Objects that don't have any ctors.
	* gtk/CellRenderer.custom : remove ctor ().
	* gtkhtml/Gtk.metadata : add a disable_void_ctor rule for HTML.

svn path=/trunk/gtk-sharp/; revision=28645
This commit is contained in:
Mike Kestner 2004-06-01 18:00:09 +00:00
parent ac5e091b8c
commit 77d1b452f5
4 changed files with 29 additions and 17 deletions

View file

@ -1,3 +1,10 @@
2004-06-01 Mike Kestner <mkestner@ximian.com>
* generator/ObjectGen.cs : generate protected ctor () for all
GLib.Objects that don't have any ctors.
* gtk/CellRenderer.custom : remove ctor ().
* gtkhtml/Gtk.metadata : add a disable_void_ctor rule for HTML.
2004-06-01 Mike Kestner <mkestner@ximian.com>
* gtk/Gtk.metadata : mark SizeRequest requisition as out, not ref.

View file

@ -48,6 +48,12 @@ namespace GtkSharp.Generation {
}
}
private bool DisableVoidCtor {
get {
return Elem.HasAttribute ("disable_void_ctor");
}
}
private class DirectoryInfo {
public string assembly_name;
public Hashtable objects;
@ -202,6 +208,13 @@ namespace GtkSharp.Generation {
gen_info.Writer.WriteLine();
gen_info.Writer.WriteLine("\t\tprotected " + Name + "(GLib.GType gtype) : base(gtype) {}");
gen_info.Writer.WriteLine("\t\tpublic " + Name + "(IntPtr raw) : base(raw) {}");
if (ctors.Count == 0 && !DisableVoidCtor) {
gen_info.Writer.WriteLine();
gen_info.Writer.WriteLine("\t\tprotected " + Name + "() : base(IntPtr.Zero)");
gen_info.Writer.WriteLine("\t\t{");
gen_info.Writer.WriteLine("\t\t\tCreateNativeObject (new string [0], new GLib.Value [0]);");
gen_info.Writer.WriteLine("\t\t}");
}
gen_info.Writer.WriteLine();
base.GenCtors (gen_info);

View file

@ -8,15 +8,6 @@
// This code is inserted after the automatically generated code.
//
public CellRenderer () : base (IntPtr.Zero)
{
if (GetType () != typeof (CellRenderer)) {
CreateNativeObject (new string[0], new GLib.Value[0]);
return;
}
throw new InvalidOperationException ("You MUST subclass this class");
}
[DllImport("gtksharpglue")]
static extern void gtksharp_cellrenderer_base_get_size (IntPtr handle, IntPtr widget, Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height);

View file

@ -1,13 +1,14 @@
<?xml version="1.0"?>
<metadata>
<attr path="//object[@cname='GtkHTML']/constructor[@cname='gtk_html_new']" name="hidden">1</attr>
<attr path="//object[@cname='GtkHTML']/constructor[@cname='gtk_html_new_from_string']" name="hidden">1</attr>
<attr path="//object[@cname='GtkHTML']/signal[@name='Command']" name="name">OnCommand</attr>
<attr path="//object[@cname='GtkHTML']/method[@name='BeginContent']" name="name">Begin</attr>
<attr path="//object[@cname='GtkHTML']/method[@name='BeginFull']" name="name">Begin</attr>
<attr path="//struct[@cname='GtkHTMLStream']" name="opaque">1</attr>
<attr path="//struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="type">const-guchar*</attr>
<attr path="//struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="array">1</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']" name="disable_void_ctor">1</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']/constructor[@cname='gtk_html_new']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']/constructor[@cname='gtk_html_new_from_string']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']/signal[@name='Command']" name="name">OnCommand</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']/method[@name='BeginContent']" name="name">Begin</attr>
<attr path="/api/namespace/object[@cname='GtkHTML']/method[@name='BeginFull']" name="name">Begin</attr>
<attr path="/api/namespace/struct[@cname='GtkHTMLStream']" name="opaque">1</attr>
<attr path="/api/namespace/struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="type">const-guchar*</attr>
<attr path="/api/namespace/struct[@cname='GtkHTMLStream']/method[@name='Write']/*/*[@name='buffer']" name="array">1</attr>
</metadata>