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