From ec960986123225df731ff0357f189660b969b3e2 Mon Sep 17 00:00:00 2001 From: Mike Kestner Date: Wed, 6 Apr 2005 15:47:17 +0000 Subject: [PATCH] 2005-04-06 Mike Kestner * gtk/FileFilter.custom : AddCustom delegate is destroy notified. * gtk/Gtk.metadata : hide FileFilter.AddCustom. hide gtk_object_get|set. svn path=/trunk/gtk-sharp/; revision=42611 --- ChangeLog | 5 +++++ doc/en/Gtk/FileFilter.xml | 12 +++--------- gtk/FileFilter.custom | 35 +++++++++++++++++++++++++++++++++++ gtk/Gtk.metadata | 3 +++ gtk/Makefile.am | 1 + 5 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 gtk/FileFilter.custom diff --git a/ChangeLog b/ChangeLog index 15c1189c7..43cf14d91 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-04-06 Mike Kestner + + * gtk/FileFilter.custom : AddCustom delegate is destroy notified. + * gtk/Gtk.metadata : hide FileFilter.AddCustom. hide gtk_object_get|set. + 2005-04-05 Mike Kestner * gtk/*.custom : persistent delegates for most of the remaining diff --git a/doc/en/Gtk/FileFilter.xml b/doc/en/Gtk/FileFilter.xml index 3cef1c96b..fa0345664 100644 --- a/doc/en/Gtk/FileFilter.xml +++ b/doc/en/Gtk/FileFilter.xml @@ -186,7 +186,7 @@ - + Method System.Void @@ -194,17 +194,11 @@ - - - - Adds a rule to a filter that allows files based on a custom callback function. - + Adds a rule to a filter that allows files based on a custom callback function. a a - a - a The bitfield which is passed in provides information about what sorts of information that the filter function needs; @@ -214,4 +208,4 @@ - \ No newline at end of file + diff --git a/gtk/FileFilter.custom b/gtk/FileFilter.custom new file mode 100644 index 000000000..bb3bfdf6a --- /dev/null +++ b/gtk/FileFilter.custom @@ -0,0 +1,35 @@ +// Gtk.FileFilter.custom - Gtk FileFilter class customizations +// +// Author: Mike Kestner +// +// 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 void gtk_file_filter_add_custom(IntPtr raw, int needed, GtkSharp.FileFilterFuncNative func, IntPtr data, NativeDestroyNotify notify); + + public void AddCustom (Gtk.FileFilterFlags needed, Gtk.FileFilterFunc func) + { + if (func == null) { + gtk_file_filter_add_custom (Handle, (int) needed, null, IntPtr.Zero, null); + return; + } + GtkSharp.FileFilterFuncWrapper func_wrapper = new GtkSharp.FileFilterFuncWrapper (func); + GCHandle gch = GCHandle.Alloc (func_wrapper); + gtk_file_filter_add_custom(Handle, (int) needed, func_wrapper.NativeDelegate, (IntPtr) gch, DestroyHelper.NotifyHandler); + } + diff --git a/gtk/Gtk.metadata b/gtk/Gtk.metadata index 2de6ea423..dd5640272 100644 --- a/gtk/Gtk.metadata +++ b/gtk/Gtk.metadata @@ -204,6 +204,7 @@ 1 1 1 + 1 1 GObject Activated @@ -270,6 +271,8 @@ 1 1 1 + 1 + 1 Destroyed 1 1 diff --git a/gtk/Makefile.am b/gtk/Makefile.am index 1e7d95e0d..0df621cc7 100644 --- a/gtk/Makefile.am +++ b/gtk/Makefile.am @@ -53,6 +53,7 @@ customs = \ EntryCompletion.custom \ FileChooserDialog.custom \ FileChooserWidget.custom \ + FileFilter.custom \ FileSelection.custom \ FileSystemModel.custom \ Frame.custom \