Commit dedd9e11 authored by Cosimo Cecchi's avatar Cosimo Cecchi

Rework architecture of NautilusView/FMDirectoryView

As a second step after ff5c759b3784db2d0cd71e1cde613dda007c3985, this
removes the NautilusView/FMDirectoryView interface split, changing
FMDirectoryView to be NautilusView directly.

Left to do: complete renaming the public fm_directory_view methods to
nautilus_view, and get rid of src/file-manager entirely.
parent 10998fbf
......@@ -171,8 +171,6 @@ libnautilus_private_la_SOURCES = \
nautilus-vfs-directory.h \
nautilus-vfs-file.c \
nautilus-vfs-file.h \
nautilus-view.c \
nautilus-view.h \
$(NULL)
nodist_libnautilus_private_la_SOURCES =\
......
......@@ -29,7 +29,6 @@
#include "nautilus-program-choosing.h"
#include "nautilus-link.h"
#include "nautilus-view.h"
#include <eel/eel-glib-extensions.h>
#include <eel/eel-gtk-extensions.h>
#include <eel/eel-string.h>
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-view.c: Interface for nautilus views
Copyright (C) 2004 Red Hat Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Alexander Larsson <alexl@redhat.com>
*/
#include <config.h>
#include "nautilus-view.h"
enum {
TITLE_CHANGED,
ZOOM_LEVEL_CHANGED,
LAST_SIGNAL
};
static guint nautilus_view_signals[LAST_SIGNAL] = { 0 };
static void
nautilus_view_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
if (! initialized) {
nautilus_view_signals[TITLE_CHANGED] =
g_signal_new ("title_changed",
NAUTILUS_TYPE_VIEW,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusViewIface, title_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
nautilus_view_signals[ZOOM_LEVEL_CHANGED] =
g_signal_new ("zoom_level_changed",
NAUTILUS_TYPE_VIEW,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (NautilusViewIface, zoom_level_changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
GType
nautilus_view_get_type (void)
{
static GType type = 0;
if (!type) {
const GTypeInfo info = {
sizeof (NautilusViewIface),
nautilus_view_base_init,
NULL,
NULL,
NULL,
NULL,
0,
0,
NULL
};
type = g_type_register_static (G_TYPE_INTERFACE,
"NautilusView",
&info, 0);
g_type_interface_add_prerequisite (type, G_TYPE_OBJECT);
}
return type;
}
const char *
nautilus_view_get_view_id (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_view_id) (view);
}
GtkWidget *
nautilus_view_get_widget (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_widget) (view);
}
void
nautilus_view_load_location (NautilusView *view,
const char *location_uri)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
g_return_if_fail (location_uri != NULL);
(* NAUTILUS_VIEW_GET_IFACE (view)->load_location) (view,
location_uri);
}
void
nautilus_view_stop_loading (NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->stop_loading) (view);
}
int
nautilus_view_get_selection_count (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), 0);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_selection_count) (view);
}
GList *
nautilus_view_get_selection (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_selection) (view);
}
void
nautilus_view_set_selection (NautilusView *view,
GList *list)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->set_selection) (view,
list);
}
void
nautilus_view_set_is_active (NautilusView *view,
gboolean is_active)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->set_is_active) (view,
is_active);
}
void
nautilus_view_invert_selection (NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->invert_selection) (view);
}
char *
nautilus_view_get_first_visible_file (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_first_visible_file) (view);
}
void
nautilus_view_scroll_to_file (NautilusView *view,
const char *uri)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->scroll_to_file) (view, uri);
}
char *
nautilus_view_get_title (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NULL);
if (NAUTILUS_VIEW_GET_IFACE (view)->get_title != NULL) {
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_title) (view);
} else {
return NULL;
}
}
gboolean
nautilus_view_supports_zooming (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
return (* NAUTILUS_VIEW_GET_IFACE (view)->supports_zooming) (view);
}
void
nautilus_view_bump_zoom_level (NautilusView *view,
int zoom_increment)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->bump_zoom_level) (view,
zoom_increment);
}
void
nautilus_view_zoom_to_level (NautilusView *view,
NautilusZoomLevel level)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->zoom_to_level) (view,
level);
}
void
nautilus_view_restore_default_zoom_level (NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
(* NAUTILUS_VIEW_GET_IFACE (view)->restore_default_zoom_level) (view);
}
gboolean
nautilus_view_can_zoom_in (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
return (* NAUTILUS_VIEW_GET_IFACE (view)->can_zoom_in) (view);
}
gboolean
nautilus_view_can_zoom_out (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), FALSE);
return (* NAUTILUS_VIEW_GET_IFACE (view)->can_zoom_out) (view);
}
NautilusZoomLevel
nautilus_view_get_zoom_level (NautilusView *view)
{
g_return_val_if_fail (NAUTILUS_IS_VIEW (view), NAUTILUS_ZOOM_LEVEL_STANDARD);
return (* NAUTILUS_VIEW_GET_IFACE (view)->get_zoom_level) (view);
}
void
nautilus_view_grab_focus (NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->grab_focus != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->grab_focus) (view);
}
}
void
nautilus_view_update_menus (NautilusView *view)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->update_menus != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->update_menus) (view);
}
}
void
nautilus_view_pop_up_location_context_menu (NautilusView *view,
GdkEventButton *event,
const char *location)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->pop_up_location_context_menu != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->pop_up_location_context_menu) (view, event, location);
}
}
void
nautilus_view_drop_proxy_received_uris (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_uris != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_uris) (view, uris, target_location, action);
}
}
void
nautilus_view_drop_proxy_received_netscape_url (NautilusView *view,
const char *source_url,
const char *target_location,
GdkDragAction action)
{
g_return_if_fail (NAUTILUS_IS_VIEW (view));
if (NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_netscape_url != NULL) {
(* NAUTILUS_VIEW_GET_IFACE (view)->drop_proxy_received_netscape_url) (view, source_url, target_location, action);
}
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*-
nautilus-view.h: Interface for nautilus views
Copyright (C) 2004 Red Hat Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program 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
General Public License for more details.
You should have received a copy of the GNU General Public
License along with this program; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Author: Alexander Larsson <alexl@redhat.com>
*/
#ifndef NAUTILUS_VIEW_H
#define NAUTILUS_VIEW_H
#include <glib-object.h>
#include <gtk/gtk.h>
/* For NautilusZoomLevel */
#include <libnautilus-private/nautilus-icon-info.h>
G_BEGIN_DECLS
#define NAUTILUS_TYPE_VIEW (nautilus_view_get_type ())
#define NAUTILUS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NAUTILUS_TYPE_VIEW, NautilusView))
#define NAUTILUS_IS_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NAUTILUS_TYPE_VIEW))
#define NAUTILUS_VIEW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NAUTILUS_TYPE_VIEW, NautilusViewIface))
typedef struct _NautilusView NautilusView; /* dummy typedef */
typedef struct _NautilusViewIface NautilusViewIface;
struct _NautilusViewIface
{
GTypeInterface g_iface;
/* Signals: */
/* emitted when the view-specific title as returned by get_title changes */
void (* title_changed) (NautilusView *view);
void (* zoom_level_changed) (NautilusView *view);
/* VTable: */
/* Get the id string for this view. Its a constant string, not memory managed */
const char * (* get_view_id) (NautilusView *view);
/* Get the widget for this view, can be the same object or a different
object owned by the view. Doesn't ref the widget. */
GtkWidget * (* get_widget) (NautilusView *view);
/* Called to tell the view to start loading a location, or to reload it.
The view responds with a load_underway as soon as it starts loading,
and a load_complete when the location is completely read. */
void (* load_location) (NautilusView *view,
const char *location_uri);
/* Called to tell the view to stop loading the location its currently loading */
void (* stop_loading) (NautilusView *view);
/* Returns the number of selected items in the view */
int (* get_selection_count) (NautilusView *view);
/* Returns a list of uris for th selected items in the view, caller frees it */
GList * (* get_selection) (NautilusView *view);
/* This is called when the window wants to change the selection in the view */
void (* set_selection) (NautilusView *view,
GList *list);
/* Inverts the selection in the view */
void (* invert_selection) (NautilusView *view);
/* Return the uri of the first visible file */
char * (* get_first_visible_file) (NautilusView *view);
/* Scroll the view so that the file specified by the uri is at the top
of the view */
void (* scroll_to_file) (NautilusView *view,
const char *uri);
/* This function can supply a special window title, if you don't want one
have this function return NULL, or just don't supply a function */
char * (* get_title) (NautilusView *view);
/* Zoom support */
gboolean (* supports_zooming) (NautilusView *view);
void (* bump_zoom_level) (NautilusView *view,
int zoom_increment);
void (* zoom_to_level) (NautilusView *view,
NautilusZoomLevel level);
NautilusZoomLevel (* get_zoom_level) (NautilusView *view);
void (* restore_default_zoom_level) (NautilusView *view);
gboolean (* can_zoom_in) (NautilusView *view);
gboolean (* can_zoom_out) (NautilusView *view);
void (* grab_focus) (NautilusView *view);
void (* update_menus) (NautilusView *view);
/* Request popup of context menu referring to the open location.
* This is triggered in spatial windows by right-clicking the location button,
* in navigational windows by right-clicking the "Location:" label in the
* navigation bar or any of the buttons in the pathbar.
* The location parameter specifies the location this popup should be displayed for.
* If it is NULL, the currently displayed location should be used.
* The view may display the popup synchronously, asynchronously
* or not react to the popup request at all. */
void (* pop_up_location_context_menu) (NautilusView *view,
GdkEventButton *event,
const char *location);
void (* drop_proxy_received_uris) (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action);
void (* drop_proxy_received_netscape_url) (NautilusView *view,
const char *source_url,
const char *target_location,
GdkDragAction action);
void (* set_is_active) (NautilusView *view,
gboolean is_active);
/* Padding for future expansion */
void (*_reserved1) (void);
void (*_reserved2) (void);
void (*_reserved3) (void);
void (*_reserved4) (void);
void (*_reserved5) (void);
void (*_reserved6) (void);
void (*_reserved7) (void);
};
GType nautilus_view_get_type (void);
const char * nautilus_view_get_view_id (NautilusView *view);
GtkWidget * nautilus_view_get_widget (NautilusView *view);
void nautilus_view_load_location (NautilusView *view,
const char *location_uri);
void nautilus_view_stop_loading (NautilusView *view);
int nautilus_view_get_selection_count (NautilusView *view);
GList * nautilus_view_get_selection (NautilusView *view);
void nautilus_view_set_selection (NautilusView *view,
GList *list);
void nautilus_view_invert_selection (NautilusView *view);
char * nautilus_view_get_first_visible_file (NautilusView *view);
void nautilus_view_scroll_to_file (NautilusView *view,
const char *uri);
char * nautilus_view_get_title (NautilusView *view);
gboolean nautilus_view_supports_zooming (NautilusView *view);
void nautilus_view_bump_zoom_level (NautilusView *view,
int zoom_increment);
void nautilus_view_zoom_to_level (NautilusView *view,
NautilusZoomLevel level);
void nautilus_view_restore_default_zoom_level (NautilusView *view);
gboolean nautilus_view_can_zoom_in (NautilusView *view);
gboolean nautilus_view_can_zoom_out (NautilusView *view);
NautilusZoomLevel nautilus_view_get_zoom_level (NautilusView *view);
void nautilus_view_pop_up_location_context_menu (NautilusView *view,
GdkEventButton *event,
const char *location);
void nautilus_view_grab_focus (NautilusView *view);
void nautilus_view_update_menus (NautilusView *view);
void nautilus_view_drop_proxy_received_uris (NautilusView *view,
GList *uris,
const char *target_location,
GdkDragAction action);
void nautilus_view_drop_proxy_received_netscape_url (NautilusView *view,
const char *source_url,
const char *target_location,
GdkDragAction action);
void nautilus_view_set_is_active (NautilusView *view,
gboolean is_active);
G_END_DECLS
#endif /* NAUTILUS_VIEW_H */
......@@ -121,6 +121,8 @@ nautilus_SOURCES = \
nautilus-trash-bar.h \
nautilus-view-as-action.c \
nautilus-view-as-action.h \
nautilus-view.c \
nautilus-view.h \
nautilus-view-factory.c \
nautilus-view-factory.h \
nautilus-window-bookmarks.c \
......@@ -138,6 +140,7 @@ nautilus_SOURCES = \
nautilus-window-toolbars.c \
nautilus-window.c \
nautilus-window.h \
nautilus-window-types.h \
nautilus-x-content-bar.c \
nautilus-x-content-bar.h \
nautilus-zoom-action.c \
......
......@@ -15,17 +15,10 @@ INCLUDES = \
$(DISABLE_DEPRECATED_CFLAGS) \
$(NULL)
BUILT_SOURCES = \
fm-marshal.c \
fm-marshal.h \
$(NULL)
libnautilus_file_manager_la_SOURCES= \
fm-actions.h \
fm-desktop-icon-view.c \
fm-desktop-icon-view.h \
fm-directory-view.c \
fm-directory-view.h \
fm-ditem-page.c \
fm-ditem-page.h \
fm-error-reporting.c \
......@@ -44,28 +37,6 @@ libnautilus_file_manager_la_SOURCES= \
nautilus-audio-mime-types.h \
$(NULL)
nodist_libnautilus_file_manager_la_SOURCES=\
$(BUILT_SOURCES) \
$(NULL)
fm-marshal.list: $(libnautilus_file_manager_la_SOURCES) Makefile.am
$(AM_V_GEN)( cd $(srcdir) && \
sed -n -e 's/.*fm_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
$(libnautilus_file_manager_la_SOURCES) ) \
| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
@if cmp -s $@.tmp $@; then \
rm $@.tmp; \
else \
mv $@.tmp $@; \
fi
%-marshal.c: %-marshal.list Makefile
$(AM_V_GEN)echo "#include \"fm-marshal.h\"" > $@ && \
$(GLIB_GENMARSHAL) --body --prefix=$(subst -,_,$*)_marshal $< >> $*-marshal.c
%-marshal.h: %-marshal.list Makefile
$(AM_V_GEN)$(GLIB_GENMARSHAL) --header --prefix=$(subst -,_,$*)_marshal $< > $*-marshal.h
EMPTY_VIEW_SOURCES = \
fm-empty-view.c \
fm-empty-view.h
......@@ -83,11 +54,4 @@ ui_DATA = \
$(NULL)
EXTRA_DIST = \
$(ui_DATA) \
fm-marshal.list
CLEANFILES = \
$(BUILT_SOURCES) \
fm-marshal.list \
$(NULL)
$(ui_DATA)
......@@ -30,6 +30,7 @@
#include "fm-desktop-icon-view.h"
#include "fm-actions.h"
#include "nautilus-view-factory.h"
#include "nautilus-view.h"
#include <X11/Xatom.h>
#include <gtk/gtk.h>
......@@ -298,7 +299,7 @@ fm_desktop_icon_view_dispose (GObject *object)
NULL);
g_signal_handlers_disconnect_by_func (gnome_lockdown_preferences,
fm_directory_view_update_menus,
nautilus_view_update_menus,
icon_view);
if (icon_view->details->background != NULL) {
......@@ -651,7 +652,7 @@ fm_desktop_icon_view_init (FMDesktopIconView *desktop_icon_view)
g_signal_connect_swapped (gnome_lockdown_preferences,
"changed::" NAUTILUS_PREFERENCES_LOCKDOWN_COMMAND_LINE,
G_CALLBACK (fm_directory_view_update_menus),
G_CALLBACK (nautilus_view_update_menus),
desktop_icon_view);
}
......
......@@ -190,11 +190,7 @@ static void default_zoom_level_changed_callback (gpointer callback_da
static void labels_beside_icons_changed_callback (gpointer callback_data);
static void all_columns_same_width_changed_callback (gpointer callback_data);
static void fm_icon_view_iface_init (NautilusViewIface *iface);
G_DEFINE_TYPE_WITH_CODE (FMIconView, fm_icon_view, FM_TYPE_DIRECTORY_VIEW,
G_IMPLEMENT_INTERFACE (NAUTILUS_TYPE_VIEW,
fm_icon_view_iface_init));
G_DEFINE_TYPE (FMIconView, fm_icon_view, FM_TYPE_DIRECTORY_VIEW);
static void
fm_icon_view_destroy (GtkWidget *object)
......@@ -1219,7 +1215,7 @@ fm_icon_view_begin_loading (FMDirectoryView *view)
preview_audio (icon_view, NULL, FALSE);
/* Set up the zoom level from the metadata. */
if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) {
if (nautilus_view_supports_zooming (NAUTILUS_VIEW (icon_view))) {
if (icon_view->details->compact) {
level = nautilus_file_get_integer_metadata
(file,
......@@ -1350,7 +1346,7 @@ fm_icon_view_set_zoom_level (FMIconView *view,
g_signal_emit_by_name (view, "zoom_level_changed");
if (fm_directory_view_get_active (FM_DIRECTORY_VIEW (view))) {
fm_directory_view_update_menus (FM_DIRECTORY_VIEW (view));
nautilus_view_update_menus (NAUTILUS_VIEW (view));
}
}
......@@ -1367,7 +1363,7 @@ fm_icon_view_bump_zoom_level (FMDirectoryView *view, int zoom_increment)
if (new_level >= NAUTILUS_ZOOM_LEVEL_SMALLEST &&
new_level <= NAUTILUS_ZOOM_LEVEL_LARGEST) {
fm_directory_view_zoom_to_level (view, new_level);
nautilus_view_zoom_to_level (view, new_level);
}
}
......@@ -1391,7 +1387,7 @@ fm_icon_view_restore_default_zoom_level (FMDirectoryView *view)
g_return_if_fail (FM_IS_ICON_VIEW (view));
icon_view = FM_ICON_VIEW (view);
fm_directory_view_zoom_to_level
nautilus_view_zoom_to_level
(view, get_default_zoom_level (icon_view));
}
......@@ -2381,7 +2377,7 @@ fm_icon_view_react_to_icon_change_idle_callback (gpointer data)
/* Rebuild the menus since some of them (e.g. Restore Stretched Icons)
* may be different now.
*/
fm_directory_view_update_menus (FM_DIRECTORY_VIEW (icon_view));
nautilus_view_update_menus (FM_DIRECTORY_VIEW (icon_view));
/* Don't call this again (unless rescheduled) */
return FALSE;
......@@ -2590,7 +2586,7 @@ default_zoom_level_changed_callback (gpointer callback_data)
icon_view = FM_ICON_VIEW (callback_data);
if (fm_directory_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) {
if (nautilus_view_supports_zooming (FM_DIRECTORY_VIEW (icon_view))) {
file = fm_directory_view_get_directory_as_file (FM_DIRECTORY_VIEW (icon_view));
if (fm_icon_view_is_compact (icon_view)) {
......@@ -2602,7 +2598,7 @@ default_zoom_level_changed_callback (gpointer callback_data)
NAUTILUS_METADATA_KEY_ICON_VIEW_ZOOM_LEVEL,
get_default_zoom_level (icon_view));
}
fm_directory_view_zoom_to_level (FM_DIRECTORY_VIEW (icon_view), level);
nautilus_view_zoom_to_level (FM_DIRECTORY_VIEW (icon_view), level);
}
}
......@@ -2809,10 +2805,10 @@ create_icon_container (FMIconView *icon_view)
g_signal_connect_object (icon_container, "renaming_icon",
G_CALLBACK (renaming_icon_callback), icon_view, 0);
g_signal_connect_object (icon_container, "icon_stretch_started",
G_CALLBACK (fm_directory_view_update_menus), icon_view,
G_CALLBACK (nautilus_view_update_menus), icon_view,
G_CONNECT_SWAPPED);
g_signal_connect_object (icon_container, "icon_stretch_ended",
G_CALLBACK (fm_directory_view_update_menus), icon_view,
G_CALLBACK (nautilus_view_update_menus), icon_view,
G_CONNECT_SWAPPED);
g_signal_connect_object (icon_container, "get_stored_layout_timestamp",
......@@ -2905,6 +2901,20 @@ icon_view_scroll_to_file (NautilusView *view,
}
}
static const char *
fm_icon_view_get_id (NautilusView *view)
{
if (FM_IS_DESKTOP_ICON_VIEW (view)) {
return FM_DESKTOP_ICON_VIEW_ID;
}
if (fm_icon_view_is_compact (FM_ICON_VIEW (view))) {
return FM_COMPACT_VIEW_ID;
}
return FM_ICON_VIEW_ID;
}