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#if !defined (GTK_DISABLE_DEPRECATED) || defined (__GTK_LIST_C__)
28
29#ifndef __GTK_LIST_H__
30#define __GTK_LIST_H__
31
32#include <gtk/gtk.h>
33
34G_BEGIN_DECLS
35
36#define GTK_TYPE_LIST (gtk_list_get_type ())
37#define GTK_LIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_LIST, GtkList))
38#define GTK_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST, GtkListClass))
39#define GTK_IS_LIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_LIST))
40#define GTK_IS_LIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST))
41#define GTK_LIST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_LIST, GtkListClass))
42
43
44typedef struct _GtkList GtkList;
45typedef struct _GtkListClass GtkListClass;
46
47struct _GtkList
48{
49 GtkContainer container;
50
51 GList *children;
52 GList *selection;
53
54 GList *undo_selection;
55 GList *undo_unselection;
56
57 GtkWidget *last_focus_child;
58 GtkWidget *undo_focus_child;
59
60 guint htimer;
61 guint vtimer;
62
63 gint anchor;
64 gint drag_pos;
65 GtkStateType anchor_state;
66
67 guint selection_mode : 2;
68 guint drag_selection:1;
69 guint add_mode:1;
70};
71
72struct _GtkListClass
73{
74 GtkContainerClass parent_class;
75
76 void (* selection_changed) (GtkList *list);
77 void (* select_child) (GtkList *list,
78 GtkWidget *child);
79 void (* unselect_child) (GtkList *list,
80 GtkWidget *child);
81};
82
83
84GType gtk_list_get_type (void) G_GNUC_CONST;
85GtkWidget* gtk_list_new (void);
86void gtk_list_insert_items (GtkList *list,
87 GList *items,
88 gint position);
89void gtk_list_append_items (GtkList *list,
90 GList *items);
91void gtk_list_prepend_items (GtkList *list,
92 GList *items);
93void gtk_list_remove_items (GtkList *list,
94 GList *items);
95void gtk_list_remove_items_no_unref (GtkList *list,
96 GList *items);
97void gtk_list_clear_items (GtkList *list,
98 gint start,
99 gint end);
100void gtk_list_select_item (GtkList *list,
101 gint item);
102void gtk_list_unselect_item (GtkList *list,
103 gint item);
104void gtk_list_select_child (GtkList *list,
105 GtkWidget *child);
106void gtk_list_unselect_child (GtkList *list,
107 GtkWidget *child);
108gint gtk_list_child_position (GtkList *list,
109 GtkWidget *child);
110void gtk_list_set_selection_mode (GtkList *list,
111 GtkSelectionMode mode);
112
113void gtk_list_extend_selection (GtkList *list,
114 GtkScrollType scroll_type,
115 gfloat position,
116 gboolean auto_start_selection);
117void gtk_list_start_selection (GtkList *list);
118void gtk_list_end_selection (GtkList *list);
119void gtk_list_select_all (GtkList *list);
120void gtk_list_unselect_all (GtkList *list);
121void gtk_list_scroll_horizontal (GtkList *list,
122 GtkScrollType scroll_type,
123 gfloat position);
124void gtk_list_scroll_vertical (GtkList *list,
125 GtkScrollType scroll_type,
126 gfloat position);
127void gtk_list_toggle_add_mode (GtkList *list);
128void gtk_list_toggle_focus_row (GtkList *list);
129void gtk_list_toggle_row (GtkList *list,
130 GtkWidget *item);
131void gtk_list_undo_selection (GtkList *list);
132void gtk_list_end_drag_selection (GtkList *list);
133
134G_END_DECLS
135
136#endif /* __GTK_LIST_H__ */
137
138#endif /* GTK_DISABLE_DEPRECATED */
139