]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
Fix the "selection_changed" signal to not get emitted twice in some cases.
[~andy/gtk] / gtk / gtkiconview.h
1 /* eggiconlist.h
2  * Copyright (C) 2002, 2004  Anders Carlsson <andersca@gnome.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 #include <gtk/gtktreemodel.h>
24
25 G_BEGIN_DECLS
26
27 #define EGG_TYPE_ICON_LIST              (egg_icon_list_get_type ())
28 #define EGG_ICON_LIST(obj)              (GTK_CHECK_CAST ((obj), EGG_TYPE_ICON_LIST, EggIconList))
29 #define EGG_ICON_LIST_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), EGG_TYPE_ICON_LIST, EggIconListClass))
30 #define EGG_IS_ICON_LIST(obj)           (GTK_CHECK_TYPE ((obj), EGG_TYPE_ICON_LIST))
31 #define EGG_IS_ICON_LIST_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), EGG_TYPE_ICON_LIST))
32 #define EGG_ICON_LIST_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), EGG_TYPE_ICON_LIST, EggIconListClass))
33
34 typedef struct _EggIconList           EggIconList;
35 typedef struct _EggIconListClass      EggIconListClass;
36 typedef struct _EggIconListPrivate    EggIconListPrivate;
37 typedef struct _EggIconListItem       EggIconListItem;
38
39 typedef void (* EggIconListForeachFunc)     (EggIconList      *icon_list,
40                                              GtkTreePath      *path,
41                                              gpointer          data);
42
43 struct _EggIconList
44 {
45   GtkContainer parent;
46
47   EggIconListPrivate *priv;
48 };
49
50 struct _EggIconListClass
51 {
52   GtkContainerClass parent_class;
53
54   void    (* set_scroll_adjustments) (EggIconList      *icon_list,
55                                       GtkAdjustment    *hadjustment,
56                                       GtkAdjustment    *vadjustment);
57   
58   void    (* item_activated)         (EggIconList      *icon_list,
59                                       GtkTreePath      *path);
60   void    (* selection_changed)      (EggIconList      *icon_list);
61
62   /* Key binding signals */
63   void    (* select_all)             (EggIconList      *icon_list);
64   void    (* unselect_all)           (EggIconList      *icon_list);
65   void    (* select_cursor_item)     (EggIconList      *icon_list);
66   void    (* toggle_cursor_item)     (EggIconList      *icon_list);
67   gboolean (* move_cursor)           (EggIconList      *icon_list,
68                                       GtkMovementStep   step,
69                                       gint              count);
70 };
71
72 GType      egg_icon_list_get_type       (void);
73 GtkWidget *egg_icon_list_new            (void);
74 GtkWidget *egg_icon_list_new_with_model (GtkTreeModel *model);
75
76 void          egg_icon_list_set_model         (EggIconList  *icon_list,
77                                                GtkTreeModel *model);
78 GtkTreeModel *egg_icon_list_get_model         (EggIconList  *icon_list);
79 void          egg_icon_list_set_text_column   (EggIconList  *icon_list,
80                                                gint          column);
81 gint          egg_icon_list_get_text_column   (EggIconList  *icon_list);
82 void          egg_icon_list_set_markup_column (EggIconList  *icon_list,
83                                                int           column);
84 gint          egg_icon_list_get_markup_column (EggIconList  *icon_list);
85 void          egg_icon_list_set_pixbuf_column (EggIconList  *icon_list,
86                                                gint          column);
87 gint          egg_icon_list_get_pixbuf_column (EggIconList  *icon_list);
88
89
90 GtkTreePath *    egg_icon_list_get_path_at_pos    (EggIconList            *icon_list,
91                                                    gint                    x,
92                                                    gint                    y);
93 void             egg_icon_list_selected_foreach   (EggIconList            *icon_list,
94                                                    EggIconListForeachFunc  func,
95                                                    gpointer                data);
96 void             egg_icon_list_set_selection_mode (EggIconList            *icon_list,
97                                                    GtkSelectionMode        mode);
98 GtkSelectionMode egg_icon_list_get_selection_mode (EggIconList            *icon_list);
99 void             egg_icon_list_select_path        (EggIconList            *icon_list,
100                                                    GtkTreePath            *path);
101 void             egg_icon_list_unselect_path      (EggIconList            *icon_list,
102                                                    GtkTreePath            *path);
103 gboolean         egg_icon_list_path_is_selected   (EggIconList            *icon_list,
104                                                    GtkTreePath            *path);
105 GList           *egg_icon_list_get_selected_items (EggIconList            *icon_list);
106 void             egg_icon_list_select_all         (EggIconList            *icon_list);
107 void             egg_icon_list_unselect_all       (EggIconList            *icon_list);
108 void             egg_icon_list_item_activated     (EggIconList            *icon_list,
109                                                    GtkTreePath            *path);
110
111
112
113 G_END_DECLS
114
115 #endif /* __EGG_ICON_LIST_H__ */