Top |
GtkSourceFile *
gedit_document_get_file (GeditDocument *doc
);
Gets the associated GtkSourceFile. You should use it only for reading purposes, not for creating a GtkSourceFileLoader or GtkSourceFileSaver, because gedit does some extra work when loading or saving a file and maintains an internal state. If you use in a plugin a file loader or saver on the returned GtkSourceFile, the internal state of gedit won't be updated.
If you want to save the GeditDocument to a secondary file, you can create a new GtkSourceFile and use a GtkSourceFileSaver.
Since: 3.14
void gedit_document_set_language (GeditDocument *doc
,GtkSourceLanguage *lang
);
Like gtk_source_buffer_set_language()
, but this function is preferred.
gchar * gedit_document_get_metadata (GeditDocument *doc
,const gchar *key
);
void gedit_document_set_metadata (GeditDocument *doc
,const gchar *first_key
,...
);
Sets metadata on a document.
[skip]
doc |
||
first_key |
the name of the first key to set. |
|
... |
value for the first key, followed optionally by more key/value pairs,
followed by |
GtkSourceSearchContext *
gedit_document_get_search_context (GeditDocument *doc
);
Gets the search context. Use this function only if you have used
gedit_document_set_search_context()
before. You should not alter other search
contexts, so you have to verify that the returned search context is yours.
One way to verify that is to compare the search settings object, or to mark
the search context with g_object_set_data()
.
void gedit_document_set_search_context (GeditDocument *doc
,GtkSourceSearchContext *search_context
);
Sets the new search context for the document. Use this function only when the search occurrences are highlighted. So this function should not be used for background searches. The purpose is to have only one highlighted search context at a time in the document.
After using this function, you should unref the search_context
. The doc
should be the only owner of the search_context
, so that the Clear Highlight
action works. If you need the search_context
after calling this function,
use gedit_document_get_search_context()
.
“content-type”
property “content-type” char *
The document's content type.
Owner: GeditDocument
Flags: Read / Write
Default value: NULL
“empty-search”
property“empty-search” gboolean
Whether the search is empty.
Owner: GeditDocument
Flags: Read
Default value: TRUE
“load”
signalvoid user_function (GeditDocument *document, gpointer user_data)
The ::load signal is emitted at the beginning of a file loading.
Before gedit 3.14 this signal contained parameters to configure the file loading (the location, encoding, etc). Plugins should not need those parameters.
document |
the GeditDocument emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“loaded”
signalvoid user_function (GeditDocument *document, gpointer user_data)
The ::loaded signal is emitted at the end of a successful file loading.
Before gedit 3.14 this signal contained a GError parameter, and the signal was also emitted if an error occurred. Plugins should not need the error parameter.
document |
the GeditDocument emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“save”
signalvoid user_function (GeditDocument *document, gpointer user_data)
The ::save signal is emitted at the beginning of a file saving.
Before gedit 3.14 this signal contained parameters to configure the file saving (the location, encoding, etc). Plugins should not need those parameters.
document |
the GeditDocument emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“saved”
signalvoid user_function (GeditDocument *document, gpointer user_data)
The ::saved signal is emitted at the end of a successful file saving.
Before gedit 3.14 this signal contained a GError parameter, and the
signal was also emitted if an error occurred. To save a document, a
plugin can use the gedit_commands_save_document_async()
function and
get the result of the operation with
gedit_commands_save_document_finish()
.
document |
the GeditDocument emitting the signal. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First