W Wrapl, The Programming Language

Libraries:Gtk:Gio:GDrive

Types

T

T - this represent a piece of hardware connected to the machine. It's generally only created for removable hardware or hardware with removable media.

T is a container class for Gtk.Gio.GVolume.T objects that stem from the same piece of media. As such, T abstracts a drive with (or without) removable media and provides operations for querying whether media is available, determing whether media change is automatically detected and ejecting the media.

If the T reports that media isn't automatically detected, one can poll for media; typically one should not do this periodically as a poll for media operation is potententially expensive and may spin up the drive creating noise.

T supports starting and stopping drives with authentication support for the former. This can be used to support a diverse set of use cases including connecting/disconnecting iSCSI devices, powering down external disk enclosures and starting/stopping multi-disk devices such as RAID devices. Note that the actual semantics and side-effects of starting/stopping a T may vary according to implementation. To choose the correct verbs in e.g. a file manager, use GetStartStopType.

For porting from GnomeVFS note that there is no equivalent of T in that API.



ParentT

Constants

InterfaceInfo : Std.Object.T

Nil : T

Functions

GetType() : Gtk.GObject.Type.T



Methods

:CanEject(self @ T) : Std.Symbol.T

Checks if a drive can be ejected.

drive a T.
Returns TRUE if the drive can be ejected, FALSE otherwise.


:CanEject(_ @ ParentT)

:CanPollForMedia(self @ T) : Std.Symbol.T

Checks if a drive can be polled for media changes.

drive a T.
Returns TRUE if the drive can be polled for media changes, FALSE otherwise.


:CanPollForMedia(_ @ ParentT)

:CanStart(self @ T) : Std.Symbol.T

Checks if a drive can be started.

drive a T.
Returns TRUE if the drive can be started, FALSE otherwise.


:CanStart(_ @ ParentT)

:CanStartDegraded(self @ T) : Std.Symbol.T

Checks if a drive can be started degraded.

drive a T.
Returns TRUE if the drive can be started degraded, FALSE otherwise.


:CanStartDegraded(_ @ ParentT)

:CanStop(self @ T) : Std.Symbol.T

Checks if a drive can be stopped.

drive a T.
Returns TRUE if the drive can be stopped, FALSE otherwise.


:CanStop(_ @ ParentT)

:Changed(_ @ ParentT)

:Disconnected(_ @ 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)

:EjectButton(_ @ ParentT)

: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 drive. This is an asynchronous operation, and is finished by calling EjectWithOperationFinish with the drive and Gtk.Gio.GAsyncResult.T data returned in the callback.

drive 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 drive. If any errors occurred during the operation, error will be set to contain the errors and FALSE will be returned.

drive 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 drive was successfully ejected. FALSE otherwise.


:EjectWithOperationFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)

:EnumerateIdentifiers(self @ T) : Std.Object.T

Gets the kinds of identifiers that drive has. Use g_drive_get_identifer() to obtain the identifiers themselves.

drive a T
Returns a NULL-terminated array of strings containing kinds of identifiers. Use Gtk.Glib.GStrfuncs.Strfreev to free. [transfer full][array zero-terminated=1]


:EnumerateIdentifiers(_ @ ParentT)

:GetIcon(self @ T) : Gtk.Gio.GIcon.T

Gets the icon for drive.

drive a T.
Returns Gtk.Gio.GIcon.T for the drive. Free the returned object with g_object_unref(). [transfer full]


:GetIcon(_ @ ParentT)

:GetIdentifier(self @ T, kind @ Std.String.T) : Std.String.T

Gets the identifier of the given kind for drive.

drive a T
kind the kind of identifier to return
Returns a newly allocated string containing the requested identfier, or NULL if the T doesn't have this kind of identifier.


:GetIdentifier(_ @ ParentT, _ @ Std.String.T)

:GetName(self @ T) : Std.String.T

Gets the name of drive.

drive a T.
Returns a string containing drive's name. The returned string should be freed when no longer needed.


:GetName(_ @ ParentT)

:GetStartStopType(self @ T) : Gtk.Gio.GDriveStartStopType.T

