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>
* generator/ClassBase.cs: Add accessors for methods and signals.

View file

@ -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/// <summary> " + Name + " Method </summary>");
sw.WriteLine("\t\t/// <remarks> To be completed </remarks>");
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);

View file

@ -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);
/// <summary>
/// GetProperty Method
/// </summary>
@ -200,15 +204,15 @@ namespace GLib {
/// Accesses a Value Property.
/// </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)
{
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>
/// SetProperty Method
/// </summary>
@ -217,10 +221,6 @@ namespace GLib {
/// Accesses a Value Property.
/// </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)
{
g_object_set_property (Raw, name, val.Handle);

View file

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

View file

@ -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);
/// <summary>
/// Value Constructor
/// </summary>
@ -73,15 +77,15 @@ namespace GLib {
/// Constructs a Value from a specified boolean.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -90,14 +94,15 @@ namespace GLib {
/// Constructs a Value from a specified boxed type.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -106,15 +111,15 @@ namespace GLib {
/// Constructs a Value from a specified double.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -123,15 +128,15 @@ namespace GLib {
/// Constructs a Value from a specified float.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -140,15 +145,15 @@ namespace GLib {
/// Constructs a Value from a specified integer.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -157,15 +162,15 @@ namespace GLib {
/// Constructs a Value from a specified object.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -174,15 +179,15 @@ namespace GLib {
/// Constructs a Value from a specified pointer.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -191,15 +196,15 @@ namespace GLib {
/// Constructs a Value from a specified string.
/// </remarks>
[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);
/// <summary>
/// Value Constructor
/// </summary>
@ -208,15 +213,15 @@ namespace GLib {
/// Constructs a Value from a specified uint.
/// </remarks>
[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);
/// <summary>
/// Value to Boolean Conversion
/// </summary>
@ -227,9 +232,6 @@ namespace GLib {
/// boolean value.
/// </remarks>
[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);
/// <summary>
/// Value to Boxed Conversion
/// </summary>
@ -247,9 +252,6 @@ namespace GLib {
/// boxed type value.
/// </remarks>
[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);
/// <summary>
/// Value to Double Conversion
/// </summary>
@ -268,9 +273,6 @@ namespace GLib {
/// double value.
/// </remarks>
[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);
/// <summary>
/// Value to Float Conversion
/// </summary>
@ -288,9 +293,6 @@ namespace GLib {
/// float value.
/// </remarks>
[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);
/// <summary>
/// Value to Integer Conversion
/// </summary>
@ -308,9 +313,6 @@ namespace GLib {
/// integer value.
/// </remarks>
[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);
/// <summary>
/// Value to Object Conversion
/// </summary>
@ -328,9 +333,6 @@ namespace GLib {
/// object value.
/// </remarks>
[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);
/// <summary>
/// Value to Pointer Conversion
/// </summary>
@ -348,9 +353,6 @@ namespace GLib {
/// pointer value.
/// </remarks>
[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);
/// <summary>
/// Value to String Conversion
/// </summary>
@ -368,9 +373,6 @@ namespace GLib {
/// string value.
/// </remarks>
[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);
/// <summary>
/// Value to Unsigned Integer Conversion
/// </summary>
@ -388,9 +393,6 @@ namespace GLib {
/// unsigned integer value.
/// </remarks>
[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

View file

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