diff --git a/ChangeLog b/ChangeLog index de8b4ffdd..b3f5eec62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2002-09-29 Rachel Hestilow + + * glue/canvas-proxy.c (update), glue/canvas-proxy-marshal.list: + Marshal the array as a pointer for now. + + * gnome/voidObjectAffineSVPintSignal.cs: Added. + * gnome/CanvasProxy.cs (Update): Use a custom signal handler. + 2002-09-23 Miguel de Icaza * gtk/Style.custom: bind it. diff --git a/glue/canvas-proxy-marshal.c b/glue/canvas-proxy-marshal.c index 913385024..878c175b9 100644 --- a/glue/canvas-proxy-marshal.c +++ b/glue/canvas-proxy-marshal.c @@ -47,22 +47,22 @@ #endif /* !G_ENABLE_DEBUG */ -/* VOID:OBJECT,DOUBLE,POINTER,INT (canvas-proxy-marshal.list:1) */ +/* VOID:OBJECT,POINTER,POINTER,INT (canvas-proxy-marshal.list:1) */ void -g_cclosure_user_marshal_VOID__OBJECT_DOUBLE_POINTER_INT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data) +g_cclosure_user_marshal_VOID__OBJECT_POINTER_POINTER_INT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data) { - typedef void (*GMarshalFunc_VOID__OBJECT_DOUBLE_POINTER_INT) (gpointer data1, - gpointer arg_1, - gdouble arg_2, - gpointer arg_3, - gint arg_4, - gpointer data2); - register GMarshalFunc_VOID__OBJECT_DOUBLE_POINTER_INT callback; + typedef void (*GMarshalFunc_VOID__OBJECT_POINTER_POINTER_INT) (gpointer data1, + gpointer arg_1, + gpointer arg_2, + gpointer arg_3, + gint arg_4, + gpointer data2); + register GMarshalFunc_VOID__OBJECT_POINTER_POINTER_INT callback; register GCClosure *cc = (GCClosure*) closure; register gpointer data1, data2; @@ -78,11 +78,11 @@ g_cclosure_user_marshal_VOID__OBJECT_DOUBLE_POINTER_INT (GClosure *closure, data1 = g_value_peek_pointer (param_values + 0); data2 = closure->data; } - callback = (GMarshalFunc_VOID__OBJECT_DOUBLE_POINTER_INT) (marshal_data ? marshal_data : cc->callback); + callback = (GMarshalFunc_VOID__OBJECT_POINTER_POINTER_INT) (marshal_data ? marshal_data : cc->callback); callback (data1, g_marshal_value_peek_object (param_values + 1), - g_marshal_value_peek_double (param_values + 2), + g_marshal_value_peek_pointer (param_values + 2), g_marshal_value_peek_pointer (param_values + 3), g_marshal_value_peek_int (param_values + 4), data2); diff --git a/glue/canvas-proxy-marshal.h b/glue/canvas-proxy-marshal.h index b9bb99660..21d6a2976 100644 --- a/glue/canvas-proxy-marshal.h +++ b/glue/canvas-proxy-marshal.h @@ -6,13 +6,13 @@ G_BEGIN_DECLS -/* VOID:OBJECT,DOUBLE,POINTER,INT (canvas-proxy-marshal.list:1) */ -extern void g_cclosure_user_marshal_VOID__OBJECT_DOUBLE_POINTER_INT (GClosure *closure, - GValue *return_value, - guint n_param_values, - const GValue *param_values, - gpointer invocation_hint, - gpointer marshal_data); +/* VOID:OBJECT,POINTER,POINTER,INT (canvas-proxy-marshal.list:1) */ +extern void g_cclosure_user_marshal_VOID__OBJECT_POINTER_POINTER_INT (GClosure *closure, + GValue *return_value, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint, + gpointer marshal_data); /* DOUBLE:OBJECT,DOUBLE,DOUBLE,INT,INT,POINTER (canvas-proxy-marshal.list:2) */ extern void g_cclosure_user_marshal_DOUBLE__OBJECT_DOUBLE_DOUBLE_INT_INT_POINTER (GClosure *closure, diff --git a/glue/canvas-proxy-marshal.list b/glue/canvas-proxy-marshal.list index 3bb5848c5..63757c8f4 100644 --- a/glue/canvas-proxy-marshal.list +++ b/glue/canvas-proxy-marshal.list @@ -1,4 +1,4 @@ -VOID:OBJECT,DOUBLE,POINTER,INT +VOID:OBJECT,POINTER,POINTER,INT DOUBLE:OBJECT,DOUBLE,DOUBLE,INT,INT,POINTER VOID:OBJECT,POINTER,POINTER,POINTER,POINTER VOID:OBJECT,INT,INT,INT,INT diff --git a/glue/canvas-proxy.c b/glue/canvas-proxy.c index 21843f24d..6f42693c7 100644 --- a/glue/canvas-proxy.c +++ b/glue/canvas-proxy.c @@ -50,8 +50,8 @@ gtksharp_canvas_proxy_class_init (CanvasProxyClass *class) G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (GnomeCanvasItemClass, update), NULL, NULL, - g_cclosure_user_marshal_VOID__OBJECT_DOUBLE_POINTER_INT, - G_TYPE_NONE, 3, G_TYPE_DOUBLE, + g_cclosure_user_marshal_VOID__OBJECT_POINTER_POINTER_INT, + G_TYPE_NONE, 3, G_TYPE_POINTER, G_TYPE_POINTER, G_TYPE_INT); /* void (* realize) (GnomeCanvasItem *item); */ diff --git a/gnome/CanvasProxy.cs b/gnome/CanvasProxy.cs index 9476a5b52..1f9e3d742 100644 --- a/gnome/CanvasProxy.cs +++ b/gnome/CanvasProxy.cs @@ -26,7 +26,9 @@ namespace Gnome { public event GtkSharp.UpdateHandler Update { add { - throw new NotImplementedException (); + if (EventList["update"] == null) + Signals["update"] = new GtkSharp.Gnome.voidObjectAffineSVPintSignal(this, Handle, "update", value, System.Type.GetType("EventArgs")); + EventList.AddHandler("update", value); } remove { diff --git a/gnome/voidObjectAffineSVPintSignal.cs b/gnome/voidObjectAffineSVPintSignal.cs new file mode 100644 index 000000000..e49211a57 --- /dev/null +++ b/gnome/voidObjectAffineSVPintSignal.cs @@ -0,0 +1,59 @@ +// Generated File. Do not modify. +// 2001-2002 Mike Kestner + +namespace GtkSharp { +namespace Gnome { + using System; + using System.Runtime.InteropServices; + + public delegate void voidObjectAffineSVPintDelegate(IntPtr arg0, IntPtr arg1, ref Art.SVP arg2, int arg3, int key); + + public class voidObjectAffineSVPintSignal : SignalCallback { + + private static voidObjectAffineSVPintDelegate _Delegate; + + private static void voidObjectAffineSVPintCallback(IntPtr arg0, IntPtr arg1, ref Art.SVP arg2, int arg3, int key) + { + if (!_Instances.Contains(key)) + throw new Exception("Unexpected signal key " + key); + + voidObjectAffineSVPintSignal inst = (voidObjectAffineSVPintSignal) _Instances[key]; + SignalArgs args = (SignalArgs) Activator.CreateInstance (inst._argstype); + args.Args = new object[3]; + if (arg1 != IntPtr.Zero) { + double[] affine = new double[6]; + Marshal.Copy (arg1, affine, 0, 6); + args.Args[0] = affine; + } else { + args.Args[0] = null; + } + arg2._Initialize (); + args.Args[1] = arg2; + args.Args[2] = arg3; + + object[] argv = new object[2]; + argv[0] = inst._obj; + argv[1] = args; + inst._handler.DynamicInvoke(argv); + } + + [DllImport("gobject-2.0")] static extern void g_signal_connect_data(IntPtr obj, String name, voidObjectAffineSVPintDelegate cb, int key, IntPtr p, int flags); + + public voidObjectAffineSVPintSignal(GLib.Object obj, IntPtr raw, String name, MulticastDelegate eh, Type argstype) : base(obj, eh, argstype) + { + if (_Delegate == null) { + _Delegate = new voidObjectAffineSVPintDelegate(voidObjectAffineSVPintCallback); + } + g_signal_connect_data(raw, name, _Delegate, _key, new IntPtr(0), 0); + } + + ~voidObjectAffineSVPintSignal() + { + _Instances.Remove(_key); + if(_Instances.Count == 0) { + _Delegate = null; + } + } + } +} +}