XedDocument

XedDocument

Functions

Properties

gchar * content-type Read / Write
gchar * mime-type Read
gboolean read-only Read
gchar * shortname Read / Write

Signals

void cursor-moved Run Last
void load Run Last
void loaded Run Last
void save Run Last
void saved Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── GtkTextBuffer
        ╰── GtkSourceBuffer
            ╰── XedDocument

Description

Functions

xed_document_new ()

XedDocument *
xed_document_new (void);

xed_document_get_file ()

GtkSourceFile *
xed_document_get_file (XedDocument *doc);

Gets the associated GtkSourceFile. You should use it only for reading purposes, not for creating a GtkSourceFileLoader or GtkSourceFileSaver, because xed 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 xed 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.

Parameters

doc

a XedDocument.

 

Returns

the associated GtkSourceFile.

[transfer none]


xed_document_get_uri_for_display ()

gchar *
xed_document_get_uri_for_display (XedDocument *doc);

Note: this never returns NULL.

Parameters

doc

a XedDocument

 

xed_document_get_short_name_for_display ()

gchar *
xed_document_get_short_name_for_display
                               (XedDocument *doc);

Note: this never returns NULL.

Parameters

doc

a XedDocument

 

xed_document_set_short_name_for_display ()

void
xed_document_set_short_name_for_display
                               (XedDocument *doc,
                                const gchar *name);

Parameters

short_name

.

[allow-none]

xed_document_get_mime_type ()

gchar *
xed_document_get_mime_type (XedDocument *doc);

Note: this never returns NULL.

Parameters

doc

a XedDocument

 

xed_document_get_readonly ()

gboolean
xed_document_get_readonly (XedDocument *doc);

xed_document_is_untouched ()

gboolean
xed_document_is_untouched (XedDocument *doc);

xed_document_is_untitled ()

gboolean
xed_document_is_untitled (XedDocument *doc);

xed_document_get_deleted ()

gboolean
xed_document_get_deleted (XedDocument *doc);

xed_document_goto_line ()

gboolean
xed_document_goto_line (XedDocument *doc,
                        gint line);

xed_document_goto_line_offset ()

gboolean
xed_document_goto_line_offset (XedDocument *doc,
                               gint line,
                               gint line_offset);

xed_document_set_language ()

void
xed_document_set_language (XedDocument *doc,
                           GtkSourceLanguage *lang);

Parameters

lang

.

[allow-none]

xed_document_get_metadata ()

gchar *
xed_document_get_metadata (XedDocument *doc,
                           const gchar *key);

Gets the metadata assigned to key .

Parameters

doc

a XedDocument

 

key

name of the key

 

Returns

the value assigned to key . Free with g_free().

Types and Values

XedDocumentPrivate

typedef struct _XedDocumentPrivate XedDocumentPrivate;

struct XedDocument

struct XedDocument;

Property Details

The “content-type” property

  “content-type”             gchar *

The document's Content Type.

Flags: Read / Write

Default value: NULL


The “mime-type” property

  “mime-type”                gchar *

The document's MIME Type.

Flags: Read

Default value: "text/plain"


The “read-only” property

  “read-only”                gboolean

Whether the document is read only or not.

Flags: Read

Default value: FALSE


The “shortname” property

  “shortname”                gchar *

The document's short name.

Flags: Read / Write

Default value: NULL

Signal Details

The “cursor-moved” signal

void
user_function (XedDocument *xeddocument,
               gpointer     user_data)

Flags: Run Last


The “load” signal

void
user_function (XedDocument *document,
               gpointer     user_data)

The "load" signal is emitted at the beginning of file loading.

Parameters

document

the XedDocument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “loaded” signal

void
user_function (XedDocument *document,
               gpointer     user_data)

The "loaded" signal is emitted at the end of a successful loading.

Parameters

document

the XedDocument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “save” signal

void
user_function (XedDocument *document,
               gpointer     user_data)

The "save" signal is emitted at the beginning of file saving.

Parameters

document

the XedDocument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last


The “saved” signal

void
user_function (XedDocument *document,
               gpointer     user_data)

The "saved" signal is emitted at the end of a successful file saving.

Parameters

document

the XedDocument.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last