Top |
TeplBufferTeplBuffer — Subclass of GtkSourceBuffer |
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 same for
TeplMetadata with tepl_buffer_get_metadata()
.
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
TeplMetadata *
tepl_buffer_get_metadata (TeplBuffer *buffer
);
Returns the TeplMetadata of buffer
. The returned object is guaranteed to be
the same for the lifetime of buffer
.
Since: 5.0
void
tepl_buffer_load_metadata_from_metadata_manager
(TeplBuffer *buffer
);
Calls tepl_metadata_manager_copy_from()
for “location” (if not NULL
)
to the associated TeplMetadata of buffer
.
Since: 5.0
void
tepl_buffer_save_metadata_into_metadata_manager
(TeplBuffer *buffer
);
Calls tepl_metadata_manager_merge_into()
for “location” (if not
NULL
) from the associated TeplMetadata of buffer
.
Since: 5.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
void
tepl_buffer_connect_style_scheme_settings
(TeplBuffer *buffer
);
Connects “style-scheme-id” to “style-scheme”.
Since: 6.11
TeplSelectionType
tepl_buffer_get_selection_type (TeplBuffer *buffer
);
Since: 1.0
“tepl-full-title”
property “tepl-full-title” char *
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” char *
The short title. See tepl_buffer_get_short_title()
.
Owner: TeplBuffer
Flags: Read
Default value: NULL
Since: 3.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