Author: mkestner
Date: 2005-03-15 12:30:59 -0500 (Tue, 15 Mar 2005)
New Revision: 41845

Added:
   trunk/gtk-sharp/gtk/TreeSortable.custom
Modified:
   trunk/gtk-sharp/ChangeLog
   trunk/gtk-sharp/gtk/Gtk.metadata
   trunk/gtk-sharp/gtk/ListStore.custom
   trunk/gtk-sharp/gtk/Makefile.am
   trunk/gtk-sharp/gtk/TreeModelSort.custom
   trunk/gtk-sharp/gtk/TreeStore.custom
Log:

2005-03-15  Mike Kestner  <[EMAIL PROTECTED]>

        * gtk/Gtk.metadata : hide TreeSortable.SetSortFunc.
        * gtk/ListStore.custom : implement SetSortFunc for persistence.
        * gtk/Makefile.am : add custom file.
        * gtk/TreeModelSort.custom : implement SetSortFunc for persistence.
        * gtk/TreeSortable.custom : new file, add hidden method decls.
        * gtk/TreeStore.custom : implement SetSortFunc for persistence.


Modified: trunk/gtk-sharp/ChangeLog
===================================================================
--- trunk/gtk-sharp/ChangeLog   2005-03-15 17:30:29 UTC (rev 41844)
+++ trunk/gtk-sharp/ChangeLog   2005-03-15 17:30:59 UTC (rev 41845)
@@ -1,3 +1,12 @@
+2005-03-15  Mike Kestner  <[EMAIL PROTECTED]>
+
+       * gtk/Gtk.metadata : hide TreeSortable.SetSortFunc.
+       * gtk/ListStore.custom : implement SetSortFunc for persistence.
+       * gtk/Makefile.am : add custom file.
+       * gtk/TreeModelSort.custom : implement SetSortFunc for persistence.
+       * gtk/TreeSortable.custom : new file, add hidden method decls.
+       * gtk/TreeStore.custom : implement SetSortFunc for persistence.
+
 2005-03-15  John Luke  <[EMAIL PROTECTED]>
 
        * glib/Object.cs: use IsDefined to check for ClassInitializer

