[Gtk-sharp-list] patch for GLib.Value
Vladimir Vukicevic
vladimir@pobox.com
04 Oct 2002 09:46:38 -0700
--=-+JZRCJA7OGacZJiFPmrR
Content-Type: text/plain
Content-Transfer-Encoding: 7bit
Small patch that lets you create uninitialized GLib values to receive
out params from functions like TreeStore.GetValue().
- Vlad
--
Vladimir Vukicevic <vladimir@pobox.com>
--=-+JZRCJA7OGacZJiFPmrR
Content-Description:
Content-Disposition: attachment; filename=value-patch.diff
Content-Transfer-Encoding: quoted-printable
Content-Type: text/x-patch; charset=ANSI_X3.4-1968
Index: ChangeLog
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/ChangeLog,v
retrieving revision 1.227
diff -u -u -r1.227 ChangeLog
--- ChangeLog 4 Oct 2002 16:38:47 -0000 1.227
+++ ChangeLog 4 Oct 2002 16:46:27 -0000
@@ -1,3 +1,10 @@
+2002-10-04 Vladimir Vukicevic <vladimir@pobox.com>
+
+ * glib/Value.cs, glue/value.c: Added default constructor
+ to GLib.Value() that creates a new value with a type of
+ INVALID, and changed the glue function to not call
+ gtk_type_init if INVALID is passed.
+
2002-10-02 Vladimir Vukicevic <vladimir@pobox.com>
=20
* gtk/TreeView.custom: added TreeView Handle as argument
Index: glib/Value.cs
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/glib/Value.cs,v
retrieving revision 1.17
diff -u -u -r1.17 Value.cs
--- glib/Value.cs 3 Aug 2002 22:24:36 -0000 1.17
+++ glib/Value.cs 4 Oct 2002 16:46:27 -0000
@@ -54,6 +54,19 @@
/// <summary>
/// Value Constructor
/// </summary>
+ ///
+ /// <remarks>
+ /// Constructs a new empty value that can be used
+ /// to receive "out" GValue parameters.
+ /// </remarks>
+
+ public Value () {
+ _val =3D gtksharp_value_create (TypeFundamentals.TypeInvalid);
+ }
+
+ /// <summary>
+ /// Value Constructor
+ /// </summary>
///=20
/// <remarks>
/// Constructs a Value corresponding to the type of the
Index: glue/value.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/public/gtk-sharp/glue/value.c,v
retrieving revision 1.2
diff -u -u -r1.2 value.c
--- glue/value.c 5 Jun 2002 21:59:10 -0000 1.2
+++ glue/value.c 4 Oct 2002 16:46:27 -0000
@@ -11,7 +11,8 @@
gtksharp_value_create (GType g_type)
{
GValue *val =3D g_new0 (GValue, 1);
- val =3D g_value_init (val, g_type);
+ if (g_type !=3D G_TYPE_INVALID)
+ val =3D g_value_init (val, g_type);
return val;
}
=20
--=-+JZRCJA7OGacZJiFPmrR--