Top | ![]() |
![]() |
![]() |
![]() |
IdeBuffer * | ide_buffer_manager_create_temporary_buffer () |
void | ide_buffer_manager_load_file_async () |
IdeBuffer * | ide_buffer_manager_load_file_finish () |
void | ide_buffer_manager_save_file_async () |
gboolean | ide_buffer_manager_save_file_finish () |
void | ide_buffer_manager_save_all_async () |
gboolean | ide_buffer_manager_save_all_finish () |
IdeBuffer * | ide_buffer_manager_get_focus_buffer () |
void | ide_buffer_manager_set_focus_buffer () |
GPtrArray * | ide_buffer_manager_get_buffers () |
guint | ide_buffer_manager_get_n_buffers () |
gboolean | ide_buffer_manager_has_file () |
IdeBuffer * | ide_buffer_manager_find_buffer () |
gsize | ide_buffer_manager_get_max_file_size () |
void | ide_buffer_manager_set_max_file_size () |
void | ide_buffer_manager_apply_edits_async () |
gboolean | ide_buffer_manager_apply_edits_finish () |
guint | ide_buffer_manager_get_auto_save_timeout () |
void | ide_buffer_manager_set_auto_save_timeout () |
gboolean | ide_buffer_manager_get_auto_save () |
void | ide_buffer_manager_set_auto_save () |
gboolean | auto-save | Read / Write |
guint | auto-save-timeout | Read / Write |
IdeBuffer * | focus-buffer | Read / Write |
void | buffer-focus-enter | Run Last |
void | buffer-focus-leave | Run Last |
void | buffer-loaded | Run Last |
void | buffer-saved | Run Last |
void | buffer-unloaded | Run Last |
IdeBuffer* | create-buffer | Run Last |
void | load-buffer | Run Last |
void | save-buffer | Run Last |
IdeBuffer *
ide_buffer_manager_create_temporary_buffer
(IdeBufferManager *self
);
Creates a new IdeBuffer that does not yet have a backing file attached to it. Interfaces should perform a save-as operation to save the file to a real file.
ide_file_get_file() will return NULL
to denote this type of buffer.
void ide_buffer_manager_load_file_async (IdeBufferManager *self
,IdeFile *file
,gboolean force_reload
,IdeWorkbenchOpenFlags flags
,IdeProgress **progress
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously requests that the file represented by file
is loaded. If the file is already
loaded, the previously loaded version of the file will be returned, asynchronously.
Before loading the file, IdeBufferManager will check the file size to help protect itself from the user accidentally loading very large files. You can change the maximum size of file that will be loaded with the “max-file-size” property.
See ide_buffer_manager_load_file_finish()
for how to complete this asynchronous request.
IdeBuffer * ide_buffer_manager_load_file_finish (IdeBufferManager *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to load a file via ide_buffer_manager_load_file_async()
.
If the buffer was already loaded, this function will return a reference to the previous buffer
with its reference count incremented by one.
void ide_buffer_manager_save_file_async (IdeBufferManager *self
,IdeBuffer *buffer
,IdeFile *file
,IdeProgress **progress
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
This function asynchronously requests that a buffer be saved to the storage
represented by file
. buffer
should be a previously loaded buffer owned by
self
, such as one loaded with ide_buffer_manager_load_file_async()
.
Call ide_buffer_manager_save_file_finish()
to complete this asynchronous
request.
self |
||
buffer |
an IdeBuffer |
|
file |
an IdeFile |
|
progress |
a location for an IdeProgress. |
[out][transfer full] |
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback or |
[nullable] |
user_data |
closure data for |
gboolean ide_buffer_manager_save_file_finish (IdeBufferManager *self
,GAsyncResult *result
,GError **error
);
This function completes an asynchronous request to save a buffer to storage using
ide_buffer_manager_save_file_async()
. Upon failure, FALSE
is returned and error
is set.
void ide_buffer_manager_save_all_async (IdeBufferManager *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean ide_buffer_manager_save_all_finish (IdeBufferManager *self
,GAsyncResult *result
,GError **error
);
IdeBuffer *
ide_buffer_manager_get_focus_buffer (IdeBufferManager *self
);
Gets the “focus-buffer” property. This is the buffer behind the current selected view.
void ide_buffer_manager_set_focus_buffer (IdeBufferManager *self
,IdeBuffer *buffer
);
GPtrArray *
ide_buffer_manager_get_buffers (IdeBufferManager *self
);
Returns a newly allocated GPtrArray of all the buffers managed by the IdeBufferManager instance.
Buffers are generally not added to the buffer list until they have been loaded.
guint
ide_buffer_manager_get_n_buffers (IdeBufferManager *self
);
gboolean ide_buffer_manager_has_file (IdeBufferManager *self
,GFile *file
);
Checks to see if the buffer manager has the file loaded.
IdeBuffer * ide_buffer_manager_find_buffer (IdeBufferManager *self
,GFile *file
);
Gets the buffer for a given file. If it has not yet been loaded, NULL
is
returned.
gsize
ide_buffer_manager_get_max_file_size (IdeBufferManager *self
);
Gets the “max-file-size” property. This contains the maximum file size in bytes that a file may be to be loaded by the IdeBufferManager.
If zero, no size limits will be enforced.
void ide_buffer_manager_set_max_file_size (IdeBufferManager *self
,gsize max_file_size
);
Sets the maximum file size in bytes, that will be loaded by the IdeBufferManager.
self |
An IdeBufferManager. |
|
max_file_size |
The maximum file size in bytes, or zero for no limit. |
void ide_buffer_manager_apply_edits_async (IdeBufferManager *self
,GPtrArray *edits
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously requests that all of edits
are applied to the buffers
in the project. If the buffer has not been loaded for a particular edit,
it will be loaded.
self |
||
edits |
An GPtrArray of IdeProjectEdit. |
[transfer full][element-type Ide.ProjectEdit] |
cancellable |
a GCancellable or |
[allow-none] |
callback |
the callback to complete the request |
|
user_data |
user data for |
gboolean ide_buffer_manager_apply_edits_finish (IdeBufferManager *self
,GAsyncResult *result
,GError **error
);
guint
ide_buffer_manager_get_auto_save_timeout
(IdeBufferManager *self
);
Gets the value of the “auto-save-timeout” property.
void ide_buffer_manager_set_auto_save_timeout (IdeBufferManager *self
,guint auto_save_timeout
);
Sets the “auto-save-timeout” property.
You can set this property to 0 to use the default timeout.
This is the number of seconds to wait after a buffer has been changed before automatically saving the buffer.
gboolean
ide_buffer_manager_get_auto_save (IdeBufferManager *self
);
Gets the “auto-save” property.
If auto-save is enabled, then buffers managed by self
will be automatically
persisted “auto-save-timeout” seconds after their last
change.
void ide_buffer_manager_set_auto_save (IdeBufferManager *self
,gboolean auto_save
);
Sets the “auto-save” property. If this is TRUE
, then a
buffer will automatically be saved after “auto-save-timeout”
seconds have elapsed since the buffer's last modification.
“auto-save”
property “auto-save” gboolean
If the documents should auto save after a configured timeout.
Flags: Read / Write
Default value: TRUE
“auto-save-timeout”
property “auto-save-timeout” guint
The number of seconds after modification before auto saving.
Flags: Read / Write
Default value: 60
“focus-buffer”
property“focus-buffer” IdeBuffer *
The currently focused buffer.
Flags: Read / Write
“buffer-focus-enter”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when a view for buffer
has received focus. You might connect to this
signal when you want to perform an operation while a buffer is in focus.
self |
An IdeBufferManager. |
|
buffer |
an IdeBuffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“buffer-focus-leave”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when the focus has left the view containing buffer
. You might connect
to this signal to stop any work you were performing while the buffer was focused.
self |
An IdeBufferManager. |
|
buffer |
an IdeBuffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“buffer-loaded”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when a buffer has been successfully loaded. You might connect to this signal to be notified when a buffer has completed loading.
self |
An IdeBufferManager. |
|
buffer |
an IdeBuffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“buffer-saved”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when a buffer has finished saving to storage. You might connect to this signal if you want to know when the modifications have successfully been written to storage. The buffer:file property point to the saved file.
self |
An IdeBufferManager. |
|
buffer |
an IdeBuffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“buffer-unloaded”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when the buffer is unloaded. This allows consumers to access the buffer before the items-changed signal is emitted; at which point it will be too late to get a pointer to the buffer.
Flags: Run Last
“create-buffer”
signalIdeBuffer* user_function (IdeBufferManager *self, IdeFile *file, gpointer user_data)
This signal is emitted when there is a request to create a new buffer object. This allows subclasses of IdeBuffer to be instantiated by the buffer manager.
The first handler of this signal is responsible for returning an
IdeBuffer or NULL
, for which one will be created.
Flags: Run Last
“load-buffer”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gboolean create_new_view, gpointer user_data)
This signal is emitted when a request has been made to load a buffer from storage. You might connect to this signal to be notified when loading of a buffer has begun.
If create_new_view
is FALSE
, then the buffer is probably being force-reloaded due to
changes from the host file-system.
self |
An IdeBufferManager. |
|
buffer |
An IdeBuffer. |
|
create_new_view |
Whether to create a new IdeEditorView for the buffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“save-buffer”
signalvoid user_function (IdeBufferManager *self, IdeBuffer *buffer, gpointer user_data)
This signal is emitted when a request has been made to save a buffer. Connect to this signal if you'd like to perform mutation of the buffer before it is persisted to storage. Till the "buffer-saved" signal is emmited, the buffer:file property point to the current file.
self |
An IdeBufferManager. |
|
buffer |
an IdeBuffer. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last