2005-06-23 Mike Kestner <mkestner@novell.com>

* generator/ReturnValue.cs : support owned and elements_owned for lists.
	* glib/List.cs : add ctor overloads for memory mgmt.
	* glib/ListBase.cs : add ctor overloads for memory mgmt. Dispose
	elements if specified.
	* glib/SList.cs : add ctor overloads for memory mgmt.
	* gnome/Gnome.metadata : unhide and generate a List prop.
	* gnomevfs/Gnomevfs.metadata : unhide and generate a List prop.
	* gtk/FileChooser.custom : new. add hidden props.
	* gtk/FileChooserButton.custom : new. impl hidden props.
	* gtk/FileChooserDialog.custom : remove some List props and use the
	GLib.Marshaller for the remaining ones..
	* gtk/FileChooserWidget.custom : remove some List props and use the
	GLib.Marshaller for the remaining ones..
	* gtk/Gtk.metadata : unhide and let the generator do some List props.

svn path=/trunk/gtk-sharp/; revision=46457
This commit is contained in:
Mike Kestner 2005-06-23 22:28:06 +00:00
parent 0dba8bb0cb
commit eddfdc7910
18 changed files with 335 additions and 194 deletions

View File

@ -1,3 +1,20 @@
2005-06-23 Mike Kestner <mkestner@novell.com>
* generator/ReturnValue.cs : support owned and elements_owned for lists.
* glib/List.cs : add ctor overloads for memory mgmt.
* glib/ListBase.cs : add ctor overloads for memory mgmt. Dispose
elements if specified.
* glib/SList.cs : add ctor overloads for memory mgmt.
* gnome/Gnome.metadata : unhide and generate a List prop.
* gnomevfs/Gnomevfs.metadata : unhide and generate a List prop.
* gtk/FileChooser.custom : new. add hidden props.
* gtk/FileChooserButton.custom : new. impl hidden props.
* gtk/FileChooserDialog.custom : remove some List props and use the
GLib.Marshaller for the remaining ones..
* gtk/FileChooserWidget.custom : remove some List props and use the
GLib.Marshaller for the remaining ones..
* gtk/Gtk.metadata : unhide and let the generator do some List props.
2005-06-23 Mike Kestner <mkestner@novell.com>
* gconf/GConf/Client.cs : support add/remove of a single notify handle

View File

@ -123,5 +123,23 @@
</remarks>
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public List (IntPtr raw, Type element_type, bool owned, bool elements_owned);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
<Parameter Name="element_type" Type="System.Type" />
<Parameter Name="owned" Type="System.Boolean" />
<Parameter Name="elements_owned" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="raw">Pointer to the native list.</param>
<param name="element_type">The type of the elements contained in the list.</param>
<param name="owned"><see langword="true" /> if the native list needs to be released on Dispose.</param>
<param name="elements_owned"><see langword="true" /> if the list elements need to be released on Dispose.</param>
<summary>Creates a List.</summary>
<remarks>This type is only recommended for marshaling GList parameters and return values in bindings.</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@ -199,7 +199,11 @@
<value>an object of type <see cref="T:System.Boolean" /></value>
<remarks>Identifies the list as one that needs to be freed. Only set this to true if you want the object to release the associated native list when it is disposed.</remarks>
</Docs>
</Member>
<Attributes>
<Attribute>
<AttributeName>System.Obsolete(Message="Replaced by owned parameter on ctor.", IsError=False)</AttributeName>
</Attribute>
</Attributes></Member>
<Member MemberName="GetEnumerator">
<MemberSignature Language="C#" Value="public System.Collections.IEnumerator GetEnumerator ();" />
<MemberType>Method</MemberType>

View File

@ -64,5 +64,23 @@
<remarks />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public SList (IntPtr raw, Type element_type, bool owned, bool elements_owned);" />
<MemberType>Constructor</MemberType>
<Parameters>
<Parameter Name="raw" Type="System.IntPtr" />
<Parameter Name="element_type" Type="System.Type" />
<Parameter Name="owned" Type="System.Boolean" />
<Parameter Name="elements_owned" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="raw">Pointer to the native list.</param>
<param name="element_type">The type if the elements contained in the list.</param>
<param name="owned"><see langword="true" /> if the native list should be released on Dispose.</param>
<param name="elements_owned"><see langword="true" /> if the elements should be released on Dispose.</param>
<summary>Creates an SList.</summary>
<remarks>This type should only be used for marshaling GSList parameters and return values in bindings.</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@ -726,5 +726,65 @@
<since version="Gtk# 2.6" />
</Docs>
</Member>
<Member MemberName="ShortcutFolderUris">
<MemberSignature Language="C#" Value="public string[] ShortcutFolderUris { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Filters">
<MemberSignature Language="C#" Value="public Gtk.FileFilter[] Filters { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gtk.FileFilter[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Uris">
<MemberSignature Language="C#" Value="public string[] Uris { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Filenames">
<MemberSignature Language="C#" Value="public string[] Filenames { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ShortcutFolders">
<MemberSignature Language="C#" Value="public string[] ShortcutFolders { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>

