Top | ![]() |
![]() |
![]() |
![]() |
TeplBufferTeplBuffer — Subclass of GtkSourceBuffer |
gchar * | tepl-full-title | Read |
gchar * | tepl-short-title | Read |
gchar * | tepl-style-scheme-id | Read / Write |
GEnum ╰── TeplSelectionType GObject ╰── GtkTextBuffer ╰── GtkSourceBuffer ╰── TeplBuffer
TeplBuffer is a subclass of GtkSourceBuffer, to add more features useful for a text editor.
It also adds an association to a TeplFile that can be retrieved with
tepl_buffer_get_file()
. The association cannot change.
The properties and signals have the tepl namespace, to avoid potential conflicts in the future if the property or signal is moved to GtkSourceBuffer.
TeplFile *
tepl_buffer_get_file (TeplBuffer *buffer
);
Returns the TeplFile of buffer
. The returned object is guaranteed to be the
same for the lifetime of buffer
.
TeplBuffer creates the TeplFile with tepl_abstract_factory_create_file()
.
Since: 1.0
gboolean
tepl_buffer_is_untouched (TeplBuffer *buffer
);
Returns whether buffer
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 buffer
must be empty, non-modified,
the undo/redo GtkSourceBuffer history must be empty, and the
“location” must be NULL
.
Since: 1.0
gchar *
tepl_buffer_get_short_title (TeplBuffer *buffer
);
Returns a title suitable for a tab label. It contains (in that order):
'*' if the buffer is modified;
the “short-name”;
Since: 3.0
gchar *
tepl_buffer_get_full_title (TeplBuffer *buffer
);
Returns a title suitable for a GtkWindow title. It contains (in that order):
the “tepl-short-title”;
the directory path in parenthesis if the “location” isn't
NULL
.
Since: 3.0
gchar *
tepl_buffer_get_style_scheme_id (TeplBuffer *buffer
);
Since: 2.0
void tepl_buffer_set_style_scheme_id (TeplBuffer *buffer
,const gchar *style_scheme_id
);
Sets the “tepl-style-scheme-id” property.
The GtkSourceStyleScheme is taken from the default
GtkSourceStyleSchemeManager as returned by
gtk_source_style_scheme_manager_get_default()
.
Since: 2.0
TeplSelectionType
tepl_buffer_get_selection_type (TeplBuffer *buffer
);
Since: 1.0
“tepl-full-title”
property“tepl-full-title” gchar *
The full title. See tepl_buffer_get_full_title()
.
Owner: TeplBuffer
Flags: Read
Default value: NULL
Since: 3.0
“tepl-short-title”
property“tepl-short-title” gchar *
The short title. See tepl_buffer_get_short_title()
.
Owner: TeplBuffer
Flags: Read
Default value: NULL
Since: 3.0
“tepl-style-scheme-id”
property“tepl-style-scheme-id” gchar *
The “style-scheme” ID, as a string. This property is useful for binding it to a GSettings key.
When the “style-scheme” is NULL
,
“tepl-style-scheme-id” contains the empty string.
Owner: TeplBuffer
Flags: Read / Write
Default value: ""
Since: 2.0
“tepl-cursor-moved”
signalvoid user_function (TeplBuffer *buffer, gpointer user_data)
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.
buffer |
the TeplBuffer emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
Since: 2.0