Tepl.Buffer¶
- Subclasses:
None
Methods¶
- Inherited:
GtkSource.Buffer (36), Gtk.TextBuffer (74), GObject.Object (37)
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
GtkSource.Buffer (3), Gtk.TextBuffer (13), GObject.Object (7)
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
|||
r/w |
Signals¶
- Inherited:
GtkSource.Buffer (5), Gtk.TextBuffer (13), GObject.Object (1)
Name |
Short Description |
---|---|
The |
Fields¶
- Inherited:
GtkSource.Buffer (5), Gtk.TextBuffer (13), GObject.Object (1)
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Tepl.Buffer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new()¶
- Returns:
a new
Tepl.Buffer
.- Return type:
New in version 1.0.
- get_file()¶
-
Returns the
Tepl.File
of self. The returned object is guaranteed to be the same for the lifetime of self.Tepl.Buffer
creates theTepl.File
withTepl.AbstractFactory.create_file
().New in version 1.0.
- get_full_title()¶
- Returns:
the self full title. Free the return value with
GLib.free
() when no longer needed.- Return type:
Returns a title suitable for a
Gtk.Window
title. It contains (in that order):New in version 3.0.
- get_metadata()¶
- Returns:
the associated
Tepl.Metadata
.- Return type:
Returns the
Tepl.Metadata
of self. The returned object is guaranteed to be the same for the lifetime of self.New in version 5.0.
- get_selection_type()¶
- Returns:
the current
Tepl.SelectionType
.- Return type:
New in version 1.0.
- get_short_title()¶
- Returns:
the self short title. Free the return value with
GLib.free
() when no longer needed.- Return type:
Returns a title suitable for a tab label. It contains (in that order):
‘*’ if the buffer is modified;
the
Tepl.File
:short-name
.
New in version 3.0.
- get_style_scheme_id()¶
- Returns:
the
Tepl.Buffer
:tepl-style-scheme-id
. Free withGLib.free
().- Return type:
New in version 2.0.
- is_untouched()¶
-
Returns whether self is untouched.
This function is for example useful to know if we can re-use this buffer to load a file, instead of opening a new tab or window.
For this function to return
True
, the self must be empty, non-modified, the undo/redoGtkSource.Buffer
history must be empty, and theTepl.File
:location
must beNone
.New in version 1.0.
- load_metadata_from_metadata_manager()¶
Calls
Tepl.MetadataManager.copy_from
() forTepl.File
:location
(if notNone
) to the associatedTepl.Metadata
of self.New in version 5.0.
- provide_style_scheme_id_gsetting(settings, setting_key, bind_to_property)¶
- Parameters:
settings (
Gio.Settings
) – aGio.Settings
object.setting_key (
str
) – aGio.Settings
key of type string.bind_to_property (
bool
) – whether to bind theGio.Settings
key to the property.
A convenience function to provide a
Gio.Settings
key corresponding to theTepl.Buffer
:tepl-style-scheme-id
property.Once this function is called, calling
Tepl.Buffer.set_style_scheme_id
() or setting the property will benefit from a fallback mechanism that takes the default value of theGio.Settings
key (seeGio.Settings.get_default_value
()).If bind_to_property is
True
, then this function additionally binds theGio.Settings
key to the property with theGio.SettingsBindFlags.GET
flag.New in version 6.4.
- save_metadata_into_metadata_manager()¶
Calls
Tepl.MetadataManager.merge_into
() forTepl.File
:location
(if notNone
) from the associatedTepl.Metadata
of self.New in version 5.0.
- set_style_scheme_id(style_scheme_id)¶
- Parameters:
style_scheme_id (
str
) – the new value.
Sets the
Tepl.Buffer
:tepl-style-scheme-id
property.The
GtkSource.StyleScheme
is taken from the defaultGtkSource.StyleSchemeManager
as returned byGtkSource.StyleSchemeManager.get_default
().Since 6.4, if there are no
GtkSource.StyleScheme
for style_scheme_id, there is a fallback mechanism that takes the default value of the providedGio.Settings
key (seeTepl.Buffer.provide_style_scheme_id_gsetting
()); if theGio.Settings
key was not provided, it takes a recommendedGtkSource.StyleScheme
provided byGtkSource.View
(see the documentation ofGtkSource.Buffer.set_style_scheme
()).If more flexibility is desired, don’t use the
Tepl.Buffer
:tepl-style-scheme-id
property, use theGtkSource.Buffer
API instead.New in version 2.0.
- do_tepl_cursor_moved() virtual¶
Signal Details¶
- Tepl.Buffer.signals.tepl_cursor_moved(buffer)¶
- Signal Name:
tepl-cursor-moved
- Flags:
- Parameters:
buffer (
Tepl.Buffer
) – The object which received the signal
The
::tepl-cursor-moved
signal is emitted when the insert mark is moved explicitely or when the buffer changes (insert/delete).A typical use-case for this signal is to update the cursor position in a statusbar.
New in version 2.0.
Property Details¶
- Tepl.Buffer.props.tepl_full_title¶
-
The full title. See
Tepl.Buffer.get_full_title
().New in version 3.0.
- Tepl.Buffer.props.tepl_short_title¶
-
The short title. See
Tepl.Buffer.get_short_title
().New in version 3.0.
- Tepl.Buffer.props.tepl_style_scheme_id¶
-
The
GtkSource.Buffer
:style-scheme
ID, as a string. This property is useful for binding it to aGio.Settings
key.When the
GtkSource.Buffer
:style-scheme
isNone
,Tepl.Buffer
:tepl-style-scheme-id
contains the empty string.New in version 2.0.