xed-commands

xed-commands

Functions

Description

Functions

xed_commands_load_location ()

void
xed_commands_load_location (XedWindow *window,
                            GFile *location,
                            const GtkSourceEncoding *encoding,
                            gint line_pos);

Loads location . Ignores non-existing locations

Parameters

window

a XedWindow

 

location

a GFile to be loaded

 

encoding

the GtkSourceEncoding of location .

[allow-none]

line_pos

the line column to place the cursor when location is loaded

 

xed_commands_load_locations ()

GSList *
xed_commands_load_locations (XedWindow *window,
                             const GSList *locations,
                             const GtkSourceEncoding *encoding,
                             gint line_pos);

Loads locataions . Ignore non-existing locations

Parameters

window

a XedWindow

 

locations

the locations to load.

[element-type Gio.File]

encoding

the GtkSourceEncoding.

[allow-none]

line_pos

the line position to place the cursor

 

Returns

the locations that were loaded.

[element-type Xed.Document][transfer container]


xed_commands_save_document ()

void
xed_commands_save_document (XedWindow *window,
                            XedDocument *document);

Asynchronously save document . document must belong to window . If you need the result of the operation, use xed_commands_save_document_async().

Parameters

window

a XedWindow.

 

document

the XedDocument to save.

 

xed_commands_save_document_async ()

void
xed_commands_save_document_async (XedDocument *document,
                                  XedWindow *window,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

Asynchronously save the document . document must belong to window . The source object of the async task is document (which will be the first parameter of the GAsyncReadyCallback).

When the operation is finished, callback will be called. You can then call xed_commands_save_document_finish() to get the result of the operation.

Parameters

document

the XedDocument to save.

 

window

a XedWindow.

 

cancellable

optional GCancellable object, NULL to ignore.

[nullable]

callback

a GAsyncReadyCallback to call when the operation is finished.

[scope async]

user_data

the data to pass to the callback function.

[closure]

xed_commands_save_document_finish ()

gboolean
xed_commands_save_document_finish (XedDocument *document,
                                   GAsyncResult *result);

Finishes an asynchronous document saving operation started with xed_commands_save_document_async().

Note that there is no error parameter because the errors are already handled by xed.

Parameters

document

a XedDocument.

 

result

a GAsyncResult.

 

Returns

TRUE if the document has been correctly saved, FALSE otherwise.


xed_commands_save_all_documents ()

void
xed_commands_save_all_documents (XedWindow *window);

Asynchronously save all documents belonging to window . The result of the operation is not available, so it's difficult to know whether all the documents are correctly saved.

Parameters

window

a XedWindow.