Commit fc450bbd authored by William Jon McCann's avatar William Jon McCann

Rename icon view to canvas view

This will allow us to retain canvas view for the desktop directory
but implement a new icon view for other folders.

https://bugzilla.gnome.org/show_bug.cgi?id=681370
parent 63e4bb8b
......@@ -61,6 +61,13 @@ libnautilus_private_la_LIBADD = \
libnautilus_private_la_SOURCES = \
nautilus-bookmark.c \
nautilus-bookmark.h \
nautilus-canvas-container.c \
nautilus-canvas-container.h \
nautilus-canvas-dnd.c \
nautilus-canvas-dnd.h \
nautilus-canvas-item.c \
nautilus-canvas-item.h \
nautilus-canvas-private.h \
nautilus-clipboard-monitor.c \
nautilus-clipboard-monitor.h \
nautilus-clipboard.c \
......@@ -118,13 +125,6 @@ libnautilus_private_la_SOURCES = \
nautilus-generated.h \
nautilus-global-preferences.c \
nautilus-global-preferences.h \
nautilus-icon-canvas-item.c \
nautilus-icon-canvas-item.h \
nautilus-icon-container.c \
nautilus-icon-container.h \
nautilus-icon-dnd.c \
nautilus-icon-dnd.h \
nautilus-icon-private.h \
nautilus-icon-info.c \
nautilus-icon-info.h \
nautilus-icon-names.h \
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-canvas-container.h - Canvas container widget.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ettore Perazzoli <ettore@gnu.org>, Darin Adler <darin@bentspoon.com>
*/
#ifndef NAUTILUS_CANVAS_CONTAINER_H
#define NAUTILUS_CANVAS_CONTAINER_H
#include <eel/eel-canvas.h>
#include <libnautilus-private/nautilus-icon-info.h>
#define NAUTILUS_TYPE_CANVAS_CONTAINER nautilus_canvas_container_get_type()
#define NAUTILUS_CANVAS_CONTAINER(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_CANVAS_CONTAINER, NautilusCanvasContainer))
#define NAUTILUS_CANVAS_CONTAINER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CANVAS_CONTAINER, NautilusCanvasContainerClass))
#define NAUTILUS_IS_CANVAS_CONTAINER(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_CANVAS_CONTAINER))
#define NAUTILUS_IS_CANVAS_CONTAINER_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_CANVAS_CONTAINER))
#define NAUTILUS_CANVAS_CONTAINER_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_CANVAS_CONTAINER, NautilusCanvasContainerClass))
#define NAUTILUS_CANVAS_ICON_DATA(pointer) \
((NautilusCanvasIconData *) (pointer))
typedef struct NautilusCanvasIconData NautilusCanvasIconData;
typedef void (* NautilusCanvasCallback) (NautilusCanvasIconData *icon_data,
gpointer callback_data);
typedef struct {
int x;
int y;
double scale;
} NautilusCanvasPosition;
typedef enum {
NAUTILUS_CANVAS_LAYOUT_L_R_T_B,
NAUTILUS_CANVAS_LAYOUT_R_L_T_B,
NAUTILUS_CANVAS_LAYOUT_T_B_L_R,
NAUTILUS_CANVAS_LAYOUT_T_B_R_L
} NautilusCanvasLayoutMode;
typedef enum {
NAUTILUS_CANVAS_LABEL_POSITION_UNDER,
} NautilusCanvasLabelPosition;
#define NAUTILUS_CANVAS_CONTAINER_TYPESELECT_FLUSH_DELAY 1000000
typedef struct NautilusCanvasContainerDetails NautilusCanvasContainerDetails;
typedef struct {
EelCanvas canvas;
NautilusCanvasContainerDetails *details;
} NautilusCanvasContainer;
typedef struct {
EelCanvasClass parent_slot;
/* Operations on the container. */
int (* button_press) (NautilusCanvasContainer *container,
GdkEventButton *event);
void (* context_click_background) (NautilusCanvasContainer *container,
GdkEventButton *event);
void (* middle_click) (NautilusCanvasContainer *container,
GdkEventButton *event);
/* Operations on icons. */
void (* activate) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void (* activate_alternate) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void (* activate_previewer) (NautilusCanvasContainer *container,
GList *files,
GArray *locations);
void (* context_click_selection) (NautilusCanvasContainer *container,
GdkEventButton *event);
void (* move_copy_items) (NautilusCanvasContainer *container,
const GList *item_uris,
GdkPoint *relative_item_points,
const char *target_uri,
GdkDragAction action,
int x,
int y);
void (* handle_netscape_url) (NautilusCanvasContainer *container,
const char *url,
const char *target_uri,
GdkDragAction action,
int x,
int y);
void (* handle_uri_list) (NautilusCanvasContainer *container,
const char *uri_list,
const char *target_uri,
GdkDragAction action,
int x,
int y);
void (* handle_text) (NautilusCanvasContainer *container,
const char *text,
const char *target_uri,
GdkDragAction action,
int x,
int y);
void (* handle_raw) (NautilusCanvasContainer *container,
char *raw_data,
int length,
const char *target_uri,
const char *direct_save_uri,
GdkDragAction action,
int x,
int y);
/* Queries on the container for subclass/client.
* These must be implemented. The default "do nothing" is not good enough.
*/
char * (* get_container_uri) (NautilusCanvasContainer *container);
/* Queries on icons for subclass/client.
* These must be implemented. The default "do nothing" is not
* good enough, these are _not_ signals.
*/
NautilusIconInfo *(* get_icon_images) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
int canvas_size,
char **embedded_text,
gboolean for_drag_accept,
gboolean need_large_embeddded_text,
gboolean *embedded_text_needs_loading,
gboolean *has_window_open);
void (* get_icon_text) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
char **editable_text,
char **additional_text,
gboolean include_invisible);
char * (* get_icon_description) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
int (* compare_icons) (NautilusCanvasContainer *container,
NautilusCanvasIconData *canvas_a,
NautilusCanvasIconData *canvas_b);
int (* compare_icons_by_name) (NautilusCanvasContainer *container,
NautilusCanvasIconData *canvas_a,
NautilusCanvasIconData *canvas_b);
void (* freeze_updates) (NautilusCanvasContainer *container);
void (* unfreeze_updates) (NautilusCanvasContainer *container);
void (* start_monitor_top_left) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
gconstpointer client,
gboolean large_text);
void (* stop_monitor_top_left) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
gconstpointer client);
void (* prioritize_thumbnailing) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
/* Queries on icons for subclass/client.
* These must be implemented => These are signals !
* The default "do nothing" is not good enough.
*/
gboolean (* can_accept_item) (NautilusCanvasContainer *container,
NautilusCanvasIconData *target,
const char *item_uri);
gboolean (* get_stored_icon_position) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
NautilusCanvasPosition *position);
char * (* get_icon_uri) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
char * (* get_icon_drop_target_uri) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
/* If canvas data is NULL, the layout timestamp of the container should be retrieved.
* That is the time when the container displayed a fully loaded directory with
* all canvas positions assigned.
*
* If canvas data is not NULL, the position timestamp of the canvas should be retrieved.
* That is the time when the file (i.e. canvas data payload) was last displayed in a
* fully loaded directory with all canvas positions assigned.
*/
gboolean (* get_stored_layout_timestamp) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
time_t *time);
/* If canvas data is NULL, the layout timestamp of the container should be stored.
* If canvas data is not NULL, the position timestamp of the container should be stored.
*/
gboolean (* store_layout_timestamp) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
const time_t *time);
/* Notifications for the whole container. */
void (* band_select_started) (NautilusCanvasContainer *container);
void (* band_select_ended) (NautilusCanvasContainer *container);
void (* selection_changed) (NautilusCanvasContainer *container);
void (* layout_changed) (NautilusCanvasContainer *container);
/* Notifications for icons. */
void (* icon_position_changed) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
const NautilusCanvasPosition *position);
void (* icon_rename_started) (NautilusCanvasContainer *container,
GtkWidget *renaming_widget);
void (* icon_rename_ended) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
const char *text);
void (* icon_stretch_started) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void (* icon_stretch_ended) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
int (* preview) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data,
gboolean start_flag);
void (* icon_added) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void (* icon_removed) (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void (* cleared) (NautilusCanvasContainer *container);
gboolean (* start_interactive_search) (NautilusCanvasContainer *container);
} NautilusCanvasContainerClass;
/* GtkObject */
GType nautilus_canvas_container_get_type (void);
GtkWidget * nautilus_canvas_container_new (void);
/* adding, removing, and managing icons */
void nautilus_canvas_container_clear (NautilusCanvasContainer *view);
gboolean nautilus_canvas_container_add (NautilusCanvasContainer *view,
NautilusCanvasIconData *data);
void nautilus_canvas_container_layout_now (NautilusCanvasContainer *container);
gboolean nautilus_canvas_container_remove (NautilusCanvasContainer *view,
NautilusCanvasIconData *data);
void nautilus_canvas_container_for_each (NautilusCanvasContainer *view,
NautilusCanvasCallback callback,
gpointer callback_data);
void nautilus_canvas_container_request_update (NautilusCanvasContainer *view,
NautilusCanvasIconData *data);
void nautilus_canvas_container_request_update_all (NautilusCanvasContainer *container);
void nautilus_canvas_container_reveal (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
gboolean nautilus_canvas_container_is_empty (NautilusCanvasContainer *container);
NautilusCanvasIconData *nautilus_canvas_container_get_first_visible_icon (NautilusCanvasContainer *container);
void nautilus_canvas_container_scroll_to_canvas (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
void nautilus_canvas_container_begin_loading (NautilusCanvasContainer *container);
void nautilus_canvas_container_end_loading (NautilusCanvasContainer *container,
gboolean all_icons_added);
/* control the layout */
gboolean nautilus_canvas_container_is_auto_layout (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_auto_layout (NautilusCanvasContainer *container,
gboolean auto_layout);
gboolean nautilus_canvas_container_is_keep_aligned (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_keep_aligned (NautilusCanvasContainer *container,
gboolean keep_aligned);
void nautilus_canvas_container_set_layout_mode (NautilusCanvasContainer *container,
NautilusCanvasLayoutMode mode);
void nautilus_canvas_container_set_label_position (NautilusCanvasContainer *container,
NautilusCanvasLabelPosition pos);
void nautilus_canvas_container_sort (NautilusCanvasContainer *container);
void nautilus_canvas_container_freeze_icon_positions (NautilusCanvasContainer *container);
int nautilus_canvas_container_get_max_layout_lines (NautilusCanvasContainer *container);
int nautilus_canvas_container_get_max_layout_lines_for_pango (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_highlighted_for_clipboard (NautilusCanvasContainer *container,
GList *clipboard_canvas_data);
/* operations on all icons */
void nautilus_canvas_container_unselect_all (NautilusCanvasContainer *view);
void nautilus_canvas_container_select_all (NautilusCanvasContainer *view);
/* operations on the selection */
GList * nautilus_canvas_container_get_selection (NautilusCanvasContainer *view);
void nautilus_canvas_container_invert_selection (NautilusCanvasContainer *view);
void nautilus_canvas_container_set_selection (NautilusCanvasContainer *view,
GList *selection);
GArray * nautilus_canvas_container_get_selected_icon_locations (NautilusCanvasContainer *view);
gboolean nautilus_canvas_container_has_stretch_handles (NautilusCanvasContainer *container);
gboolean nautilus_canvas_container_is_stretched (NautilusCanvasContainer *container);
void nautilus_canvas_container_show_stretch_handles (NautilusCanvasContainer *container);
void nautilus_canvas_container_unstretch (NautilusCanvasContainer *container);
void nautilus_canvas_container_start_renaming_selected_item (NautilusCanvasContainer *container,
gboolean select_all);
/* options */
NautilusZoomLevel nautilus_canvas_container_get_zoom_level (NautilusCanvasContainer *view);
void nautilus_canvas_container_set_zoom_level (NautilusCanvasContainer *view,
int new_zoom_level);
void nautilus_canvas_container_set_single_click_mode (NautilusCanvasContainer *container,
gboolean single_click_mode);
void nautilus_canvas_container_enable_linger_selection (NautilusCanvasContainer *view,
gboolean enable);
gboolean nautilus_canvas_container_get_is_fixed_size (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_is_fixed_size (NautilusCanvasContainer *container,
gboolean is_fixed_size);
gboolean nautilus_canvas_container_get_is_desktop (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_is_desktop (NautilusCanvasContainer *container,
gboolean is_desktop);
void nautilus_canvas_container_reset_scroll_region (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_font (NautilusCanvasContainer *container,
const char *font);
void nautilus_canvas_container_set_margins (NautilusCanvasContainer *container,
int left_margin,
int right_margin,
int top_margin,
int bottom_margin);
void nautilus_canvas_container_set_use_drop_shadows (NautilusCanvasContainer *container,
gboolean use_drop_shadows);
char* nautilus_canvas_container_get_icon_description (NautilusCanvasContainer *container,
NautilusCanvasIconData *data);
gboolean nautilus_canvas_container_get_allow_moves (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_allow_moves (NautilusCanvasContainer *container,
gboolean allow_moves);
gboolean nautilus_canvas_container_is_layout_rtl (NautilusCanvasContainer *container);
gboolean nautilus_canvas_container_is_layout_vertical (NautilusCanvasContainer *container);
gboolean nautilus_canvas_container_get_store_layout_timestamps (NautilusCanvasContainer *container);
void nautilus_canvas_container_set_store_layout_timestamps (NautilusCanvasContainer *container,
gboolean store_layout);
void nautilus_canvas_container_widget_to_file_operation_position (NautilusCanvasContainer *container,
GdkPoint *position);
#define CANVAS_WIDTH(container,allocation) ((allocation.width \
- container->details->left_margin \
- container->details->right_margin) \
/ EEL_CANVAS (container)->pixels_per_unit)
#define CANVAS_HEIGHT(container,allocation) ((allocation.height \
- container->details->top_margin \
- container->details->bottom_margin) \
/ EEL_CANVAS (container)->pixels_per_unit)
#endif /* NAUTILUS_CANVAS_CONTAINER_H */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* nautilus-icon-dnd.h - Drag & drop handling for the icon container widget.
/* nautilus-canvas-dnd.h - Drag & drop handling for the canvas container widget.
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
......@@ -25,10 +25,10 @@
Andy Hertzfeld <andy@eazel.com>
*/
#ifndef NAUTILUS_ICON_DND_H
#define NAUTILUS_ICON_DND_H
#ifndef NAUTILUS_CANVAS_DND_H
#define NAUTILUS_CANVAS_DND_H
#include <libnautilus-private/nautilus-icon-container.h>
#include <libnautilus-private/nautilus-canvas-container.h>
#include <libnautilus-private/nautilus-dnd.h>
/* DnD-related information. */
......@@ -40,17 +40,17 @@ typedef struct {
/* Shadow for the icons being dragged. */
EelCanvasItem *shadow;
} NautilusIconDndInfo;
} NautilusCanvasDndInfo;
void nautilus_icon_dnd_init (NautilusIconContainer *container);
void nautilus_icon_dnd_fini (NautilusIconContainer *container);
void nautilus_icon_dnd_begin_drag (NautilusIconContainer *container,
GdkDragAction actions,
gint button,
GdkEventMotion *event,
int start_x,
int start_y);
void nautilus_icon_dnd_end_drag (NautilusIconContainer *container);
void nautilus_canvas_dnd_init (NautilusCanvasContainer *container);
void nautilus_canvas_dnd_fini (NautilusCanvasContainer *container);
void nautilus_canvas_dnd_begin_drag (NautilusCanvasContainer *container,
GdkDragAction actions,
gint button,
GdkEventMotion *event,
int start_x,
int start_y);
void nautilus_canvas_dnd_end_drag (NautilusCanvasContainer *container);
#endif /* NAUTILUS_ICON_DND_H */
#endif /* NAUTILUS_CANVAS_DND_H */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* Nautilus - Canvas item class for canvas container.
*
* Copyright (C) 2000 Eazel, Inc.
*
* Author: Andy Hertzfeld <andy@eazel.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef NAUTILUS_CANVAS_ITEM_H
#define NAUTILUS_CANVAS_ITEM_H
#include <eel/eel-canvas.h>
#include <eel/eel-art-extensions.h>
G_BEGIN_DECLS
#define NAUTILUS_TYPE_CANVAS_ITEM nautilus_canvas_item_get_type()
#define NAUTILUS_CANVAS_ITEM(obj) \
(G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_CANVAS_ITEM, NautilusCanvasItem))
#define NAUTILUS_CANVAS_ITEM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_CANVAS_ITEM, NautilusCanvasItemClass))
#define NAUTILUS_IS_CANVAS_ITEM(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_CANVAS_ITEM))
#define NAUTILUS_IS_CANVAS_ITEM_CLASS(klass) \
(G_TYPE_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_CANVAS_ITEM))
#define NAUTILUS_CANVAS_ITEM_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS ((obj), NAUTILUS_TYPE_CANVAS_ITEM, NautilusCanvasItemClass))
typedef struct NautilusCanvasItem NautilusCanvasItem;
typedef struct NautilusCanvasItemClass NautilusCanvasItemClass;
typedef struct NautilusCanvasItemDetails NautilusCanvasItemDetails;
struct NautilusCanvasItem {
EelCanvasItem item;
NautilusCanvasItemDetails *details;
gpointer user_data;
};
struct NautilusCanvasItemClass {
EelCanvasItemClass parent_class;
};
/* not namespaced due to their length */
typedef enum {
BOUNDS_USAGE_FOR_LAYOUT,
BOUNDS_USAGE_FOR_ENTIRE_ITEM,
BOUNDS_USAGE_FOR_DISPLAY
} NautilusCanvasItemBoundsUsage;
/* GObject */
GType nautilus_canvas_item_get_type (void);
/* attributes */
void nautilus_canvas_item_set_image (NautilusCanvasItem *item,
GdkPixbuf *image);
cairo_surface_t* nautilus_canvas_item_get_drag_surface (NautilusCanvasItem *item);
void nautilus_canvas_item_set_emblems (NautilusCanvasItem *item,
GList *emblem_pixbufs);
void nautilus_canvas_item_set_show_stretch_handles (NautilusCanvasItem *item,
gboolean show_stretch_handles);
void nautilus_canvas_item_set_attach_points (NautilusCanvasItem *item,
GdkPoint *attach_points,
int n_attach_points);
void nautilus_canvas_item_set_embedded_text_rect (NautilusCanvasItem *item,
const GdkRectangle *text_rect);
void nautilus_canvas_item_set_embedded_text (NautilusCanvasItem *item,
const char *text);
double nautilus_canvas_item_get_max_text_width (NautilusCanvasItem *item);
const char *nautilus_canvas_item_get_editable_text (NautilusCanvasItem *canvas_item);
void nautilus_canvas_item_set_renaming (NautilusCanvasItem *canvas_item,
gboolean state);
/* geometry and hit testing */
gboolean nautilus_canvas_item_hit_test_rectangle (NautilusCanvasItem *item,
EelIRect canvas_rect);
gboolean nautilus_canvas_item_hit_test_stretch_handles (NautilusCanvasItem *item,
gdouble world_x,
gdouble world_y,
GtkCornerType *corner);
void nautilus_canvas_item_invalidate_label (NautilusCanvasItem *item);
void nautilus_canvas_item_invalidate_label_size (NautilusCanvasItem *item);
EelDRect nautilus_canvas_item_get_icon_rectangle (const NautilusCanvasItem *item);
EelDRect nautilus_canvas_item_get_text_rectangle (NautilusCanvasItem *item,
gboolean for_layout);
void nautilus_canvas_item_get_bounds_for_layout (NautilusCanvasItem *item,
double *x1, double *y1, double *x2, double *y2);
void nautilus_canvas_item_get_bounds_for_entire_item (NautilusCanvasItem *item,
double *x1, double *y1, double *x2, double *y2);
void nautilus_canvas_item_update_bounds (NautilusCanvasItem *item,
double i2w_dx, double i2w_dy);
void nautilus_canvas_item_set_is_visible (NautilusCanvasItem *item,
gboolean visible);
/* whether the entire label text must be visible at all times */
void nautilus_canvas_item_set_entire_text (NautilusCanvasItem *canvas_item,
gboolean entire_text);
G_END_DECLS
#endif /* NAUTILUS_CANVAS_ITEM_H */
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gnome-icon-container-private.h
/* gnome-canvas-container-private.h
Copyright (C) 1999, 2000 Free Software Foundation
Copyright (C) 2000 Eazel, Inc.
......@@ -22,22 +22,22 @@
Author: Ettore Perazzoli <ettore@gnu.org>
*/
#ifndef NAUTILUS_ICON_CONTAINER_PRIVATE_H
#define NAUTILUS_ICON_CONTAINER_PRIVATE_H
#ifndef NAUTILUS_CANVAS_CONTAINER_PRIVATE_H
#define NAUTILUS_CANVAS_CONTAINER_PRIVATE_H
#include <eel/eel-glib-extensions.h>
#include <libnautilus-private/nautilus-icon-canvas-item.h>
#include <libnautilus-private/nautilus-icon-container.h>
#include <libnautilus-private/nautilus-icon-dnd.h>
#include <libnautilus-private/nautilus-canvas-item.h>
#include <libnautilus-private/nautilus-canvas-container.h>
#include <libnautilus-private/nautilus-canvas-dnd.h>
/* An Icon. */
typedef struct {
/* Object represented by this icon. */
NautilusIconData *data;
NautilusCanvasIconData *data;
/* Canvas item for the icon. */
NautilusIconCanvasItem *item;
NautilusCanvasItem *item;
/* X/Y coordinates. */
double x, y;
......@@ -66,10 +66,10 @@ typedef struct {
eel_boolean_bit is_monitored : 1;
eel_boolean_bit has_lazy_position : 1;
} NautilusIcon;
} NautilusCanvasIcon;
/* Private NautilusIconContainer members. */
/* Private NautilusCanvasContainer members. */
typedef struct {
gboolean active;
......@@ -84,7 +84,7 @@ typedef struct {
EelDRect prev_rect;
int last_adj_x;
int last_adj_y;
} NautilusIconRubberbandInfo;
} NautilusCanvasRubberbandInfo;
typedef enum {
DRAG_STATE_INITIAL,
......@@ -118,33 +118,33 @@ enum {
LAST_LABEL_COLOR
};
struct NautilusIconContainerDetails {
struct NautilusCanvasContainerDetails {
/* List of icons. */
GList *icons;
GList *new_icons;
GHashTable *icon_set;
/* Current icon for keyboard navigation. */
NautilusIcon *keyboard_focus;
NautilusIcon *keyboard_rubberband_start;
NautilusCanvasIcon *keyboard_focus;
NautilusCanvasIcon *keyboard_rubberband_start;
/* Current icon with stretch handles, so we have only one. */
NautilusIcon *stretch_icon;
NautilusCanvasIcon *stretch_icon;
double stretch_initial_x, stretch_initial_y;
guint stretch_initial_size;
/* Last highlighted drop target. */
NautilusIcon *drop_target;
NautilusCanvasIcon *drop_target;
/* Rubberbanding status. */
NautilusIconRubberbandInfo rubberband_info;
NautilusCanvasRubberbandInfo rubberband_info;
/* Timeout used to make a selected icon fully visible after a short
* period of time. (The timeout is needed to make sure
* double-clicking still works.)
*/
guint keyboard_icon_reveal_timer_id;
NautilusIcon *keyboard_icon_to_reveal;
NautilusCanvasIcon *keyboard_icon_to_reveal;
/* Used to coalesce selection changed signals in some cases */
guint selection_changed_id;
......@@ -152,19 +152,19 @@ struct NautilusIconContainerDetails {
/* If a request is made to reveal an unpositioned icon we remember
* it and reveal it once it gets positioned (in relayout).
*/
NautilusIcon *pending_icon_to_reveal;
NautilusCanvasIcon *pending_icon_to_reveal;
/* If a request is made to rename an unpositioned icon we remember
* it and start renaming it once it gets positioned (in relayout).
*/
NautilusIcon *pending_icon_to_rename;
NautilusCanvasIcon *pending_icon_to_rename;
/* Remembered information about the start of the current event. */
guint32 button_down_time;
/* Drag state. Valid only if drag_button is non-zero. */
guint drag_button;
NautilusIcon *drag_icon;
NautilusCanvasIcon *drag_icon;
int drag_x, drag_y;
DragState drag_state;
gboolean drag_started;
......@@ -172,10 +172,10 @@ struct NautilusIconContainerDetails {
gboolean drag_allow_moves;
gboolean icon_selected_on_button_down;
NautilusIcon *double_click_icon[2]; /* Both clicks in a double click need to be on the same icon */
NautilusCanvasIcon *double_click_icon[2]; /* Both clicks in a double click need to be on the same icon */
guint double_click_button[2];
NautilusIcon *range_selection_base_icon;
NautilusCanvasIcon *range_selection_base_icon;
/* Renaming Details */
gboolean renaming;
......@@ -192,7 +192,7 @@ struct NautilusIconContainerDetails {
guint align_idle_id;
/* DnD info. */
NautilusIconDndInfo *dnd_info;
NautilusCanvasDndInfo *dnd_info