Commit 4dc286da authored by Darin Adler's avatar Darin Adler

Allow changing the background of the icon view by dropping colors

	on the icon view.

	* libnautilus/gnome-icon-container-dnd.h:
	libnautilus/gnome-icon-container-dnd.c:
	(gnome_icon_container_position_shadow): (drag_data_received_cb):
	(gnome_icon_container_ensure_drag_data): (drag_motion_cb):
	(drag_drop_cb): (gnome_icon_container_receive_dropped_icons):
	(gnome_icon_container_free_drag_data): (drag_leave_cb): Added
	support for receiving dropped colors to change the background of a
	GnomeIconContainer.

	* src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_initialize_class):
	(fm_directory_view_icons_clear):
	(fm_directory_view_icons_background_changed_cb): Added code to
	load and save the background color from metadata.

	* libnautilus/gdk-extensions.c: (nautilus_gradient_new): Changed
	nautilus_gradient_new to handle NULLs in the same way that the
	rest of the gradient functions do instead of NULL being an illegal
	input value.

	* src/file-manager/fm-directory-view.h:
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_initialize): (fm_directory_view_destroy):
	(fm_directory_view_get_model): (fm_directory_view_load_uri): Added
	a NautilusDirectory object to each directory view, accessed by
	subclasses with a call to fm_directory_view_get_model.

	* libnautilus/nautilus-gtk-extensions.h:
	libnautilus/nautilus-gtk-extensions.c:
	(gnome_icon_container_dropped_icon_feedback):
	(nautilus_gdk_selection_data_copy_deep): Added deep versions of
	these GtkSelectionData functions.

	* libnautilus/nautilus-gtk-macros.h:
	(NAUTILUS_DEFINE_GET_TYPE_FUNCTION):
	(NAUTILUS_DEFINE_CLASS_BOILERPLATE): Added definition and
	initialization of the parent_class global to
	NAUTILUS_DEFINE_GET_TYPE_FUNCTION and renamed it to
	NAUTILUS_DEFINE_CLASS_BOILERPLATE.

	* libnautilus/nautilus-background-canvas-group:
	(nautilus_background_canvas_group_initialize_class):
	libnautilus/nautilus-background.c:
	(nautilus_background_initialize_class):
	libnautilus/nautilus-directory.c:
	(nautilus_directory_initialize_class): src/ntl-index-panel.c:
	(nautilus_index_panel_initialize_class):
	src/file-manager/fm-directory-view-icons.c:
	(fm_directory_view_icons_initialize_class):
	src/file-manager/fm-directory-view-list.c:
	(fm_directory_view_list_initialize_class):
	src/file-manager/fm-directory-view.c:
	(fm_directory_view_initialize_class): Take advantage of the new
	NAUTILUS_DEFINE_CLASS_BOILERPLATE and get rid of existing code to
	set up parent_class.

	* libnautilus/gnome-icon-container-dnd.h:
	libnautilus/gnome-icon-container-dnd.c:
	libnautilus/gnome-icon-container-layout.h:
	libnautilus/gnome-icon-container-layout.c:
	libnautilus/gnome-icon-container.c: Minimized includes.
