]> Pileus Git - ~andy/gtk/blob - gtk/gtklist.h
new function to perform the same actions as gtk_list_remove_items, but
[~andy/gtk] / gtk / gtklist.h
1 /* GTK - The GIMP Toolkit
2  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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 Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  */
18 #ifndef __GTK_LIST_H__
19 #define __GTK_LIST_H__
20
21
22 #include <gdk/gdk.h>
23 #include <gtk/gtkenums.h>
24 #include <gtk/gtkcontainer.h>
25
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif /* __cplusplus */
30
31
32 #define GTK_LIST(obj)          GTK_CHECK_CAST (obj, gtk_list_get_type (), GtkList)
33 #define GTK_LIST_CLASS(klass)  GTK_CHECK_CLASS_CAST (klass, gtk_list_get_type (), GtkListClass)
34 #define GTK_IS_LIST(obj)       GTK_CHECK_TYPE (obj, gtk_list_get_type ())
35
36
37 typedef struct _GtkList       GtkList;
38 typedef struct _GtkListClass  GtkListClass;
39
40 struct _GtkList
41 {
42   GtkContainer container;
43
44   GList *children;
45   GList *selection;
46
47   guint32 timer;
48   guint16 selection_start_pos;
49   guint16 selection_end_pos;
50   guint selection_mode : 2;
51   guint scroll_direction : 1;
52   guint have_grab : 1;
53 };
54
55 struct _GtkListClass
56 {
57   GtkContainerClass parent_class;
58
59   void (* selection_changed) (GtkList   *list);
60   void (* select_child)      (GtkList   *list,
61                               GtkWidget *child);
62   void (* unselect_child)    (GtkList   *list,
63                               GtkWidget *child);
64 };
65
66
67 guint      gtk_list_get_type              (void);
68 GtkWidget* gtk_list_new                   (void);
69 void       gtk_list_insert_items          (GtkList          *list,
70                                            GList            *items,
71                                            gint              position);
72 void       gtk_list_append_items          (GtkList          *list,
73                                            GList            *items);
74 void       gtk_list_prepend_items         (GtkList          *list,
75                                            GList            *items);
76 void       gtk_list_remove_items          (GtkList          *list,
77                                            GList            *items);
78 void       gtk_list_remove_items_no_unref (GtkList          *list,
79                                            GList            *items);
80 void       gtk_list_clear_items           (GtkList          *list,
81                                            gint              start,
82                                            gint              end);
83 void       gtk_list_select_item           (GtkList          *list,
84                                            gint              item);
85 void       gtk_list_unselect_item         (GtkList          *list,
86                                            gint              item);
87 void       gtk_list_select_child          (GtkList          *list,
88                                            GtkWidget        *child);
89 void       gtk_list_unselect_child        (GtkList          *list,
90                                            GtkWidget        *child);
91 gint       gtk_list_child_position        (GtkList          *list,
92                                            GtkWidget        *child);
93 void       gtk_list_set_selection_mode    (GtkList          *list,
94                                            GtkSelectionMode  mode);
95
96
97 #ifdef __cplusplus
98 }
99 #endif /* __cplusplus */
100
101
102 #endif /* __GTK_LIST_H__ */