From acc160cd0140f95be1d68cfa1e3811bee90dadd3 Mon Sep 17 00:00:00 2001 From: Rachel Hestilow Date: Sun, 23 Jun 2002 18:49:33 +0000 Subject: [PATCH] 2002-06-23 Rachel Hestilow * glib/Object.cs, glib/SList.cs, glib/Value.cs, gtk/Application.cs: Move documentation to right before their actual methods, rather than the DllImported ones. * generator/Method.cs: Generate documentation before the actual method and not the DllImport. svn path=/trunk/gtk-sharp/; revision=5423 --- ChangeLog | 9 ++++ generator/Method.cs | 12 +++-- glib/Object.cs | 16 +++---- glib/SList.cs | 6 +-- glib/Value.cs | 108 ++++++++++++++++++++++---------------------- gtk/Application.cs | 11 ++--- 6 files changed, 87 insertions(+), 75 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80f1c407a..2059eaf57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2002-06-23 Rachel Hestilow + + * glib/Object.cs, glib/SList.cs, glib/Value.cs, gtk/Application.cs: + Move documentation to right before their actual methods, rather + than the DllImported ones. + + * generator/Method.cs: Generate documentation before the actual + method and not the DllImport. + 2002-06-23 Rachel Hestilow * generator/ClassBase.cs: Add accessors for methods and signals. diff --git a/generator/Method.cs b/generator/Method.cs index ef74bad80..8c0580589 100644 --- a/generator/Method.cs +++ b/generator/Method.cs @@ -250,16 +250,18 @@ namespace GtkSharp.Generation { if (comp != null && !comp.is_set) comp = null; } - else { + + GenerateImport (sw); + if (comp != null && s_ret == comp.parms.AccessorReturnType) + comp.GenerateImport (sw); + + if (!(is_set || is_get)) + { sw.WriteLine("\t\t/// " + Name + " Method "); sw.WriteLine("\t\t/// To be completed "); sw.WriteLine(); } - GenerateImport (sw); - if (comp != null && s_ret == comp.parms.AccessorReturnType) - comp.GenerateImport (sw); - sw.Write("\t\t"); if (protection != "") sw.Write("{0} ", protection); diff --git a/glib/Object.cs b/glib/Object.cs index 40d3b7413..fb9e0d71c 100644 --- a/glib/Object.cs +++ b/glib/Object.cs @@ -192,6 +192,10 @@ namespace GLib { Data [key] = val; } + [DllImport("gobject-2.0")] + static extern void g_object_get_property ( + IntPtr obj, string name, IntPtr val); + /// /// GetProperty Method /// @@ -200,15 +204,15 @@ namespace GLib { /// Accesses a Value Property. /// - [DllImport("gobject-2.0")] - static extern void g_object_get_property ( - IntPtr obj, string name, IntPtr val); - public void GetProperty (String name, GLib.Value val) { g_object_get_property (Raw, name, val.Handle); } + [DllImport("gobject-2.0")] + static extern void g_object_set_property ( + IntPtr obj, string name, IntPtr val); + /// /// SetProperty Method /// @@ -217,10 +221,6 @@ namespace GLib { /// Accesses a Value Property. /// - [DllImport("gobject-2.0")] - static extern void g_object_set_property ( - IntPtr obj, string name, IntPtr val); - public void SetProperty (String name, GLib.Value val) { g_object_set_property (Raw, name, val.Handle); diff --git a/glib/SList.cs b/glib/SList.cs index ef62b90a6..efe145806 100644 --- a/glib/SList.cs +++ b/glib/SList.cs @@ -31,6 +31,9 @@ namespace GLib { g_slist_free (list_ptr); } + [DllImport("gobject-2.0")] + static extern IntPtr g_slist_append(IntPtr l, IntPtr d); + /// /// Handle Property /// @@ -39,9 +42,6 @@ namespace GLib { /// A raw GSList reference for marshaling situations. /// - [DllImport("gobject-2.0")] - static extern IntPtr g_slist_append(IntPtr l, IntPtr d); - public IntPtr Handle { get { if (list_ptr != IntPtr.Zero) diff --git a/glib/Value.cs b/glib/Value.cs index 5bfe6d3ba..9fc4fd38c 100755 --- a/glib/Value.cs +++ b/glib/Value.cs @@ -65,6 +65,10 @@ namespace GLib { _val = gtksharp_value_create_from_property (obj, prop_name); } + [DllImport("gobject-2.0")] + static extern void g_value_set_boolean (IntPtr val, + bool data); + /// /// Value Constructor /// @@ -73,15 +77,15 @@ namespace GLib { /// Constructs a Value from a specified boolean. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_boolean (IntPtr val, - bool data); public Value (bool val) { _val = gtksharp_value_create(TypeFundamentals.TypeBoolean); g_value_set_boolean (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_boxed (IntPtr val, IntPtr data); + /// /// Value Constructor /// @@ -90,14 +94,15 @@ namespace GLib { /// Constructs a Value from a specified boxed type. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_boxed (IntPtr val, IntPtr data); public Value (GLib.Boxed val) { _val = gtksharp_value_create(TypeFundamentals.TypeBoxed); g_value_set_boxed (_val, val.Handle); } + [DllImport("gobject-2.0")] + static extern void g_value_set_double (IntPtr val, double data); + /// /// Value Constructor /// @@ -106,15 +111,15 @@ namespace GLib { /// Constructs a Value from a specified double. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_double (IntPtr val, double data); - public Value (double val) { _val = gtksharp_value_create (TypeFundamentals.TypeDouble); g_value_set_double (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_float (IntPtr val, float data); + /// /// Value Constructor /// @@ -123,15 +128,15 @@ namespace GLib { /// Constructs a Value from a specified float. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_float (IntPtr val, float data); - public Value (float val) { _val = gtksharp_value_create (TypeFundamentals.TypeFloat); g_value_set_float (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_int (IntPtr val, int data); + /// /// Value Constructor /// @@ -140,15 +145,15 @@ namespace GLib { /// Constructs a Value from a specified integer. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_int (IntPtr val, int data); - public Value (int val) { _val = gtksharp_value_create (TypeFundamentals.TypeInt); g_value_set_int (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_object (IntPtr val, IntPtr data); + /// /// Value Constructor /// @@ -157,15 +162,15 @@ namespace GLib { /// Constructs a Value from a specified object. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_object (IntPtr val, IntPtr data); - public Value (GLib.Object val) { _val = gtksharp_value_create (TypeFundamentals.TypeObject); g_value_set_object (_val, val.Handle); } + [DllImport("gobject-2.0")] + static extern void g_value_set_pointer (IntPtr val, IntPtr data); + /// /// Value Constructor /// @@ -174,15 +179,15 @@ namespace GLib { /// Constructs a Value from a specified pointer. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_pointer (IntPtr val, IntPtr data); - public Value (IntPtr val) { _val = gtksharp_value_create (TypeFundamentals.TypePointer); g_value_set_pointer (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_string (IntPtr val, string data); + /// /// Value Constructor /// @@ -191,15 +196,15 @@ namespace GLib { /// Constructs a Value from a specified string. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_string (IntPtr val, string data); - public Value (string val) { _val = gtksharp_value_create (TypeFundamentals.TypeString); g_value_set_string (_val, val); } + [DllImport("gobject-2.0")] + static extern void g_value_set_uint (IntPtr val, uint data); + /// /// Value Constructor /// @@ -208,15 +213,15 @@ namespace GLib { /// Constructs a Value from a specified uint. /// - [DllImport("gobject-2.0")] - static extern void g_value_set_uint (IntPtr val, uint data); - public Value (uint val) { _val = gtksharp_value_create (TypeFundamentals.TypeUInt); g_value_set_uint (_val, val); } + [DllImport("gobject-2.0")] + static extern bool g_value_get_boolean (IntPtr val); + /// /// Value to Boolean Conversion /// @@ -227,9 +232,6 @@ namespace GLib { /// boolean value. /// - [DllImport("gobject-2.0")] - static extern bool g_value_get_boolean (IntPtr val); - public static explicit operator bool (Value val) { // FIXME: Insert an appropriate exception here if @@ -237,6 +239,9 @@ namespace GLib { return g_value_get_boolean (val._val); } + [DllImport("gobject-2.0")] + static extern IntPtr g_value_get_boxed (IntPtr val); + /// /// Value to Boxed Conversion /// @@ -247,9 +252,6 @@ namespace GLib { /// boxed type value. /// - [DllImport("gobject-2.0")] - static extern IntPtr g_value_get_boxed (IntPtr val); - public static explicit operator GLib.Boxed (Value val) { // FIXME: Insert an appropriate exception here if @@ -258,6 +260,9 @@ namespace GLib { return null; } + [DllImport("gobject-2.0")] + static extern double g_value_get_double (IntPtr val); + /// /// Value to Double Conversion /// @@ -268,9 +273,6 @@ namespace GLib { /// double value. /// - [DllImport("gobject-2.0")] - static extern double g_value_get_double (IntPtr val); - public static explicit operator double (Value val) { // FIXME: Insert an appropriate exception here if @@ -278,6 +280,9 @@ namespace GLib { return g_value_get_double (val._val); } + [DllImport("gobject-2.0")] + static extern float g_value_get_float (IntPtr val); + /// /// Value to Float Conversion /// @@ -288,9 +293,6 @@ namespace GLib { /// float value. /// - [DllImport("gobject-2.0")] - static extern float g_value_get_float (IntPtr val); - public static explicit operator float (Value val) { // FIXME: Insert an appropriate exception here if @@ -298,6 +300,9 @@ namespace GLib { return g_value_get_float (val._val); } + [DllImport("gobject-2.0")] + static extern int g_value_get_int (IntPtr val); + /// /// Value to Integer Conversion /// @@ -308,9 +313,6 @@ namespace GLib { /// integer value. /// - [DllImport("gobject-2.0")] - static extern int g_value_get_int (IntPtr val); - public static explicit operator int (Value val) { // FIXME: Insert an appropriate exception here if @@ -318,6 +320,9 @@ namespace GLib { return g_value_get_int (val._val); } + [DllImport("gobject-2.0")] + static extern IntPtr g_value_get_object (IntPtr val); + /// /// Value to Object Conversion /// @@ -328,9 +333,6 @@ namespace GLib { /// object value. /// - [DllImport("gobject-2.0")] - static extern IntPtr g_value_get_object (IntPtr val); - public static explicit operator GLib.Object (Value val) { // FIXME: Insert an appropriate exception here if @@ -338,6 +340,9 @@ namespace GLib { return GLib.Object.GetObject(g_value_get_object (val._val)); } + [DllImport("gobject-2.0")] + static extern IntPtr g_value_get_pointer (IntPtr val); + /// /// Value to Pointer Conversion /// @@ -348,9 +353,6 @@ namespace GLib { /// pointer value. /// - [DllImport("gobject-2.0")] - static extern IntPtr g_value_get_pointer (IntPtr val); - public static explicit operator IntPtr (Value val) { // FIXME: Insert an appropriate exception here if @@ -358,6 +360,9 @@ namespace GLib { return g_value_get_pointer (val._val); } + [DllImport("gobject-2.0")] + static extern string g_value_get_string (IntPtr val); + /// /// Value to String Conversion /// @@ -368,9 +373,6 @@ namespace GLib { /// string value. /// - [DllImport("gobject-2.0")] - static extern string g_value_get_string (IntPtr val); - public static explicit operator String (Value val) { // FIXME: Insert an appropriate exception here if @@ -378,6 +380,9 @@ namespace GLib { return g_value_get_string (val._val); } + [DllImport("gobject-2.0")] + static extern uint g_value_get_uint (IntPtr val); + /// /// Value to Unsigned Integer Conversion /// @@ -388,9 +393,6 @@ namespace GLib { /// unsigned integer value. /// - [DllImport("gobject-2.0")] - static extern uint g_value_get_uint (IntPtr val); - public static explicit operator uint (Value val) { // FIXME: Insert an appropriate exception here if diff --git a/gtk/Application.cs b/gtk/Application.cs index 3f034ab2e..c5a5ca3cb 100755 --- a/gtk/Application.cs +++ b/gtk/Application.cs @@ -48,6 +48,9 @@ namespace Gtk { gtk_init (ref argc, ref args); } + [DllImport("gtk-x11-2.0")] + static extern void gtk_main (); + /// /// Run Method /// @@ -56,14 +59,13 @@ namespace Gtk { /// Begins the event loop iteration. /// - [DllImport("gtk-x11-2.0")] - static extern void gtk_main (); - public static void Run () { gtk_main (); } + [DllImport("gtk-x11-2.0")] + static extern void gtk_main_quit (); /// /// Quit Method @@ -73,9 +75,6 @@ namespace Gtk { /// Terminates the event loop iteration. /// - [DllImport("gtk-x11-2.0")] - static extern void gtk_main_quit (); - public static void Quit () { gtk_main_quit ();