Commit 58a9b33c authored by Darin Adler's avatar Darin Adler

Changed it to not attempt to create a GC just to measure the text. This

	* nautilus-icons-view-icon-item.c:
	(nautilus_icons_view_draw_text_box):
	Changed it to not attempt to create a GC just to measure the text.
	This makes it work when the widget is not realized.

	* nautilus-icons-view-icon-item.h:
	nautilus-icons-view-icon-item.c:
	gnome-icon-container-dnd.c:
	(nautilus_icons_view_icon_item_center_offset):
	Changed the parameter type to NautilusIconsViewIconItem.

	* fm-directory-view.c:
	(stop_load):
	(fm_directory_view_load_uri):
	Fixed code so that if you stop loading more than once, or
	stop before you even start, it won't send extra progress
	requests to the Nautilus shell or call stop_monitoring
	extra times on the NautilusDirectory object.

	* nautilus-icons-view-icon-item.h:
	nautilus-icons-view-icon-item.c:
	gnome-icon-container-dnd.c:
	Quick cleanup of the new NautilusIconsViewIconItem class.

	* libnautilus/gdk-extensions.c:
	libnautilus/gnome-icon-container-dnd.c:
	libnautilus/gnome-icon-container.c:
	libnautilus/gtkflist.c:
	libnautilus/nautilus-background-canvas-group.c:
	libnautilus/nautilus-background.c:
	libnautilus/nautilus-debug.c:
	libnautilus/nautilus-default-file-icon.c:
	libnautilus/nautilus-directory.c:
	libnautilus/nautilus-icon-factory.c:
	libnautilus/nautilus-icons-controller.c:
	libnautilus/nautilus-icons-view-icon-item.c:
	libnautilus/nautilus-lib-self-check-functions.c:
	libnautilus/nautilus-self-checks.c:
	libnautilus/nautilus-string.c:
	src/explorer-location-bar.c:
	src/file-manager/dfos-corba.c:
	src/file-manager/dfos-xfer-progress-dialog.c:
	src/file-manager/dfos-xfer.c:
	src/file-manager/dfos.c:
	src/file-manager/fm-directory-view-icons.c:
	src/file-manager/fm-directory-view-list.c:
	src/file-manager/fm-directory-view.c:
	src/file-manager/fm-icons-controller.c:
	src/file-manager/fm-main.c:
	src/nautilus-self-check-functions.c:
	src/ntl-index-panel.c:
	Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always
	include <config.h>, but there's no reason to include that ifdef
	since we don't plan on building without a <config.h> ever.
