1 /* GTK - The GIMP Toolkit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
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.
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.
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.
19 #ifndef __GTK_LIST_H__
20 #define __GTK_LIST_H__
24 #include <gtk/gtkenums.h>
25 #include <gtk/gtkcontainer.h>
26 #include <gtk/gtklistitem.h>
30 #endif /* __cplusplus */
33 #define GTK_TYPE_LIST (gtk_list_get_type ())
34 #define GTK_LIST(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST, GtkList))
35 #define GTK_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
36 #define GTK_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST))
37 #define GTK_IS_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
40 typedef struct _GtkList GtkList;
41 typedef struct _GtkListClass GtkListClass;
45 GtkContainer container;
50 GList *undo_selection;
51 GList *undo_unselection;
53 GtkWidget *last_focus_child;
54 GtkWidget *undo_focus_child;
61 GtkStateType anchor_state;
63 guint selection_mode : 2;
64 guint drag_selection:1;
70 GtkContainerClass parent_class;
72 void (* selection_changed) (GtkList *list);
73 void (* select_child) (GtkList *list,
75 void (* unselect_child) (GtkList *list,
80 GtkType gtk_list_get_type (void);
81 GtkWidget* gtk_list_new (void);
82 void gtk_list_insert_items (GtkList *list,
85 void gtk_list_append_items (GtkList *list,
87 void gtk_list_prepend_items (GtkList *list,
89 void gtk_list_remove_items (GtkList *list,
91 void gtk_list_remove_items_no_unref (GtkList *list,
93 void gtk_list_clear_items (GtkList *list,
96 void gtk_list_select_item (GtkList *list,
98 void gtk_list_unselect_item (GtkList *list,
100 void gtk_list_select_child (GtkList *list,
102 void gtk_list_unselect_child (GtkList *list,
104 gint gtk_list_child_position (GtkList *list,
106 void gtk_list_set_selection_mode (GtkList *list,
107 GtkSelectionMode mode);
109 void gtk_list_extend_selection (GtkList *list,
110 GtkScrollType scroll_type,
112 gboolean auto_start_selection);
113 void gtk_list_start_selection (GtkList *list);
114 void gtk_list_end_selection (GtkList *list);
115 void gtk_list_select_all (GtkList *list);
116 void gtk_list_unselect_all (GtkList *list);
117 void gtk_list_scroll_horizontal (GtkList *list,
118 GtkScrollType scroll_type,
120 void gtk_list_scroll_vertical (GtkList *list,
121 GtkScrollType scroll_type,
123 void gtk_list_toggle_add_mode (GtkList *list);
124 void gtk_list_toggle_focus_row (GtkList *list);
125 void gtk_list_toggle_row (GtkList *list,
127 void gtk_list_undo_selection (GtkList *list);
128 void gtk_list_end_drag_selection (GtkList *list);
132 #endif /* __cplusplus */
135 #endif /* __GTK_LIST_H__ */