[egg-list-box] Make egg_list_box_set_sort_func() usable from gjs



commit 035666d2d5892e75315b56fd27ceb478d700ec17
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Fri Jan 4 13:52:16 2013 +0100

    Make egg_list_box_set_sort_func() usable from gjs
    
    Add a new function signature with explicit pointer types and annotate
    egg_list_box_set_sort_func properly.
    
    WARNING: This changes the signature of the sort function which may cause
    new warnings for modules that currently passes a GCompareDataFunc.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=691130

 egg-list-box.c |   10 ++++++++--
 egg-list-box.h |    3 ++-
 2 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/egg-list-box.c b/egg-list-box.c
index 54492de..2f89592 100644
--- a/egg-list-box.c
+++ b/egg-list-box.c
@@ -64,7 +64,7 @@ struct _EggListBoxPrivate
   GHashTable *child_hash;
   GHashTable *separator_hash;
 
-  GCompareDataFunc sort_func;
+  EggListBoxSortFunc sort_func;
   gpointer sort_func_target;
   GDestroyNotify sort_func_target_destroy_notify;
 
@@ -685,9 +685,15 @@ egg_list_box_reseparate (EggListBox *list_box)
   gtk_widget_queue_resize (GTK_WIDGET (list_box));
 }
 
+/**
+ * egg_list_box_set_sort_func:
+ * @f: (closure f_target):
+ * @f_target: (allow-none):
+ * @f_target_destroy_notify: (allow-none):
+ */
 void
 egg_list_box_set_sort_func (EggListBox *list_box,
-                           GCompareDataFunc f,
+                           EggListBoxSortFunc f,
                            void *f_target,
                            GDestroyNotify f_target_destroy_notify)
 {
diff --git a/egg-list-box.h b/egg-list-box.h
index d071991..a478aa8 100644
--- a/egg-list-box.h
+++ b/egg-list-box.h
@@ -36,6 +36,7 @@ struct _EggListBoxClass
 };
 
 typedef gboolean (*EggListBoxFilterFunc) (GtkWidget* child, void* user_data);
+typedef gint (*EggListBoxSortFunc) (GtkWidget* child1, GtkWidget* child2, void* user_data);
 typedef void (*EggListBoxUpdateSeparatorFunc) (GtkWidget** separator, GtkWidget* child, GtkWidget* before, 
void* user_data);
 
 GType egg_list_box_get_type (void) G_GNUC_CONST;
@@ -62,7 +63,7 @@ void        egg_list_box_refilter                     (EggListBox
 void        egg_list_box_resort                       (EggListBox                    *self);
 void        egg_list_box_reseparate                   (EggListBox                    *self);
 void        egg_list_box_set_sort_func                (EggListBox                    *self,
-                                                      GCompareDataFunc               f,
+                                                      EggListBoxSortFunc             f,
                                                       void                          *f_target,
                                                       GDestroyNotify                 
f_target_destroy_notify);
 void        egg_list_box_child_changed                (EggListBox                    *self,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]