mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-09-19 15:51:40 +00:00
b1ce82df18
2000-09-07 Gene Z. Ragan <gzr@eazel.com> Fixed bug 2445, Some volume monitor code applies only to desktop case. Fixed bug 2452, find_volumes confused about which volumes to include. Fixed bug 2451, Incorrect test for removability of ISO9660 volumes. * libnautilus-extensions/nautilus-volume-monitor.c: * libnautilus-extensions/nautilus-volume-monitor.h: (floppy_sort): Changed function to use NautilusVolumes as opposed to paths (nautilus_volume_monitor_volume_is_removable): New function to check and see if volume is removable. (nautilus_volume_monitor_get_removable_volumes): New function to return a list of removable NautilusVolumes (nautilus_volume_monitor_get_volume_name): New function to return a human readable name of volume (nautilus_volume_monitor_volume_is_mounted), (mount_volume_floppy_set_state), (mount_volume_mount), (find_volumes), (nautilus_volume_monitor_mount_unmount_removable): Clean up and bug fix work. * src/file-manager/fm-desktop-icon-view.c: (create_mount_link), (fm_desktop_icon_view_create_background_context_menu_items), (volume_unmounted_callback): Use new functions in NautilusVolumeMonitor.
104 lines
3.9 KiB
C
104 lines
3.9 KiB
C
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
|
|
|
|
/* nautilus-volume-monitor.h - interface for desktop mounting functions.
|
|
|
|
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: Gene Z. Ragan <gzr@eazel.com>
|
|
*/
|
|
|
|
#ifndef NAUTILUS_VOLUME_MONITOR_H
|
|
#define NAUTILUS_VOLUME_MONITOR_H
|
|
|
|
#include <gtk/gtkobject.h>
|
|
|
|
typedef struct NautilusVolumeMonitor NautilusVolumeMonitor;
|
|
typedef struct NautilusVolumeMonitorClass NautilusVolumeMonitorClass;
|
|
typedef struct NautilusVolumeMonitorDetails NautilusVolumeMonitorDetails;
|
|
|
|
#define NAUTILUS_TYPE_VOLUME_MONITOR (nautilus_volume_monitor_get_type())
|
|
#define NAUTILUS_VOLUME_MONITOR(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_VOLUME_MONITOR, NautilusVolumeMonitor))
|
|
#define NAUTILUS_VOLUME_MONITOR_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_VOLUME_MONITOR, NautilusVolumeMonitorClass))
|
|
#define IS_NAUTILUS_VOLUME_MONITOR(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_VOLUME_MONITOR))
|
|
|
|
struct NautilusVolumeMonitor {
|
|
GtkObject parent;
|
|
NautilusVolumeMonitorDetails *details;
|
|
};
|
|
|
|
typedef struct NautilusVolume NautilusVolume;
|
|
|
|
struct NautilusVolumeMonitorClass {
|
|
GtkObjectClass parent_class;
|
|
|
|
/* Signals */
|
|
void (* volume_mounted) (NautilusVolumeMonitor *monitor,
|
|
const NautilusVolume *volume);
|
|
void (* volume_unmounted) (NautilusVolumeMonitor *monitor,
|
|
const NautilusVolume *volume);
|
|
};
|
|
|
|
typedef enum {
|
|
NAUTILUS_VOLUME_ACTIVE,
|
|
NAUTILUS_VOLUME_INACTIVE,
|
|
NAUTILUS_VOLUME_EMPTY,
|
|
NAUTILUS_VOLUME_NUMBER_OF_STATES
|
|
} NautilusVolumeState;
|
|
|
|
typedef enum {
|
|
NAUTILUS_VOLUME_CDROM,
|
|
NAUTILUS_VOLUME_FLOPPY,
|
|
NAUTILUS_VOLUME_EXT2,
|
|
NAUTILUS_VOLUME_OTHER
|
|
} NautilusVolumeType;
|
|
|
|
struct NautilusVolume {
|
|
NautilusVolumeType type;
|
|
NautilusVolumeState state;
|
|
|
|
char *fsname;
|
|
char *mount_path;
|
|
char *volume_name;
|
|
|
|
gboolean is_mounted;
|
|
gboolean did_mount;
|
|
|
|
gboolean is_read_only;
|
|
};
|
|
|
|
typedef gboolean (* NautilusEachVolumeFunction) (const NautilusVolume *, gpointer);
|
|
|
|
GtkType nautilus_volume_monitor_get_type (void);
|
|
NautilusVolumeMonitor *nautilus_volume_monitor_get (void);
|
|
char *nautilus_volume_monitor_get_volume_name (const NautilusVolume *volume);
|
|
|
|
gboolean nautilus_volume_monitor_volume_is_mounted (const NautilusVolume *volume);
|
|
gboolean nautilus_volume_monitor_mount_unmount_removable (NautilusVolumeMonitor *monitor,
|
|
const char *mount_point);
|
|
gboolean nautilus_volume_monitor_volume_is_removable (NautilusVolume *volume);
|
|
gboolean nautilus_volume_monitor_is_volume_link (const char *path);
|
|
void nautilus_volume_monitor_each_volume (NautilusVolumeMonitor *monitor,
|
|
NautilusEachVolumeFunction function,
|
|
gpointer context);
|
|
void nautilus_volume_monitor_each_mounted_volume (NautilusVolumeMonitor *monitor,
|
|
NautilusEachVolumeFunction function,
|
|
gpointer context);
|
|
GList *nautilus_volume_monitor_get_removable_volumes (NautilusVolumeMonitor *monitor);
|
|
|
|
#endif /* NAUTILUS_VOLUME_MONITOR_H */
|