]> Pileus Git - ~andy/gtk/blob - gtk/gtksequence.h
Make it possible to specify additional modules to load via a setting.
[~andy/gtk] / gtk / gtksequence.h
1 /* GLIB - Library of useful routines for C programming
2  * Copyright (C) 2002  Soeren Sandmann (sandmann@daimi.au.dk)
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser 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
20 #include <glib.h>
21
22 #ifndef __GSEQUENCE_H__
23 #define __GSEQUENCE_H__
24
25
26 /* Warning
27  *
28  * Do not use this API. It is here, internal to gtk+, for 2.6 only.
29  * In 2.8 the plan is to add a similar data structure to GLib. 
30  */
31
32 typedef struct _GtkSequence      GtkSequence;
33 typedef struct _GtkSequenceNode *GtkSequencePtr;
34
35 /* GtkSequence */
36 GtkSequence *  _gtk_sequence_new              (GDestroyNotify     data_destroy);
37 void           _gtk_sequence_free             (GtkSequence       *seq);
38 void           _gtk_sequence_sort             (GtkSequence       *seq,
39                                                GCompareDataFunc   cmp_func,
40                                                gpointer           cmp_data);
41 void           _gtk_sequence_append           (GtkSequence       *seq,
42                                                gpointer           data);
43 void           _gtk_sequence_prepend          (GtkSequence       *seq,
44                                                gpointer           data);
45 GtkSequencePtr _gtk_sequence_insert           (GtkSequencePtr     ptr,
46                                                gpointer           data);
47 void           _gtk_sequence_remove           (GtkSequencePtr     ptr);
48 void           _gtk_sequence_move             (GtkSequencePtr     ptr,
49                                                GtkSequencePtr     pos);
50 void           _gtk_sequence_swap             (GtkSequencePtr     a,
51                                                GtkSequencePtr     b);
52 GtkSequencePtr _gtk_sequence_insert_sorted    (GtkSequence       *seq,
53                                                gpointer           data,
54                                                GCompareDataFunc   cmp_func,
55                                                gpointer           cmp_data);
56 void           _gtk_sequence_set              (GtkSequencePtr     ptr,
57                                                gpointer           data);
58 void           _gtk_sequence_insert_sequence  (GtkSequencePtr     ptr,
59                                                GtkSequence       *other_seq);
60 void           _gtk_sequence_concatenate      (GtkSequence       *seq1,
61                                                GtkSequence       *seq);
62 void           _gtk_sequence_remove_range     (GtkSequencePtr     begin,
63                                                GtkSequencePtr     end,
64                                                GtkSequence      **removed);
65 gint           _gtk_sequence_get_length       (GtkSequence       *seq);
66 GtkSequencePtr _gtk_sequence_get_end_ptr      (GtkSequence       *seq);
67 GtkSequencePtr _gtk_sequence_get_begin_ptr    (GtkSequence       *seq);
68 GtkSequencePtr _gtk_sequence_get_ptr_at_pos   (GtkSequence       *seq,
69                                                gint               pos);
70 void           _gtk_sequence_sort_changed     (GtkSequencePtr     ptr,
71                                                GCompareDataFunc   cmp_func,
72                                                gpointer           cmp_data);
73 void           _gtk_sequence_foreach          (GtkSequence       *seq,
74                                                GFunc              func,
75                                                gpointer           data);
76
77 /* GtkSequencePtr */
78 gboolean       _gtk_sequence_ptr_is_end       (GtkSequencePtr     ptr);
79 gboolean       _gtk_sequence_ptr_is_begin     (GtkSequencePtr     ptr);
80 gint           _gtk_sequence_ptr_get_position (GtkSequencePtr     ptr);
81 GtkSequencePtr _gtk_sequence_ptr_next         (GtkSequencePtr     ptr);
82 GtkSequencePtr _gtk_sequence_ptr_prev         (GtkSequencePtr     ptr);
83 GtkSequencePtr _gtk_sequence_ptr_move         (GtkSequencePtr     ptr,
84                                                guint              leap);
85 gpointer       _gtk_sequence_ptr_get_data     (GtkSequencePtr     ptr);
86 GtkSequence   *_gtk_sequence_ptr_get_sequence (GtkSequencePtr     ptr);
87
88 /* search */
89
90 /* return TRUE if you want to be called again with two
91  * smaller segments
92  */
93 typedef gboolean (* GtkSequenceSearchFunc) (GtkSequencePtr begin,
94                                              GtkSequencePtr end,
95                                              gpointer     data);
96
97 void         _gtk_sequence_search             (GtkSequence               *seq,
98                                                GtkSequenceSearchFunc      f,
99                                                gpointer                 data);
100
101 /* debug */
102 gint         _gtk_sequence_calc_tree_height   (GtkSequence               *seq);
103
104 #endif /* __GSEQUENCE_H__ */