diff --git a/ChangeLog b/ChangeLog index 833319fcd..ad9834aba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,15 @@ -2004-04-30 Larry Ewing +2004-05-05 Mike Kestner + + * generator/BoxedGen.cs : remove g_value_init DllImport and change + (g|s)et_boxed to use a glue method to simplify dllmapping. + * glib/Value.cs : add Init method. + * glib/glue/value.cs : add get/set_boxed glue methods. + * */*.config.in : remove libgobject mappings for dlls that no longer + need them. + +2004-05-05 Larry Ewing * gtk/Adjustment.custom: add an a set method for StepIncrement. - * gtk/glue/adjustment.c: add gtk_adjustment_set_step_increment. 2004-05-05 Mike Kestner diff --git a/atk/atk-sharp.dll.config.in b/atk/atk-sharp.dll.config.in index 32f431fee..9488c8629 100644 --- a/atk/atk-sharp.dll.config.in +++ b/atk/atk-sharp.dll.config.in @@ -1,4 +1,3 @@ - diff --git a/gda/gda-sharp.dll.config.in b/gda/gda-sharp.dll.config.in index 02f1b6fb5..fc3e22b19 100644 --- a/gda/gda-sharp.dll.config.in +++ b/gda/gda-sharp.dll.config.in @@ -1,4 +1,3 @@ - diff --git a/generator/BoxedGen.cs b/generator/BoxedGen.cs index b87dc430f..0ab4b2982 100644 --- a/generator/BoxedGen.cs +++ b/generator/BoxedGen.cs @@ -24,28 +24,25 @@ namespace GtkSharp.Generation { { StreamWriter sw = gen_info.Writer = gen_info.OpenStream (Name); base.Generate (gen_info); - sw.WriteLine ("\t\t[DllImport(\"libgobject-2.0-0.dll\")]"); - sw.WriteLine ("\t\tstatic extern IntPtr g_value_init (ref GLib.Value val, GLib.GType gtype);"); + sw.WriteLine ("\t\t[DllImport(\"glibsharpglue\")]"); + sw.WriteLine ("\t\tstatic extern IntPtr glibsharp_value_get_boxed (ref GLib.Value val);"); sw.WriteLine (); - sw.WriteLine ("\t\t[DllImport(\"libgobject-2.0-0.dll\")]"); - sw.WriteLine ("\t\tstatic extern IntPtr g_value_get_boxed (ref GLib.Value val);"); - sw.WriteLine (); - sw.WriteLine ("\t\t[DllImport(\"libgobject-2.0-0.dll\")]"); - sw.WriteLine ("\t\tstatic extern void g_value_set_boxed (ref GLib.Value val, ref " + QualifiedName + " boxed);"); + sw.WriteLine ("\t\t[DllImport(\"glibsharpglue\")]"); + sw.WriteLine ("\t\tstatic extern void glibsharp_value_set_boxed (ref GLib.Value val, ref " + QualifiedName + " boxed);"); sw.WriteLine (); sw.WriteLine ("\t\tpublic static explicit operator GLib.Value (" + QualifiedName + " boxed)"); sw.WriteLine ("\t\t{"); sw.WriteLine ("\t\t\tGLib.Value val = GLib.Value.Empty;"); - sw.WriteLine ("\t\t\tg_value_init (ref val, " + QualifiedName + ".GType);"); - sw.WriteLine ("\t\t\tg_value_set_boxed (ref val, ref boxed);"); + sw.WriteLine ("\t\t\tval.Init (" + QualifiedName + ".GType);"); + sw.WriteLine ("\t\t\tglibsharp_value_set_boxed (ref val, ref boxed);"); sw.WriteLine ("\t\t\treturn val;"); sw.WriteLine ("\t\t}"); sw.WriteLine (); sw.WriteLine ("\t\tpublic static explicit operator " + QualifiedName + " (GLib.Value val)"); sw.WriteLine ("\t\t{"); - sw.WriteLine ("\t\t\tIntPtr boxed_ptr = g_value_get_boxed (ref val);"); + sw.WriteLine ("\t\t\tIntPtr boxed_ptr = glibsharp_value_get_boxed (ref val);"); sw.WriteLine ("\t\t\treturn New (boxed_ptr);"); sw.WriteLine ("\t\t}"); diff --git a/glib/Value.cs b/glib/Value.cs index 2b0f8623e..9d9195f55 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -35,6 +35,11 @@ namespace GLib { g_value_unset (ref this); } + public void Init (GLib.GType gtype) + { + g_value_init (ref this, gtype.Val); + } + public Value (GLib.GType gtype) { type = GType.Invalid; diff --git a/glib/glue/value.c b/glib/glue/value.c index cdf6af98c..2d808bc99 100644 --- a/glib/glue/value.c +++ b/glib/glue/value.c @@ -10,6 +10,8 @@ /* Forward declarations */ void gtksharp_value_create_from_property (GValue *value, GObject *obj, const gchar* name); GType gtksharp_value_get_value_type (GValue *value); +gpointer glibsharp_value_get_boxed (GValue *value); +void glibsharp_value_set_boxed (GValue *value, gpointer boxed); /* */ void @@ -27,3 +29,15 @@ gtksharp_value_get_value_type (GValue *value) return G_VALUE_TYPE (value); } +gpointer +glibsharp_value_get_boxed (GValue *value) +{ + return g_value_get_boxed (value); +} + +void +glibsharp_value_set_boxed (GValue *value, gpointer boxed) +{ + g_value_set_boxed (value, boxed); +} + diff --git a/gnomedb/gnomedb-sharp.dll.config.in b/gnomedb/gnomedb-sharp.dll.config.in index 38d6eb598..a543b1ac7 100644 --- a/gnomedb/gnomedb-sharp.dll.config.in +++ b/gnomedb/gnomedb-sharp.dll.config.in @@ -1,4 +1,3 @@ - diff --git a/gtkhtml/gtkhtml-sharp.dll.config.in b/gtkhtml/gtkhtml-sharp.dll.config.in index f0404814a..6282da4e4 100644 --- a/gtkhtml/gtkhtml-sharp.dll.config.in +++ b/gtkhtml/gtkhtml-sharp.dll.config.in @@ -1,4 +1,3 @@ - diff --git a/pango/pango-sharp.dll.config.in b/pango/pango-sharp.dll.config.in index 50bd178c4..cbfa9a76d 100644 --- a/pango/pango-sharp.dll.config.in +++ b/pango/pango-sharp.dll.config.in @@ -1,4 +1,3 @@ - diff --git a/vte/vte-sharp.dll.config.in b/vte/vte-sharp.dll.config.in index a06e9ad3e..362762f58 100644 --- a/vte/vte-sharp.dll.config.in +++ b/vte/vte-sharp.dll.config.in @@ -1,5 +1,4 @@ -