[gnome-text-editor] document: add API to get spelling tag



commit d9edc99a086707a56ad38b063d7f68d87ca7151d
Author: Christian Hergert <chergert redhat com>
Date:   Sun Jul 25 14:02:41 2021 -0700

    document: add API to get spelling tag

 src/editor-document-private.h          | 1 +
 src/editor-document.c                  | 8 ++++++++
 src/editor-text-buffer-spell-adapter.c | 8 ++++++++
 src/editor-text-buffer-spell-adapter.h | 1 +
 4 files changed, 18 insertions(+)
---
diff --git a/src/editor-document-private.h b/src/editor-document-private.h
index f65de02..388d835 100644
--- a/src/editor-document-private.h
+++ b/src/editor-document-private.h
@@ -84,5 +84,6 @@ void                      _editor_document_add_spelling            (EditorDocume
                                                                     const char               *word);
 void                      _editor_document_ignore_spelling         (EditorDocument           *self,
                                                                     const char               *word);
+GtkTextTag               *_editor_document_get_spelling_tag        (EditorDocument           *self);
 
 G_END_DECLS
diff --git a/src/editor-document.c b/src/editor-document.c
index 1f58e2a..1d9e242 100644
--- a/src/editor-document.c
+++ b/src/editor-document.c
@@ -1866,3 +1866,11 @@ _editor_document_ignore_spelling (EditorDocument *self,
       editor_text_buffer_spell_adapter_invalidate_all (self->spell_adapter);
     }
 }
+
+GtkTextTag *
+_editor_document_get_spelling_tag (EditorDocument *self)
+{
+  g_return_val_if_fail (EDITOR_IS_DOCUMENT (self), NULL);
+
+  return editor_text_buffer_spell_adapter_get_tag (self->spell_adapter);
+}
diff --git a/src/editor-text-buffer-spell-adapter.c b/src/editor-text-buffer-spell-adapter.c
index 306865c..035f0b8 100644
--- a/src/editor-text-buffer-spell-adapter.c
+++ b/src/editor-text-buffer-spell-adapter.c
@@ -746,3 +746,11 @@ editor_text_buffer_spell_adapter_set_language (EditorTextBufferSpellAdapter *sel
 
   editor_text_buffer_spell_adapter_invalidate_all (self);
 }
+
+GtkTextTag *
+editor_text_buffer_spell_adapter_get_tag (EditorTextBufferSpellAdapter *self)
+{
+  g_return_val_if_fail (EDITOR_IS_TEXT_BUFFER_SPELL_ADAPTER (self), NULL);
+
+  return self->tag;
+}
diff --git a/src/editor-text-buffer-spell-adapter.h b/src/editor-text-buffer-spell-adapter.h
index 3ee674a..de11866 100644
--- a/src/editor-text-buffer-spell-adapter.h
+++ b/src/editor-text-buffer-spell-adapter.h
@@ -54,5 +54,6 @@ const char         *editor_text_buffer_spell_adapter_get_language        (Editor
 void                editor_text_buffer_spell_adapter_set_language        (EditorTextBufferSpellAdapter *self,
                                                                           const char                   
*language);
 void                editor_text_buffer_spell_adapter_invalidate_all      (EditorTextBufferSpellAdapter 
*self);
+GtkTextTag         *editor_text_buffer_spell_adapter_get_tag             (EditorTextBufferSpellAdapter 
*self);
 
 G_END_DECLS


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]