You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

107 regels
4.1 KiB

  1. /* gtktreemodelsort.h
  2. * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Library General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Library General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Library General Public
  15. * License along with this library; if not, write to the
  16. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  17. * Boston, MA 02111-1307, USA.
  18. */
  19. #if defined(GTK_DISABLE_SINGLE_INCLUDES) && !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
  20. #error "Only <gtk/gtk.h> can be included directly."
  21. #endif
  22. #ifndef __GTK_TREE_MODEL_SORT_H__
  23. #define __GTK_TREE_MODEL_SORT_H__
  24. #include <gdkconfig.h>
  25. #include <gtk/gtktreemodel.h>
  26. #include <gtk/gtktreesortable.h>
  27. G_BEGIN_DECLS
  28. #define GTK_TYPE_TREE_MODEL_SORT (gtk_tree_model_sort_get_type ())
  29. #define GTK_TREE_MODEL_SORT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSort))
  30. #define GTK_TREE_MODEL_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSortClass))
  31. #define GTK_IS_TREE_MODEL_SORT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TREE_MODEL_SORT))
  32. #define GTK_IS_TREE_MODEL_SORT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_MODEL_SORT))
  33. #define GTK_TREE_MODEL_SORT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_MODEL_SORT, GtkTreeModelSortClass))
  34. typedef struct _GtkTreeModelSort GtkTreeModelSort;
  35. typedef struct _GtkTreeModelSortClass GtkTreeModelSortClass;
  36. struct _GtkTreeModelSort
  37. {
  38. GObject parent;
  39. /* < private > */
  40. gpointer GSEAL (root);
  41. gint GSEAL (stamp);
  42. guint GSEAL (child_flags);
  43. GtkTreeModel *GSEAL (child_model);
  44. gint GSEAL (zero_ref_count);
  45. /* sort information */
  46. GList *GSEAL (sort_list);
  47. gint GSEAL (sort_column_id);
  48. GtkSortType GSEAL (order);
  49. /* default sort */
  50. GtkTreeIterCompareFunc GSEAL (default_sort_func);
  51. gpointer GSEAL (default_sort_data);
  52. GDestroyNotify GSEAL (default_sort_destroy);
  53. /* signal ids */
  54. guint GSEAL (changed_id);
  55. guint GSEAL (inserted_id);
  56. guint GSEAL (has_child_toggled_id);
  57. guint GSEAL (deleted_id);
  58. guint GSEAL (reordered_id);
  59. };
  60. struct _GtkTreeModelSortClass
  61. {
  62. GObjectClass parent_class;
  63. /* Padding for future expansion */
  64. void (*_gtk_reserved1) (void);
  65. void (*_gtk_reserved2) (void);
  66. void (*_gtk_reserved3) (void);
  67. void (*_gtk_reserved4) (void);
  68. };
  69. GType gtk_tree_model_sort_get_type (void) G_GNUC_CONST;
  70. GtkTreeModel *gtk_tree_model_sort_new_with_model (GtkTreeModel *child_model);
  71. GtkTreeModel *gtk_tree_model_sort_get_model (GtkTreeModelSort *tree_model);
  72. GtkTreePath *gtk_tree_model_sort_convert_child_path_to_path (GtkTreeModelSort *tree_model_sort,
  73. GtkTreePath *child_path);
  74. gboolean gtk_tree_model_sort_convert_child_iter_to_iter (GtkTreeModelSort *tree_model_sort,
  75. GtkTreeIter *sort_iter,
  76. GtkTreeIter *child_iter);
  77. GtkTreePath *gtk_tree_model_sort_convert_path_to_child_path (GtkTreeModelSort *tree_model_sort,
  78. GtkTreePath *sorted_path);
  79. void gtk_tree_model_sort_convert_iter_to_child_iter (GtkTreeModelSort *tree_model_sort,
  80. GtkTreeIter *child_iter,
  81. GtkTreeIter *sorted_iter);
  82. void gtk_tree_model_sort_reset_default_sort_func (GtkTreeModelSort *tree_model_sort);
  83. void gtk_tree_model_sort_clear_cache (GtkTreeModelSort *tree_model_sort);
  84. gboolean gtk_tree_model_sort_iter_is_valid (GtkTreeModelSort *tree_model_sort,
  85. GtkTreeIter *iter);
  86. G_END_DECLS
  87. #endif /* __GTK_TREE_MODEL_SORT_H__ */