parent 2689b7f2
2000-01-19 Darin Adler <darin@eazel.com>
Allow changing the background of the icon view by dropping colors
on the icon view.
* libnautilus/gnome-icon-container-dnd.h:
libnautilus/gnome-icon-container-dnd.c:
(gnome_icon_container_position_shadow): (drag_data_received_cb):
(gnome_icon_container_ensure_drag_data): (drag_motion_cb):
(drag_drop_cb): (gnome_icon_container_receive_dropped_icons):
(gnome_icon_container_free_drag_data): (drag_leave_cb): Added
support for receiving dropped colors to change the background of a
GnomeIconContainer.
* src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class):
(fm_directory_view_icons_clear):
(fm_directory_view_icons_background_changed_cb): Added code to
load and save the background color from metadata.
* libnautilus/gdk-extensions.c: (nautilus_gradient_new): Changed
nautilus_gradient_new to handle NULLs in the same way that the
rest of the gradient functions do instead of NULL being an illegal
input value.
* src/file-manager/fm-directory-view.h:
src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize): (fm_directory_view_destroy):
(fm_directory_view_get_model): (fm_directory_view_load_uri): Added
a NautilusDirectory object to each directory view, accessed by
subclasses with a call to fm_directory_view_get_model.
* libnautilus/nautilus-gtk-extensions.h:
libnautilus/nautilus-gtk-extensions.c:
(gnome_icon_container_dropped_icon_feedback):
(nautilus_gdk_selection_data_copy_deep): Added deep versions of
these GtkSelectionData functions.
* libnautilus/nautilus-gtk-macros.h:
(NAUTILUS_DEFINE_GET_TYPE_FUNCTION):
(NAUTILUS_DEFINE_CLASS_BOILERPLATE): Added definition and
initialization of the parent_class global to
NAUTILUS_DEFINE_GET_TYPE_FUNCTION and renamed it to
NAUTILUS_DEFINE_CLASS_BOILERPLATE.
* libnautilus/nautilus-background-canvas-group:
(nautilus_background_canvas_group_initialize_class):
libnautilus/nautilus-background.c:
(nautilus_background_initialize_class):
libnautilus/nautilus-directory.c:
(nautilus_directory_initialize_class): src/ntl-index-panel.c:
(nautilus_index_panel_initialize_class):
src/file-manager/fm-directory-view-icons.c:
(fm_directory_view_icons_initialize_class):
src/file-manager/fm-directory-view-list.c:
(fm_directory_view_list_initialize_class):
src/file-manager/fm-directory-view.c:
(fm_directory_view_initialize_class): Take advantage of the new
NAUTILUS_DEFINE_CLASS_BOILERPLATE and get rid of existing code to
set up parent_class.
* libnautilus/gnome-icon-container-dnd.h:
libnautilus/gnome-icon-container-dnd.c:
libnautilus/gnome-icon-container-layout.h:
libnautilus/gnome-icon-container-layout.c:
libnautilus/gnome-icon-container.c: Minimized includes.
2000-01-18 Andy Hertzfeld <andy@eazel.com>
* libnautilus/gnome-icon-container.c
......
......@@ -107,11 +107,11 @@ nautilus_fill_rectangle_with_gradient (GdkDrawable *drawable,
gdouble multiplier;
gint band;
g_return_if_fail (drawable);
g_return_if_fail (gc);
g_return_if_fail (rectangle);
g_return_if_fail (start_color);
g_return_if_fail (end_color);
g_return_if_fail (drawable != NULL);
g_return_if_fail (gc != NULL);
g_return_if_fail (rectangle != NULL);
g_return_if_fail (start_color != NULL);
g_return_if_fail (end_color != NULL);
g_return_if_fail (horizontal == FALSE || horizontal == TRUE);
/* Set up the band box so we can access it the same way for horizontal or vertical. */
......@@ -193,18 +193,16 @@ nautilus_gradient_new (const char *start_color,
const char *end_color,
gboolean is_horizontal)
{
g_return_val_if_fail (start_color != NULL, NULL);
g_return_val_if_fail (end_color != NULL, NULL);
g_return_val_if_fail (is_horizontal == FALSE || is_horizontal == TRUE, NULL);
/* Handle the special case where the start and end colors are identical.
Handle the special case where the end color is an empty string.
*/
if (strcmp(start_color, end_color) == 0 || end_color[0] == '\0')
if (nautilus_strcmp(start_color, end_color) == 0 || end_color == NULL || end_color[0] == '\0')
return g_strdup (start_color);
/* Handle the special case where the start color is an empty string. */
if (start_color[0] == '\0')
if (start_color == NULL || start_color[0] == '\0')
return g_strdup (end_color);
/* Handle the general case. */
......
......@@ -23,12 +23,17 @@
Author: Ettore Perazzoli <ettore@gnu.org>
*/
#include <glib.h>
#include <gtk/gtk.h>
#include <gnome.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "gnome-icon-container-dnd.h"
#include "gnome-icon-container-private.h"
#include "gnome-icon-container-dnd.h"
#include "nautilus-background.h"
#include "nautilus-gtk-extensions.h"
struct _DndSelectionItem {
gchar *uri;
......@@ -46,7 +51,8 @@ static const int num_drag_types = sizeof (drag_types) / sizeof (drag_types[0]);
static GtkTargetEntry drop_types [] = {
{ GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST_TYPE, 0, GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST },
{ GNOME_ICON_CONTAINER_DND_URI_LIST_TYPE, 0, GNOME_ICON_CONTAINER_DND_URI_LIST },
{ GNOME_ICON_CONTAINER_DND_URL_TYPE, 0, GNOME_ICON_CONTAINER_DND_URL }
{ GNOME_ICON_CONTAINER_DND_URL_TYPE, 0, GNOME_ICON_CONTAINER_DND_URL },
{ GNOME_ICON_CONTAINER_DND_COLOR_TYPE, 0, GNOME_ICON_CONTAINER_DND_COLOR }
};
static const int num_drop_types = sizeof (drop_types) / sizeof (drop_types[0]);
......@@ -184,7 +190,8 @@ destroy_selection_list (GList *list)
dnd_selection_item_destroy ((DndSelectionItem *) p->data);
g_list_free (list);
}
}
/* Source-side handling of the drag. */
/* Encode a "special/x-gnome-icon-list" selection. */
......@@ -241,7 +248,7 @@ set_gnome_icon_list_selection (GnomeIconContainer *container,
gtk_selection_data_set (selection_data,
selection_data->target,
8, (guchar *) data->str, data->len);
8, data->str, data->len);
g_string_free (data, TRUE);
}
......@@ -281,7 +288,7 @@ set_uri_list_selection (GnomeIconContainer *container,
gtk_selection_data_set (selection_data,
selection_data->target,
8, (guchar *) data->str, data->len);
8, data->str, data->len);
g_string_free (data, TRUE);
}
......@@ -397,14 +404,26 @@ get_gnome_icon_list_selection (GnomeIconContainer *container,
}
static void
drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint32 time,
gpointer user_data)
gnome_icon_container_position_shadow (GnomeIconContainer *container,
int x, int y)
{
GnomeCanvasItem *shadow;
double world_x, world_y;
shadow = container->priv->dnd_info->shadow;
if (shadow == NULL)
return;
gnome_canvas_window_to_world (GNOME_CANVAS (container),
x, y, &world_x, &world_y);
gnome_canvas_item_show (shadow);
set_shadow_position (shadow, world_x, world_y);
}
static void
gnome_icon_container_dropped_icon_feedback (GtkWidget *widget,
GtkSelectionData *data,
int x, int y)
{
GnomeIconContainer *container;
GnomeIconContainerDndInfo *dnd_info;
......@@ -414,23 +433,16 @@ drag_data_received_cb (GtkWidget *widget,
container = GNOME_ICON_CONTAINER (widget);
dnd_info = container->priv->dnd_info;
/* delete old selection list if any */
/* delete old selection list if any */
if (dnd_info->selection_list != NULL) {
destroy_selection_list (dnd_info->selection_list);
dnd_info->selection_list = NULL;
}
/* build the selection list from the drag data */
/* build the selection list from the drag data */
switch (info) {
case GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST:
get_gnome_icon_list_selection (container, data);
break;
case GNOME_ICON_CONTAINER_DND_URI_LIST:
puts ("Bad! URI list!"); /* FIXME */
return;
}
get_gnome_icon_list_selection (container, data);
shadow = create_selection_shadow (container, dnd_info->selection_list);
......@@ -448,31 +460,62 @@ drag_data_received_cb (GtkWidget *widget,
dnd_info->shadow = shadow;
}
static gboolean
drag_motion_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time)
static void
drag_data_received_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint32 time,
gpointer user_data)
{
GnomeIconContainerDndInfo *dnd_info;
GnomeIconContainerDndInfo *dnd_info;
dnd_info = GNOME_ICON_CONTAINER (widget)->priv->dnd_info;
if (dnd_info->selection_list == NULL)
gtk_drag_get_data (widget, context,
GPOINTER_TO_INT (context->targets->data),
time);
if (dnd_info->shadow != NULL) {
double world_x, world_y;
dnd_info->got_data_type = TRUE;
dnd_info->data_type = info;
gnome_canvas_window_to_world (GNOME_CANVAS (widget),
x, y, &world_x, &world_y);
gnome_canvas_item_show (dnd_info->shadow);
set_shadow_position (dnd_info->shadow, world_x, world_y);
switch (info) {
case GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST:
gnome_icon_container_dropped_icon_feedback (widget, data, x, y);
break;
case GNOME_ICON_CONTAINER_DND_COLOR:
/* Save the data so we can do the actual work on drop. */
dnd_info->selection_data = nautilus_gtk_selection_data_copy_deep (data);
break;
default:
g_warning ("drag_data_received_cb received data but could not handle it");
}
}
static void
gnome_icon_container_ensure_drag_data (GnomeIconContainer *container,
GdkDragContext *context,
guint32 time)
{
GnomeIconContainerDndInfo *dnd_info;
dnd_info = container->priv->dnd_info;
if (!dnd_info->got_data_type)
gtk_drag_get_data (GTK_WIDGET (container), context,
GPOINTER_TO_INT (context->targets->data),
time);
}
static gboolean
drag_motion_cb (GtkWidget *widget,
GdkDragContext *context,
int x, int y,
guint32 time)
{
gnome_icon_container_ensure_drag_data (GNOME_ICON_CONTAINER (widget), context, time);
gnome_icon_container_position_shadow (GNOME_ICON_CONTAINER (widget), x, y);
gdk_drag_status (context, context->suggested_action, time);
return TRUE;
}
......@@ -493,7 +536,8 @@ drag_end_cb (GtkWidget *widget,
/* utility routine to extract the directory from an item_uri (which may have geometry info attached) */
static gchar* extract_directory(const gchar* item_uri)
static gchar*
extract_directory(const gchar* item_uri)
{
gchar *last_slash;
gchar *temp_str = strdup(item_uri);
......@@ -511,68 +555,110 @@ static gchar* extract_directory(const gchar* item_uri)
return temp_str;
}
static gboolean
drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint time,
gpointer data)
static void
gnome_icon_container_receive_dropped_icons (GnomeIconContainer *container,
GdkDragContext *context,
int x, int y)
{
GnomeIconContainer *container;
DndSelectionItem *item;
GnomeIconContainerDndInfo *dnd_info;
DndSelectionItem *item;
char *item_directory_uri;
container = GNOME_ICON_CONTAINER (widget);
dnd_info = container->priv->dnd_info;
item = (DndSelectionItem*) dnd_info->selection_list->data;
if (dnd_info->selection_list) {
gchar *item_directory_uri = extract_directory(item->uri);
if (strcmp(item_directory_uri, container->priv->base_uri)) {
/* copy files from other directory, handle this soon */
printf("drop from other directory: %s\n", item_directory_uri);
}
else {
if (dnd_info->selection_list == NULL)
return;
item = dnd_info->selection_list->data;
item_directory_uri = extract_directory(item->uri);
if (strcmp(item_directory_uri, container->priv->base_uri) != 0) {
g_warning ("not implemented: drop from other directory: %s", item_directory_uri);
} else {
/* copy files in same directory */
if (context->action == GDK_ACTION_MOVE) {
double world_x, world_y;
gnome_canvas_window_to_world (GNOME_CANVAS (container),
x, y, &world_x, &world_y);
gnome_icon_container_xlate_selected (container,
if (context->action == GDK_ACTION_MOVE) {
double world_x, world_y;
gnome_canvas_window_to_world (GNOME_CANVAS (container),
x, y, &world_x, &world_y);
gnome_icon_container_xlate_selected (container,
world_x - dnd_info->start_x,
world_y - dnd_info->start_y,
TRUE);
}
}
g_free(item_directory_uri);
destroy_selection_list (dnd_info->selection_list);
dnd_info->selection_list = NULL;
}
return FALSE;
}
g_free(item_directory_uri);
destroy_selection_list (dnd_info->selection_list);
dnd_info->selection_list = NULL;
}
static void
drag_leave_cb (GtkWidget *widget,
GdkDragContext *context,
guint time,
gpointer data)
gnome_icon_container_free_drag_data (GnomeIconContainer *container)
{
GnomeIconContainerDndInfo *dnd_info;
dnd_info = GNOME_ICON_CONTAINER (widget)->priv->dnd_info;
dnd_info = container->priv->dnd_info;
dnd_info->got_data_type = FALSE;
if (dnd_info->shadow != NULL) {
gtk_object_destroy (GTK_OBJECT (dnd_info->shadow));
dnd_info->shadow = NULL;
}
if (dnd_info->selection_data != NULL) {
nautilus_gtk_selection_data_free_deep (dnd_info->selection_data);
dnd_info->selection_data = NULL;
}
}
static gboolean
drag_drop_cb (GtkWidget *widget,
GdkDragContext *context,
gint x,
gint y,
guint32 time,
gpointer data)
{
GnomeIconContainerDndInfo *dnd_info;
dnd_info = GNOME_ICON_CONTAINER (widget)->priv->dnd_info;
gnome_icon_container_ensure_drag_data (GNOME_ICON_CONTAINER (widget), context, time);
g_assert (dnd_info->got_data_type);
switch (dnd_info->data_type) {
case GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST:
gnome_icon_container_receive_dropped_icons
(GNOME_ICON_CONTAINER (widget),
context, x, y);
break;
case GNOME_ICON_CONTAINER_DND_COLOR:
nautilus_background_receive_dropped_color
(nautilus_get_widget_background (widget),
widget, x, y, dnd_info->selection_data);
gtk_drag_finish (context, TRUE, FALSE, time);
break;
default:
g_warning ("drag_drop_cb received data but could not handle it");
}
gnome_icon_container_free_drag_data (GNOME_ICON_CONTAINER (widget));
return FALSE;
}
static void
drag_leave_cb (GtkWidget *widget,
GdkDragContext *context,
guint32 time,
gpointer data)
{
}
void
gnome_icon_container_dnd_init (GnomeIconContainer *container,
......@@ -583,18 +669,13 @@ gnome_icon_container_dnd_init (GnomeIconContainer *container,
g_return_if_fail (container != NULL);
g_return_if_fail (GNOME_IS_ICON_CONTAINER (container));
dnd_info = g_new (GnomeIconContainerDndInfo, 1);
dnd_info = g_new0 (GnomeIconContainerDndInfo, 1);
dnd_info->target_list = gtk_target_list_new (drag_types,
num_drag_types);
dnd_info->start_x = 0;
dnd_info->start_y = 0;
dnd_info->selection_list = NULL;
dnd_info->stipple = gdk_bitmap_ref (stipple);
dnd_info->shadow = NULL;
/* Set up the widget as a drag destination. */
/* (But not a source, as drags starting from this widget will be
......@@ -605,14 +686,19 @@ gnome_icon_container_dnd_init (GnomeIconContainer *container,
drop_types, num_drop_types,
GDK_ACTION_COPY | GDK_ACTION_MOVE);
/* Messages for outgoing drag. */
gtk_signal_connect (GTK_OBJECT (container), "drag_data_get",
GTK_SIGNAL_FUNC (drag_data_get_cb), NULL);
gtk_signal_connect (GTK_OBJECT (container), "drag_motion",
GTK_SIGNAL_FUNC (drag_motion_cb), NULL);
gtk_signal_connect (GTK_OBJECT (container), "drag_end",
GTK_SIGNAL_FUNC (drag_end_cb), NULL);
/* Messages for incoming drag. */
gtk_signal_connect (GTK_OBJECT (container), "drag_data_received",
GTK_SIGNAL_FUNC (drag_data_received_cb), NULL);
gtk_signal_connect (GTK_OBJECT (container), "drag_motion",
GTK_SIGNAL_FUNC (drag_motion_cb), NULL);
gtk_signal_connect (GTK_OBJECT (container), "drag_drop",
GTK_SIGNAL_FUNC (drag_drop_cb), NULL);
gtk_signal_connect (GTK_OBJECT (container), "drag_leave",
......@@ -665,27 +751,27 @@ gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
g_return_if_fail (dnd_info != NULL);
/* Notice that the event is already in world coordinates, because of
the way the canvas handles events! */
the way the canvas handles events! */
dnd_info->start_x = event->x;
dnd_info->start_y = event->y;
context = gtk_drag_begin (GTK_WIDGET (container),
dnd_info->target_list,
actions,
button,
(GdkEvent *) event);
dnd_info->target_list,
actions,
button,
(GdkEvent *) event);
/* create a pixmap and mask to drag with */
pixbuf_item = (GnomeCanvasItem*) container->priv->drag_icon->image_item;
pixbuf_item = GNOME_CANVAS_ITEM (container->priv->drag_icon->image_item);
pixbuf_args[0].name = "GnomeCanvasPixbuf::pixbuf";
gtk_object_getv(GTK_OBJECT(pixbuf_item), 1, pixbuf_args);
temp_pixbuf = (GdkPixbuf*) GTK_VALUE_OBJECT(pixbuf_args[0]);
gdk_pixbuf_render_pixmap_and_mask(temp_pixbuf, &pixmap_for_dragged_file, &mask_for_dragged_file, 128);
gtk_object_getv (GTK_OBJECT (pixbuf_item), 1, pixbuf_args);
temp_pixbuf = (GdkPixbuf *) GTK_VALUE_OBJECT (pixbuf_args[0]);
gdk_pixbuf_render_pixmap_and_mask (temp_pixbuf, &pixmap_for_dragged_file, &mask_for_dragged_file, 128);
/* set the pixmap and mask for dragging */
gtk_drag_set_icon_pixmap(context, gtk_widget_get_colormap(GTK_WIDGET(container)), pixmap_for_dragged_file, mask_for_dragged_file, event->x - pixbuf_item->x1 , event->y - pixbuf_item->y1);
gtk_drag_set_icon_pixmap (context, gtk_widget_get_colormap (GTK_WIDGET (container)),
pixmap_for_dragged_file, mask_for_dragged_file,
event->x - pixbuf_item->x1, event->y - pixbuf_item->y1);
}
void
......
......@@ -3,6 +3,7 @@
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
......@@ -22,32 +23,38 @@
Author: Ettore Perazzoli <ettore@gnu.org>
*/
#ifndef _GNOME_ICON_CONTAINER_DND_H
#define _GNOME_ICON_CONTAINER_DND_H
#ifndef GNOME_ICON_CONTAINER_DND_H
#define GNOME_ICON_CONTAINER_DND_H
#include "gnome-icon-container.h"
typedef struct _GnomeIconContainerDndInfo GnomeIconContainerDndInfo;
typedef enum _GnomeIconContainerDndTargetType GnomeIconContainerDndTargetType;
#include "gnome-icon-container.h"
/* Standard DnD types. */
enum _GnomeIconContainerDndTargetType {
GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST,
GNOME_ICON_CONTAINER_DND_URI_LIST,
GNOME_ICON_CONTAINER_DND_URL,
GNOME_ICON_CONTAINER_DND_NTARGETS
GNOME_ICON_CONTAINER_DND_COLOR
};
/* DnD target names. */
#define GNOME_ICON_CONTAINER_DND_GNOME_ICON_LIST_TYPE "special/x-gnome-icon-list"
#define GNOME_ICON_CONTAINER_DND_URI_LIST_TYPE "text/uri-list"
#define GNOME_ICON_CONTAINER_DND_URL_TYPE "_NETSCAPE_URL"
#define GNOME_ICON_CONTAINER_DND_COLOR_TYPE "application/x-color"
/* DnD-related information. */
struct _GnomeIconContainerDndInfo {
GtkTargetList *target_list;
/* Stuff saved at "receive data" time needed later in the drag. */
gboolean got_data_type;
GnomeIconContainerDndTargetType data_type;
GtkSelectionData *selection_data;
/* Start of the drag, in world coordinates. */
gdouble start_x, start_y;
......@@ -72,4 +79,4 @@ void gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
GdkEventMotion *event);
void gnome_icon_container_dnd_end_drag (GnomeIconContainer *container);
#endif /* _GNOME_ICON_CONTAINER_DND_H */
#endif /* GNOME_ICON_CONTAINER_DND_H */
......@@ -21,11 +21,6 @@
Author: Ettore Perazzoli <ettore@gnu.org>
*/
#include <glib.h>
#include "gnome-icon-container.h"
#include "gnome-icon-container-private.h"
#include "gnome-icon-container-layout.h"
......
......@@ -34,10 +34,8 @@ typedef void (* GnomeIconContainerLayoutForeachFunc)
gint x, gint y,
gpointer callback_data);
#include "gnome-icon-container.h"
#include "gnome-icon-container-private.h"
GnomeIconContainerLayout *
gnome_icon_container_layout_new (void);
void gnome_icon_container_layout_free (GnomeIconContainerLayout *layout);
......
......@@ -26,13 +26,13 @@
#include <config.h>
#endif
#include <gnome.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
#include "gnome-icon-container.h"
#include "gnome-icon-container-private.h"
#include "gnome-icon-container-dnd.h"
#include <gdk-pixbuf/gnome-canvas-pixbuf.h>
static GnomeCanvasClass *parent_class;
......
......@@ -39,9 +39,7 @@ static void nautilus_background_canvas_group_finalize (GtkObject *object);
static void nautilus_background_canvas_group_draw (GnomeCanvasItem *item, GdkDrawable *drawable,
int x, int y, int width, int height);
NAUTILUS_DEFINE_GET_TYPE_FUNCTION (NautilusBackgroundCanvasGroup, nautilus_background_canvas_group, GNOME_TYPE_CANVAS_GROUP)
static GtkObjectClass *parent_class;
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusBackgroundCanvasGroup, nautilus_background_canvas_group, GNOME_TYPE_CANVAS_GROUP)
static void