2004-02-11 Mike Kestner <mkestner@ximian.com>

* gtk/*.custom : return 0 length arrays, not null.

svn path=/trunk/gtk-sharp/; revision=22992
This commit is contained in:
Mike Kestner 2004-02-11 21:58:47 +00:00
parent 1e87aeb079
commit 2419dff1d9
9 changed files with 17 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2004-02-11 Mike Kestner <mkestner@ximian.com>
* gtk/*.custom : return 0 length arrays, not null.
2004-02-11 Mike Kestner <mkestner@ximian.com>
* gtk/Gtk.metadata : hide the GList API

View file

@ -11,7 +11,7 @@ public Widget[] Children {
get {
IntPtr list_ptr = gtk_container_get_children (Handle);
if (list_ptr == IntPtr.Zero)
return null;
return new Widget [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.Widget));
Widget[] result = new Widget [list.Count];
@ -32,7 +32,7 @@ public Widget[] FocusChain {
IntPtr list_ptr;
bool success = gtk_container_get_focus_chain (Handle, out list_ptr);
if (!success)
return null;
return new Widget [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.Widget));
Widget[] result = new Widget [list.Count];

View file

@ -15,6 +15,7 @@
<attr path="/api/namespace/boxed[@cname='GtkTextIter']/method[@name='ForwardToTagToggle']/*/*[@type='GtkTextTag*']" name="null_ok">1</attr>
<attr path="/api/namespace/boxed[@cname='GtkTreePath']/method[@name='GetIndices']" name="hidden">1</attr>
<attr path="/api/namespace/callback[@cname='GtkClipboardGetFunc']/*/*[@type='GtkSelectionData*']" name="pass_as">ref</attr>
<attr path="/api/namespace/class[@cname='GtkAccel_']/method[@name='GroupsFromObject']" name="hidden">1</attr>
<attr path="/api/namespace/class[@cname='GtkAccelerator_']/method[@name='GetDefaultModMask']/return-type" name="type">GdkModifierType</attr>
<attr path="/api/namespace/class[@cname='GtkDrag_']/method[@name='DestSet']/*/*[@name='targets']" name="array">1</attr>
<attr path="/api/namespace/class[@cname='GtkDrag_']/method[@name='DestSet']/*/*[@name='targets']" name="null_ok">1</attr>

View file

@ -11,7 +11,7 @@
get {
IntPtr raw_ret = gtk_text_child_anchor_get_widgets (Handle);
if (raw_ret == IntPtr.Zero)
return null;
return new Widget [0];
GLib.List list = new GLib.List(raw_ret, typeof (Widget));
Widget[] result = new Widget [list.Count];
for (int i = 0; i < list.Count; i++)

View file

@ -13,7 +13,7 @@
IntPtr list_ptr = gtk_tree_selection_get_selected_rows (Handle, out model_handle);
model = (Gtk.TreeModel) GLib.Object.GetObject(model_handle);
if (list_ptr == IntPtr.Zero)
return null;
return new TreePath [0];
GLib.List list = new GLib.List (list_ptr, typeof (Gtk.TreePath));
TreePath[] result = new TreePath [list.Count];

View file

@ -22,7 +22,7 @@
get {
IntPtr raw_ret = gtk_tree_view_get_columns (Handle);
if (raw_ret == IntPtr.Zero)
return null;
return new TreeViewColumn [0];
GLib.List list = new GLib.List (raw_ret, typeof (Gtk.TreeViewColumn));
TreeViewColumn[] result = new TreeViewColumn [list.Count];
for (int i = 0; i < list.Count; i++)

View file

@ -39,7 +39,7 @@
get {
IntPtr raw_ret = gtk_tree_view_column_get_cell_renderers (Handle);
if (raw_ret == IntPtr.Zero)
return null;
return new CellRenderer [0];
GLib.List list = new GLib.List (raw_ret, typeof (CellRenderer));
CellRenderer[] result = new CellRenderer [list.Count];
for (int i = 0; i < list.Count; i++)

View file

@ -35,6 +35,8 @@
public static Gdk.Pixbuf[] DefaultIconList {
get {
IntPtr raw_ret = gtk_window_get_default_icon_list();
if (raw_ret == IntPtr.Zero)
return new Gdk.Pixbuf [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gdk.Pixbuf));
Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count];
for (int i = 0; i < list.Count; i++)
@ -69,6 +71,8 @@
public Gdk.Pixbuf[] IconList {
get {
IntPtr raw_ret = gtk_window_get_icon_list(Handle);
if (raw_ret == IntPtr.Zero)
return new Gdk.Pixbuf [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gdk.Pixbuf));
Gdk.Pixbuf[] result = new Gdk.Pixbuf [list.Count];
for (int i = 0; i < list.Count; i++)
@ -110,7 +114,7 @@
{
IntPtr raw_ret = gtk_window_list_toplevels();
if (raw_ret == IntPtr.Zero)
return null;
return new Window [0];
GLib.List list = new GLib.List(raw_ret, typeof (Gtk.Window));
Window[] result = new Window [list.Count];

View file

@ -12236,7 +12236,7 @@
<parameter type="GdkModifierType" name="accel_mods" />
</parameters>
</method>
<method name="GroupsFromObject" cname="gtk_accel_groups_from_object" shared="true">
<method name="GroupsFromObject" cname="gtk_accel_groups_from_object" shared="true" hidden="1">
<return-type type="GSList*" />
<parameters>
<parameter type="GObject*" name="object" />