mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-21 16:52:32 +00:00
c885369012
ask questions and perform actions, even though only the FMDirectoryViewIcons knows how to answer the questions and perform the actions. Replaced use of nautilus_file_get_info with specific accessors for various file info. * libnautilus/Makefile.am: libnautilus/nautilus-icons-controller.h: libnautilus/nautilus-icons-controller.c: libnautilus/gnome-icon-container-private.h: libnautilus/gnome-icon-container.h: libnautilus/gnome-icon-container.c: (icon_new_pixbuf): (gnome_icon_container_new): (gnome_icon_container_add): (gnome_icon_container_add_auto): Added NautilusIconsController, an interface provided so that the file manager can connect the icons up with the file code. This is all so we can keep the view/controller separation. This eliminates the need to pass around the icon name all the time, so the signals have changed to not take the icon name as a parameter. * src/file-manager/Makefile.am: src/file-manager/fm-icons-controller.c: src/file-manager/fm-icons-controller.h: Added FMIconsController, the actual controller used by the file manager instance of GnomeIconContainer. src/file-manager/fm-directory-view-icons.c: (create_icon_container): (add_icon_if_already_positioned): (add_icon_at_free_position): (icon_container_activate_cb): (fm_directory_view_icons_icon_moved_cb): Create and use the FMIconController. * libnautilus/gnome-icon-container-private.h: libnautilus/gnome-icon-container-dnd.c: (set_gnome_icon_list_selection): (set_uri_list_selection): libnautilus/gnome-icon-container.c: (gnome_icon_container_set_base_uri): src/file-manager/fm-directory-view-icons.c: (set_up_base_uri): (fm_directory_view_icons_begin_loading): Get rid of the old base_uri technique for handling drags. Instead the icon controller supplies URIs for icons when requested. * RENAMING: Proposed that we use NautilusIconsView as the new name for GnomeIconContainer instead of NautilusIconContainer. * libnautilus/gnome-icon-container-private.h: libnautilus/gnome-icon-container.h: libnautilus/gnome-icon-container.c: (gnome_icon_container_initialize): (handle_icon_enter_notify): (handle_icon_leave_notify): Renamed browser mode to linger selection mode. * libnautilus/gnome-icon-container-private.h: libnautilus/gnome-icon-container.h: libnautilus/gnome-icon-container.c: (icon_configure): (icon_position): (change_icon_mode): (gnome_icon_container_initialize): (gnome_icon_container_set_icon_mode): (gnome_icon_container_get_icon_mode): src/file-manager/fm-directory-view-icons.c: (fm_directory_view_icons_initialize): Got rid of icon mode, since we won't be using it. * libnautilus/gnome-icon-container-dnd.c: (get_gnome_icon_list_selection): Changed geometry parsing so it will not ignore extra characters after the numeric geometry. (gnome_icon_container_receive_dropped_icons): The code here tried to work when dragging icons between windows, but the implementation was actually only good within the same window, so I modified it to check for that case. * libnautilus/gnome-icon-container-dnd.c: (create_selection_shadow): (set_gnome_icon_list_selection): libnautilus/gnome-icon-container.c: (icon_position): Renamed GNOME_ICON_CONTAINER_ICON_XOFFSET to GNOME_ICON_CONTAINER_ICON_X_OFFSET and GNOME_ICON_CONTAINER_ICON_YOFFSET to GNOME_ICON_CONTAINER_ICON_Y_OFFSET. We use an underscore between words in identifiers. * libnautilus/gnome-icon-container.c: (destroy): Added code to remove timeouts and idles when the container is destroyed. * libnautilus/nautilus-directory.h: libnautilus/nautilus-directory.c: (nautilus_file_get_info): Get rid of the direct call to get GnomeVFSFileInfo. All info is accessed through individual functions. (nautilus_file_get_size): (nautilus_file_get_type): (nautilus_file_get_mime_type): (nautilus_file_is_executable): (nautilus_file_is_symbolic_link): Added new accessor functions as needed. src/file-manager/fm-directory-view.c: (display_selection_info): src/file-manager/fm-icon-cache.c: (fm_icon_cache_get_icon_set_for_file): (fm_icon_cache_get_icon_for_file): Change code to use the accessors instead of get_info. * libnautilus/nautilus-gtk-macros.h: (NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL): Changed macro to take a class pointer of the right type instead of taking both a casting macro name and a class pointer. src/file-manager/fm-directory-view.c: (fm_directory_view_initialize_class): Changed existing uses of macro to match. * src/file-manager/Makefile.am: src/file-manager/fm-icon-cache.c: src/file-manager/fm-default-file-icon.h: src/file-manager/fm-default-file-icon.c: Moved the default icon into its own file.
85 lines
2.9 KiB
C
85 lines
2.9 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
||
/* gnome-icon-container-dnd.h - Drag & drop handling for the icon 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.
|
||
|
||
Author: Ettore Perazzoli <ettore@gnu.org>
|
||
*/
|
||
|
||
#ifndef GNOME_ICON_CONTAINER_DND_H
|
||
#define GNOME_ICON_CONTAINER_DND_H
|
||
|
||
#include "gnome-icon-container.h"
|
||
|
||
#include <gtk/gtkdnd.h>
|
||
|
||
typedef struct _GnomeIconContainerDndInfo GnomeIconContainerDndInfo;
|
||
typedef enum _GnomeIconContainerDndTargetType GnomeIconContainerDndTargetType;
|
||
|
||
/* 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_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;
|
||
|
||
/* List of DndSelectionItems, representing items being dragged, or NULL
|
||
if data about them has not been received from the source yet. */
|
||
GList *selection_list;
|
||
|
||
/* Stipple for drawing icon shadows during DnD. */
|
||
GdkBitmap *stipple;
|
||
|
||
/* Shadow for the icons being dragged. */
|
||
GnomeCanvasItem *shadow;
|
||
};
|
||
|
||
|
||
void gnome_icon_container_dnd_init (GnomeIconContainer *container,
|
||
GdkBitmap *stipple);
|
||
void gnome_icon_container_dnd_fini (GnomeIconContainer *container);
|
||
void gnome_icon_container_dnd_begin_drag (GnomeIconContainer *container,
|
||
GdkDragAction actions,
|
||
gint button,
|
||
GdkEventMotion *event);
|
||
void gnome_icon_container_dnd_end_drag (GnomeIconContainer *container);
|
||
|
||
#endif /* GNOME_ICON_CONTAINER_DND_H */
|