GspellTextBuffer

GspellTextBuffer — Spell checking support for GtkTextBuffer

Functions

Properties

GtkTextBuffer * buffer Read / Write / Construct Only
GspellChecker * spell-checker Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GspellTextBuffer

Includes

#include <gspell/gspell.h>

Description

GspellTextBuffer extends the GtkTextBuffer class but without subclassing it, because the GtkSourceView library has already a GtkTextBuffer subclass.

Support of the no-spell-check tag defined by GtkSourceView

The syntax highlighting engine of the GtkSourceView library has a feature called “context classes”. One of the standard context classes is “no-spell-check”: it defines the regions in the GtkTextBuffer that should not be spell-checked.

GtkSourceView creates a GtkTextTag named "gtksourceview:context-classes:no-spell-check". gspell reads this tag, to skip the text contained within the tag.

If you use the GtkSourceView library in your application, keep in mind that the GtkTextTag created by GtkSourceView is for read-only purposes; you cannot apply it yourself to other regions.

On the other hand if the GtkSourceView library is not used, you can create a GtkTextTag with the same name to mark certain regions in the text that gspell should skip. As it is not a great API, it is planned to add an explicit API in GspellTextBuffer to set a GtkTextTag that gspell should skip.

See the class description of GtkSourceBuffer for more information about context classes.

Functions

gspell_text_buffer_get_from_gtk_text_buffer ()

GspellTextBuffer *
gspell_text_buffer_get_from_gtk_text_buffer
                               (GtkTextBuffer *gtk_buffer);

Returns the GspellTextBuffer of gtk_buffer . The returned object is guaranteed to be the same for the lifetime of gtk_buffer .

Parameters

gtk_buffer

a GtkTextBuffer.

 

Returns

the GspellTextBuffer of gtk_buffer .

[transfer none]


gspell_text_buffer_get_buffer ()

GtkTextBuffer *
gspell_text_buffer_get_buffer (GspellTextBuffer *gspell_buffer);

Parameters

gspell_buffer

a GspellTextBuffer.

 

Returns

the GtkTextBuffer of gspell_buffer .

[transfer none]


gspell_text_buffer_get_spell_checker ()

GspellChecker *
gspell_text_buffer_get_spell_checker (GspellTextBuffer *gspell_buffer);

Parameters

gspell_buffer

a GspellTextBuffer.

 

Returns

the GspellChecker if one has been set, or NULL.

[nullable][transfer none]


gspell_text_buffer_set_spell_checker ()

void
gspell_text_buffer_set_spell_checker (GspellTextBuffer *gspell_buffer,
                                      GspellChecker *spell_checker);

Sets a GspellChecker to a GspellTextBuffer. The gspell_buffer will own a reference to spell_checker , so you can release your reference to spell_checker if you no longer need it.

Parameters

gspell_buffer

a GspellTextBuffer.

 

spell_checker

a GspellChecker, or NULL to unset the spell checker.

[nullable]

Types and Values

GspellTextBuffer

typedef struct _GspellTextBuffer GspellTextBuffer;

Property Details

The “buffer” property

  “buffer”                   GtkTextBuffer *

The GtkTextBuffer.

Owner: GspellTextBuffer

Flags: Read / Write / Construct Only


The “spell-checker” property

  “spell-checker”            GspellChecker *

The GspellChecker.

Owner: GspellTextBuffer

Flags: Read / Write