]> Pileus Git - ~andy/gtk/blob - gtk/gtklist.h
fixup, so that enum values are looked up.
[~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
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19 #ifndef __GTK_LIST_H__
20 #define __GTK_LIST_H__
21
22
23 #include <gdk/gdk.h>
24 #include <gtk/gtkenums.h>
25 #include <gtk/gtkcontainer.h>
26
27
28 #ifdef __cplusplus
29 extern "C" {
30 #pragma }
31 #endif /* __cplusplus */
32
33
34 #define GTK_TYPE_LIST                  (gtk_list_get_type ())
35 #define GTK_LIST(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST, GtkList))
36 #define GTK_LIST_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
37 #define GTK_IS_LIST(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST))
38 #define GTK_IS_LIST_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
39
40
41 typedef struct _GtkList       GtkList;
42 typedef struct _GtkListClass  GtkListClass;
43
44 struct _GtkList
45 {
46   GtkContainer container;
47
48   GList *children;
49   GList *selection;
50
51   guint32 timer;
52   guint16 selection_start_pos;
53   guint16 selection_end_pos;
54   guint selection_mode : 2;
55   guint scroll_direction : 1;
56   guint have_grab : 1;          /* unused */
57   guint16 button;               /* read by GtkCombo */
58 };
59
60 struct _GtkListClass
61 {
62   GtkContainerClass parent_class;
63
64   void (* selection_changed) (GtkList   *list);
65   void (* select_child)      (GtkList   *list,
66                               GtkWidget *child);
67   void (* unselect_child)    (GtkList   *list,
68                               GtkWidget *child);
69 };
70
71
72 GtkType    gtk_list_get_type              (void);
73 GtkWidget* gtk_list_new                   (void);
74 void       gtk_list_insert_items          (GtkList          *list,
75                                            GList            *items,
76                                            gint              position);
77 void       gtk_list_append_items          (GtkList          *list,
78                                            GList            *items);
79 void       gtk_list_prepend_items         (GtkList          *list,
80                                            GList            *items);
81 void       gtk_list_remove_items          (GtkList          *list,
82                                            GList            *items);
83 void       gtk_list_remove_items_no_unref (GtkList          *list,
84                                            GList            *items);
85 void       gtk_list_clear_items           (GtkList          *list,
86                                            gint              start,
87                                            gint              end);
88 void       gtk_list_select_item           (GtkList          *list,
89                                            gint              item);
90 void       gtk_list_unselect_item         (GtkList          *list,
91                                            gint              item);
92 void       gtk_list_select_child          (GtkList          *list,
93                                            GtkWidget        *child);
94 void       gtk_list_unselect_child        (GtkList          *list,
95                                            GtkWidget        *child);
96 gint       gtk_list_child_position        (GtkList          *list,
97                                            GtkWidget        *child);
98 void       gtk_list_set_selection_mode    (GtkList          *list,
99                                            GtkSelectionMode  mode);
100
101
102 #ifdef __cplusplus
103 }
104 #endif /* __cplusplus */
105
106
107 #endif /* __GTK_LIST_H__ */