View File

@ -693,5 +693,65 @@
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ShortcutFolderUris">
<MemberSignature Language="C#" Value="public string[] ShortcutFolderUris { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Filters">
<MemberSignature Language="C#" Value="public Gtk.FileFilter[] Filters { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>Gtk.FileFilter[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Uris">
<MemberSignature Language="C#" Value="public string[] Uris { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="Filenames">
<MemberSignature Language="C#" Value="public string[] Filenames { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="ShortcutFolders">
<MemberSignature Language="C#" Value="public string[] ShortcutFolders { get; };" />
<MemberType>Property</MemberType>
<ReturnValue>
<ReturnType>System.String[]</ReturnType>
</ReturnValue>
<Docs>
<summary>To be added.</summary>
<value>To be added.</value>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>
</Type>

View File

@ -2,7 +2,7 @@
//
// Author: Mike Kestner <mkestner@novell.com>
//
// Copyright (c) 2004 Novell, Inc.
// Copyright (c) 2004-2005 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
@ -25,6 +25,7 @@ namespace GtkSharp.Generation {
using System.Xml;
public class ReturnValue {
private XmlElement elem;
@ -51,9 +52,30 @@ namespace GtkSharp.Generation {
}
}
string ElementCType {
get {
if (elem != null && elem.HasAttribute ("element_type"))
return elem.GetAttribute ("element_type");
return String.Empty;
}
}
bool ElementsOwned {
get {
if (elem != null && elem.GetAttribute ("elements_owned") == "true")
return true;
return false;
}
}
string ElementType {
get {
return elem == null ? String.Empty : elem.GetAttribute("element_type");
if (ElementCType.Length > 0)
return SymbolTable.Table.GetCSType (ElementCType);
return String.Empty;
}
}
@ -104,12 +126,13 @@ namespace GtkSharp.Generation {
{
if (IGen == null)
return String.Empty;
if (Owned)
var += ", true";
else if (ElementType != String.Empty) {
if (ElementType != String.Empty) {
string type_str = "typeof (" + ElementType + ")";
return String.Format ("({0}[]) GLib.Marshaller.ListToArray ({1}, {2})", ElementType, IGen.FromNativeReturn (var + ", " + type_str), type_str);
}
string args = type_str + ", " + (Owned ? "true" : "false") + ", " + (ElementsOwned ? "true" : "false");
return String.Format ("({0}[]) GLib.Marshaller.ListToArray ({1}, {2})", ElementType, IGen.FromNativeReturn (var + ", " + args), type_str);
} else if (Owned)
var += ", true";
return IGen.FromNativeReturn (var);
}

View File

@ -91,17 +91,13 @@ namespace GLib {
return g_list_nth_data (Handle, n);
}
public List (IntPtr raw) : this (raw, null) {}
public List (IntPtr raw) : base (raw)
{
}
public List (System.Type element_type) : this (IntPtr.Zero, element_type) {}
public List (System.Type element_type) : base (IntPtr.Zero, element_type)
{
}
public List (IntPtr raw, System.Type element_type) : this (raw, element_type, false, false) {}
public List (IntPtr raw, System.Type element_type, bool owned, bool elements_owned) : base (raw, element_type, owned, elements_owned) {}
public List (IntPtr raw, System.Type element_type) : base (raw, element_type)
{
}
}
}

View File

