Geany dev
Data Fields
GeanyDocument Struct Reference

Structure for representing an open tab with all its properties. More...

#include <document.h>

Data Fields

gboolean changed
 Whether this document has been changed since it was last saved.
 
GeanyEditoreditor
 The editor associated with the document.
 
gchar * encoding
 The encoding of the document, must be a valid string representation of an encoding, can be retrieved with encodings_get_charset_from_index.
 
gchar * file_name
 The UTF-8 encoded file name. More...
 
GeanyFiletypefile_type
 The filetype for this document, it's only a reference to one of the elements of the global filetypes array.
 
gboolean has_bom
 Internally used flag to indicate whether the file of this document has a byte-order-mark.
 
gboolean has_tags
 Whether this document supports source code symbols(tags) to show in the sidebar.
 
guint id
 A pseudo-unique ID for this document. More...
 
gint index
 Index in the documents array.
 
gboolean is_valid
 Flag used to check if this document is valid when iterating GeanyData::documents_array.
 
gboolean readonly
 Whether this document is read-only.
 
gchar * real_path
 The link-dereferenced, locale-encoded file name. More...
 
TMSourceFiletm_file
 TMSourceFile object for this document, or NULL.
 

Detailed Description

Structure for representing an open tab with all its properties.

Field Documentation

◆ file_name

gchar* GeanyDocument::file_name

The UTF-8 encoded file name.

Be careful; glibc and GLib file functions expect the locale representation of the file name which can be different from this. For conversion into locale encoding, you can use utils_get_locale_from_utf8().

See also
real_path.

◆ id

guint GeanyDocument::id

A pseudo-unique ID for this document.

0 is reserved as an unused value.

See also
document_find_by_id().

◆ real_path

gchar* GeanyDocument::real_path

The link-dereferenced, locale-encoded file name.

If non-NULL, this indicates the file once existed on disk (not just as an unsaved document with a filename set).

Note
This is only assigned after a successful save or open - it should not be set elsewhere.
See also
file_name.