2002-06-23 Rachel Hestilow <hestilow@ximian.com>

* 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
This commit is contained in:
Rachel Hestilow 2002-06-23 18:49:33 +00:00
parent 7fb558bea0
commit acc160cd01
6 changed files with 87 additions and 75 deletions

View file

@ -1,3 +1,12 @@
2002-06-23 Rachel Hestilow <hestilow@ximian.com>
* 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 <hestilow@ximian.com> 2002-06-23 Rachel Hestilow <hestilow@ximian.com>
* generator/ClassBase.cs: Add accessors for methods and signals. * generator/ClassBase.cs: Add accessors for methods and signals.

View file

@ -250,16 +250,18 @@ namespace GtkSharp.Generation {
if (comp != null && !comp.is_set) if (comp != null && !comp.is_set)
comp = null; 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/// <summary> " + Name + " Method </summary>"); sw.WriteLine("\t\t/// <summary> " + Name + " Method </summary>");
sw.WriteLine("\t\t/// <remarks> To be completed </remarks>"); sw.WriteLine("\t\t/// <remarks> To be completed </remarks>");
sw.WriteLine(); sw.WriteLine();
} }
GenerateImport (sw);
if (comp != null && s_ret == comp.parms.AccessorReturnType)
comp.GenerateImport (sw);
sw.Write("\t\t"); sw.Write("\t\t");
if (protection != "") if (protection != "")
sw.Write("{0} ", protection); sw.Write("{0} ", protection);

View file

