Top | ![]() |
![]() |
![]() |
![]() |
IdeBufferManager * | buffer-manager | Write / Construct Only |
IdeBufferChangeMonitor * | change-monitor | Read / Write |
gboolean | changed-on-volume | Read |
IdeDiagnostics * | diagnostics | Read / Write |
gboolean | failed | Read |
GFile * | file | Read / Write |
IdeFileSettings * | file-settings | Read |
gboolean | has-diagnostics | Read |
gboolean | has-symbol-resolvers | Read |
gboolean | highlight-diagnostics | Read / Write |
gboolean | is-temporary | Read / Write / Construct Only |
gchar * | language-id | Read / Write |
gboolean | read-only | Read |
IdeBufferState | state | Read |
gchar * | style-scheme-name | Read / Write |
gchar * | title | Read |
void | change-settled | Run Last |
void | cursor-moved | Run Last |
void | line-flags-changed | Run Last |
void | loaded | Run Last |
void | request-scroll-to-insert | Run Last |
GEnum ╰── IdeBufferState GObject ╰── GtkTextBuffer ╰── GtkSourceBuffer ╰── IdeBuffer
GBytes *
ide_buffer_dup_content (IdeBuffer *self
);
Gets the contents of the buffer as GBytes.
By using this function to get the bytes, you allow IdeBuffer to avoid calculating the buffer text unnecessarily, potentially saving on allocations.
Additionally, this allows the buffer to update the state in IdeUnsavedFiles if the content is out of sync.
Since: 3.32
gchar *
ide_buffer_dup_title (IdeBuffer *self
);
Gets a string to represent the title of the buffer. An attempt is made to make this relative to the project workdir if possible.
Since: 3.32
void ide_buffer_format_selection_async (IdeBuffer *self
,IdeFormatterOptions *options
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Formats the selection using an available IdeFormatter for the buffer.
self |
an IdeBuffer |
|
options |
options for the formatting |
|
cancellable |
a GCancellable, or |
[nullable] |
callback |
the callback upon completion |
|
user_data |
user data for |
Since: 3.32
gboolean ide_buffer_format_selection_finish (IdeBuffer *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to ide_buffer_format_selection_async()
.
Since: 3.32
guint
ide_buffer_get_change_count (IdeBuffer *self
);
Gets the monotonic change count for the buffer.
Since: 3.32
IdeBufferChangeMonitor *
ide_buffer_get_change_monitor (IdeBuffer *self
);
Gets the “change-monitor” for the buffer.
Since: 3.32
gboolean
ide_buffer_get_changed_on_volume (IdeBuffer *self
);
Returns TRUE
if the IdeBuffer is known to have been modified on storage
externally from this IdeBuffer.
Since: 3.32
IdeDiagnostics *
ide_buffer_get_diagnostics (IdeBuffer *self
);
Gets the IdeDiagnostics for the buffer if any have been registered.
Since: 3.32
IdeLocation *
ide_buffer_get_insert_location (IdeBuffer *self
);
Gets the location of the insert mark as an IdeLocation.
Since: 3.32
gboolean
ide_buffer_get_is_temporary (IdeBuffer *self
);
Checks if the buffer represents a temporary file.
This is useful to check by views that want to provide a save-as dialog when the user requests to save the buffer.
Since: 3.32
gboolean
ide_buffer_get_failed (IdeBuffer *self
);
Gets the “failed” property, denoting if the buffer has failed in some aspect such as loading or saving.
Since: 3.32
const GError *
ide_buffer_get_failure (IdeBuffer *self
);
Gets a GError representing a failure that has occurred for the buffer.
Since: 3.32
gchar *
ide_buffer_dup_uri (IdeBuffer *self
);
Gets the URI for the underlying file and returns a copy of it.
Since: 3.32
GFile *
ide_buffer_get_file (IdeBuffer *self
);
Gets the “file” property.
Since: 3.32
IdeFileSettings *
ide_buffer_get_file_settings (IdeBuffer *self
);
Gets the “file-settings” property.
The IdeFileSettings are updated when changes to the file or language syntax are chnaged.
Since: 3.32
IdeFormatter *
ide_buffer_get_formatter (IdeBuffer *self
);
Gets an IdeFormatter for the buffer, if any.
Since: 3.32
gboolean
ide_buffer_get_highlight_diagnostics (IdeBuffer *self
);
Checks if diagnostics should be highlighted.
Since: 3.32
void ide_buffer_get_iter_at_location (IdeBuffer *self
,GtkTextIter *iter
,IdeLocation *location
);
Set iter
to the position designated by location
.
Since: 3.32
IdeLocation * ide_buffer_get_iter_location (IdeBuffer *self
,const GtkTextIter *iter
);
Gets an IdeLocation for the position represented by iter
.
Since: 3.32
const gchar *
ide_buffer_get_language_id (IdeBuffer *self
);
A helper to get the language identifier of the buffers current language.
Since: 3.32
void ide_buffer_set_language_id (IdeBuffer *self
,const gchar *language_id
);
gchar * ide_buffer_get_line_text (IdeBuffer *self
,guint line
);
Gets the contents of a single line within the buffer.
a string containing the line's text
or NULL
if the line does not exist.
[transfer full][nullable]
Since: 3.32
gboolean
ide_buffer_get_loading (IdeBuffer *self
);
This checks to see if the buffer is currently loading. This is equivalent
to calling ide_buffer_get_state()
and checking for IDE_BUFFER_STATE_LOADING
.
Since: 3.32
gboolean
ide_buffer_get_read_only (IdeBuffer *self
);
This function returns TRUE
if the underlying file has been discovered to
be read-only. This may be used by the interface to display information to
the user about saving the file.
Since: 3.32
IdeRenameProvider *
ide_buffer_get_rename_provider (IdeBuffer *self
);
Gets the IdeRenameProvider for this buffer, or NULL
.
An IdeRenameProvider or NULL
if
there is no IdeRenameProvider that can statisfy the buffer.
[nullable][transfer none]
Since: 3.32
void ide_buffer_get_selection_bounds (IdeBuffer *self
,GtkTextIter *insert
,GtkTextIter *selection
);
This function acts like gtk_text_buffer_get_selection_bounds()
except that
it always places the location of the insert mark at insert
and the location
of the selection mark at selection
.
Calling gtk_text_iter_order()
with the results of this function would be
equivalent to calling gtk_text_buffer_get_selection_bounds()
.
self |
an IdeBuffer |
|
insert |
a GtkTextIter to get the insert position. |
[out] |
selection |
a GtkTextIter to get the selection position. |
[out] |
Since: 3.32
IdeRange *
ide_buffer_get_selection_range (IdeBuffer *self
);
Gets an IdeRange to represent the current buffer selection.
Since: 3.32
IdeBufferState
ide_buffer_get_state (IdeBuffer *self
);
Gets the “state” property.
This will changed while files are loaded or saved to disk.
Since: 3.32
const gchar *
ide_buffer_get_style_scheme_name (IdeBuffer *self
);
Gets the name of the GtkSourceStyleScheme from the “style-scheme” property.
Since: 3.32
void ide_buffer_get_symbol_at_location_async (IdeBuffer *self
,const GtkTextIter *location
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously get a possible symbol at location
.
self |
an IdeBuffer |
|
location |
a GtkTextIter indicating a position to search for a symbol |
|
cancellable |
||
callback |
||
user_data |
a gpointer to hold user data |
Since: 3.32
IdeSymbol * ide_buffer_get_symbol_at_location_finish (IdeBuffer *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to locate a symbol at a location.
Since: 3.32
GPtrArray *
ide_buffer_get_symbol_resolvers (IdeBuffer *self
);
Gets the symbol resolvers for the buffer based on the current language. The resolvers in the resulting array are sorted by priority.
Since: 3.32
gchar * ide_buffer_get_word_at_iter (IdeBuffer *self
,const GtkTextIter *iter
);
Gets the word found under the position denoted by iter
.
Since: 3.32
gboolean
ide_buffer_has_diagnostics (IdeBuffer *self
);
Returns TRUE
if any diagnostics have been registered for the buffer.
Since: 3.32
gboolean
ide_buffer_has_symbol_resolvers (IdeBuffer *self
);
Checks if any symbol resolvers are available.
Since: 3.32
IdeBuffer *
ide_buffer_hold (IdeBuffer *self
);
Increases the "hold count" of the IdeBuffer by one.
The hold count is similar to a reference count, as it allows the buffer manager to know when a buffer may be destroyed cleanly.
Doing so ensures that the buffer wont be unloaded or have reference cycles broken.
Release the hold with ide_buffer_release()
.
When the hold count reaches zero, the buffer will be destroyed.
Since: 3.32
IdeContext *
ide_buffer_ref_context (IdeBuffer *self
);
Locates the IdeContext for the buffer and returns it.
Since: 3.32
void
ide_buffer_rehighlight (IdeBuffer *self
);
Force self
to rebuild the highlighted words.
Since: 3.32
void
ide_buffer_release (IdeBuffer *self
);
Releases the "hold count" on a buffer.
The buffer will be destroyed and unloaded when the hold count reaches zero.
Since: 3.32
void ide_buffer_save_file_async (IdeBuffer *self
,GFile *file
,GCancellable *cancellable
,IdeNotification **notif
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously saves the buffer contents to file
.
If file
is NULL
, then the “file” property is used.
The buffer is marked as busy during the operation, and must not have further editing until the operation is complete.
callback
is executed upon completion and should call
ide_buffer_save_file_finish()
to get the result of the operation.
self |
an IdeBuffer |
|
file |
[nullable] | |
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion |
|
user_data |
closure data for |
Since: 3.32
gboolean ide_buffer_save_file_finish (IdeBuffer *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to save the buffer via
ide_buffer_save_file_async()
.
Since: 3.32
void ide_buffer_set_change_monitor (IdeBuffer *self
,IdeBufferChangeMonitor *change_monitor
);
Sets an IdeBufferChangeMonitor to use for the buffer.
Since: 3.32
void ide_buffer_set_diagnostics (IdeBuffer *self
,IdeDiagnostics *diagnostics
);
Sets the IdeDiagnostics for the buffer. These will be used to highlight
the buffer for errors and warnings if “highlight-diagnostics”
is TRUE
.
Since: 3.32
void ide_buffer_set_highlight_diagnostics (IdeBuffer *self
,gboolean highlight_diagnostics
);
Sets the “highlight-diagnostics” property.
If set to TRUE
, diagnostics will be styled in the buffer.
Since: 3.32
void ide_buffer_set_style_scheme_name (IdeBuffer *self
,const gchar *style_scheme_name
);
Sets the “style-scheme” property by locating the style scheme
matching style_scheme_name
.
self |
an IdeBuffer |
|
style_scheme_name |
string containing the style scheme's name. |
[nullable] |
Since: 3.32
“buffer-manager”
property“buffer-manager” IdeBufferManager *
Sets the "buffer-manager" property, which is used by the buffer to clean-up state when the buffer is no longer in use.
Flags: Write / Construct Only
Since: 3.32
“change-monitor”
property“change-monitor” IdeBufferChangeMonitor *
The "change-monitor" property is an IdeBufferChangeMonitor that will be used to track changes in the IdeBuffer. This can be used to show line changes in the editor gutter.
Flags: Read / Write
Since: 3.32
“changed-on-volume”
property“changed-on-volume” gboolean
The "changed-on-volume" property is set to TRUE
when it has been
discovered that the file represented by the IdeBuffer has changed
externally to Builder.
Flags: Read
Default value: FALSE
Since: 3.32
“diagnostics”
property“diagnostics” IdeDiagnostics *
The "diagnostics" property contains an IdeDiagnostics that represent the diagnostics found in the buffer.
Flags: Read / Write
Since: 3.32
“failed”
property“failed” gboolean
The "failed" property is TRUE
when the buffer has entered a failed
state such as when loading or saving the buffer to disk.
Flags: Read
Default value: FALSE
Since: 3.32
“file”
property“file” GFile *
The "file" property is the underlying file represented by the buffer.
Flags: Read / Write
Since: 3.32
“file-settings”
property“file-settings” IdeFileSettings *
The "file-settings" property are the settings to be used by the buffer and source-view for the underlying file.
These are automatically discovered and kept up to date based on the IdeFileSettings extension points.
Flags: Read
Since: 3.32
“has-diagnostics”
property“has-diagnostics” gboolean
The "has-diagnostics" property denotes that there are a non-zero number of diangostics registered for the buffer.
Flags: Read
Default value: FALSE
Since: 3.32
“has-symbol-resolvers”
property“has-symbol-resolvers” gboolean
The "has-symbol-resolvers" property is TRUE
if there are any symbol
resolvers loaded.
Flags: Read
Default value: FALSE
Since: 3.32
“highlight-diagnostics”
property“highlight-diagnostics” gboolean
The "highlight-diagnostics" property indicates that diagnostics which are discovered should be styled.
Flags: Read / Write
Default value: TRUE
Since: 3.32
“is-temporary”
property“is-temporary” gboolean
The "is-temporary" property denotes the “file” property points to a temporary file. When saving the the buffer, various UI components know to check this property and provide a file chooser to allow the user to select the destination file.
Upon saving the file, the property will change to FALSE
.
Flags: Read / Write / Construct Only
Default value: FALSE
Since: 3.32
“language-id”
property“language-id” gchar *
The "language-id" property is a convenience property to set the “langauge” property using a string name.
Flags: Read / Write
Default value: NULL
Since: 3.32
“read-only”
property“read-only” gboolean
The "read-only" property is set to TRUE
when it has been
discovered that the file represented by the IdeBuffer is read-only
on the underlying storage.
Flags: Read
Default value: FALSE
Since: 3.32
“state”
property“state” IdeBufferState
The "state" property can be used to determine if the buffer is currently performing any specific background work, such as loading from or saving a buffer to storage.
Flags: Read
Default value: IDE_BUFFER_STATE_READY
Since: 3.32
“style-scheme-name”
property“style-scheme-name” gchar *
The "style-scheme-name" is the name of the style scheme that is used. It is a convenience property so that you do not need to use the GtkSourceStyleSchemeManager to lookup style schemes.
Flags: Read / Write
Default value: NULL
Since: 3.32
“title”
property“title” gchar *
The "title" for the buffer which includes some variant of the path to the underlying file.
Flags: Read
Default value: NULL
Since: 3.32
“change-settled”
signalvoid user_function (IdeBuffer *self, gpointer user_data)
The "change-settled" signal is emitted when the buffer has stopped being edited for a short period of time. This is useful to connect to when you want to perform work as the user is editing, but you don't want to get in the way of their editing.
Flags: Run Last
Since: 3.32
“cursor-moved”
signalvoid user_function (IdeBuffer *self, GtkTextIter *location, gpointer user_data)
This signal is emitted when the insertion location has moved. You might want to attach to this signal to update the location of the insert mark in the display.
self |
an IdeBuffer |
|
location |
||
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
Since: 3.32
“line-flags-changed”
signalvoid user_function (IdeBuffer *self, gpointer user_data)
The "line-flags-changed" signal is emitted when the buffer has detected ancillary information has changed for lines in the buffer. Such information might include diagnostics or version control information.
Flags: Run Last
Since: 3.32
“loaded”
signalvoid user_function (IdeBuffer *self, gpointer user_data)
The "loaded" signal is emitted after the buffer is loaded.
This is useful to watch if you want to perform a given action but do not want to interfere with buffer loading.
Flags: Run Last
Since: 3.32