2004-05-25 Mike Kestner <mkestner@ximian.com>
* gtk/Container.custom : use glue to invoke the GtkCallback in Forall. * gtk/glue/container.c : add gtksharp_container_invoke_gtk_callback. svn path=/trunk/gtk-sharp/; revision=28047
This commit is contained in:
parent
ca91d3c85f
commit
f37e02b5b2
3 changed files with 24 additions and 8 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-05-25 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
|
* gtk/Container.custom : use glue to invoke the GtkCallback in
|
||||||
|
Forall.
|
||||||
|
* gtk/glue/container.c : add gtksharp_container_invoke_gtk_callback.
|
||||||
|
|
||||||
2004-05-23 Mike Kestner <mkestner@ximian.com>
|
2004-05-23 Mike Kestner <mkestner@ximian.com>
|
||||||
|
|
||||||
* generator/SignalHandler.cs : put back the ObjectGen hack
|
* generator/SignalHandler.cs : put back the ObjectGen hack
|
||||||
|
|
|
@ -50,20 +50,23 @@ public Widget[] FocusChain {
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("gtksharpglue")]
|
[DllImport("gtksharpglue")]
|
||||||
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, GtkSharp.CallbackNative cb, IntPtr data);
|
static extern void gtksharp_container_base_forall (IntPtr handle, bool include_internals, IntPtr cb, IntPtr data);
|
||||||
|
|
||||||
[DllImport("gtksharpglue")]
|
[DllImport("gtksharpglue")]
|
||||||
static extern void gtksharp_container_override_forall (GLib.GType gtype, ForallDelegate cb);
|
static extern void gtksharp_container_override_forall (GLib.GType gtype, ForallDelegate cb);
|
||||||
|
|
||||||
delegate void ForallDelegate (IntPtr container, bool include_internals, GtkSharp.CallbackNative cb, IntPtr data);
|
[DllImport("gtksharpglue")]
|
||||||
|
static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data);
|
||||||
|
|
||||||
|
delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data);
|
||||||
|
|
||||||
static ForallDelegate ForallCallback;
|
static ForallDelegate ForallCallback;
|
||||||
|
|
||||||
public struct CallbackInvoker {
|
public struct CallbackInvoker {
|
||||||
GtkSharp.CallbackNative cb;
|
IntPtr cb;
|
||||||
IntPtr data;
|
IntPtr data;
|
||||||
|
|
||||||
internal CallbackInvoker (GtkSharp.CallbackNative cb, IntPtr data)
|
internal CallbackInvoker (IntPtr cb, IntPtr data)
|
||||||
{
|
{
|
||||||
this.cb = cb;
|
this.cb = cb;
|
||||||
this.data = data;
|
this.data = data;
|
||||||
|
@ -75,7 +78,7 @@ public struct CallbackInvoker {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal GtkSharp.CallbackNative Delegate {
|
internal IntPtr Callback {
|
||||||
get {
|
get {
|
||||||
return cb;
|
return cb;
|
||||||
}
|
}
|
||||||
|
@ -83,11 +86,11 @@ public struct CallbackInvoker {
|
||||||
|
|
||||||
public void Invoke (Widget w)
|
public void Invoke (Widget w)
|
||||||
{
|
{
|
||||||
cb (w.Handle, data);
|
gtksharp_container_invoke_gtk_callback (cb, w.Handle, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void Forall_cb (IntPtr container, bool include_internals, GtkSharp.CallbackNative cb, IntPtr data)
|
static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data)
|
||||||
{
|
{
|
||||||
Container obj = GLib.Object.GetObject (container, false) as Container;
|
Container obj = GLib.Object.GetObject (container, false) as Container;
|
||||||
CallbackInvoker invoker = new CallbackInvoker (cb, data);
|
CallbackInvoker invoker = new CallbackInvoker (cb, data);
|
||||||
|
@ -103,6 +106,6 @@ protected static void OverrideForall (GLib.GType gtype)
|
||||||
|
|
||||||
protected virtual void OnForall (bool include_internals, CallbackInvoker invoker)
|
protected virtual void OnForall (bool include_internals, CallbackInvoker invoker)
|
||||||
{
|
{
|
||||||
gtksharp_container_base_forall (Handle, include_internals, invoker.Delegate, invoker.Data);
|
gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,3 +28,10 @@ gtksharp_container_override_forall (GType gtype, gpointer cb)
|
||||||
((GtkContainerClass *) klass)->forall = cb;
|
((GtkContainerClass *) klass)->forall = cb;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void gtksharp_container_invoke_gtk_callback (GtkCallback cb, GtkWidget *widget, gpointer data);
|
||||||
|
|
||||||
|
void
|
||||||
|
gtksharp_container_invoke_gtk_callback (GtkCallback cb, GtkWidget *widget, gpointer data)
|
||||||
|
{
|
||||||
|
cb (widget, data);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue