Class: GtkSource::File

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Constructor Details

#initializeGtkSource::File

Returns a new Gtk::SourceFile object.

Instance Method Details

#check_file_on_disknil

Checks synchronously the file on disk, to know whether the file is externally modified, or has been deleted, and whether the file is read-only.

Gtk::SourceFile doesn't create a [classGio.FileMonitor] to track those properties, so this function needs to be called instead. Creating lots of [classGio.FileMonitor]'s would take lots of resources.

Since this function is synchronous, it is advised to call it only on local files. See [methodFile.is_local].

Returns:

  • (nil)

#compression_typeGtkSource::CompressionType

The compression type.

Returns:

#compression_type=(compression_type) ⇒ GtkSource::CompressionType

The compression type.

Parameters:

Returns:

#encodingGtkSource::Encoding

The character encoding, initially nil. After a successful file loading or saving operation, the encoding is non-nil.

Returns:

  • (GtkSource::Encoding)

    encoding

#encoding=(encoding) ⇒ GtkSource::Encoding

The character encoding, initially nil. After a successful file loading or saving operation, the encoding is non-nil.

Parameters:

  • encoding (GtkSource::Encoding)

Returns:

  • (GtkSource::Encoding)

    encoding

  • (GtkSource::Encoding)

    encoding

#is_deletedBoolean

Returns whether the file has been deleted. If the [propertyFile:location] is nil, returns false.

To have an up-to-date value, you must first call [methodFile.check_file_on_disk].

Returns:

  • (Boolean)

    whether the file has been deleted.

#is_externally_modifiedBoolean

Returns whether the file is externally modified. If the [propertyFile:location] is nil, returns false.

To have an up-to-date value, you must first call [methodFile.check_file_on_disk].

Returns:

  • (Boolean)

    whether the file is externally modified.

#is_localBoolean

Returns whether the file is local. If the [propertyFile:location] is nil, returns false.

Returns:

  • (Boolean)

    whether the file is local.

#is_readonlyBoolean

Returns whether the file is read-only. If the [propertyFile:location] is nil, returns false.

To have an up-to-date value, you must first call [methodFile.check_file_on_disk].

Returns:

  • (Boolean)

    whether the file is read-only.

#locationGio::File

The location.

Returns:

  • (Gio::File)

    location

#location=(location) ⇒ Gio::File

The location.

Parameters:

  • location (Gio::File)

Returns:

  • (Gio::File)

    location

  • (Gio::File)

    location

#newline_typeGtkSource::NewlineType

The line ending type.

Returns:

#newline_type=(newline_type) ⇒ GtkSource::NewlineType

The line ending type.

Parameters:

Returns:

#read_only=(read_only) ⇒ Boolean

Whether the file is read-only or not. The value of this property is not updated automatically (there is no file monitors).

Parameters:

  • read_only (Boolean)

Returns:

  • (Boolean)

    read-only

  • (Boolean)

    read-only

#read_only?Boolean

Whether the file is read-only or not. The value of this property is not updated automatically (there is no file monitors).

Returns:

  • (Boolean)

    read-only

#set_mount_operation_factory(callback, user_data, notify) ⇒ nil

Sets a [callbackMountOperationFactory] function that will be called when a [classGio.MountOperation] must be created.

This is useful for creating a [classGtk.MountOperation] with the parent [classGtk.Window].

If a mount operation factory isn't set, [ctorGio.MountOperation.new] will be called.

Parameters:

  • callback (GtkSource::MountOperationFactory)

    a Gtk::SourceMountOperationFactory to call when a GMount::Operation is needed.

  • user_data (GObject)

    the data to pass to the callback function.

  • notify (GLib::DestroyNotify)

    function to call on user_data when the callback is no longer needed, or nil.

Returns:

  • (nil)