@ -192,6 +192,10 @@ namespace GLib {
Data [key] = val; Data [key] = val;
} }
[DllImport("gobject-2.0")]
static extern void g_object_get_property (
IntPtr obj, string name, IntPtr val);
/// <summary> /// <summary>
/// GetProperty Method /// GetProperty Method
/// </summary> /// </summary>
@ -200,15 +204,15 @@ namespace GLib {
/// Accesses a Value Property. /// Accesses a Value Property.
/// </remarks> /// </remarks>
[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) public void GetProperty (String name, GLib.Value val)
{ {
g_object_get_property (Raw, name, val.Handle); 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);
/// <summary> /// <summary>
/// SetProperty Method /// SetProperty Method
/// </summary> /// </summary>
@ -217,10 +221,6 @@ namespace GLib {
/// Accesses a Value Property. /// Accesses a Value Property.
/// </remarks> /// </remarks>
[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) public void SetProperty (String name, GLib.Value val)
{ {
g_object_set_property (Raw, name, val.Handle); g_object_set_property (Raw, name, val.Handle);

View file

@ -31,6 +31,9 @@ namespace GLib {
g_slist_free (list_ptr); g_slist_free (list_ptr);
} }
[DllImport("gobject-2.0")]
static extern IntPtr g_slist_append(IntPtr l, IntPtr d);
/// <summary> /// <summary>
/// Handle Property /// Handle Property
/// </summary> /// </summary>
@ -39,9 +42,6 @@ namespace GLib {
/// A raw GSList reference for marshaling situations. /// A raw GSList reference for marshaling situations.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern IntPtr g_slist_append(IntPtr l, IntPtr d);
public IntPtr Handle { public IntPtr Handle {
get { get {
if (list_ptr != IntPtr.Zero) if (list_ptr != IntPtr.Zero)

View file

@ -65,6 +65,10 @@ namespace GLib {
_val = gtksharp_value_create_from_property (obj, prop_name); _val = gtksharp_value_create_from_property (obj, prop_name);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_boolean (IntPtr val,
bool data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -73,15 +77,15 @@ namespace GLib {
/// Constructs a Value from a specified boolean. /// Constructs a Value from a specified boolean.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_boolean (IntPtr val,
bool data);
public Value (bool val) public Value (bool val)
{ {
_val = gtksharp_value_create(TypeFundamentals.TypeBoolean); _val = gtksharp_value_create(TypeFundamentals.TypeBoolean);
g_value_set_boolean (_val, val); g_value_set_boolean (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_boxed (IntPtr val, IntPtr data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -90,14 +94,15 @@ namespace GLib {
/// Constructs a Value from a specified boxed type. /// Constructs a Value from a specified boxed type.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_boxed (IntPtr val, IntPtr data);
public Value (GLib.Boxed val) public Value (GLib.Boxed val)
{ {
_val = gtksharp_value_create(TypeFundamentals.TypeBoxed); _val = gtksharp_value_create(TypeFundamentals.TypeBoxed);
g_value_set_boxed (_val, val.Handle); g_value_set_boxed (_val, val.Handle);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_double (IntPtr val, double data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -106,15 +111,15 @@ namespace GLib {
/// Constructs a Value from a specified double. /// Constructs a Value from a specified double.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_double (IntPtr val, double data);
public Value (double val) public Value (double val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeDouble); _val = gtksharp_value_create (TypeFundamentals.TypeDouble);
g_value_set_double (_val, val); g_value_set_double (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_float (IntPtr val, float data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -123,15 +128,15 @@ namespace GLib {
/// Constructs a Value from a specified float. /// Constructs a Value from a specified float.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_float (IntPtr val, float data);
public Value (float val) public Value (float val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeFloat); _val = gtksharp_value_create (TypeFundamentals.TypeFloat);
g_value_set_float (_val, val); g_value_set_float (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_int (IntPtr val, int data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -140,15 +145,15 @@ namespace GLib {
/// Constructs a Value from a specified integer. /// Constructs a Value from a specified integer.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_int (IntPtr val, int data);
public Value (int val) public Value (int val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeInt); _val = gtksharp_value_create (TypeFundamentals.TypeInt);
g_value_set_int (_val, val); g_value_set_int (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_object (IntPtr val, IntPtr data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -157,15 +162,15 @@ namespace GLib {
/// Constructs a Value from a specified object. /// Constructs a Value from a specified object.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_object (IntPtr val, IntPtr data);
public Value (GLib.Object val) public Value (GLib.Object val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeObject); _val = gtksharp_value_create (TypeFundamentals.TypeObject);
g_value_set_object (_val, val.Handle); g_value_set_object (_val, val.Handle);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_pointer (IntPtr val, IntPtr data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -174,15 +179,15 @@ namespace GLib {
/// Constructs a Value from a specified pointer. /// Constructs a Value from a specified pointer.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_pointer (IntPtr val, IntPtr data);
public Value (IntPtr val) public Value (IntPtr val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypePointer); _val = gtksharp_value_create (TypeFundamentals.TypePointer);
g_value_set_pointer (_val, val); g_value_set_pointer (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_string (IntPtr val, string data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -191,15 +196,15 @@ namespace GLib {
/// Constructs a Value from a specified string. /// Constructs a Value from a specified string.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_string (IntPtr val, string data);
public Value (string val) public Value (string val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeString); _val = gtksharp_value_create (TypeFundamentals.TypeString);
g_value_set_string (_val, val); g_value_set_string (_val, val);
} }
[DllImport("gobject-2.0")]
static extern void g_value_set_uint (IntPtr val, uint data);
/// <summary> /// <summary>
/// Value Constructor /// Value Constructor
/// </summary> /// </summary>
@ -208,15 +213,15 @@ namespace GLib {
/// Constructs a Value from a specified uint. /// Constructs a Value from a specified uint.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern void g_value_set_uint (IntPtr val, uint data);
public Value (uint val) public Value (uint val)
{ {
_val = gtksharp_value_create (TypeFundamentals.TypeUInt); _val = gtksharp_value_create (TypeFundamentals.TypeUInt);
g_value_set_uint (_val, val); g_value_set_uint (_val, val);
} }
[DllImport("gobject-2.0")]
static extern bool g_value_get_boolean (IntPtr val);
/// <summary> /// <summary>
/// Value to Boolean Conversion /// Value to Boolean Conversion
/// </summary> /// </summary>
@ -227,9 +232,6 @@ namespace GLib {
/// boolean value. /// boolean value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern bool g_value_get_boolean (IntPtr val);
public static explicit operator bool (Value val) public static explicit operator bool (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -237,6 +239,9 @@ namespace GLib {
return g_value_get_boolean (val._val); return g_value_get_boolean (val._val);
} }
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_boxed (IntPtr val);
/// <summary> /// <summary>
/// Value to Boxed Conversion /// Value to Boxed Conversion
/// </summary> /// </summary>
@ -247,9 +252,6 @@ namespace GLib {
/// boxed type value. /// boxed type value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_boxed (IntPtr val);
public static explicit operator GLib.Boxed (Value val) public static explicit operator GLib.Boxed (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -258,6 +260,9 @@ namespace GLib {
return null; return null;
} }
[DllImport("gobject-2.0")]
static extern double g_value_get_double (IntPtr val);
/// <summary> /// <summary>
/// Value to Double Conversion /// Value to Double Conversion
/// </summary> /// </summary>
@ -268,9 +273,6 @@ namespace GLib {
/// double value. /// double value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern double g_value_get_double (IntPtr val);
public static explicit operator double (Value val) public static explicit operator double (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -278,6 +280,9 @@ namespace GLib {
return g_value_get_double (val._val); return g_value_get_double (val._val);
} }
[DllImport("gobject-2.0")]
static extern float g_value_get_float (IntPtr val);
/// <summary> /// <summary>
/// Value to Float Conversion /// Value to Float Conversion
/// </summary> /// </summary>
@ -288,9 +293,6 @@ namespace GLib {
/// float value. /// float value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern float g_value_get_float (IntPtr val);
public static explicit operator float (Value val) public static explicit operator float (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -298,6 +300,9 @@ namespace GLib {
return g_value_get_float (val._val); return g_value_get_float (val._val);
} }
[DllImport("gobject-2.0")]
static extern int g_value_get_int (IntPtr val);
/// <summary> /// <summary>
/// Value to Integer Conversion /// Value to Integer Conversion
/// </summary> /// </summary>
@ -308,9 +313,6 @@ namespace GLib {
/// integer value. /// integer value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern int g_value_get_int (IntPtr val);
public static explicit operator int (Value val) public static explicit operator int (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -318,6 +320,9 @@ namespace GLib {
return g_value_get_int (val._val); return g_value_get_int (val._val);
} }
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_object (IntPtr val);
/// <summary> /// <summary>
/// Value to Object Conversion /// Value to Object Conversion
/// </summary> /// </summary>
@ -328,9 +333,6 @@ namespace GLib {
/// object value. /// object value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_object (IntPtr val);
public static explicit operator GLib.Object (Value val) public static explicit operator GLib.Object (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -338,6 +340,9 @@ namespace GLib {
return GLib.Object.GetObject(g_value_get_object (val._val)); return GLib.Object.GetObject(g_value_get_object (val._val));
} }
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_pointer (IntPtr val);
/// <summary> /// <summary>
/// Value to Pointer Conversion /// Value to Pointer Conversion
/// </summary> /// </summary>
@ -348,9 +353,6 @@ namespace GLib {
/// pointer value. /// pointer value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern IntPtr g_value_get_pointer (IntPtr val);
public static explicit operator IntPtr (Value val) public static explicit operator IntPtr (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -358,6 +360,9 @@ namespace GLib {
return g_value_get_pointer (val._val); return g_value_get_pointer (val._val);
} }
[DllImport("gobject-2.0")]
static extern string g_value_get_string (IntPtr val);
/// <summary> /// <summary>
/// Value to String Conversion /// Value to String Conversion
/// </summary> /// </summary>
@ -368,9 +373,6 @@ namespace GLib {
/// string value. /// string value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern string g_value_get_string (IntPtr val);
public static explicit operator String (Value val) public static explicit operator String (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if
@ -378,6 +380,9 @@ namespace GLib {
return g_value_get_string (val._val); return g_value_get_string (val._val);
} }
[DllImport("gobject-2.0")]
static extern uint g_value_get_uint (IntPtr val);
/// <summary> /// <summary>
/// Value to Unsigned Integer Conversion /// Value to Unsigned Integer Conversion
/// </summary> /// </summary>
@ -388,9 +393,6 @@ namespace GLib {
/// unsigned integer value. /// unsigned integer value.
/// </remarks> /// </remarks>
[DllImport("gobject-2.0")]
static extern uint g_value_get_uint (IntPtr val);
public static explicit operator uint (Value val) public static explicit operator uint (Value val)
{ {
// FIXME: Insert an appropriate exception here if // FIXME: Insert an appropriate exception here if

View file

@ -48,6 +48,9 @@ namespace Gtk {
gtk_init (ref argc, ref args); gtk_init (ref argc, ref args);
} }
[DllImport("gtk-x11-2.0")]
static extern void gtk_main ();
/// <summary> /// <summary>
/// Run Method /// Run Method
/// </summary> /// </summary>
@ -56,14 +59,13 @@ namespace Gtk {
/// Begins the event loop iteration. /// Begins the event loop iteration.
/// </remarks> /// </remarks>
[DllImport("gtk-x11-2.0")]
static extern void gtk_main ();
public static void Run () public static void Run ()
{ {
gtk_main (); gtk_main ();
} }
[DllImport("gtk-x11-2.0")]
static extern void gtk_main_quit ();
/// <summary> /// <summary>
/// Quit Method /// Quit Method
@ -73,9 +75,6 @@ namespace Gtk {
/// Terminates the event loop iteration. /// Terminates the event loop iteration.
/// </remarks> /// </remarks>
[DllImport("gtk-x11-2.0")]
static extern void gtk_main_quit ();
public static void Quit () public static void Quit ()
{ {
gtk_main_quit (); gtk_main_quit ();