Libraries:Gtk:Gio:GMount
Types
T
ParentT
Constants
InterfaceInfo : Std.Object.T
Nil : T
Functions
GetType() : Gtk.GObject.Type.T
Methods
:CanEject(self @ T) : Std.Symbol.T
:CanEject(_ @ ParentT)
:CanUnmount(self @ T) : Std.Symbol.T
:CanUnmount(_ @ ParentT)
:Changed(_ @ ParentT)
:Eject(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Warning
Eject has been deprecated since version 2.22 and should not be used in newly-written code. Use EjectWithOperation instead.
:Eject(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:EjectFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Warning
EjectFinish has been deprecated since version 2.22 and should not be used in newly-written code. Use EjectWithOperationFinish instead.
:EjectFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:EjectWithOperation(self @ T, flags @ Std.Integer.SmallT, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Ejects a mount. This is an asynchronous operation, and is finished by calling EjectWithOperationFinish with the mount and Gtk.Gio.GAsyncResult.T data returned in the callback.
mount | a T. |
flags | flags affecting the unmount if required for eject |
mount_operation | a Gtk.Gio.GMountOperation.T or NULL to avoid user interaction. [allow-none] |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback, or NULL. [allow-none] |
user_data | user data passed to callback. |
:EjectWithOperation(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:EjectWithOperationFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes ejecting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.
mount | a T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore. |
Returns | TRUE if the mount was successfully ejected. FALSE otherwise. |
:EjectWithOperationFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:GetDefaultLocation(self @ T) : Gtk.Gio.GFile.T
Gets the default location of mount. The default location of the given mount is a path that reflects the main entry point for the user (e.g. the home directory, or the root of the volume).
mount | a T. |
Returns | a Gtk.Gio.GFile.T. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
:GetDefaultLocation(_ @ ParentT)
:GetDrive(self @ T) : Gtk.Gio.GDrive.T
Gets the drive for the mount.
This is a convenience method for getting the Gtk.Gio.GVolume.T and then using that object to get the Gtk.Gio.GDrive.T.
mount | a T. |
Returns | a Gtk.Gio.GDrive.T or NULL if mount is not associated with a volume or a drive. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
:GetDrive(_ @ ParentT)
:GetIcon(self @ T) : Gtk.Gio.GIcon.T
Gets the icon for mount.
mount | a T. |
Returns | a Gtk.Gio.GIcon.T. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
:GetIcon(_ @ ParentT)
:GetName(self @ T) : Std.String.T
Gets the name of mount.
mount | a T. |
Returns | the name for the given mount. The returned string should be freed with g_free() when no longer needed. |
:GetName(_ @ ParentT)
:GetRoot(self @ T) : Gtk.Gio.GFile.T
Gets the root directory on mount.
mount | a T. |
Returns | a Gtk.Gio.GFile.T. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
:GetRoot(_ @ ParentT)
:GetUuid(self @ T) : Std.String.T
Gets the UUID for the mount. The reference is typically based on the file system UUID for the mount in question and should be considered an opaque string. Returns NULL if there is no UUID available.
mount | a T. |
Returns | the UUID for mount or NULL if no UUID can be computed. The returned string should be freed with g_free() when no longer needed. |
:GetUuid(_ @ ParentT)
:GetVolume(self @ T) : Gtk.Gio.GVolume.T
Gets the volume for the mount.
mount | a T. |
Returns | a Gtk.Gio.GVolume.T or NULL if mount is not associated with a volume. The returned object should be unreffed with g_object_unref() when no longer needed. [transfer full] |
:GetVolume(_ @ ParentT)
:GuessContentType(self @ T, force_rescan @ Std.Symbol.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an asynchronous operation (see GuessContentTypeSync for the synchronous version), and is finished by calling GuessContentTypeFinish with the mount and Gtk.Gio.GAsyncResult.T data returned in the callback.
mount | a T |
force_rescan | Whether to force a rescan of the content. Otherwise a cached result will be used if available |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback |
user_data | user data passed to callback |
:GuessContentType(_ @ ParentT, _ @ Std.Symbol.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:GuessContentTypeFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Agg.List.T
Finishes guessing content types of mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned. In particular, you may get an Gtk.Gio.GIOErrorEnum.NotSupported if the mount does not support content guessing.
mount | a T |
result | a Gtk.Gio.GAsyncResult.T |
error | a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore |
Returns | a NULL-terminated array of content types or NULL on error. Caller should free this array with Gtk.Glib.GStrfuncs.Strfreev when done with it. [transfer full][element-type utf8] |
:GuessContentTypeFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:GuessContentTypeSync(self @ T, force_rescan @ Std.Symbol.T, cancellable @ Gtk.Gio.GCancellable.T, error @ Std.Object.T) : Agg.List.T
Tries to guess the type of content stored on mount. Returns one or more textual identifiers of well-known content types (typically prefixed with "x-content/"), e.g. x-content/image-dcf for camera memory cards. See the shared-mime-info specification for more on x-content types.
This is an synchronous operation and as such may block doing IO; see GuessContentType for the asynchronous version.
mount | a T |
force_rescan | Whether to force a rescan of the content. Otherwise a cached result will be used if available |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
error | a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore |
Returns | a NULL-terminated array of content types or NULL on error. Caller should free this array with Gtk.Glib.GStrfuncs.Strfreev when done with it. [transfer full][element-type utf8] |
:GuessContentTypeSync(_ @ ParentT, _ @ Std.Symbol.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Object.T)
:IsShadowed(self @ T) : Std.Symbol.T
Determines if mount is shadowed. Applications or libraries should avoid displaying mount in the user interface if it is shadowed.
A mount is said to be shadowed if there exists one or more user visible objects (currently T objects) with a root that is inside the root of mount.
One application of shadow mounts is when exposing a single file system that is used to address several logical volumes. In this situation, a Gtk.Gio.GVolumeMonitor.T implementation would create two Gtk.Gio.GVolume.T objects (for example, one for the camera functionality of the device and one for a SD card reader on the device) with activation URIs gphoto2://[usb:001,002]/store1/ and gphoto2://[usb:001,002]/store2/. When the underlying mount (with root gphoto2://[usb:001,002]/) is mounted, said Gtk.Gio.GVolumeMonitor.T implementation would create two T objects (each with their root matching the corresponding volume activation root) that would shadow the original mount.
The proxy monitor in GVfs 2.26 and later, automatically creates and manage shadow mounts (and shadows the underlying mount) if the activation root on a Gtk.Gio.GVolume.T is set.
:PreUnmount(_ @ ParentT)
:Remount(self @ T, flags @ Gtk.Gio.GMountMountFlags.T, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Remounts a mount. This is an asynchronous operation, and is finished by calling RemountFinish with the mount and GAsyncResults data returned in the callback.
Remounting is useful when some setting affecting the operation of the volume has been changed, as these may need a remount to take affect. While this is semantically equivalent with unmounting and then remounting not all backends might need to actually be unmounted.
mount | a T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T or NULL to avoid user interaction. [allow-none] |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback, or NULL. [allow-none] |
user_data | user data passed to callback. |
:Remount(_ @ ParentT, _ @ Gtk.Gio.GMountMountFlags.T, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:RemountFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes remounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.
mount | a T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore. |
Returns | TRUE if the mount was successfully remounted. FALSE otherwise. |
:RemountFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Shadow(self @ T) : Std.Object.T
Increments the shadow count on mount. Usually used by Gtk.Gio.GVolumeMonitor.T implementations when creating a shadow mount for mount, see IsShadowed for more information. The caller will need to emit the "changed" signal on mount manually.
mount | A T. |
:Unmount(self @ T, flags @ Std.Integer.SmallT, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Warning
Unmount has been deprecated since version 2.22 and should not be used in newly-written code. Use UnmountWithOperation instead.
:Unmount(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:UnmountFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Warning
UnmountFinish has been deprecated since version 2.22 and should not be used in newly-written code. Use UnmountWithOperationFinish instead.
:UnmountFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:UnmountWithOperation(self @ T, flags @ Std.Integer.SmallT, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T
Unmounts a mount. This is an asynchronous operation, and is finished by calling UnmountWithOperationFinish with the mount and Gtk.Gio.GAsyncResult.T data returned in the callback.
mount | a T. |
flags | flags affecting the operation |
mount_operation | a Gtk.Gio.GMountOperation.T or NULL to avoid user interaction. [allow-none] |
cancellable | optional Gtk.Gio.GCancellable.T object, NULL to ignore. [allow-none] |
callback | a Gtk.Gio.GAsyncReadyCallback, or NULL. [allow-none] |
user_data | user data passed to callback. |
:UnmountWithOperation(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)
:UnmountWithOperationFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T
Finishes unmounting a mount. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.
mount | a T. |
result | a Gtk.Gio.GAsyncResult.T. |
error | a Gtk.Glib.GError.T location to store the error occurring, or NULL to ignore. |
Returns | TRUE if the mount was successfully unmounted. FALSE otherwise. |
:UnmountWithOperationFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)
:Unmounted(_ @ ParentT)
:Unshadow(self @ T) : Std.Object.T
Decrements the shadow count on mount. Usually used by Gtk.Gio.GVolumeMonitor.T implementations when destroying a shadow mount for mount, see IsShadowed for more information. The caller will need to emit the "changed" signal on mount manually.
mount | A T. |
The T interface represents user-visible mounts. Note, when porting from GnomeVFS, T is the moral equivalent of Gtk.GnomeVFS.Volume.T.
T is a "mounted" filesystem that you can access. Mounted is in quotes because it's not the same as a unix mount, it might be a gvfs mount, but you can still access the files on it if you use GIO. Might or might not be related to a volume object.
Unmounting a T instance is an asynchronous operation. For more information about asynchronous operations, see GAsyncReady and GSimpleAsyncReady. To unmount a T instance, first call UnmountWithOperation with (at least) the T instance and a Gtk.Gio.GAsyncReadyCallback. The callback will be fired when the operation has resolved (either with success or failure), and a GAsyncReady structure will be passed to the callback. That callback should then call UnmountWithOperationFinish with the T and the GAsyncReady data to see if the operation was completed successfully. If an error is present when UnmountWithOperationFinish is called, then it will be filled with any error information.