Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: DriveChangedCallback

[466:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DriveChangedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DriveDisconnectedCallback

[536:7] extends: object

Generated low-level callback wrapper for GIR callback disconnected.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DriveDisconnectedCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: DriveMeta

[746:14] static extends: object

Generated metadata helpers for Drive interface surfaces.

Methods

  • signals ()

    Returns signal metadata for Drive.

    • @r A list.

class: DriveEjectbuttonCallback

[606:7] extends: object

Generated low-level callback wrapper for GIR callback eject-button.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DriveEjectbuttonCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.

class: Drive

[32:7] extends: object

GDrive represents a piece of hardware connected to the machine. It’s generally only created for removable hardware or hardware with removable media. For example, an optical disc drive, or a USB flash drive. GDrive is a container class for [iface@Gio.Volume] objects that stem from the same piece of media. As such, GDrive abstracts a drive with (or without) removable media and provides operations for querying whether media is available, determining whether media change is automatically detected and ejecting the media. If the GDrive 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 potentially expensive and may spin up the drive creating noise. GDrive 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 GDrive may vary according to implementation. To choose the correct verbs in e.g. a file manager, use [method@Gio.Drive.get_start_stop_type]. For porting from GnomeVFS note that there is no equivalent of GDrive in that API.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Drive (Handle = null)

    Creates a new Drive by wrapping a native handle or another wrapper.

    • @p Handle is the native handle or another wrapper whose handle to adopt.
  • toNativeHandle (Source)

    Normalizes a constructor argument into a raw pointer carrier. Accepts a raw NativeHandle, a raw NativeBuffer returned from fn.call(...), another generated wrapper exposing handle(), or null. Returns null when the argument carries no pointer.

    • @p Source is the raw handle, raw buffer, wrapper, or null.
    • @r A raw pointer carrier or null when no pointer is present.
  • getLib ()

    Returns the opened native library for this generated wrapper.

    • @r The opened native library.
  • handle ()

    Returns the wrapped NativeHandle.

    • @r The wrapped NativeHandle.
  • isNull ()

    Returns true when the wrapped handle is null.

    • @r A bool.
  • describe ()

    Returns a small string for debugging generated wrappers.

    • @r A string.
  • connectSignal (string Name, CallbackObj)

    Connects one generated callback wrapper to a named signal.

    • @p Name is the signal name.
    • @p CallbackObj is the generated callback wrapper to connect.
    • @r The connected handler id.
  • disconnectSignalHandler (int HandlerId)

    Disconnects one retained signal handler id.

    • @p HandlerId is the signal handler id to disconnect.
    • @r None.
  • setOnChanged (callback Fn, UserData = null)

    Emitted when the drive's state has changed.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Drive Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnDisconnected (callback Fn, UserData = null)

    This signal is emitted when the #GDrive have been disconnected. If the recipient is holding references to the object they should release them so the object can be finalized.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Drive Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnEjectbutton (callback Fn, UserData = null)

    Emitted when the physical eject button (if any) of a drive has been pressed.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Drive Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • setOnStopbutton (callback Fn, UserData = null)

    Emitted when the physical stop button (if any) of a drive has been pressed.

    • @p Fn is the Aussom callback.
    • @p Fn is called with (Drive Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • can_eject ()

    Checks if a drive can be ejected.

  • can_poll_for_media ()

    Checks if a drive can be polled for media changes.

  • can_start ()

    Checks if a drive can be started.

  • can_start_degraded ()

    Checks if a drive can be started degraded.

  • can_stop ()

    Checks if a drive can be stopped.

  • eject_finish (object result)

    Finishes ejecting a drive.

    • @p result is a #GAsyncResult..
  • eject_with_operation_finish (object result)

    Finishes ejecting a drive. If any errors occurred during the operation,

    • @error will be set to contain the errors and %FALSE will be returned.
    • @p result is a #GAsyncResult..
  • enumerate_identifiers ()

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

  • get_icon ()

    Gets the icon for @drive.

  • get_identifier (string kind)

    Gets the identifier of the given kind for @drive. The only identifier currently available is %G_DRIVE_IDENTIFIER_KIND_UNIX_DEVICE.

    • @p kind is the kind of identifier to return.
  • get_name ()

    Gets the name of @drive.

  • get_sort_key ()

    Gets the sort key for @drive, if any.

  • get_start_stop_type ()

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

  • get_symbolic_icon ()

    Gets the icon for @drive.

  • get_volumes ()

    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().

  • has_media ()

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

  • has_volumes ()

    Check if @drive has any mountable volumes.

  • is_media_check_automatic ()

    Checks if @drive is capable of automatically detecting media changes.

  • is_media_removable ()

    Checks if the @drive supports removable media.

  • is_removable ()

    Checks if the #GDrive and/or its media is considered removable by the user. See g_drive_is_media_removable().

  • poll_for_media_finish (object result)

    Finishes an operation started with g_drive_poll_for_media() on a drive.

    • @p result is a #GAsyncResult..
  • start_finish (object result)

    Finishes starting a drive.

    • @p result is a #GAsyncResult..
  • stop_finish (object result)

    Finishes stopping a drive.

    • @p result is a #GAsyncResult..
  • volumes ()

    Returns get_volumes as an Aussom list of wrapper objects. This companion method materializes the full collection up front; use get_volumes() when lazy or change-notify access is required.

    • @r An Aussom list of elements.

class: DriveStopbuttonCallback

[676:7] extends: object

Generated low-level callback wrapper for GIR callback stop-button.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • DriveStopbuttonCallback (callback Fn, UserData = null)

    Creates one native callback wrapper. The wrapper owns a trampoline that converts native pointers into generated wrapper objects before invoking Fn.

    • @p Fn is the Aussom callback implementation.
    • @p UserData is retained and passed through to Fn on each invocation when provided.
  • trampoline (nativeSelf, nativeUserData)

    Internal trampoline. Converts native pointer arguments into generated wrapper instances, then invokes the user's callback.

  • callback ()

    Returns the wrapped NativeCallback.

  • handle ()

    Returns the callback as a NativeHandle.

  • close ()

    Closes the underlying NativeCallback.

  • isClosed ()

    Returns true when the callback has been closed.