Gets a hint about how a drive can be started/stopped.

drive a T.
Returns A value from the Gtk.Gio.GDriveStartStopType.T enumeration.


:GetStartStopType(_ @ ParentT)

:GetVolumes(self @ T) : Std.Object.T

Get a list of mountable volumes for drive.

The returned list should be freed with g_list_free(), after its elements have been unreffed with g_object_unref().

drive a T.
Returns GList containing any Gtk.Gio.GVolume.T objects on the given drive. [element-type GVolume][transfer full]


:GetVolumes(_ @ ParentT)

:HasMedia(self @ T) : Std.Symbol.T

Checks if the drive has media. Note that the OS may not be polling the drive for media changes; see IsMediaCheckAutomatic for more details.

drive a T.
Returns TRUE if drive has media, FALSE otherwise.


:HasMedia(_ @ ParentT)

:HasVolumes(self @ T) : Std.Symbol.T

Check if drive has any mountable volumes.

drive a T.
Returns TRUE if the drive contains volumes, FALSE otherwise.


:HasVolumes(_ @ ParentT)

:IsMediaCheckAutomatic(self @ T) : Std.Symbol.T

Checks if drive is capabable of automatically detecting media changes.

drive a T.
Returns TRUE if the drive is capabable of automatically detecting media changes, FALSE otherwise.


:IsMediaCheckAutomatic(_ @ ParentT)

:IsMediaRemovable(self @ T) : Std.Symbol.T

Checks if the drive supports removable media.

drive a T.
Returns TRUE if drive supports removable media, FALSE otherwise.


:IsMediaRemovable(_ @ ParentT)

:PollForMedia(self @ T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T

Asynchronously polls drive to see if media has been inserted or removed.

When the operation is finished, callback will be called. You can then call PollForMediaFinish to obtain the result of the operation.

drive a T.
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 to pass to callback


:PollForMedia(_ @ ParentT, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)

:PollForMediaFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T

Finishes an operation started with PollForMedia on a drive.

drive a T.
result a Gtk.Gio.GAsyncResult.T.
error a Gtk.Glib.GError.T, or NULL
Returns TRUE if the drive has been poll_for_mediaed successfully, FALSE otherwise.


:PollForMediaFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)

:Start(self @ T, flags @ Gtk.Gio.GDriveStartFlags.T, mount_operation @ Gtk.Gio.GMountOperation.T, cancellable @ Gtk.Gio.GCancellable.T, callback @ Std.Function.T, user_data) : Std.Object.T

Asynchronously starts a drive.

When the operation is finished, callback will be called. You can then call StartFinish to obtain the result of the operation.

drive a T.
flags flags affecting the start 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 to pass to callback


:Start(_ @ ParentT, _ @ Gtk.Gio.GDriveStartFlags.T, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)

:StartFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T

Finishes starting a drive.

drive a T.
result a Gtk.Gio.GAsyncResult.T.
error a Gtk.Glib.GError.T, or NULL
Returns TRUE if the drive has been started successfully, FALSE otherwise.


:StartFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)

:Stop(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

Asynchronously stops a drive.

When the operation is finished, callback will be called. You can then call StopFinish to obtain the result of the operation.

drive a T.
flags flags affecting the unmount if required for stopping.
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 to pass to callback


:Stop(_ @ ParentT, _ @ Std.Integer.SmallT, _ @ Gtk.Gio.GMountOperation.T, _ @ Gtk.Gio.GCancellable.T, _ @ Std.Function.T, _ @ Std.Address.T)

:StopButton(_ @ ParentT)

:StopFinish(self @ T, result @ Gtk.Gio.GAsyncResult.T, error @ Std.Object.T) : Std.Symbol.T

Finishes stopping a drive.

drive a T.
result a Gtk.Gio.GAsyncResult.T.
error a Gtk.Glib.GError.T, or NULL
Returns TRUE if the drive has been stopped successfully, FALSE otherwise.


:StopFinish(_ @ ParentT, _ @ Gtk.Gio.GAsyncResult.T, _ @ Std.Object.T)