]> Pileus Git - ~andy/gtk/blob - gtk/gtkiconviewprivate.h
Change FSF Address
[~andy/gtk] / gtk / gtkiconviewprivate.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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #include "gtk/gtkiconview.h"
19
20 #ifndef __GTK_ICON_VIEW_PRIVATE_H__
21 #define __GTK_ICON_VIEW_PRIVATE_H__
22
23 typedef struct _GtkIconViewItem GtkIconViewItem;
24 struct _GtkIconViewItem
25 {
26   /* First member is always the rectangle so it 
27    * can be cast to a rectangle. */
28   GdkRectangle cell_area;
29
30   GtkTreeIter iter;
31   gint index;
32   
33   gint row, col;
34
35   guint prelight : 1;
36   guint selected : 1;
37   guint selected_before_rubberbanding : 1;
38
39 };
40
41 struct _GtkIconViewPrivate
42 {
43   GtkCellArea        *cell_area;
44   GtkCellAreaContext *cell_area_context;
45
46   gulong              add_editable_id;
47   gulong              remove_editable_id;
48   gulong              context_changed_id;
49
50   GPtrArray          *row_contexts;
51
52   gint width, height;
53
54   GtkSelectionMode selection_mode;
55
56   guint layout_idle_id;
57
58   GdkWindow *bin_window;
59
60   GList *children;
61
62   GtkTreeModel *model;
63
64   GList *items;
65
66   GtkAdjustment *hadjustment;
67   GtkAdjustment *vadjustment;
68
69   gint rubberband_x1, rubberband_y1;
70   gint rubberband_x2, rubberband_y2;
71   GdkDevice *rubberband_device;
72
73   guint scroll_timeout_id;
74   gint scroll_value_diff;
75   gint event_last_x, event_last_y;
76
77   GtkIconViewItem *anchor_item;
78   GtkIconViewItem *cursor_item;
79
80   GtkIconViewItem *last_single_clicked;
81   GtkIconViewItem *last_prelight;
82
83   GtkOrientation item_orientation;
84
85   gint columns;
86   gint item_width;
87   gint spacing;
88   gint row_spacing;
89   gint column_spacing;
90   gint margin;
91   gint item_padding;
92
93   gint text_column;
94   gint markup_column;
95   gint pixbuf_column;
96   gint tooltip_column;
97
98   GtkCellRenderer *pixbuf_cell;
99   GtkCellRenderer *text_cell;
100
101   /* Drag-and-drop. */
102   GdkModifierType start_button_mask;
103   gint pressed_button;
104   gint press_start_x;
105   gint press_start_y;
106
107   GdkDragAction source_actions;
108   GdkDragAction dest_actions;
109
110   GtkTreeRowReference *dest_item;
111   GtkIconViewDropPosition dest_pos;
112
113   /* scroll to */
114   GtkTreeRowReference *scroll_to_path;
115   gfloat scroll_to_row_align;
116   gfloat scroll_to_col_align;
117   guint scroll_to_use_align : 1;
118
119   guint source_set : 1;
120   guint dest_set : 1;
121   guint reorderable : 1;
122   guint empty_view_drop :1;
123
124   guint modify_selection_pressed : 1;
125   guint extend_selection_pressed : 1;
126
127   guint draw_focus : 1;
128
129   /* GtkScrollablePolicy needs to be checked when
130    * driving the scrollable adjustment values */
131   guint hscroll_policy : 1;
132   guint vscroll_policy : 1;
133
134   guint doing_rubberband : 1;
135
136 };
137
138 void                 _gtk_icon_view_set_cell_data                  (GtkIconView            *icon_view,
139                                                                     GtkIconViewItem        *item);
140 void                 _gtk_icon_view_set_cursor_item                (GtkIconView            *icon_view,
141                                                                     GtkIconViewItem        *item,
142                                                                     GtkCellRenderer        *cursor_cell);
143 GtkIconViewItem *    _gtk_icon_view_get_item_at_coords             (GtkIconView            *icon_view,
144                                                                     gint                    x,
145                                                                     gint                    y,
146                                                                     gboolean                only_in_cell,
147                                                                     GtkCellRenderer       **cell_at_pos);
148 void                 _gtk_icon_view_select_item                    (GtkIconView            *icon_view,
149                                                                     GtkIconViewItem        *item);
150 void                 _gtk_icon_view_unselect_item                  (GtkIconView            *icon_view,
151                                                                     GtkIconViewItem        *item);
152
153 G_END_DECLS
154
155 #endif /* __GTK_ICON_VIEW_PRIVATE_H__ */