From 4caefdec00bce842d379e2c92a662522521b27f8 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 25 Mar 2005 17:57:15 +0000 Subject: [PATCH] 2005-03-25 Mike Kestner * */*.cs : tag native callback delegates with [CDeclCallback]. * */*.custom : tag native callback delegates with [CDeclCallback]. svn path=/trunk/gtk-sharp/; revision=42253 --- ChangeLog | 5 +++++ glib/DelegateWrapper.cs | 1 + glib/Object.cs | 1 + glib/Signal.cs | 2 ++ glib/WeakObject.cs | 1 + gnome/CanvasItem.custom | 5 +++++ gtk/CellRenderer.custom | 3 +++ gtk/Container.custom | 2 ++ gtk/NodeStore.cs | 12 ++++++++++++ gtk/Widget.custom | 2 ++ 10 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2c21b7c7e..2c52cd0f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-25 Mike Kestner + + * */*.cs : tag native callback delegates with [CDeclCallback]. + * */*.custom : tag native callback delegates with [CDeclCallback]. + 2005-03-24 Mike Kestner * generator/CallbackGen.cs : don't create native delegates for nulls. diff --git a/glib/DelegateWrapper.cs b/glib/DelegateWrapper.cs index 1b3f16c49..5fd4a9021 100644 --- a/glib/DelegateWrapper.cs +++ b/glib/DelegateWrapper.cs @@ -69,6 +69,7 @@ namespace GLib { } } + [CDeclCallback] private delegate void DestroyNotify (IntPtr data); [DllImport("libgobject-2.0-0.dll")] diff --git a/glib/Object.cs b/glib/Object.cs index c2581da36..abfe9fabb 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -295,6 +295,7 @@ namespace GLib { } } + [CDeclCallback] delegate void NotifyDelegate (IntPtr handle, IntPtr pspec, IntPtr gch); void NotifyCallback (IntPtr handle, IntPtr pspec, IntPtr gch) diff --git a/glib/Signal.cs b/glib/Signal.cs index 89dac128c..80efa34d6 100644 --- a/glib/Signal.cs +++ b/glib/Signal.cs @@ -52,6 +52,7 @@ namespace GLib { Delegate marshaler; static DestroyNotify notify = new DestroyNotify (OnNativeDestroy); + [CDeclCallback] delegate void DestroyNotify (IntPtr data, IntPtr obj); static void OnNativeDestroy (IntPtr data, IntPtr obj) { @@ -161,6 +162,7 @@ namespace GLib { g_signal_handler_disconnect (handle, handler_id); } + [CDeclCallback] delegate void voidObjectDelegate (IntPtr handle, IntPtr gch); static void voidObjectCallback (IntPtr handle, IntPtr gch) diff --git a/glib/WeakObject.cs b/glib/WeakObject.cs index 24d5ea266..ebe51bc45 100644 --- a/glib/WeakObject.cs +++ b/glib/WeakObject.cs @@ -30,6 +30,7 @@ namespace GLib { GCHandle gc_handle; static DestroyNotify notify = new DestroyNotify (OnNativeDestroy); + [CDeclCallback] delegate void DestroyNotify (IntPtr data); static void OnNativeDestroy (IntPtr data) { diff --git a/gnome/CanvasItem.custom b/gnome/CanvasItem.custom index 614769106..7840f80fd 100644 --- a/gnome/CanvasItem.custom +++ b/gnome/CanvasItem.custom @@ -62,6 +62,7 @@ [DllImport("gnomesharpglue-2")] static extern void gnomesharp_canvas_item_override_realize (GLib.GType gtype, RealizeDelegate cb); + [GLib.CDeclCallback] delegate void RealizeDelegate (IntPtr item); static RealizeDelegate RealizeCallback; @@ -91,6 +92,7 @@ [DllImport("gnomesharpglue-2")] static extern void gnomesharp_canvas_item_override_point (GLib.GType gtype, PointDelegate cb); + [GLib.CDeclCallback] delegate double PointDelegate (IntPtr item, double x, double y, int cx, int cy, out IntPtr actual_item_handle); static PointDelegate PointCallback; @@ -126,6 +128,7 @@ [DllImport("gnomesharpglue-2")] static extern void gnomesharp_canvas_item_override_draw (GLib.GType gtype, DrawDelegate cb); + [GLib.CDeclCallback] delegate void DrawDelegate (IntPtr handle, IntPtr drawable, int x, int y, int width, int height); static DrawDelegate DrawCallback; @@ -156,6 +159,7 @@ [DllImport("gnomesharpglue-2")] static extern void gnomesharp_canvas_item_override_render (GLib.GType gtype, RenderDelegate cb); + [GLib.CDeclCallback] delegate void RenderDelegate (IntPtr handle, ref CanvasBuf buf); static RenderDelegate RenderCallback; @@ -185,6 +189,7 @@ [DllImport("gnomesharpglue-2")] static extern void gnomesharp_canvas_item_override_update (GLib.GType gtype, UpdateDelegate cb); + [GLib.CDeclCallback] delegate void UpdateDelegate (IntPtr item, IntPtr affine_ptr, IntPtr clip_path, int flags); static UpdateDelegate UpdateCallback; diff --git a/gtk/CellRenderer.custom b/gtk/CellRenderer.custom index 625c91c25..6a32c1e69 100644 --- a/gtk/CellRenderer.custom +++ b/gtk/CellRenderer.custom @@ -29,6 +29,7 @@ [DllImport("gtksharpglue-2")] static extern void gtksharp_cellrenderer_override_get_size (GLib.GType gtype, GetSizeDelegate cb); + [GLib.CDeclCallback] delegate void GetSizeDelegate (IntPtr item, IntPtr widget, IntPtr cell_area_ptr, IntPtr x_offset, IntPtr y_offset, IntPtr width, IntPtr height); static GetSizeDelegate GetSizeCallback; @@ -70,6 +71,7 @@ [DllImport("gtksharpglue-2")] static extern void gtksharp_cellrenderer_override_render (GLib.GType gtype, RenderDelegate cb); + [GLib.CDeclCallback] delegate void RenderDelegate (IntPtr item, IntPtr window, IntPtr widget, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, ref Gdk.Rectangle expose_area, Gtk.CellRendererState flags); static RenderDelegate RenderCallback; @@ -98,6 +100,7 @@ [DllImport("gtksharpglue-2")] static extern void gtksharp_cellrenderer_override_start_editing (GLib.GType gtype, StartEditingDelegate cb); + [GLib.CDeclCallback] delegate IntPtr StartEditingDelegate (IntPtr raw, IntPtr evnt, IntPtr widget, IntPtr path, ref Gdk.Rectangle background_area, ref Gdk.Rectangle cell_area, Gtk.CellRendererState flags); static StartEditingDelegate StartEditingCallback; diff --git a/gtk/Container.custom b/gtk/Container.custom index fa4a20316..75f8ccf65 100644 --- a/gtk/Container.custom +++ b/gtk/Container.custom @@ -106,6 +106,7 @@ static extern void gtksharp_container_override_forall (GLib.GType gtype, ForallD [DllImport("gtksharpglue-2")] static extern void gtksharp_container_invoke_gtk_callback (IntPtr cb, IntPtr handle, IntPtr data); +[GLib.CDeclCallback] delegate void ForallDelegate (IntPtr container, bool include_internals, IntPtr cb, IntPtr data); static ForallDelegate ForallCallback; @@ -164,6 +165,7 @@ static extern IntPtr gtk_container_child_type(IntPtr raw); [DllImport("gtksharpglue-2")] static extern void gtksharp_container_override_child_type (GLib.GType type, ChildTypeDelegate cb); +[GLib.CDeclCallback] delegate IntPtr ChildTypeDelegate (IntPtr raw); static ChildTypeDelegate ChildTypeCallback; diff --git a/gtk/NodeStore.cs b/gtk/NodeStore.cs index b1e0a6712..ee159507d 100644 --- a/gtk/NodeStore.cs +++ b/gtk/NodeStore.cs @@ -49,17 +49,29 @@ namespace Gtk { public IDHashtable () : base (new IDHashCodeProvider (), new IDComparer ()) {} } + [GLib.CDeclCallback] delegate int GetFlagsDelegate (); + [GLib.CDeclCallback] delegate int GetNColumnsDelegate (); + [GLib.CDeclCallback] delegate IntPtr GetColumnTypeDelegate (int col); + [GLib.CDeclCallback] delegate bool GetNodeDelegate (out int node_idx, IntPtr path); + [GLib.CDeclCallback] delegate IntPtr GetPathDelegate (int node_idx); + [GLib.CDeclCallback] delegate void GetValueDelegate (int node_idx, int col, ref GLib.Value val); + [GLib.CDeclCallback] delegate bool NextDelegate (ref int node_idx); + [GLib.CDeclCallback] delegate bool ChildrenDelegate (out int child, int parent); + [GLib.CDeclCallback] delegate bool HasChildDelegate (int node_idx); + [GLib.CDeclCallback] delegate int NChildrenDelegate (int node_idx); + [GLib.CDeclCallback] delegate bool NthChildDelegate (out int child, int parent, int n); + [GLib.CDeclCallback] delegate bool ParentDelegate (out int parent, int child); [StructLayout(LayoutKind.Sequential)] diff --git a/gtk/Widget.custom b/gtk/Widget.custom index a6d9f07ed..a608dcf94 100644 --- a/gtk/Widget.custom +++ b/gtk/Widget.custom @@ -211,6 +211,7 @@ public int FocusLineWidth { [DllImport("gtksharpglue-2")] static extern int gtksharp_widget_connect_set_scroll_adjustments_signal (IntPtr gtype, SetScrollAdjustmentsDelegate cb); +[GLib.CDeclCallback] delegate void SetScrollAdjustmentsDelegate (IntPtr widget, IntPtr hadj, IntPtr vadj); static SetScrollAdjustmentsDelegate SetScrollAdjustmentsCallback; @@ -251,6 +252,7 @@ private class BindingInvoker { } } +[GLib.CDeclCallback] private delegate void BindingHandler (IntPtr handle, IntPtr user_data); private static void BindingCallback (IntPtr handle, IntPtr user_data)