]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
Make this compile again.
[~andy/gtk] / gtk / gtkiconview.h
1 /* eggiconlist.h
2  * Copyright (C) 2002  Anders Carlsson <andersca@gnu.org>
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 __EGG_ICON_LIST_H__
20 #define __EGG_ICON_LIST_H__
21
22 #include <gtk/gtkcontainer.h>
23
24 G_BEGIN_DECLS
25
26 #define EGG_TYPE_ICON_LIST              (egg_icon_list_get_type ())
27 #define EGG_ICON_LIST(obj)              (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST, EggIconList))
28 #define EGG_ICON_LIST_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_ICON_LIST, EggIconListClass))
29 #define EGG_IS_ICON_LIST(obj)           (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST))
30 #define EGG_IS_ICON_LIST_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST))
31 #define EGG_ICON_LIST_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass))
32
33 #define EGG_TYPE_ICON_LIST_ITEM         (egg_icon_list_item_get_type ())
34 #define EGG_ICON_LIST_ITEM(obj)         (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST_ITEM, EggIconListItem))
35 #define EGG_IS_ICON_LIST_ITEM(obj)      (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST_ITEM))
36
37 typedef struct _EggIconList           EggIconList;
38 typedef struct _EggIconListClass      EggIconListClass;
39 typedef struct _EggIconListPrivate    EggIconListPrivate;
40 typedef struct _EggIconListItem       EggIconListItem;
41
42 typedef void (* EggIconListForeachFunc)     (EggIconList      *icon_list,
43                                              EggIconListItem  *item,
44                                              gpointer          data);
45 typedef gint (* EggIconListItemCompareFunc) (EggIconList      *icon_list,
46                                              EggIconListItem  *a,
47                                              EggIconListItem  *b,
48                                              gpointer          user_data);
49
50 struct _EggIconList
51 {
52   GtkContainer parent;
53
54   EggIconListPrivate *priv;
55 };
56
57 struct _EggIconListClass
58 {
59   GtkContainerClass parent_class;
60
61   void    (* set_scroll_adjustments) (EggIconList      *icon_list,
62                                       GtkAdjustment    *hadjustment,
63                                       GtkAdjustment    *vadjustment);
64   
65   void    (* item_activated)         (EggIconList      *icon_list,
66                                       EggIconListItem  *item);
67   void    (* selection_changed)      (EggIconList      *icon_list);
68   void    (* item_added)             (EggIconList      *icon_list,
69                                       EggIconListItem  *item);
70   void    (* item_removed)           (EggIconList      *icon_list,
71                                       EggIconListItem  *item);
72   void    (* item_changed)           (EggIconList      *icon_list,
73                                       EggIconListItem  *item);
74   /* Key binding signals */
75   void    (* select_all)             (EggIconList      *icon_list);
76   void    (* unselect_all)           (EggIconList      *icon_list);
77   void    (* select_cursor_item)     (EggIconList      *icon_list);
78   void    (* toggle_cursor_item)     (EggIconList      *icon_list);
79 };
80
81 GType      egg_icon_list_get_type      (void);
82 GType      egg_icon_list_item_get_type (void);
83 GtkWidget *egg_icon_list_new           (void);
84
85 EggIconListItem *     egg_icon_list_item_new           (GdkPixbuf                  *icon,
86                                                         const gchar                *label);
87 void                  egg_icon_list_item_set_data      (EggIconListItem            *item,
88                                                         gpointer                    data);
89 void                  egg_icon_list_item_set_data_full (EggIconListItem            *item,
90                                                         gpointer                    data,
91                                                         GDestroyNotify              destroy_notify);
92 gpointer              egg_icon_list_item_get_data      (EggIconListItem            *item);
93 void                  egg_icon_list_item_set_label     (EggIconListItem            *item,
94                                                         const char                 *label);
95 G_CONST_RETURN gchar *egg_icon_list_item_get_label     (EggIconListItem            *item);
96 void                  egg_icon_list_item_set_icon      (EggIconListItem            *item,
97                                                         GdkPixbuf                  *icon);
98 GdkPixbuf *           egg_icon_list_item_get_icon      (EggIconListItem            *item);
99 void                  egg_icon_list_append_item        (EggIconList                *icon_list,
100                                                         EggIconListItem            *item);
101 void                  egg_icon_list_prepend_item       (EggIconList                *icon_list,
102                                                         EggIconListItem            *item);
103 void                  egg_icon_list_insert_item_before (EggIconList                *icon_list,
104                                                         EggIconListItem            *sibling,
105                                                         EggIconListItem            *item);
106 void                  egg_icon_list_insert_item_after  (EggIconList                *icon_list,
107                                                         EggIconListItem            *sibling,
108                                                         EggIconListItem            *item);
109 void                  egg_icon_list_remove_item        (EggIconList                *icon_list,
110                                                         EggIconListItem            *item);
111 EggIconListItem *     egg_icon_list_get_item_at_pos    (EggIconList                *icon_list,
112                                                         gint                        x,
113                                                         gint                        y);
114 gint                  egg_icon_list_get_item_count     (EggIconList                *icon_list);
115 void                  egg_icon_list_foreach            (EggIconList                *icon_list,
116                                                         EggIconListForeachFunc      func,
117                                                         gpointer                    data);
118 GList *               egg_icon_list_get_selected       (EggIconList                *icon_list);
119 void                  egg_icon_list_selected_foreach   (EggIconList                *icon_list,
120                                                         EggIconListForeachFunc      func,
121                                                         gpointer                    data);
122 void                  egg_icon_list_set_selection_mode (EggIconList                *icon_list,
123                                                         GtkSelectionMode            mode);
124 GtkSelectionMode      egg_icon_list_get_selection_mode (EggIconList                *icon_list);
125 void                  egg_icon_list_select_item        (EggIconList                *icon_list,
126                                                         EggIconListItem            *item);
127 void                  egg_icon_list_unselect_item      (EggIconList                *icon_list,
128                                                         EggIconListItem            *item);
129 gboolean              egg_icon_list_item_is_selected   (EggIconListItem            *item);
130 void                  egg_icon_list_select_all         (EggIconList                *icon_list);
131 void                  egg_icon_list_unselect_all       (EggIconList                *icon_list);
132 void                  egg_icon_list_set_sorted         (EggIconList                *icon_list,
133                                                         gboolean                    sorted);
134 gboolean              egg_icon_list_get_sorted         (EggIconList                *icon_list);
135 void                  egg_icon_list_set_sort_func      (EggIconList                *icon_list,
136                                                         EggIconListItemCompareFunc  func,
137                                                         gpointer                    data,
138                                                         GDestroyNotify              destroy_notify);
139 void                  egg_icon_list_set_sort_order     (EggIconList                *icon_list,
140                                                         GtkSortType                 order);
141 GtkSortType           egg_icon_list_get_sort_order     (EggIconList                *icon_list);
142 void                  egg_icon_list_item_activated     (EggIconList                *icon_list,
143                                                         EggIconListItem            *item);
144
145 /* For accessibility */
146 GList                *egg_icon_list_get_items          (EggIconList                *icon_list);
147
148 G_END_DECLS
149
150 #endif /* __EGG_ICON_LIST_H__ */