2004-06-04 Todd Berman <tberman@sevenl.net>

* glib/Object.cs: ConnectDefaultHandlers needs to look at public api
        as well for virtual methods.
        * gtk/CellRenderer.custom:
        * gtk/Container.custom:
        * gnome/CanvasItem.custom: Add DefaultSignalHandler to remove the need
        for the static ctor.

svn path=/trunk/gtk-sharp/; revision=28851
This commit is contained in:
Todd Berman 2004-06-05 01:01:07 +00:00
parent 12bc3b0550
commit 01e3962bc8
6 changed files with 21 additions and 9 deletions

View file

@ -1,3 +1,12 @@
2004-06-04 Todd Berman <tberman@sevenl.net>
* glib/Object.cs: ConnectDefaultHandlers needs to look at public api
as well for virtual methods.
* gtk/CellRenderer.custom:
* gtk/Container.custom:
* gnome/CanvasItem.custom: Add DefaultSignalHandler to remove the need
for the static ctor.
2004-06-04 Todd Berman <tberman@sevenl.net>
* gnome/CanvasItem.custom: Changed from OnXXX vmethods to XXX vmethods

View file

@ -102,7 +102,7 @@ namespace GLib {
private static void ConnectDefaultHandlers (GType gtype, System.Type t)
{
foreach (MethodInfo minfo in t.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)) {
foreach (MethodInfo minfo in t.GetMethods(BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.DeclaredOnly)) {
MethodInfo baseinfo = minfo.GetBaseDefinition ();
if (baseinfo == minfo)
continue;

View file

@ -80,6 +80,7 @@
gnomesharp_canvas_item_override_realize (gtype, RealizeCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gnome.CanvasItem), ConnectionMethod="OverrideRealize")]
protected virtual void Realize ()
{
gnomesharp_canvas_item_base_realize (Handle);
@ -111,6 +112,7 @@
gnomesharp_canvas_item_override_point (gtype, PointCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gnome.CanvasItem), ConnectionMethod="OverridePoint")]
protected virtual double Point (double x, double y, int cx, int cy, out CanvasItem actual_item)
{
IntPtr actual_item_handle;
@ -143,6 +145,7 @@
gnomesharp_canvas_item_override_draw (gtype, DrawCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gnome.CanvasItem), ConnectionMethod="OverrideDraw")]
protected virtual void Draw (Gdk.Drawable drawable, int x, int y, int width, int height)
{
gnomesharp_canvas_item_base_draw (Handle, drawable.Handle, x, y, width, height);
@ -164,6 +167,7 @@
obj.Render (ref buf);
}
[GLib.DefaultSignalHandler (Type=typeof(Gnome.CanvasItem), ConnectionMethod="OverrideRender")]
protected static void OverrideRender (GLib.GType gtype)
{
if (RenderCallback == null)
@ -206,6 +210,7 @@
gnomesharp_canvas_item_override_update (gtype, UpdateCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gnome.CanvasItem), ConnectionMethod="OverrideUpdate")]
protected virtual void Update (double[] affine, ref Art.SVP clip_path, int flags)
{
gnomesharp_canvas_item_base_update (Handle, affine, ref clip_path, flags);

View file

@ -43,6 +43,7 @@
gtksharp_cellrenderer_override_get_size (gtype, GetSizeCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gtk.CellRenderer), ConnectionMethod="OverrideGetSize")]
public virtual void GetSize(Gtk.Widget widget, ref Gdk.Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height) {
gtksharp_cellrenderer_base_get_size(Handle, widget.Handle, ref cell_area, out x_offset, out y_offset, out width, out height);
}
@ -73,6 +74,7 @@
gtksharp_cellrenderer_override_render (gtype, RenderCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gtk.CellRenderer), ConnectionMethod="OverrideRender")]
protected virtual void Render (Gdk.Drawable window, Gtk.Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, Gtk.CellRendererState flags)
{
gtksharp_cellrenderer_base_render (Handle, window.Handle, widget.Handle, background_area, cell_area, expose_area, flags);
@ -106,6 +108,7 @@
[DllImport("gtksharpglue")]
static extern IntPtr gtksharp_cellrenderer_base_start_editing(IntPtr raw, IntPtr evnt, IntPtr widget, string path, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, int flags);
[GLib.DefaultSignalHandler (Type=typeof(Gtk.CellRenderer), ConnectionMethod="OverrideStartEditing")]
public virtual Gtk.CellEditable StartEditing(Gdk.Event evnt, Gtk.Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gtk.CellRendererState flags) {
IntPtr raw_ret = gtksharp_cellrenderer_base_start_editing(Handle, evnt.Handle, widget.Handle, path, ref background_area, ref cell_area, (int) flags);
Gtk.CellEditable ret = (Gtk.CellEditable) GLib.Object.GetObject(raw_ret);

View file

@ -104,6 +104,7 @@ protected static void OverrideForall (GLib.GType gtype)
gtksharp_container_override_forall (gtype, ForallCallback);
}
[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForall")]
protected virtual void ForAll (bool include_internals, CallbackInvoker invoker)
{
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);

View file

@ -26,12 +26,6 @@ public class CustomCellRenderer : CellRenderer
}
}
static CustomCellRenderer ()
{
OverrideGetSize (GLib.Object.LookupGType (typeof (CustomCellRenderer)));
OverrideRender (GLib.Object.LookupGType (typeof (CustomCellRenderer)));
}
public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
{
int calc_width = (int) this.Xpad * 2 + 100;