| 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 | |
| 34 | G_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 | |
| 44 | typedef struct _GtkList GtkList; |
| 45 | typedef struct _GtkListClass GtkListClass; |
| 46 | |
| 47 | struct _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 | |
| 72 | struct _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 | |
| 84 | GType gtk_list_get_type (void) G_GNUC_CONST; |
| 85 | GtkWidget* gtk_list_new (void); |
| 86 | void gtk_list_insert_items (GtkList *list, |
| 87 | GList *items, |
| 88 | gint position); |
| 89 | void gtk_list_append_items (GtkList *list, |
| 90 | GList *items); |
| 91 | void gtk_list_prepend_items (GtkList *list, |
| 92 | GList *items); |
| 93 | void gtk_list_remove_items (GtkList *list, |
| 94 | GList *items); |
| 95 | void gtk_list_remove_items_no_unref (GtkList *list, |
| 96 | GList *items); |
| 97 | void gtk_list_clear_items (GtkList *list, |
| 98 | gint start, |
| 99 | gint end); |
| 100 | void gtk_list_select_item (GtkList *list, |
| 101 | gint item); |
| 102 | void gtk_list_unselect_item (GtkList *list, |
| 103 | gint item); |
| 104 | void gtk_list_select_child (GtkList *list, |
| 105 | GtkWidget *child); |
| 106 | void gtk_list_unselect_child (GtkList *list, |
| 107 | GtkWidget *child); |
| 108 | gint gtk_list_child_position (GtkList *list, |
| 109 | GtkWidget *child); |
| 110 | void gtk_list_set_selection_mode (GtkList *list, |
| 111 | GtkSelectionMode mode); |
| 112 | |
| 113 | void gtk_list_extend_selection (GtkList *list, |
| 114 | GtkScrollType scroll_type, |
| 115 | gfloat position, |
| 116 | gboolean auto_start_selection); |
| 117 | void gtk_list_start_selection (GtkList *list); |
| 118 | void gtk_list_end_selection (GtkList *list); |
| 119 | void gtk_list_select_all (GtkList *list); |
| 120 | void gtk_list_unselect_all (GtkList *list); |
| 121 | void gtk_list_scroll_horizontal (GtkList *list, |
| 122 | GtkScrollType scroll_type, |
| 123 | gfloat position); |
| 124 | void gtk_list_scroll_vertical (GtkList *list, |
| 125 | GtkScrollType scroll_type, |
| 126 | gfloat position); |
| 127 | void gtk_list_toggle_add_mode (GtkList *list); |
| 128 | void gtk_list_toggle_focus_row (GtkList *list); |
| 129 | void gtk_list_toggle_row (GtkList *list, |
| 130 | GtkWidget *item); |
| 131 | void gtk_list_undo_selection (GtkList *list); |
| 132 | void gtk_list_end_drag_selection (GtkList *list); |
| 133 | |
| 134 | G_END_DECLS |
| 135 | |
| 136 | #endif /* __GTK_LIST_H__ */ |
| 137 | |
| 138 | #endif /* GTK_DISABLE_DEPRECATED */ |
| 139 | |