parent e250cfd7
2000-01-31 Darin Adler <darin@eazel.com>
* nautilus-icons-view-icon-item.c:
(nautilus_icons_view_draw_text_box):
Changed it to not attempt to create a GC just to measure the text.
This makes it work when the widget is not realized.
* nautilus-icons-view-icon-item.h:
nautilus-icons-view-icon-item.c:
gnome-icon-container-dnd.c:
(nautilus_icons_view_icon_item_center_offset):
Changed the parameter type to NautilusIconsViewIconItem.
* fm-directory-view.c:
(stop_load):
(fm_directory_view_load_uri):
Fixed code so that if you stop loading more than once, or
stop before you even start, it won't send extra progress
requests to the Nautilus shell or call stop_monitoring
extra times on the NautilusDirectory object.
* nautilus-icons-view-icon-item.h:
nautilus-icons-view-icon-item.c:
gnome-icon-container-dnd.c:
Quick cleanup of the new NautilusIconsViewIconItem class.
* libnautilus/gdk-extensions.c:
libnautilus/gnome-icon-container-dnd.c:
libnautilus/gnome-icon-container.c:
libnautilus/gtkflist.c:
libnautilus/nautilus-background-canvas-group.c:
libnautilus/nautilus-background.c:
libnautilus/nautilus-debug.c:
libnautilus/nautilus-default-file-icon.c:
libnautilus/nautilus-directory.c:
libnautilus/nautilus-icon-factory.c:
libnautilus/nautilus-icons-controller.c:
libnautilus/nautilus-icons-view-icon-item.c:
libnautilus/nautilus-lib-self-check-functions.c:
libnautilus/nautilus-self-checks.c:
libnautilus/nautilus-string.c:
src/explorer-location-bar.c:
src/file-manager/dfos-corba.c:
src/file-manager/dfos-xfer-progress-dialog.c:
src/file-manager/dfos-xfer.c:
src/file-manager/dfos.c:
src/file-manager/fm-directory-view-icons.c:
src/file-manager/fm-directory-view-list.c:
src/file-manager/fm-directory-view.c:
src/file-manager/fm-icons-controller.c:
src/file-manager/fm-main.c:
src/nautilus-self-check-functions.c:
src/ntl-index-panel.c:
Got rid of #ifdef HAVE_CONFIG_H. Elliot says that we must always
include <config.h>, but there's no reason to include that ifdef
since we don't plan on building without a <config.h> ever.
2000-01-31 Andy Hertzfeld <andy@eazel.com> 2000-01-31 Andy Hertzfeld <andy@eazel.com>
* libnautilus/gnome-icon-container-dnd.c: * libnautilus/gnome-icon-container-dnd.c:
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Authors: Darin Adler <darin@eazel.com> Authors: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gdk-extensions.h" #include "gdk-extensions.h"
#include "nautilus-lib-self-check-functions.h" #include "nautilus-lib-self-check-functions.h"
......
...@@ -23,14 +23,11 @@ ...@@ -23,14 +23,11 @@
Author: Ettore Perazzoli <ettore@gnu.org> Author: Ettore Perazzoli <ettore@gnu.org>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gnome-icon-container-dnd.h" #include "gnome-icon-container-dnd.h"
#include "nautilus-icons-view-icon-item.h"
#include "gnome-icon-container-private.h" #include "gnome-icon-container-private.h"
#include "nautilus-icons-view-icon-item.h"
#include "nautilus-background.h" #include "nautilus-background.h"
#include "nautilus-gtk-extensions.h" #include "nautilus-gtk-extensions.h"
...@@ -217,8 +214,8 @@ set_gnome_icon_list_selection (GnomeIconContainer *container, ...@@ -217,8 +214,8 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
if (!icon->is_selected) if (!icon->is_selected)
continue; continue;
center_offset = nautilus_icons_view_icon_item_center_offset
center_offset = nautilus_icons_view_icon_item_center_offset(icon->item); (NAUTILUS_ICONS_VIEW_ICON_ITEM (icon->item));
/* Corner of the icon relative to the cursor. */ /* Corner of the icon relative to the cursor. */
icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit); icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit);
...@@ -579,7 +576,8 @@ gnome_icon_container_receive_dropped_icons (GnomeIconContainer *container, ...@@ -579,7 +576,8 @@ gnome_icon_container_receive_dropped_icons (GnomeIconContainer *container,
if (item->got_icon_position) { if (item->got_icon_position) {
int icon_x, icon_y; int icon_x, icon_y;
double scale = icon->item->canvas->pixels_per_unit; double scale = icon->item->canvas->pixels_per_unit;
int center_offset = nautilus_icons_view_icon_item_center_offset(icon->item); int center_offset = nautilus_icons_view_icon_item_center_offset
(NAUTILUS_ICONS_VIEW_ICON_ITEM (icon->item));
icon_x = (int) world_x + item->icon_x - (center_offset / scale); icon_x = (int) world_x + item->icon_x - (center_offset / scale);
icon_y = (int) world_y + item->icon_y; icon_y = (int) world_y + item->icon_y;
...@@ -768,14 +766,11 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container, ...@@ -768,14 +766,11 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
dnd_info->start_y = event->y; dnd_info->start_y = event->y;
/* start the drag */ /* start the drag */
context = gtk_drag_begin (GTK_WIDGET (container), context = gtk_drag_begin (GTK_WIDGET (container),
dnd_info->target_list, dnd_info->target_list,
actions, actions,
button, button,
(GdkEvent *) event); (GdkEvent *) event);
/* create a pixmap and mask to drag with */ /* create a pixmap and mask to drag with */
pixbuf_item = GNOME_CANVAS_ITEM (container->details->drag_icon->item); pixbuf_item = GNOME_CANVAS_ITEM (container->details->drag_icon->item);
...@@ -784,40 +779,40 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container, ...@@ -784,40 +779,40 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
temp_pixbuf = (GdkPixbuf *) GTK_VALUE_OBJECT (pixbuf_args[0]); temp_pixbuf = (GdkPixbuf *) GTK_VALUE_OBJECT (pixbuf_args[0]);
/* compute the image's offset */ /* compute the image's offset */
canvas = GNOME_CANVAS(container); canvas = GNOME_CANVAS (container);
x_offset = floor(event->x - pixbuf_item->x1 + .5); x_offset = floor (event->x - pixbuf_item->x1 + .5);
y_offset = floor(event->y - pixbuf_item->y1 + .5); y_offset = floor (event->y - pixbuf_item->y1 + .5);
center_offset = nautilus_icons_view_icon_item_center_offset(container->details->drag_icon->item); center_offset = nautilus_icons_view_icon_item_center_offset
(NAUTILUS_ICONS_VIEW_ICON_ITEM (container->details->drag_icon->item));
x_offset -= center_offset; x_offset -= center_offset;
/* if the scale factor isn't 1.0, we have to scale the pixmap */ /* if the scale factor isn't 1.0, we have to scale the pixmap */
/* FIXME: eventually need to get the size, if any, from the metadata here */ /* FIXME: eventually need to get the size, if any, from the metadata here */
scaled_pixbuf = NULL; scaled_pixbuf = NULL;
if (container->details->zoom_level != NAUTILUS_ZOOM_LEVEL_STANDARD) if (container->details->zoom_level != NAUTILUS_ZOOM_LEVEL_STANDARD) {
{ gint old_width, old_height;
gint old_width, old_height; gint new_width, new_height;
gint new_width, new_height;
x_offset = floor (event->x * canvas->pixels_per_unit - center_offset - pixbuf_item->x1 + .5);
x_offset = floor(event->x * canvas->pixels_per_unit - center_offset - pixbuf_item->x1 + .5); y_offset = floor (event->y * canvas->pixels_per_unit - pixbuf_item->y1 + .5);
y_offset = floor(event->y * canvas->pixels_per_unit - pixbuf_item->y1 + .5);
old_width = gdk_pixbuf_get_width (temp_pixbuf);
old_width = gdk_pixbuf_get_width (temp_pixbuf); old_height = gdk_pixbuf_get_height (temp_pixbuf);
old_height = gdk_pixbuf_get_height (temp_pixbuf);
new_width = floor ((old_width * canvas->pixels_per_unit) + .5);
new_width = floor((old_width * canvas->pixels_per_unit) + .5); new_height = floor ((old_height * canvas->pixels_per_unit) + .5);
new_height = floor((old_height * canvas->pixels_per_unit) + .5);
scaled_pixbuf = gdk_pixbuf_scale_simple (temp_pixbuf, new_width, new_height, ART_FILTER_NEAREST);
scaled_pixbuf = gdk_pixbuf_scale_simple (temp_pixbuf, new_width, new_height, ART_FILTER_NEAREST); temp_pixbuf = scaled_pixbuf;
temp_pixbuf = scaled_pixbuf; }
}
gdk_pixbuf_render_pixmap_and_mask (temp_pixbuf, &pixmap_for_dragged_file, &mask_for_dragged_file, 128); gdk_pixbuf_render_pixmap_and_mask (temp_pixbuf, &pixmap_for_dragged_file, &mask_for_dragged_file, 128);
if (scaled_pixbuf) if (scaled_pixbuf)
gdk_pixbuf_unref(scaled_pixbuf); gdk_pixbuf_unref(scaled_pixbuf);
/* set the pixmap and mask for dragging */ /* set the pixmap and mask for dragging */
gtk_drag_set_icon_pixmap (context, gtk_widget_get_colormap (GTK_WIDGET (container)), gtk_drag_set_icon_pixmap (context, gtk_widget_get_colormap (GTK_WIDGET (container)),
pixmap_for_dragged_file, mask_for_dragged_file, pixmap_for_dragged_file, mask_for_dragged_file,
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Ettore Perazzoli <ettore@gnu.org> Author: Ettore Perazzoli <ettore@gnu.org>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gnome-icon-container.h" #include "gnome-icon-container.h"
#include <string.h> #include <string.h>
......
...@@ -12,10 +12,7 @@ ...@@ -12,10 +12,7 @@
native List widget that uses a simple API similiar to the GnomeIconContainer native List widget that uses a simple API similiar to the GnomeIconContainer
one. */ one. */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gtkflist.h" #include "gtkflist.h"
#include <gtk/gtkdnd.h> #include <gtk/gtkdnd.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-background-canvas-group.h" #include "nautilus-background-canvas-group.h"
#include <libgnomeui/gnome-canvas.h> #include <libgnomeui/gnome-canvas.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-background.h" #include "nautilus-background.h"
#include <gtk/gtksignal.h> #include <gtk/gtksignal.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-debug.h" #include "nautilus-debug.h"
#include <glib.h> #include <glib.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-default-file-icon.h" #include "nautilus-default-file-icon.h"
const int nautilus_default_file_icon_width = 48; const int nautilus_default_file_icon_width = 48;
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-directory.h" #include "nautilus-directory.h"
#include <stdlib.h> #include <stdlib.h>
......
...@@ -21,14 +21,11 @@ ...@@ -21,14 +21,11 @@
Author: Ettore Perazzoli <ettore@gnu.org> */ Author: Ettore Perazzoli <ettore@gnu.org> */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #include "dfos-xfer-progress-dialog.h"
#include <gnome.h> #include <gnome.h>
#include "dfos-xfer-progress-dialog.h"
#define DIALOG_WIDTH 350 /* FIXME? */ #define DIALOG_WIDTH 350 /* FIXME? */
......
...@@ -20,17 +20,12 @@ ...@@ -20,17 +20,12 @@
Author: Ettore Perazzoli <ettore@gnu.org> */ Author: Ettore Perazzoli <ettore@gnu.org> */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif #include "dfos.h"
#include <gnome.h> #include <gnome.h>
#include <libgnomevfs/gnome-vfs.h> #include <libgnomevfs/gnome-vfs.h>
#include "dfos.h"
#include "dfos-xfer.h"
struct _XferInfo { struct _XferInfo {
GnomeVFSAsyncHandle *handle; GnomeVFSAsyncHandle *handle;
......
...@@ -23,14 +23,12 @@ ...@@ -23,14 +23,12 @@
Author: John Sullivan <sullivan@eazel.com> Author: John Sullivan <sullivan@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <string.h>
#include <stdio.h>
#include <config.h> #include <config.h>
#endif
#include "nautilus-icon-factory.h" #include "nautilus-icon-factory.h"
#include <string.h>
#include <stdio.h>
#include <libgnome/gnome-defs.h> #include <libgnome/gnome-defs.h>
#include <libgnome/gnome-mime-info.h> #include <libgnome/gnome-mime-info.h>
#include <libgnome/gnome-util.h> #include <libgnome/gnome-util.h>
......
...@@ -23,10 +23,7 @@ ...@@ -23,10 +23,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-icons-controller.h" #include "nautilus-icons-controller.h"
#include "nautilus-gtk-macros.h" #include "nautilus-gtk-macros.h"
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* GNOME libraries - Icon Item class for Icon View /* GNOME libraries - Icon Item class for Icon View
* *
* Copyright (C) 2000 Eazel, Inc. * Copyright (C) 2000 Eazel, Inc.
...@@ -28,32 +30,33 @@ ...@@ -28,32 +30,33 @@
BEGIN_GNOME_DECLS BEGIN_GNOME_DECLS
#define NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM (nautilus_icons_view_icon_item_get_type ()) #define NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM \
#define NAUTILUS_ICONS_VIEW_ICON_ITEM(obj) (GTK_CHECK_CAST ((obj), \ (nautilus_icons_view_icon_item_get_type ())
NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM, NautilusIconsViewIconItem)) #define NAUTILUS_ICONS_VIEW_ICON_ITEM(obj) \
#define NAUTILUS_ICONS_VIEW_ICON_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), \ (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM, NautilusIconsViewIconItem))
NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM, NautilusIconsViewIconItemClass)) #define NAUTILUS_ICONS_VIEW_ICON_ITEM_CLASS(klass) \
#define NAUTILUS_IS_ICONS_VIEW_ICON_ITEM(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM)) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM, NautilusIconsViewIconItemClass))
#define NAUTILUS_IS_ICONS_VIEW_ICON_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), \ #define NAUTILUS_IS_ICONS_VIEW_ICON_ITEM(obj) \
NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM)) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM))
#define NAUTILUS_IS_ICONS_VIEW_ICON_ITEM_CLASS(klass) \
(GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_ICONS_VIEW_ICON_ITEM))
typedef struct _NautilusIconsViewIconItem NautilusIconsViewIconItem; typedef struct _NautilusIconsViewIconItem NautilusIconsViewIconItem;
typedef struct _NautilusIconsViewIconItemClass NautilusIconsViewIconItemClass; typedef struct _NautilusIconsViewIconItemClass NautilusIconsViewIconItemClass;
typedef struct _NautilusIconsViewIconItemDetails NautilusIconsViewIconItemDetails;
struct _NautilusIconsViewIconItem { struct _NautilusIconsViewIconItem {
GnomeCanvasItem item; GnomeCanvasItem item;
NautilusIconsViewIconItemDetails *details;
/* Private data */
gpointer priv;
}; };
struct _NautilusIconsViewIconItemClass { struct _NautilusIconsViewIconItemClass {
GnomeCanvasItemClass parent_class; GnomeCanvasItemClass parent_class;
}; };
GtkType nautilus_icons_view_icon_item_get_type (void); GtkType nautilus_icons_view_icon_item_get_type (void);
gint nautilus_icons_view_icon_item_center_offset(GnomeCanvasItem *item); int nautilus_icons_view_icon_item_center_offset (NautilusIconsViewIconItem *item);
END_GNOME_DECLS END_GNOME_DECLS
......
...@@ -23,9 +23,7 @@ ...@@ -23,9 +23,7 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#if ! defined (NAUTILUS_OMIT_SELF_CHECK) #if ! defined (NAUTILUS_OMIT_SELF_CHECK)
......
...@@ -22,13 +22,12 @@ ...@@ -22,13 +22,12 @@
Author: Darin Adler <darin@eazel.com> Author: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#if ! defined (NAUTILUS_OMIT_SELF_CHECK) #if ! defined (NAUTILUS_OMIT_SELF_CHECK)
#include "nautilus-self-checks.h" #include "nautilus-self-checks.h"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Authors: Darin Adler <darin@eazel.com> Authors: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "nautilus-string.h" #include "nautilus-string.h"
#include <ctype.h> #include <ctype.h>
......
...@@ -22,10 +22,7 @@ ...@@ -22,10 +22,7 @@
Authors: Darin Adler <darin@eazel.com> Authors: Darin Adler <darin@eazel.com>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gdk-extensions.h" #include "gdk-extensions.h"
#include "nautilus-lib-self-check-functions.h" #include "nautilus-lib-self-check-functions.h"
......
...@@ -23,14 +23,11 @@ ...@@ -23,14 +23,11 @@
Author: Ettore Perazzoli <ettore@gnu.org> Author: Ettore Perazzoli <ettore@gnu.org>
*/ */
#ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
#endif
#include "gnome-icon-container-dnd.h" #include "gnome-icon-container-dnd.h"
#include "nautilus-icons-view-icon-item.h"
#include "gnome-icon-container-private.h" #include "gnome-icon-container-private.h"
#include "nautilus-icons-view-icon-item.h"
#include "nautilus-background.h" #include "nautilus-background.h"
#include "nautilus-gtk-extensions.h" #include "nautilus-gtk-extensions.h"
...@@ -217,8 +214,8 @@ set_gnome_icon_list_selection (GnomeIconContainer *container, ...@@ -217,8 +214,8 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
if (!icon->is_selected) if (!icon->is_selected)
continue; continue;
center_offset = nautilus_icons_view_icon_item_center_offset
center_offset = nautilus_icons_view_icon_item_center_offset(icon->item); (NAUTILUS_ICONS_VIEW_ICON_ITEM (icon->item));
/* Corner of the icon relative to the cursor. */ /* Corner of the icon relative to the cursor. */
icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit); icon_x = icon->x - details->dnd_info->start_x + floor(center_offset / canvas->pixels_per_unit);
...@@ -579,7 +576,8 @@ gnome_icon_container_receive_dropped_icons (GnomeIconContainer *container, ...@@ -579,7 +576,8 @@ gnome_icon_container_receive_dropped_icons (GnomeIconContainer *container,
if (item->got_icon_position) { if (item->got_icon_position) {
int icon_x, icon_y; int icon_x, icon_y;
double scale = icon->item->canvas->pixels_per_unit; double scale = icon->item->canvas->pixels_per_unit;
int center_offset = nautilus_icons_view_icon_item_center_offset(icon->item); int center_offset = nautilus_icons_view_icon_item_center_offset
(NAUTILUS_ICONS_VIEW_ICON_ITEM (icon->item));
icon_x = (int) world_x + item->icon_x - (center_offset / scale); icon_x = (int) world_x + item->icon_x - (center_offset / scale);
icon_y = (int) world_y + item->icon_y; icon_y = (int) world_y + item->icon_y;
...@@ -768,14 +766,11 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container, ...@@ -768,14 +766,11 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
dnd_info->start_y = event->y; dnd_info->start_y = event->y;
/* start the drag */ /* start the drag */
context = gtk_drag_begin (GTK_WIDGET (container), context = gtk_drag_begin (GTK_WIDGET (container),
dnd_info->target_list, dnd_info->target_list,
actions, actions,
button, button,
(GdkEvent *) event); (GdkEvent *) event);</