Modified: trunk/gtk-sharp/gtk/Gtk.metadata
===================================================================
--- trunk/gtk-sharp/gtk/Gtk.metadata    2005-03-15 17:30:29 UTC (rev 41844)
+++ trunk/gtk-sharp/gtk/Gtk.metadata    2005-03-15 17:30:59 UTC (rev 41845)
@@ -94,6 +94,7 @@
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkTreeModel']/[EMAIL 
PROTECTED]'RowInserted']" name="name">EmitRowInserted</attr>
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkTreeModel']/[EMAIL 
PROTECTED]'RowsReordered']" name="name">EmitRowsReordered</attr>
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkTreeSortable']/[EMAIL 
PROTECTED]'SetDefaultSortFunc']" name="hidden">1</attr>
+  <attr path="/api/namespace/[EMAIL PROTECTED]'GtkTreeSortable']/[EMAIL 
PROTECTED]'SetSortFunc']" name="hidden">1</attr>
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkTreeSortable']/[EMAIL 
PROTECTED]'SortColumnChanged']" name="name">ChangeSortColumn</attr>
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkAccelLabel']/[EMAIL 
PROTECTED]'gtk_accel_label_new']/*/[EMAIL PROTECTED]'string']" 
name="property_name">label</attr>
   <attr path="/api/namespace/[EMAIL PROTECTED]'GtkAction']/[EMAIL 
PROTECTED]'Activate']" name="name">Activated</attr>

Modified: trunk/gtk-sharp/gtk/ListStore.custom
===================================================================
--- trunk/gtk-sharp/gtk/ListStore.custom        2005-03-15 17:30:29 UTC (rev 
41844)
+++ trunk/gtk-sharp/gtk/ListStore.custom        2005-03-15 17:30:59 UTC (rev 
41845)
@@ -151,6 +151,27 @@
                }
 
                [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, IntPtr sort_func, IntPtr user_data, IntPtr destroy);
+
+               [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, GtkSharp.TreeIterCompareFuncNative sort_func, IntPtr user_data, 
GtkSharp.DestroyNotifyNative destroy);
+
+               public void SetSortFunc (int sort_column_id, 
TreeIterCompareFunc sort_func, IntPtr user_data, Gtk.DestroyNotify destroy) 
+               {
+                       if (sort_func == null) {
+                               PersistentData ["column_" + sort_column_id + 
"_sort_func"] = null;
+                               gtk_tree_sortable_set_sort_func (Handle, 
sort_column_id, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+                               return;
+                       }
+
+                       GtkSharp.TreeIterCompareFuncWrapper sort_func_wrapper = 
new GtkSharp.TreeIterCompareFuncWrapper (sort_func);
+                       PersistentData ["column_" + sort_column_id + 
"_sort_func"] = sort_func_wrapper;
+                       GtkSharp.DestroyNotifyWrapper destroy_wrapper = null;
+                       destroy_wrapper = new GtkSharp.DestroyNotifyWrapper 
(destroy);
+                       gtk_tree_sortable_set_sort_func(Handle, sort_column_id, 
sort_func_wrapper.NativeDelegate, user_data, destroy_wrapper.NativeDelegate);
+               }
+
+               [DllImport("libgtk-win32-2.0-0.dll")]
                static extern void 
gtk_tree_sortable_set_default_sort_func(IntPtr raw, IntPtr sort_func, IntPtr 
user_data, IntPtr destroy);
 
                [DllImport("libgtk-win32-2.0-0.dll")]

Modified: trunk/gtk-sharp/gtk/Makefile.am
===================================================================
--- trunk/gtk-sharp/gtk/Makefile.am     2005-03-15 17:30:29 UTC (rev 41844)
+++ trunk/gtk-sharp/gtk/Makefile.am     2005-03-15 17:30:59 UTC (rev 41845)
@@ -97,6 +97,7 @@
        TreeModelSort.custom            \
        TreePath.custom                 \
        TreeSelection.custom            \
+       TreeSortable.custom             \
        TreeStore.custom                \
        TreeViewColumn.custom           \
        TreeView.custom                 \

Modified: trunk/gtk-sharp/gtk/TreeModelSort.custom
===================================================================
--- trunk/gtk-sharp/gtk/TreeModelSort.custom    2005-03-15 17:30:29 UTC (rev 
41844)
+++ trunk/gtk-sharp/gtk/TreeModelSort.custom    2005-03-15 17:30:59 UTC (rev 
41845)
@@ -106,3 +106,24 @@
                        gtk_tree_sortable_set_default_sort_func(Handle, 
sort_func_wrapper.NativeDelegate, user_data, destroy_wrapper.NativeDelegate);
                }
 
+               [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, IntPtr sort_func, IntPtr user_data, IntPtr destroy);
+
+               [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, GtkSharp.TreeIterCompareFuncNative sort_func, IntPtr user_data, 
GtkSharp.DestroyNotifyNative destroy);
+
+               public void SetSortFunc (int sort_column_id, 
TreeIterCompareFunc sort_func, IntPtr user_data, Gtk.DestroyNotify destroy) 
+               {
+                       if (sort_func == null) {
+                               PersistentData ["column_" + sort_column_id + 
"_sort_func"] = null;
+                               gtk_tree_sortable_set_sort_func (Handle, 
sort_column_id, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+                               return;
+                       }
+
+                       GtkSharp.TreeIterCompareFuncWrapper sort_func_wrapper = 
new GtkSharp.TreeIterCompareFuncWrapper (sort_func);
+                       PersistentData ["column_" + sort_column_id + 
"_sort_func"] = sort_func_wrapper;
+                       GtkSharp.DestroyNotifyWrapper destroy_wrapper = null;
+                       destroy_wrapper = new GtkSharp.DestroyNotifyWrapper 
(destroy);
+                       gtk_tree_sortable_set_sort_func(Handle, sort_column_id, 
sort_func_wrapper.NativeDelegate, user_data, destroy_wrapper.NativeDelegate);
+               }
+

Added: trunk/gtk-sharp/gtk/TreeSortable.custom
===================================================================
--- trunk/gtk-sharp/gtk/TreeSortable.custom     2005-03-15 17:30:29 UTC (rev 
41844)
+++ trunk/gtk-sharp/gtk/TreeSortable.custom     2005-03-15 17:30:59 UTC (rev 
41845)
@@ -0,0 +1,26 @@
+// Gtk.TreeSortable.Custom - Gtk TreeSortable interface customizations
+//
+// Author: Mike Kestner  <[EMAIL PROTECTED]>
+//
+// Copyright (c) 2005 Novell, Inc.
+//
+// This code is inserted after the automatically generated code.
+//
+// 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.
+
+               void SetDefaultSortFunc (TreeIterCompareFunc sort_func, IntPtr 
user_data, Gtk.DestroyNotify destroy);
+
+               void SetSortFunc (int sort_column_id, TreeIterCompareFunc 
sort_func, IntPtr user_data, Gtk.DestroyNotify destroy); 
+

Modified: trunk/gtk-sharp/gtk/TreeStore.custom
===================================================================
--- trunk/gtk-sharp/gtk/TreeStore.custom        2005-03-15 17:30:29 UTC (rev 
41844)
+++ trunk/gtk-sharp/gtk/TreeStore.custom        2005-03-15 17:30:59 UTC (rev 
41845)
@@ -214,4 +214,24 @@
                        gtk_tree_sortable_set_default_sort_func(Handle, 
sort_func_wrapper.NativeDelegate, user_data, destroy_wrapper.NativeDelegate);
                }
 
+               [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, IntPtr sort_func, IntPtr user_data, IntPtr destroy);
 
+               [DllImport("libgtk-win32-2.0-0.dll")]
+               static extern void gtk_tree_sortable_set_sort_func(IntPtr raw, 
int col_id, GtkSharp.TreeIterCompareFuncNative sort_func, IntPtr user_data, 
GtkSharp.DestroyNotifyNative destroy);
+
+               public void SetSortFunc (int sort_column_id, 
TreeIterCompareFunc sort_func, IntPtr user_data, Gtk.DestroyNotify destroy) 
+               {
+                       if (sort_func == null) {
+                               PersistentData ["column_" + sort_column_id + 
"_sort_func"] = null;
+                               gtk_tree_sortable_set_sort_func (Handle, 
sort_column_id, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero);
+                               return;
+                       }
+
+                       GtkSharp.TreeIterCompareFuncWrapper sort_func_wrapper = 
new GtkSharp.TreeIterCompareFuncWrapper (sort_func);
+                       PersistentData ["column_" + sort_column_id + 
"_sort_func"] = sort_func_wrapper;
+                       GtkSharp.DestroyNotifyWrapper destroy_wrapper = null;
+                       destroy_wrapper = new GtkSharp.DestroyNotifyWrapper 
(destroy);
+                       gtk_tree_sortable_set_sort_func(Handle, sort_column_id, 
sort_func_wrapper.NativeDelegate, user_data, destroy_wrapper.NativeDelegate);
+               }
+

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to