Top |
#define | GNOME_IS_VFS_DRIVE() |
#define | GNOME_IS_VFS_DRIVE_CLASS() |
#define | GNOME_VFS_TYPE_DRIVE |
#define | GNOME_VFS_DRIVE() |
#define | GNOME_VFS_DRIVE_CLASS() |
gint | gnome_vfs_drive_compare () |
void | gnome_vfs_drive_eject () |
char * | gnome_vfs_drive_get_activation_uri () |
char * | gnome_vfs_drive_get_device_path () |
GnomeVFSDeviceType | gnome_vfs_drive_get_device_type () |
char * | gnome_vfs_drive_get_display_name () |
char * | gnome_vfs_drive_get_hal_udi () |
char * | gnome_vfs_drive_get_icon () |
gulong | gnome_vfs_drive_get_id () |
GnomeVFSVolume * | gnome_vfs_drive_get_mounted_volume () |
GList * | gnome_vfs_drive_get_mounted_volumes () |
void | gnome_vfs_drive_volume_list_free () |
GType | gnome_vfs_drive_get_type () |
gboolean | gnome_vfs_drive_is_connected () |
gboolean | gnome_vfs_drive_is_mounted () |
gboolean | gnome_vfs_drive_is_user_visible () |
void | gnome_vfs_drive_mount () |
GnomeVFSDrive * | gnome_vfs_drive_ref () |
void | gnome_vfs_drive_unmount () |
void | gnome_vfs_drive_unref () |
void | volume-mounted | Run First |
void | volume-pre-unmount | Run First |
void | volume-unmounted | Run First |
#define GNOME_IS_VFS_DRIVE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GNOME_VFS_TYPE_DRIVE))
#define GNOME_IS_VFS_DRIVE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GNOME_VFS_TYPE_DRIVE))
#define GNOME_VFS_DRIVE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GNOME_VFS_TYPE_DRIVE, GnomeVFSDrive))
#define GNOME_VFS_DRIVE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GNOME_VFS_TYPE_DRIVE, GnomeVFSDriveClass))
gint gnome_vfs_drive_compare (GnomeVFSDrive *a
,GnomeVFSDrive *b
);
Compares two GnomeVFSDrive objects a
and b
. Two
GnomeVFSDrive objects referring to different drives
are guaranteed to not return 0 when comparing them,
if they refer to the same drive 0 is returned.
The resulting gint should be used to determine the
order in which a
and b
are displayed in graphical
user interfces.
The comparison algorithm first of all peeks the device
type of a
and b
, they will be sorted in the following
order:
Magnetic and opto-magnetic drives (ZIP, floppy)
Optical drives (CD, DVD)
External drives (USB sticks, music players)
Mounted hard disks<
Other drives<
Afterwards, the display name of a
and b
is compared
using a locale-sensitive sorting algorithm, which
involves g_utf8_collate_key()
.
If two drives have the same display name, their
unique ID is compared which can be queried using
gnome_vfs_drive_get_id()
.
0 if the drives refer to the same GnomeVFSDrive
,
a negative value if a
should be displayed before b
,
or a positive value if a
should be displayed after b
.
Since: 2.6
void gnome_vfs_drive_eject (GnomeVFSDrive *drive
,GnomeVFSVolumeOpCallback callback
,gpointer user_data
);
If drive
has associated GnomeVFSVolume objects, all of them will be
unmounted by calling gnome_vfs_volume_unmount()
for each volume in
gnome_vfs_drive_get_mounted_volumes()
, except for the last one,
for which gnome_vfs_volume_eject()
is called to ensure that the
drive
's media is ejected.
If drive
however has no associated GnomeVFSVolume objects, it
simply calls an unmount helper on the drive
.
drive |
the GnomeVFSDrive that should be ejcted. |
|
callback |
the GnomeVFSVolumeOpCallback that should be invoked after ejecting |
|
user_data |
the user data to pass to |
Since: 2.6
char *
gnome_vfs_drive_get_activation_uri (GnomeVFSDrive *drive
);
Returns the activation URI of a GnomeVFSDrive.
The returned URI usually refers to a valid location. You can check the
validity of the location by calling gnome_vfs_uri_new()
with the URI,
and checking whether the return value is not NULL
.
Since: 2.6
char *
gnome_vfs_drive_get_device_path (GnomeVFSDrive *drive
);
Returns the device path of a GnomeVFSDrive.
For HAL drives, this returns the value of the
drives's "block.device" key. For UNIX mounts,
it returns the mntent
's mnt_fsname
entry.
Otherwise, it returns NULL
.
Since: 2.6
GnomeVFSDeviceType
gnome_vfs_drive_get_device_type (GnomeVFSDrive *drive
);
Since: 2.6
char *
gnome_vfs_drive_get_display_name (GnomeVFSDrive *drive
);
Since: 2.6
char *
gnome_vfs_drive_get_hal_udi (GnomeVFSDrive *drive
);
Returns the HAL UDI of a GnomeVFSDrive.
For HAL drives, this matches the value of the "info.udi" key,
for other drives it is NULL
.
Since: 2.6
GnomeVFSVolume *
gnome_vfs_drive_get_mounted_volume (GnomeVFSDrive *drive
);
gnome_vfs_drive_get_mounted_volume
is deprecated and should not be used in newly-written code.
Use gnome_vfs_drive_get_mounted_volumes()
instead.
Returns the first mounted volume for the drive
.
Since: 2.6
GList *
gnome_vfs_drive_get_mounted_volumes (GnomeVFSDrive *drive
);
gnome_vfs_drive_get_mounted_volumes
is deprecated and should not be used in newly-written code.
Since: 2.8
void
gnome_vfs_drive_volume_list_free (GList *volumes
);
Frees the list volumes
, if it is not NULL
.
Since: 2.8
gboolean
gnome_vfs_drive_is_connected (GnomeVFSDrive *drive
);
Since: 2.6
gboolean
gnome_vfs_drive_is_mounted (GnomeVFSDrive *drive
);
Since: 2.6
gboolean
gnome_vfs_drive_is_user_visible (GnomeVFSDrive *drive
);
Returns whether the drive
is visible to the user. This
should be used by applications to determine whether it
is included in user interfaces listing available drives.
Since: 2.6
void gnome_vfs_drive_mount (GnomeVFSDrive *drive
,GnomeVFSVolumeOpCallback callback
,gpointer user_data
);
drive |
the GnomeVFSDrive that should be mounted. |
|
callback |
the GnomeVFSVolumeOpCallback that should be invoked after mounting |
|
user_data |
the user data to pass to |
Since: 2.6
GnomeVFSDrive *
gnome_vfs_drive_ref (GnomeVFSDrive *drive
);
Increases the refcount of the drive
by 1, if it is not NULL
.
Since: 2.6
void gnome_vfs_drive_unmount (GnomeVFSDrive *drive
,GnomeVFSVolumeOpCallback callback
,gpointer user_data
);
gnome_vfs_drive_unmount() invokes gnome_vfs_drive_eject()
, if the drive
signals
that it should be ejected when it is unmounted. This may be true for CD-ROMs,
USB sticks and other devices, depending on the backend providing the GnomeVFSDrive drive
.
If the drive
does not signal that it should be ejected when it is unmounted,
gnome_vfs_drive_unmount()
calls gnome_vfs_volume_unmount()
for each of the
drive
's mounted GnomeVFSVolumes, which can be queried using
gnome_vfs_drive_get_mounted_volumes()
.
drive |
the GnomeVFSDrive that should be unmounted. |
|
callback |
the GnomeVFSVolumeOpCallback that should be invoked after unmounting |
|
user_data |
the user data to pass to |
Since: 2.6
void
gnome_vfs_drive_unref (GnomeVFSDrive *drive
);
Decreases the refcount of the drive
by 1, if it is not NULL
.
Since: 2.6
Identifies the device type of a GnomeVFSVolume or a GnomeVFSDrive.
the type of this GnomeVFSVolume or GnomeVFSDrive is not known. |
||
only used for GnomeVFSVolume objects. Denotes that this volume is an audio CD. |
||
only used for GnomeVFSVolume objects. Denotes that this volume is a video DVD. |
||
this is a mount point refering to a harddisk partition that neither has a Microsoft file system (FAT, VFAT, NTFS) nor an Apple file system (HFS, HFS+). |
||
this may either be a mount point or a HAL drive/volume. Either way, it refers to a CD-ROM device respectively volume. |
||
the volume or drive referenced by this GnomeVFSVolume or GnomeVFSDrive is a floppy disc respectively a floppy drive. |
||
the volume or drive referenced by this GnomeVFSVolume or GnomeVFSDrive is a ZIP disc respectively a ZIP drive. |
||
the volume or drive referenced by this GnomeVFSVolume or GnomeVFSDrive is a JAZ disc respectively a JAZ drive. |
||
this is a mount point having an NFS file system. |
||
this is a mount point having an AutoFS file system. |
||
only used for GnomeVFSVolume objects. Denotes that this volume is a camera. |
||
only used for GnomeVFSVolume objects. Denotes that this volume is a memory stick. |
||
this is a mount point having a Samba file system. |
||
this is a mount point refering to a harddisk partition, that has an Apple file system (HFS, HFS+). |
||
only used for GnomeVFSVolume objects. Denotes that this volume is a music player. |
||
this is a mount point refering to a harddisk partition, that has a Microsoft file system (FAT, VFAT, NTFS). |
||
this is a mount point refering to a loopback device. |
||
only used for GnomeVFSVolume objects, denoting that this volume refers to a network mount that is not managed by the kernel VFS but exclusively known to GnomeVFS. |
struct GnomeVFSDriveClass { GObjectClass parent_class; void (* volume_mounted) (GnomeVFSDrive *drive, GnomeVFSVolume *volume); void (* volume_pre_unmount) (GnomeVFSDrive *drive, GnomeVFSVolume *volume); void (* volume_unmounted) (GnomeVFSDrive *drive, GnomeVFSVolume *volume); };
“volume-mounted”
signalvoid user_function (GnomeVFSDrive *drive, GnomeVFSVolume *volume, gpointer user_data)
This signal is emitted after the GnomeVFSVolume volume
has been mounted.
When the volume
is mounted, it is added to the drive
's list of mounted
volumes, which can be queried using gnome_vfs_drive_get_mounted_volumes()
.
It is also added to the list of the GnomeVFSVolumeMonitor's list of mounted
volumes, which can be queried using gnome_vfs_volume_monitor_get_mounted_volumes()
.
drive |
the GnomeVFSDrive which received the signal. |
|
volume |
the GnomeVFSVolume that has been mounted. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“volume-pre-unmount”
signalvoid user_function (GnomeVFSDrive *drive, GnomeVFSVolume *volume, gpointer user_data)
This signal is emitted when the GnomeVFSVolume volume
, which has been present in
the GnomeVFSDrive drive
, is about to be unmounted.
When the volume
is unmounted, it is removed from the drive
's list of mounted
volumes, which can be queried using gnome_vfs_drive_get_mounted_volumes()
.
It is also removed from the GnomeVFSVolumeMonitor's list of mounted volumes,
which can be queried using gnome_vfs_volume_monitor_get_mounted_volumes()
.
When a client application receives this signal, it must free all resources
associated with the volume
, for instance cancel all pending file operations
on the volume
, and cancel all pending file monitors using gnome_vfs_monitor_cancel()
.
drive |
the GnomeVFSDrive which received the signal. |
|
volume |
the GnomeVFSVolume that is about to be unmounted. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“volume-unmounted”
signalvoid user_function (GnomeVFSDrive *drive, GnomeVFSVolume *volume, gpointer user_data)
This signal is emitted after the GnomeVFSVolume volume
, which had been present in
the GnomeVFSDrive drive
, has been unmounted.
When the volume
is unmounted, it is removed from the drive
's list of mounted
volumes, which can be queried using gnome_vfs_drive_get_mounted_volumes()
.
It is also removed from the GnomeVFSVolumeMonitor's list of mounted volumes,
which can be queried using gnome_vfs_volume_monitor_get_mounted_volumes()
.
drive |
the GnomeVFSDrive which received the signal. |
|
volume |
the GnomeVFSVolume that has been unmounted. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First