1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
/* gnome-icon-container-private.h
4
Copyright (C) 1999, 2000 Free Software Foundation
5
Copyright (C) 2000 Eazel, Inc.
7
The Gnome Library is free software; you can redistribute it and/or
8
modify it under the terms of the GNU Library General Public License as
9
published by the Free Software Foundation; either version 2 of the
10
License, or (at your option) any later version.
12
The Gnome Library is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
Library General Public License for more details.
17
You should have received a copy of the GNU Library General Public
18
License along with the Gnome Library; see the file COPYING.LIB. If not,
19
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
Boston, MA 02111-1307, USA.
22
Author: Ettore Perazzoli <ettore@gnu.org>
25
#ifndef NAUTILUS_ICON_CONTAINER_PRIVATE_H
26
#define NAUTILUS_ICON_CONTAINER_PRIVATE_H
28
#include <eel/eel-glib-extensions.h>
29
#include <libnautilus-private/nautilus-icon-canvas-item.h>
30
#include <libnautilus-private/nautilus-icon-container.h>
31
#include <libnautilus-private/nautilus-icon-dnd.h>
36
/* Object represented by this icon. */
37
NautilusIconData *data;
39
/* Canvas item for the icon. */
40
NautilusIconCanvasItem *item;
42
/* X/Y coordinates. */
46
* In RTL mode x is RTL x position, we use saved_ltr_x for
47
* keeping track of x value before it gets converted into
48
* RTL value, this is used for saving the icon position
49
* to the nautilus metafile.
53
/* Scale factor (stretches icon). */
56
/* Whether this item is selected. */
57
eel_boolean_bit is_selected : 1;
59
/* Whether this item was selected before rubberbanding. */
60
eel_boolean_bit was_selected_before_rubberband : 1;
62
/* Whether this item is visible in the view. */
63
eel_boolean_bit is_visible : 1;
65
/* Whether a monitor was set on this icon. */
66
eel_boolean_bit is_monitored : 1;
68
eel_boolean_bit has_lazy_position : 1;
72
/* Private NautilusIconContainer members. */
77
double start_x, start_y;
79
EelCanvasItem *selection_rectangle;
87
} NautilusIconRubberbandInfo;
91
DRAG_STATE_MOVE_OR_COPY,
96
/* Pointer position in canvas coordinates. */
97
int pointer_x, pointer_y;
99
/* Icon top, left, and size in canvas coordinates. */
112
LABEL_COLOR_HIGHLIGHT,
114
LABEL_COLOR_PRELIGHT,
116
LABEL_INFO_COLOR_HIGHLIGHT,
117
LABEL_INFO_COLOR_ACTIVE,
121
struct NautilusIconContainerDetails {
125
GHashTable *icon_set;
127
/* Current icon for keyboard navigation. */
128
NautilusIcon *keyboard_focus;
129
NautilusIcon *keyboard_rubberband_start;
131
/* Current icon with stretch handles, so we have only one. */
132
NautilusIcon *stretch_icon;
133
double stretch_initial_x, stretch_initial_y;
134
guint stretch_initial_size;
136
/* Last highlighted drop target. */
137
NautilusIcon *drop_target;
139
/* Rubberbanding status. */
140
NautilusIconRubberbandInfo rubberband_info;
142
/* Timeout used to make a selected icon fully visible after a short
143
* period of time. (The timeout is needed to make sure
144
* double-clicking still works.)
146
guint keyboard_icon_reveal_timer_id;
147
NautilusIcon *keyboard_icon_to_reveal;
149
/* Used to coalesce selection changed signals in some cases */
150
guint selection_changed_id;
152
/* If a request is made to reveal an unpositioned icon we remember
153
* it and reveal it once it gets positioned (in relayout).
155
NautilusIcon *pending_icon_to_reveal;
157
/* If a request is made to rename an unpositioned icon we remember
158
* it and start renaming it once it gets positioned (in relayout).
160
NautilusIcon *pending_icon_to_rename;
162
/* Remembered information about the start of the current event. */
163
guint32 button_down_time;
165
/* Drag state. Valid only if drag_button is non-zero. */
167
NautilusIcon *drag_icon;
169
DragState drag_state;
170
gboolean drag_started;
171
StretchState stretch_start;
172
gboolean drag_allow_moves;
174
gboolean icon_selected_on_button_down;
175
NautilusIcon *double_click_icon[2]; /* Both clicks in a double click need to be on the same icon */
176
guint double_click_button[2];
178
NautilusIcon *range_selection_base_icon;
180
/* Renaming Details */
182
GtkWidget *rename_widget; /* Editable text item */
183
char *original_text; /* Copy of editable text for later compare */
188
/* Idle handler for stretch code */
189
guint stretch_idle_id;
195
NautilusIconDndInfo *dnd_info;
200
/* specific fonts used to draw labels */
203
/* font sizes used to draw labels */
204
int font_size_table[NAUTILUS_ZOOM_LEVEL_LARGEST + 1];
206
/* State used so arrow keys don't wander if icons aren't lined up.
208
int arrow_key_start_x;
209
int arrow_key_start_y;
210
GtkDirectionType arrow_key_direction;
213
gboolean single_click_mode;
214
gboolean auto_layout;
215
gboolean tighter_layout;
216
gboolean active_background;
218
/* Whether for the vertical layout, all columns are supposed to
219
* have the same width. */
220
gboolean all_columns_same_width;
223
NautilusIconLayoutMode layout_mode;
226
NautilusIconLabelPosition label_position;
228
/* Forced icon size, iff greater than 0 */
229
int forced_icon_size;
231
/* Should the container keep icons aligned to a grid */
232
gboolean keep_aligned;
234
/* Set to TRUE after first allocation has been done */
235
gboolean has_been_allocated;
237
int size_allocation_count;
238
guint size_allocation_count_id;
240
/* Is the container fixed or resizable */
241
gboolean is_fixed_size;
243
/* Is the container for a desktop window */
246
/* Ignore the visible area the next time the scroll region is recomputed */
247
gboolean reset_scroll_region_trigger;
249
/* The position we are scaling to on stretch */
253
/* margins to follow, used for the desktop panel avoidance */
259
/* Whether we should use drop shadows for the icon labels or not */
260
gboolean use_drop_shadows;
261
gboolean drop_shadows_requested;
263
/* a11y items used by canvas items */
264
guint a11y_item_action_idle_handler;
265
GQueue* a11y_item_action_queue;
267
eel_boolean_bit is_loading : 1;
268
eel_boolean_bit needs_resort : 1;
270
eel_boolean_bit store_layout_timestamps : 1;
271
eel_boolean_bit store_layout_timestamps_when_finishing_new_icons : 1;
272
time_t layout_timestamp;
274
/* interactive search */
275
gboolean disable_popdown;
276
gboolean imcontext_changed;
278
GtkWidget *search_window;
279
GtkWidget *search_entry;
280
guint search_entry_changed_id;
281
guint typeselect_flush_timeout;
284
/* Private functions shared by mutiple files. */
285
NautilusIcon *nautilus_icon_container_get_icon_by_uri (NautilusIconContainer *container,
287
void nautilus_icon_container_move_icon (NautilusIconContainer *container,
294
gboolean update_position);
295
void nautilus_icon_container_select_list_unselect_others (NautilusIconContainer *container,
297
char * nautilus_icon_container_get_icon_uri (NautilusIconContainer *container,
299
char * nautilus_icon_container_get_icon_drop_target_uri (NautilusIconContainer *container,
301
void nautilus_icon_container_update_icon (NautilusIconContainer *container,
303
gboolean nautilus_icon_container_has_stored_icon_positions (NautilusIconContainer *container);
304
gboolean nautilus_icon_container_scroll (NautilusIconContainer *container,
307
void nautilus_icon_container_update_scroll_region (NautilusIconContainer *container);
309
#endif /* NAUTILUS_ICON_CONTAINER_PRIVATE_H */