]> Pileus Git - ~andy/gtk/blob - gtk/gtklist.h
Include "." and ".." in the list of entries; they are needed for correct
[~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 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 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
25  */
26
27 #ifndef GTK_DISABLE_DEPRECATED
28
29 #ifndef __GTK_LIST_H__
30 #define __GTK_LIST_H__
31
32
33 #include <gdk/gdk.h>
34 #include <gtk/gtkenums.h>
35 #include <gtk/gtkcontainer.h>
36 #include <gtk/gtklistitem.h>
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif /* __cplusplus */
41
42
43 #define GTK_TYPE_LIST                  (gtk_list_get_type ())
44 #define GTK_LIST(obj)                  (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST, GtkList))
45 #define GTK_LIST_CLASS(klass)          (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
46 #define GTK_IS_LIST(obj)               (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST))
47 #define GTK_IS_LIST_CLASS(klass)       (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
48 #define GTK_LIST_GET_CLASS(obj)        (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LIST, GtkListClass))
49
50
51 typedef struct _GtkList       GtkList;
52 typedef struct _GtkListClass  GtkListClass;
53
54 struct _GtkList
55 {
56   GtkContainer container;
57
58   GList *children;
59   GList *selection;
60
61   GList *undo_selection;
62   GList *undo_unselection;
63
64   GtkWidget *last_focus_child;
65   GtkWidget *undo_focus_child;
66
67   guint htimer;
68   guint vtimer;
69
70   gint anchor;
71   gint drag_pos;
72   GtkStateType anchor_state;
73
74   guint selection_mode : 2;
75   guint drag_selection:1;
76   guint add_mode:1;
77 };
78
79 struct _GtkListClass
80 {
81   GtkContainerClass parent_class;
82
83   void (* selection_changed) (GtkList   *list);
84   void (* select_child)      (GtkList   *list,
85                               GtkWidget *child);
86   void (* unselect_child)    (GtkList   *list,
87                               GtkWidget *child);
88 };
89
90
91 GtkType    gtk_list_get_type              (void) G_GNUC_CONST;
92 GtkWidget* gtk_list_new                   (void);
93 void       gtk_list_insert_items          (GtkList          *list,
94                                            GList            *items,
95                                            gint              position);
96 void       gtk_list_append_items          (GtkList          *list,
97                                            GList            *items);
98 void       gtk_list_prepend_items         (GtkList          *list,
99                                            GList            *items);
100 void       gtk_list_remove_items          (GtkList          *list,
101                                            GList            *items);
102 void       gtk_list_remove_items_no_unref (GtkList          *list,
103                                            GList            *items);
104 void       gtk_list_clear_items           (GtkList          *list,
105                                            gint              start,
106                                            gint              end);
107 void       gtk_list_select_item           (GtkList          *list,
108                                            gint              item);
109 void       gtk_list_unselect_item         (GtkList          *list,
110                                            gint              item);
111 void       gtk_list_select_child          (GtkList          *list,
112                                            GtkWidget        *child);
113 void       gtk_list_unselect_child        (GtkList          *list,
114                                            GtkWidget        *child);
115 gint       gtk_list_child_position        (GtkList          *list,
116                                            GtkWidget        *child);
117 void       gtk_list_set_selection_mode    (GtkList          *list,
118                                            GtkSelectionMode  mode);
119
120 void       gtk_list_extend_selection      (GtkList          *list,
121                                            GtkScrollType     scroll_type,
122                                            gfloat            position,
123                                            gboolean          auto_start_selection);
124 void       gtk_list_start_selection       (GtkList          *list);
125 void       gtk_list_end_selection         (GtkList          *list);
126 void       gtk_list_select_all            (GtkList          *list);
127 void       gtk_list_unselect_all          (GtkList          *list);
128 void       gtk_list_scroll_horizontal     (GtkList          *list,
129                                            GtkScrollType     scroll_type,
130                                            gfloat            position);
131 void       gtk_list_scroll_vertical       (GtkList          *list,
132                                            GtkScrollType     scroll_type,
133                                            gfloat            position);
134 void       gtk_list_toggle_add_mode       (GtkList          *list);
135 void       gtk_list_toggle_focus_row      (GtkList          *list);
136 void       gtk_list_toggle_row            (GtkList          *list,
137                                            GtkWidget        *item);
138 void       gtk_list_undo_selection        (GtkList          *list);
139 void       gtk_list_end_drag_selection    (GtkList          *list);
140
141 #ifdef __cplusplus
142 }
143 #endif /* __cplusplus */
144
145
146 #endif /* __GTK_LIST_H__ */
147
148 #endif /* GTK_DISABLE_DEPRECATED */