diff --git a/ChangeLog b/ChangeLog index f9e2f6a39..41e96a022 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ 2005-08-25 Mike Kestner - * sample/GtkDemo/DemoIconView.cs : remove some C# 2.0-isms. + * sample/GtkDemo/DemoIconView.cs : remove C# 2.0-isms. + * sample/opaquetest/OpaqueTest.cs : remove C# 2.0-isms. + * sample/valuetest/ValueTest.cs : remove C# 2.0-isms. + * sample/PolarFixed.cs : remove C# 2.0-isms. 2005-08-23 Ben Maurer diff --git a/sample/PolarFixed.cs b/sample/PolarFixed.cs index 855cc4f06..79c689cea 100644 --- a/sample/PolarFixed.cs +++ b/sample/PolarFixed.cs @@ -185,7 +185,7 @@ class Test { Application.Init (); Gtk.Window win = new Gtk.Window ("Polar Coordinate Container"); - win.DeleteEvent += Window_Delete; + win.DeleteEvent += new DeleteEventHandler (Window_Delete); Notebook notebook = new Notebook (); win.Add (notebook); diff --git a/sample/opaquetest/Makefile.am b/sample/opaquetest/Makefile.am index 2d3d61a2a..dd96599af 100644 --- a/sample/opaquetest/Makefile.am +++ b/sample/opaquetest/Makefile.am @@ -5,7 +5,7 @@ assemblies=../../glib/glib-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-s references=$(addprefix /r:, $(assemblies)) opaquetest.exe: OpaqueTest.cs generated/*.cs $(assemblies) - $(CSC) /out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs generated/*.cs + $(CSC) /out:opaquetest.exe $(references) $(srcdir)/OpaqueTest.cs $(GENERATED_SOURCES) libopaque_la_SOURCES = \ opaques.c \ diff --git a/sample/opaquetest/OpaqueTest.cs b/sample/opaquetest/OpaqueTest.cs index f8bef9366..cec6be1e5 100644 --- a/sample/opaquetest/OpaqueTest.cs +++ b/sample/opaquetest/OpaqueTest.cs @@ -100,7 +100,7 @@ public class OpaqueTest { Console.WriteLine ("Testing returning a Gtk#-owned opaque from C# to C"); ret_op = new Opaque (); - op = Opaque.Check (ReturnOpaque, GC); + op = Opaque.Check (new Gtksharp.OpaqueReturnFunc (ReturnOpaque), new Gtksharp.GCFunc (GC)); if (op.Serial != Opaque.LastSerial || Opaquetest.Error) Error ("Error during Opaque.Check. Expected {0}, Got {1}", Opaque.LastSerial, op.Serial); op.Dispose (); @@ -109,7 +109,7 @@ public class OpaqueTest { Console.WriteLine ("Testing returning a Gtk#-owned opaque to a C method that will free it"); ret_op = new Opaque (); - op = Opaque.CheckFree (ReturnOpaque, GC); + op = Opaque.CheckFree (new Gtksharp.OpaqueReturnFunc (ReturnOpaque), new Gtksharp.GCFunc (GC)); if (Opaquetest.Error) Error ("Error during Opaque.CheckFree."); Opaquetest.ExpectError = true; @@ -125,7 +125,7 @@ public class OpaqueTest { Console.WriteLine ("Testing leaking a C-owned opaque"); ret_op = new Opaque (); ret_op.Owned = false; - op = Opaque.Check (ReturnOpaque, GC); + op = Opaque.Check (new Gtksharp.OpaqueReturnFunc (ReturnOpaque), new Gtksharp.GCFunc (GC)); if (op.Serial != Opaque.LastSerial || Opaquetest.Error) Error ("Error during Opaque.Check. Expected {0}, Got {1}", Opaque.LastSerial, op.Serial); handle = op.Handle; @@ -139,7 +139,7 @@ public class OpaqueTest { Console.WriteLine ("Testing handing over a C-owned opaque to a C method that will free it"); ret_op = new Opaque (); ret_op.Owned = false; - op = Opaque.CheckFree (ReturnOpaque, GC); + op = Opaque.CheckFree (new Gtksharp.OpaqueReturnFunc (ReturnOpaque), new Gtksharp.GCFunc (GC)); if (Opaquetest.Error) Error ("Error during Opaque.CheckFree."); Opaquetest.ExpectError = true; @@ -222,7 +222,7 @@ public class OpaqueTest { Console.WriteLine ("Testing returning a Gtk#-owned refcounted from C# to C"); ret_ref = new Refcounted (); - ref1 = Refcounted.Check (ReturnRefcounted, GC); + ref1 = Refcounted.Check (new Gtksharp.RefcountedReturnFunc (ReturnRefcounted), new Gtksharp.GCFunc (GC)); if (ref1.Serial != Refcounted.LastSerial || Opaquetest.Error) Error ("Error during Refcounted.Check. Expected {0}, Got {1}", Refcounted.LastSerial, ref1.Serial); ref1.Dispose (); @@ -231,7 +231,7 @@ public class OpaqueTest { Console.WriteLine ("Testing returning a Gtk#-owned refcounted to a C method that will free it"); ret_ref = new Refcounted (); - ref1 = Refcounted.CheckUnref (ReturnRefcounted, GC); + ref1 = Refcounted.CheckUnref (new Gtksharp.RefcountedReturnFunc (ReturnRefcounted), new Gtksharp.GCFunc (GC)); if (Opaquetest.Error) Error ("Error during Refcounted.CheckUnref."); Opaquetest.ExpectError = true; @@ -247,7 +247,7 @@ public class OpaqueTest { Console.WriteLine ("Testing leaking a C-owned refcounted"); ret_ref = new Refcounted (); ret_ref.Owned = false; - ref1 = Refcounted.Check (ReturnRefcounted, GC); + ref1 = Refcounted.Check (new Gtksharp.RefcountedReturnFunc (ReturnRefcounted), new Gtksharp.GCFunc (GC)); if (ref1.Serial != Refcounted.LastSerial || Opaquetest.Error) Error ("Error during Refcounted.Check. Expected {0}, Got {1}", Refcounted.LastSerial, ref1.Serial); handle = ref1.Handle; @@ -261,7 +261,7 @@ public class OpaqueTest { Console.WriteLine ("Testing handing over a C-owned refcounted to a C method that will free it"); ret_ref = new Refcounted (); ret_ref.Owned = false; - ref1 = Refcounted.CheckUnref (ReturnRefcounted, GC); + ref1 = Refcounted.CheckUnref (new Gtksharp.RefcountedReturnFunc (ReturnRefcounted), new Gtksharp.GCFunc (GC)); if (Opaquetest.Error) Error ("Error during Refcounted.CheckUnref."); Opaquetest.ExpectError = true; diff --git a/sample/valtest/Valtest.cs b/sample/valtest/Valtest.cs index f30fa44bf..29b223648 100644 --- a/sample/valtest/Valtest.cs +++ b/sample/valtest/Valtest.cs @@ -89,20 +89,20 @@ public class Valtest { try { val = new GLib.Value (ENUM_VAL); - if ((Gtk.ArrowType)val != ENUM_VAL) - CVError ("enum cast", ENUM_VAL, (Gtk.ArrowType)val, val.Val); - if ((Gtk.ArrowType)val.Val != ENUM_VAL) - CVError ("enum Val", ENUM_VAL, (Gtk.ArrowType)val, val.Val); + if ((Gtk.ArrowType)(Enum)val != ENUM_VAL) + CVError ("enum cast", ENUM_VAL, (Gtk.ArrowType)(Enum)val, val.Val); + if ((Gtk.ArrowType)(Enum)val.Val != ENUM_VAL) + CVError ("enum Val", ENUM_VAL, (Gtk.ArrowType)(Enum)val, val.Val); } catch (Exception e) { ExceptionError ("enum", e); } try { val = new GLib.Value (FLAGS_VAL); - if ((Gtk.AttachOptions)val != FLAGS_VAL) - CVError ("flags cast", FLAGS_VAL, (Gtk.AttachOptions)val, val.Val); - if ((Gtk.AttachOptions)val.Val != FLAGS_VAL) - CVError ("flags Val", FLAGS_VAL, (Gtk.AttachOptions)val, val.Val); + if ((Gtk.AttachOptions)(Enum)val != FLAGS_VAL) + CVError ("flags cast", FLAGS_VAL, (Gtk.AttachOptions)(Enum)val, val.Val); + if ((Gtk.AttachOptions)(Enum)val.Val != FLAGS_VAL) + CVError ("flags Val", FLAGS_VAL, (Gtk.AttachOptions)(Enum)val, val.Val); } catch (Exception e) { ExceptionError ("flags", e); }