@ -31,6 +31,7 @@ namespace GLib {
private IntPtr list_ptr = IntPtr.Zero;
private int length = -1;
private bool managed = false;
private bool elements_owned = false;
protected System.Type element_type = null;
abstract internal IntPtr NthData (uint index);
@ -41,19 +42,12 @@ namespace GLib {
abstract internal IntPtr Append (IntPtr current, IntPtr raw);
abstract internal IntPtr Prepend (IntPtr current, IntPtr raw);
private ListBase ()
{
}
internal ListBase (IntPtr list, System.Type element_type)
internal ListBase (IntPtr list, System.Type element_type, bool owned, bool elements_owned)
{
list_ptr = list;
this.element_type = element_type;
}
internal ListBase (IntPtr list)
{
list_ptr = list;
managed = owned;
this.elements_owned = elements_owned;
}
~ListBase ()
@ -61,6 +55,7 @@ namespace GLib {
Dispose (false);
}
[Obsolete ("Replaced by owned parameter on ctor.")]
public bool Managed {
set { managed = value; }
}
@ -71,18 +66,6 @@ namespace GLib {
}
}
internal IntPtr Raw {
get {
return list_ptr;
}
set {
if (managed && list_ptr != IntPtr.Zero)
FreeList ();
list_ptr = value;
}
}
public void Append (IntPtr raw)
{
list_ptr = Append (list_ptr, raw);
@ -172,14 +155,15 @@ namespace GLib {
public void Empty ()
{
for (uint i = 0; i < Count; i++)
{
if (typeof (GLib.Object).IsAssignableFrom (element_type))
g_object_unref (NthData (i));
else
g_free (NthData (i));
}
FreeList ();
if (elements_owned)
for (uint i = 0; i < Count; i++)
if (typeof (GLib.Object).IsAssignableFrom (element_type))
g_object_unref (NthData (i));
else
g_free (NthData (i));
if (managed)
FreeList ();
}
private class ListEnumerator : IEnumerator
@ -231,10 +215,7 @@ namespace GLib {
protected virtual void Dispose (bool disposing)
{
if (!managed)
return;
FreeList ();
Empty ();
}
void FreeList ()

View File

@ -92,16 +92,12 @@ namespace GLib {
return g_slist_nth_data (Handle, n);
}
public SList (IntPtr raw) : base (raw)
{
}
public SList (IntPtr raw) : this (raw, null) {}
public SList (System.Type element_type) : base (IntPtr.Zero, element_type)
{
}
public SList (System.Type element_type) : this (IntPtr.Zero, element_type) {}
public SList (IntPtr raw, System.Type element_type) : base (raw, element_type)
{
}
public SList (IntPtr raw, System.Type element_type) : this (raw, element_type, false, false) {}
public SList (IntPtr raw, System.Type element_type, bool owned, bool elements_owned) : base (raw, element_type, false, false) {}
}
}

View File

@ -150,7 +150,9 @@
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Lineto']" name="name">LineTo</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='LinetoMoving']" name="name">LineToMoving</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Moveto']" name="name">MoveTo</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="element_type">Gnome.CanvasPathDef</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="element_type">GnomeCanvasPathDef*</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="owned">true</attr>
<attr path="/api/namespace/struct[@cname='GnomeCanvasPathDef']/method[@name='Split']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/struct[@cname='GPFontEntry']/field[@cname='weight']" name="access">private</attr>
<attr path="/api/namespace/struct[@cname='GnomePrintPaper']/method/*/*[@type='const-guchar*']" name="type">const-gchar*</attr>
<attr path="/api/namespace/object[@cname='GnomeScores']/constructor[@cname='gnome_scores_new']" name="hidden">1</attr>

View File

@ -16,7 +16,9 @@
<remove-node path="/api/namespace/callback[@cname='GnomeVFSXferProgressCallback']" />
<remove-node path="/api/namespace/class[@cname='GnomeVfsAsync_']" />
<remove-node path="/api/namespace/class[@cname='GnomeVfsDirectory_']" />
<attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="element_type">Gnome.Vfs.MimeApplication</attr>
<attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="element_type">GnomeVFSMimeApplication*</attr>
<attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="owned">true</attr>
<attr path="/api/namespace/class[@cname='GnomeVfsMime_']/method[@name='GetAllApplications']/return-type" name="elements_owned">true</attr>
<remove-node path="/api/namespace/class[@cname='GnomeVfsMonitor_']" />
<remove-node path="/api/namespace/class[@cname='GnomeVfsXfer_']" />
<attr path="/api/namespace/enum[@cname='GnomeVFSDirectoryVisitOptions']" name="hidden">1</attr>

24
gtk/FileChooser.custom Normal file
View File

@ -0,0 +1,24 @@
// Gtk.FileChooser.custom - Gtk FileChooser customizations
//
// Authors: Mike Kestner <mkestner@novell.com>
//
// Copyright (c) 2004 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
string[] Filenames { get; }
string[] ShortcutFolders { get; }

View File

@ -0,0 +1,43 @@
// Gtk.FileChooserButton.custom - Gtk FileChooserButton customizations
//
// Authors: Mike Kestner <mkestner@novell.com>
//
// Copyright (c) 2005 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
// Public License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this program; if not, write to the
// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
// Boston, MA 02111-1307, USA.
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_filenames (IntPtr raw);
public string[] Filenames {
get {
IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle);
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folders (IntPtr raw);
public string[] ShortcutFolders {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle);
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}

View File

@ -2,8 +2,10 @@
//
// Authors: Todd Berman <tberman@off.net>
// Jeroen Zwartepoorte <jeroen@xs4all.nl>
// Mike Kestner <mkestner@novell.com>
//
// Copyright (c) 2004 Todd Berman, Jeroen Zwartepoorte
// Copyright (c) 2005 Novell, Inc.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the Lesser GNU General
@ -66,80 +68,23 @@
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_filenames (IntPtr raw);
public string[] Filenames {
get {
IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_uris (IntPtr raw);
public string[] Uris {
get {
IntPtr raw_ret = gtk_file_chooser_get_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_filters (IntPtr raw);
public FileFilter[] Filters {
get {
IntPtr raw_ret = gtk_file_chooser_list_filters (Handle);
if (raw_ret == IntPtr.Zero)
return new FileFilter[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (FileFilter));
FileFilter[] result = new FileFilter [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (FileFilter) list [i];
list.Dispose ();
return result;
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folders (IntPtr raw);
public string[] ShortcutFolders {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folder_uris (IntPtr raw);
public string[] ShortcutFolderUris {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folder_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}

View File

@ -25,77 +25,19 @@
public string[] Filenames {
get {
IntPtr raw_ret = gtk_file_chooser_get_filenames (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_get_uris (IntPtr raw);
public string[] Uris {
get {
IntPtr raw_ret = gtk_file_chooser_get_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_filters (IntPtr raw);
public FileFilter[] Filters {
get {
IntPtr raw_ret = gtk_file_chooser_list_filters (Handle);
if (raw_ret == IntPtr.Zero)
return new FileFilter[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (FileFilter));
FileFilter[] result = new FileFilter [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (FileFilter) list [i];
list.Dispose ();
return result;
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folders (IntPtr raw);
public string[] ShortcutFolders {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folders (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
GLib.SList list = new GLib.SList (raw_ret, typeof (GLib.ListBase.FilenameString), true, true);
return (string[]) GLib.Marshaller.ListToArray (list, typeof (string));
}
}
[DllImport ("libgtk-win32-2.0-0.dll")]
static extern IntPtr gtk_file_chooser_list_shortcut_folder_uris (IntPtr raw);
public string[] ShortcutFolderUris {
get {
IntPtr raw_ret = gtk_file_chooser_list_shortcut_folder_uris (Handle);
if (raw_ret == IntPtr.Zero)
return new string[0];
GLib.SList list = new GLib.SList (raw_ret, typeof (string));
string[] result = new string [list.Count];
for (int i = 0; i < list.Count; i++)
result [i] = (string) list [i];
list.Empty ();
return result;
}
}

View File

@ -89,14 +89,21 @@
<attr path="/api/namespace/interface[@cname='GtkEditable']/signal[@name='InsertText']" name="name">TextInserted</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetCurrentFolder']/return-type" name="type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilename']/return-type" name="type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']/return-type" name="type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetFilenames']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetPreviewFilename']/return-type" name="type">gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method/parameters/*[@name='filename']" name="type">const-gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method/parameters/*[@name='folder']" name="type">const-gfilename*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetUris']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListFilters']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetUris']/return-type" name="element_type">gchar*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetUris']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='GetUris']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']" name="name">GetFilters</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']/return-type" name="element_type">GtkFileFilter*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_filters']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListShortcutFolders']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@name='ListShortcutFolderUris']" name="hidden">1</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']" name="name">GetShortcutFolderUris</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="element_type">gchar*</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="elements_owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkFileChooser']/method[@cname='gtk_file_chooser_list_shortcut_folder_uris']/return-type" name="owned">true</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Foreach']/*/*[@name='func']" name="scope">call</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='GetIterFirst']/*/*[@name='iter']" name="pass_as">out</attr>
<attr path="/api/namespace/interface[@cname='GtkTreeModel']/method[@name='Get']" name="hidden">1</attr>
@ -579,7 +586,8 @@
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='GetSize']/*/*[@type='gint*']" name="pass_as">out</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='HasToplevelFocus']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='IsActive']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="element_type">Gtk.Window</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="element_type">GtkWindow*</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='ListToplevels']/return-type" name="owned">true</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetDefaultIconList']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/method[@name='SetIconList']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkWindow']/property[@name='Screen']" name="new_flag">1</attr>

View File

@ -52,6 +52,8 @@ customs = \
Dialog.custom \
Entry.custom \
EntryCompletion.custom \
FileChooser.custom \
FileChooserButton.custom \
FileChooserDialog.custom \
FileChooserWidget.custom \
FileSelection.custom \