Basics

Guides

API Reference

Menu

Basics

Guides

API Reference

class: MountMeta

[651:14] static extends: object

Generated metadata helpers for Mount interface surfaces.

Methods

  • signals ()

    Returns signal metadata for Mount.

    • @r A list.

class: MountPreunmountCallback

[511:7] extends: object

Generated low-level callback wrapper for GIR callback pre-unmount.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • MountPreunmountCallback (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: Mount

[31:7] extends: object

The GMount interface represents a user-visible mount, such as a mounted file system. GMount 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. A GMount might be associated with a [iface@Gio.Volume] (such as a USB flash drive) which hosts it. Unmounting a GMount instance is an asynchronous operation. For more information about asynchronous operations, see [iface@Gio.AsyncResult] and [class@Gio.Task]. To unmount a GMount instance, first call [method@Gio.Mount.unmount_with_operation] with (at least) the GMount instance and a [type@Gio.AsyncReadyCallback]. The callback will be fired when the operation has resolved (either with success or failure), and a [iface@Gio.AsyncResult] structure will be passed to the callback. That callback should then call [method@Gio.Mount.unmount_with_operation_finish] with the GMount and the [iface@Gio.AsyncResult] data to see if the operation was completed successfully. If an error is present when [method@Gio.Mount.unmount_with_operation_finish] is called, then it will be filled with any error information. Note, when porting from GnomeVFS, GMount is the moral equivalent of GnomeVFSVolume.

Members

  • handleObj
  • lib
  • retainedCallbacks
  • signalHandlerNames
  • signalSetterHandlers

Methods

  • Mount (Handle = null)

    Creates a new Mount 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 mount has been changed.

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

    This signal may be emitted when the #GMount is about to be unmounted. This signal depends on the backend and is only emitted if GIO was used to unmount.

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

    This signal is emitted when the #GMount have been unmounted. 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 (Mount Self).
    • @p UserData is retained and passed through to the generated callback wrapper when provided.
    • @r The connected handler id.
  • can_eject ()

    Checks if @mount can be ejected.

  • can_unmount ()

    Checks if @mount can be unmounted.

  • eject_finish (object result)

    Finishes ejecting a mount. 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..
  • eject_with_operation_finish (object result)

    Finishes ejecting a mount. 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..
  • get_default_location ()

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

    Gets the drive for the @mount. This is a convenience method for getting the #GVolume and then using that object to get the #GDrive.

  • get_icon ()

    Gets the icon for @mount.

  • get_name ()

    Gets the name of @mount.

  • get_root ()

    Gets the root directory on @mount.

  • get_sort_key ()

    Gets the sort key for @mount, if any.

  • get_symbolic_icon ()

    Gets the symbolic icon for @mount.

  • get_uuid ()

    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.

  • get_volume ()

    Gets the volume for the @mount.

  • guess_content_type_finish (object result)

    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 %G_IO_ERROR_NOT_SUPPORTED if the mount does not support content guessing.

    • @p result is a #GAsyncResult.
  • guess_content_type_sync (bool force_rescan, object cancellable)

    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 a synchronous operation and as such may block doing IO; see g_mount_guess_content_type() for the asynchronous version.

    • @p force_rescan is Whether to force a rescan of the content. Otherwise a cached result will be used if available.
    • @p cancellable is optional #GCancellable object, %NULL to ignore.
  • is_shadowed ()

    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 #GMount 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 #GVolumeMonitor implementation would create two #GVolume 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 #GVolumeMonitor implementation would create two #GMount 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 #GVolume is set.
  • remount_finish (object result)

    Finishes remounting a mount. 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..
  • shadow ()

    Increments the shadow count on @mount. Usually used by #GVolumeMonitor implementations when creating a shadow mount for @mount, see g_mount_is_shadowed() for more information. The caller will need to emit the #GMount::changed signal on @mount manually.

    • @r None.
  • unmount_finish (object result)

    Finishes unmounting a mount. 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..
  • unmount_with_operation_finish (object result)

    Finishes unmounting a mount. 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..
  • unshadow ()

    Decrements the shadow count on @mount. Usually used by #GVolumeMonitor implementations when destroying a shadow mount for @mount, see g_mount_is_shadowed() for more information. The caller will need to emit the #GMount::changed signal on @mount manually.

    • @r None.

class: MountUnmountedCallback

[581:7] extends: object

Generated low-level callback wrapper for GIR callback unmounted.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • MountUnmountedCallback (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: MountChangedCallback

[441:7] extends: object

Generated low-level callback wrapper for GIR callback changed.

Members

  • callbackObj
  • userFn
  • userData
  • hasUserData

Methods

  • MountChangedCallback (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.