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