]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconview.h
Add pointer warping to GDK. (#160437)
[~andy/gtk] / gtk / gtkiconview.h
1 /* gtkiconview.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 __GTK_ICON_VIEW_H__
20 #define __GTK_ICON_VIEW_H__
21
22 #include <gtk/gtkcontainer.h>
23 #include <gtk/gtktreemodel.h>
24
25 G_BEGIN_DECLS
26
27 #define GTK_TYPE_ICON_VIEW              (gtk_icon_view_get_type ())
28 #define GTK_ICON_VIEW(obj)              (GTK_CHECK_CAST ((obj), GTK_TYPE_ICON_VIEW, GtkIconView))
29 #define GTK_ICON_VIEW_CLASS(klass)      (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
30 #define GTK_IS_ICON_VIEW(obj)           (GTK_CHECK_TYPE ((obj), GTK_TYPE_ICON_VIEW))
31 #define GTK_IS_ICON_VIEW_CLASS(klass)   (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_ICON_VIEW))
32 #define GTK_ICON_VIEW_GET_CLASS(obj)    (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_ICON_VIEW, GtkIconViewClass))
33
34 typedef struct _GtkIconView           GtkIconView;
35 typedef struct _GtkIconViewClass      GtkIconViewClass;
36 typedef struct _GtkIconViewPrivate    GtkIconViewPrivate;
37
38 typedef void (* GtkIconViewForeachFunc)     (GtkIconView      *icon_view,
39                                              GtkTreePath      *path,
40                                              gpointer          data);
41
42 struct _GtkIconView
43 {
44   GtkContainer parent;
45
46   GtkIconViewPrivate *priv;
47 };
48
49 struct _GtkIconViewClass
50 {
51   GtkContainerClass parent_class;
52
53   void    (* set_scroll_adjustments) (GtkIconView      *icon_view,
54                                       GtkAdjustment    *hadjustment,
55                                       GtkAdjustment    *vadjustment);
56   
57   void    (* item_activated)         (GtkIconView      *icon_view,
58                                       GtkTreePath      *path);
59   void    (* selection_changed)      (GtkIconView      *icon_view);
60
61   /* Key binding signals */
62   void    (* select_all)             (GtkIconView      *icon_view);
63   void    (* unselect_all)           (GtkIconView      *icon_view);
64   void    (* select_cursor_item)     (GtkIconView      *icon_view);
65   void    (* toggle_cursor_item)     (GtkIconView      *icon_view);
66   gboolean (* move_cursor)           (GtkIconView      *icon_view,
67                                       GtkMovementStep   step,
68                                       gint              count);
69   gboolean (* activate_cursor_item)  (GtkIconView      *icon_view);
70 };
71
72 GType      gtk_icon_view_get_type       (void) G_GNUC_CONST;
73 GtkWidget *gtk_icon_view_new            (void);
74 GtkWidget *gtk_icon_view_new_with_model (GtkTreeModel *model);
75
76 void          gtk_icon_view_set_model         (GtkIconView  *icon_view,
77                                                GtkTreeModel *model);
78 GtkTreeModel *gtk_icon_view_get_model         (GtkIconView  *icon_view);
79 void          gtk_icon_view_set_text_column   (GtkIconView  *icon_view,
80                                                gint          column);
81 gint          gtk_icon_view_get_text_column   (GtkIconView  *icon_view);
82 void          gtk_icon_view_set_markup_column (GtkIconView  *icon_view,
83                                                gint          column);
84 gint          gtk_icon_view_get_markup_column (GtkIconView  *icon_view);
85 void          gtk_icon_view_set_pixbuf_column (GtkIconView  *icon_view,
86                                                gint          column);
87 gint          gtk_icon_view_get_pixbuf_column (GtkIconView  *icon_view);
88
89 void           gtk_icon_view_set_orientation   (GtkIconView    *icon_view,
90                                                 GtkOrientation  orientation);
91 GtkOrientation gtk_icon_view_get_orientation   (GtkIconView    *icon_view);
92 void          gtk_icon_view_set_columns        (GtkIconView    *icon_view,
93                                                 gint            columns);
94 gint          gtk_icon_view_get_columns        (GtkIconView    *icon_view);
95 void          gtk_icon_view_set_item_width     (GtkIconView    *icon_view,
96                                                 gint            item_width);
97 gint          gtk_icon_view_get_item_width     (GtkIconView    *icon_view);
98 void          gtk_icon_view_set_spacing        (GtkIconView    *icon_view, 
99                                                 gint            spacing);
100 gint          gtk_icon_view_get_spacing        (GtkIconView    *icon_view);
101 void          gtk_icon_view_set_row_spacing    (GtkIconView    *icon_view, 
102                                                 gint            row_spacing);
103 gint          gtk_icon_view_get_row_spacing    (GtkIconView    *icon_view);
104 void          gtk_icon_view_set_column_spacing (GtkIconView    *icon_view, 
105                                                 gint            column_spacing);
106 gint          gtk_icon_view_get_column_spacing (GtkIconView    *icon_view);
107 void          gtk_icon_view_set_margin         (GtkIconView    *icon_view, 
108                                                 gint            margin);
109 gint          gtk_icon_view_get_margin         (GtkIconView    *icon_view);
110
111
112 GtkTreePath *    gtk_icon_view_get_path_at_pos    (GtkIconView            *icon_view,
113                                                    gint                    x,
114                                                    gint                    y);
115 void             gtk_icon_view_selected_foreach   (GtkIconView            *icon_view,
116                                                    GtkIconViewForeachFunc  func,
117                                                    gpointer                data);
118 void             gtk_icon_view_set_selection_mode (GtkIconView            *icon_view,
119                                                    GtkSelectionMode        mode);
120 GtkSelectionMode gtk_icon_view_get_selection_mode (GtkIconView            *icon_view);
121 void             gtk_icon_view_select_path        (GtkIconView            *icon_view,
122                                                    GtkTreePath            *path);
123 void             gtk_icon_view_unselect_path      (GtkIconView            *icon_view,
124                                                    GtkTreePath            *path);
125 gboolean         gtk_icon_view_path_is_selected   (GtkIconView            *icon_view,
126                                                    GtkTreePath            *path);
127 GList           *gtk_icon_view_get_selected_items (GtkIconView            *icon_view);
128 void             gtk_icon_view_select_all         (GtkIconView            *icon_view);
129 void             gtk_icon_view_unselect_all       (GtkIconView            *icon_view);
130 void             gtk_icon_view_item_activated     (GtkIconView            *icon_view,
131                                                    GtkTreePath            *path);
132 G_END_DECLS
133
134 #endif /* __GTK_ICON_VIEW_H__ */