From 50d266b30b6051924689181e4e413725d07c1d43 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Fri, 7 May 2004 19:33:09 +0000 Subject: [PATCH] 2004-05-07 Mike Kestner * gtk/Gtk.metadata : hide ListStore and TreeStore newv ctors. * gtk/ListStore.custom : rework the ctors for subclassing. * gtk/TreeStore.custom : rework the ctors for subclassing. svn path=/trunk/gtk-sharp/; revision=26941 --- ChangeLog | 6 ++++++ gtk/Gtk.metadata | 6 ++---- gtk/ListStore.custom | 17 +++++++++++------ gtk/TreeStore.custom | 24 +++++++++++++++--------- 4 files changed, 34 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6d3bbb4d5..b3d500430 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-05-07 Mike Kestner + + * gtk/Gtk.metadata : hide ListStore and TreeStore newv ctors. + * gtk/ListStore.custom : rework the ctors for subclassing. + * gtk/TreeStore.custom : rework the ctors for subclassing. + 2004-05-07 Mike Kestner * gtk/Gtk.metadata : hide HScale and VScale with_range ctors. diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 7c111c8a4..6e71e9f7a 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -127,8 +127,7 @@ 1 1 ScrollAdjustmentsSet - 1 - 1 + 1 out out out @@ -217,8 +216,7 @@ out out 1 - 1 - 1 + 1 out out out diff --git a/gtk/ListStore.custom b/gtk/ListStore.custom index 04c3a5d87..abf37cac9 100644 --- a/gtk/ListStore.custom +++ b/gtk/ListStore.custom @@ -80,25 +80,30 @@ return AppendValues ((Array) values); } + public ListStore (params GLib.GType[] types) : base (IntPtr.Zero) + { + CreateNativeObject (new string [0], new GLib.Value [0]); + SetColumnTypes (types); + } + public ListStore (params Type[] types) : base (IntPtr.Zero) { - if (GetType() != typeof (ListStore)) - throw new InvalidOperationException ("Can't chain to this constructor from subclasses."); - IntPtr[] ctypes = new IntPtr[types.Length]; + GLib.GType[] gtypes = new GLib.GType[types.Length]; int i = 0; foreach (Type type in types) { GLib.GType ctype = GLibSharp.TypeConverter.LookupType (type); if (ctype == GLib.GType.None) { - ctypes[i] = GLibSharp.ManagedValue.GType.Val; + gtypes[i] = GLibSharp.ManagedValue.GType; } else if (ctype == GLib.GType.Invalid) { throw new Exception ("Unknown type"); } else { - ctypes[i] = ctype.Val; + gtypes[i] = ctype; } i++; } - Raw = gtk_list_store_newv (ctypes.Length, ctypes); + CreateNativeObject (new string [0], new GLib.Value [0]); + SetColumnTypes (gtypes); } public object GetValue(Gtk.TreeIter iter, int column) { diff --git a/gtk/TreeStore.custom b/gtk/TreeStore.custom index 192e69052..0cc64e43d 100644 --- a/gtk/TreeStore.custom +++ b/gtk/TreeStore.custom @@ -1,8 +1,10 @@ // Gtk.TreeStore.Custom - Gtk TreeStore class customizations // -// Author: Kristian Rietveld +// Authors: Kristian Rietveld +// Mike Kestner // -// (c) 2002 Kristian Rietveld +// Copyright (c) 2002 Kristian Rietveld +// Copyright (c) 2004 Novell, Inc. // // This code is inserted after the automatically generated code. @@ -125,26 +127,30 @@ return AppendValues ((Array) values); } + public TreeStore (params GLib.GType[] types) : base (IntPtr.Zero) + { + CreateNativeObject (new string [0], new GLib.Value [0]); + SetColumnTypes (types); + } + public TreeStore (params Type[] types) : base (IntPtr.Zero) { - if (GetType() != typeof (TreeStore)) - throw new InvalidOperationException ("Can't chain to this constructor from subclasses."); - - IntPtr[] ctypes = new IntPtr[types.Length]; + GLib.GType[] gtypes = new GLib.GType[types.Length]; int i = 0; foreach (Type type in types) { GLib.GType ctype = GLibSharp.TypeConverter.LookupType (type); if (ctype == GLib.GType.None) { - ctypes[i] = GLibSharp.ManagedValue.GType.Val; + gtypes[i] = GLibSharp.ManagedValue.GType; } else if (ctype == GLib.GType.Invalid) { throw new Exception ("Unknown type"); } else { - ctypes[i] = ctype.Val; + gtypes[i] = ctype; } i++; } - Raw = gtk_tree_store_newv (ctypes.Length, ctypes); + CreateNativeObject (new string [0], new GLib.Value [0]); + SetColumnTypes (gtypes); } public object GetValue (Gtk.TreeIter iter, int column) {