[gspell/wip/inline-checker: 2/2] docs: document GtkTextView support and reorganize chapters



commit 761957469eb77dd0c06a47678194a468ba4dfc9d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Wed Jan 6 13:17:07 2016 +0100

    docs: document GtkTextView support and reorganize chapters

 docs/reference/Makefile.am             |    1 +
 docs/reference/gspell-1.0-sections.txt |   66 +++++++++++++++----------------
 docs/reference/gspell-docs.xml         |   22 ++++------
 gspell/gspell-inline-checker-text.c    |   39 +------------------
 gspell/gspell-text-view.c              |   37 +++++++++++++++++-
 5 files changed, 79 insertions(+), 86 deletions(-)
---
diff --git a/docs/reference/Makefile.am b/docs/reference/Makefile.am
index 508c04e..4a3f74b 100644
--- a/docs/reference/Makefile.am
+++ b/docs/reference/Makefile.am
@@ -21,6 +21,7 @@ CFILE_GLOB = $(top_srcdir)/gspell/*.c
 # e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h private_code
 IGNORE_HFILES =                                        \
        gspell-buffer-notifier.h                \
+       gspell-inline-checker-text.h            \
        gspell-inline-checker-text-buffer.h     \
        gspell-osx.h                            \
        gspell-utils.h                          \
diff --git a/docs/reference/gspell-1.0-sections.txt b/docs/reference/gspell-1.0-sections.txt
index 878b0f0..1f7703f 100644
--- a/docs/reference/gspell-1.0-sections.txt
+++ b/docs/reference/gspell-1.0-sections.txt
@@ -22,24 +22,6 @@ gspell_checker_error_quark
 </SECTION>
 
 <SECTION>
-<FILE>checker-dialog</FILE>
-<TITLE>GspellCheckerDialog</TITLE>
-GspellCheckerDialog
-gspell_checker_dialog_new
-<SUBSECTION Standard>
-GSPELL_TYPE_CHECKER_DIALOG
-</SECTION>
-
-<SECTION>
-<FILE>inline-checker-text</FILE>
-<TITLE>GspellInlineCheckerText</TITLE>
-GspellInlineCheckerText
-gspell_inline_checker_text_new
-<SUBSECTION Standard>
-GSPELL_TYPE_INLINE_CHECKER_TEXT
-</SECTION>
-
-<SECTION>
 <FILE>language</FILE>
 <TITLE>GspellLanguage</TITLE>
 GspellLanguage
@@ -56,6 +38,27 @@ gspell_language_get_type
 </SECTION>
 
 <SECTION>
+<FILE>checker-dialog</FILE>
+<TITLE>GspellCheckerDialog</TITLE>
+GspellCheckerDialog
+gspell_checker_dialog_new
+<SUBSECTION Standard>
+GSPELL_TYPE_CHECKER_DIALOG
+</SECTION>
+
+<SECTION>
+<FILE>navigator</FILE>
+<TITLE>GspellNavigator</TITLE>
+GspellNavigator
+gspell_navigator_goto_next
+gspell_navigator_change
+gspell_navigator_change_all
+<SUBSECTION Standard>
+GspellNavigatorInterface
+GSPELL_TYPE_NAVIGATOR
+</SECTION>
+
+<SECTION>
 <FILE>language-chooser</FILE>
 <TITLE>GspellLanguageChooser</TITLE>
 GspellLanguageChooser
@@ -86,15 +89,17 @@ GSPELL_TYPE_LANGUAGE_CHOOSER_DIALOG
 </SECTION>
 
 <SECTION>
-<FILE>navigator</FILE>
-<TITLE>GspellNavigator</TITLE>
-GspellNavigator
-gspell_navigator_goto_next
-gspell_navigator_change
-gspell_navigator_change_all
-<SUBSECTION Standard>
-GspellNavigatorInterface
-GSPELL_TYPE_NAVIGATOR
+<FILE>text-buffer</FILE>
+<TITLE>GtkTextBuffer support</TITLE>
+gspell_text_buffer_set_spell_checker
+gspell_text_buffer_get_spell_checker
+</SECTION>
+
+<SECTION>
+<FILE>text-view</FILE>
+<TITLE>GtkTextView support</TITLE>
+gspell_text_view_set_inline_checking
+gspell_text_view_get_inline_checking
 </SECTION>
 
 <SECTION>
@@ -106,10 +111,3 @@ gspell_navigator_gtv_new
 GSPELL_TYPE_NAVIGATOR_GTV
 GspellNavigatorGtvClass
 </SECTION>
-
-<SECTION>
-<FILE>text-buffer</FILE>
-<TITLE>GtkTextBuffer support</TITLE>
-gspell_text_buffer_set_spell_checker
-gspell_text_buffer_get_spell_checker
-</SECTION>
diff --git a/docs/reference/gspell-docs.xml b/docs/reference/gspell-docs.xml
index 79f64fe..0fef2a2 100644
--- a/docs/reference/gspell-docs.xml
+++ b/docs/reference/gspell-docs.xml
@@ -16,26 +16,15 @@
     <title>API reference</title>
 
     <chapter>
-      <title>Main Classes</title>
+      <title>Core Classes</title>
       <xi:include href="xml/checker.xml"/>
       <xi:include href="xml/language.xml"/>
     </chapter>
 
     <chapter>
-      <title>Buffer Support</title>
-      <xi:include href="xml/text-buffer.xml"/>
-    </chapter>
-
-    <chapter>
-      <title>Inline Checkers</title>
-      <xi:include href="xml/inline-checker-text.xml"/>
-    </chapter>
-
-    <chapter>
-      <title>External Checkers</title>
+      <title>External Checking</title>
       <xi:include href="xml/checker-dialog.xml"/>
       <xi:include href="xml/navigator.xml"/>
-      <xi:include href="xml/navigator-gtv.xml"/>
     </chapter>
 
     <chapter>
@@ -44,6 +33,13 @@
       <xi:include href="xml/language-chooser-button.xml"/>
       <xi:include href="xml/language-chooser-dialog.xml"/>
     </chapter>
+
+    <chapter>
+      <title>GtkTextView Support</title>
+      <xi:include href="xml/text-buffer.xml"/>
+      <xi:include href="xml/text-view.xml"/>
+      <xi:include href="xml/navigator-gtv.xml"/>
+    </chapter>
   </part>
 
   <chapter id="object-tree">
diff --git a/gspell/gspell-inline-checker-text.c b/gspell/gspell-inline-checker-text.c
index 694bef0..d0408f8 100644
--- a/gspell/gspell-inline-checker-text.c
+++ b/gspell/gspell-inline-checker-text.c
@@ -20,33 +20,7 @@
 #include "gspell-inline-checker-text.h"
 #include "gspell-inline-checker-text-buffer.h"
 
-/**
- * SECTION:inline-checker-text
- * @Short_description: Inline spell checker for GtkTextView
- * @Title: GspellInlineCheckerText
- * @See_also: #GspellChecker
- *
- * The #GspellInlineCheckerText is an inline spell checker for the
- * #GtkTextView widget. Misspelled words are highlighted with a
- * %PANGO_UNDERLINE_ERROR, usually a red wavy underline. Right-clicking a
- * misspelled word pops up a context menu of suggested replacements. The context
- * menu also contains an “Ignore All” item to add the misspelled word to the
- * session dictionary. And an “Add” item to add the word to the personal
- * dictionary.
- *
- * The spell is checked only on the visible region of the #GtkTextView. Note
- * that if a same #GtkTextBuffer is used for several views, the misspelled words
- * are visible in all views, because the highlighting is achieved with a
- * #GtkTextTag added to the buffer.
- *
- * You need to call gspell_text_buffer_set_spell_checker() to associate a
- * #GspellChecker to the #GtkTextBuffer. You can call
- * gspell_text_buffer_set_spell_checker() at any time, a
- * #GspellInlineCheckerText re-checks the buffer when the #GspellChecker
- * changes.
- *
- * #GspellInlineCheckerText supports buffer changes.
- */
+/* Inline spell checker for GtkTextView. Handles buffer changes. */
 
 typedef struct _GspellInlineCheckerTextPrivate GspellInlineCheckerTextPrivate;
 
@@ -192,11 +166,6 @@ gspell_inline_checker_text_class_init (GspellInlineCheckerTextClass *klass)
        object_class->set_property = gspell_inline_checker_text_set_property;
        object_class->dispose = gspell_inline_checker_text_dispose;
 
-       /**
-        * GspellInlineCheckerText:view:
-        *
-        * The #GtkTextView.
-        */
        g_object_class_install_property (object_class,
                                         PROP_VIEW,
                                         g_param_spec_object ("view",
@@ -213,12 +182,6 @@ gspell_inline_checker_text_init (GspellInlineCheckerText *self)
 {
 }
 
-/**
- * gspell_inline_checker_text_new:
- * @view: a #GtkTextView.
- *
- * Returns: a new #GspellInlineCheckerText object.
- */
 GspellInlineCheckerText *
 gspell_inline_checker_text_new (GtkTextView *view)
 {
diff --git a/gspell/gspell-text-view.c b/gspell/gspell-text-view.c
index 3b88154..7540403 100644
--- a/gspell/gspell-text-view.c
+++ b/gspell/gspell-text-view.c
@@ -1,7 +1,7 @@
 /*
  * This file is part of gspell, a spell-checking library.
  *
- * Copyright 2015 - Sébastien Wilmet
+ * Copyright 2015, 2016 - Sébastien Wilmet
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -20,8 +20,37 @@
 #include "gspell-text-view.h"
 #include "gspell-inline-checker-text.h"
 
+/**
+ * SECTION:text-view
+ * @Title: GtkTextView support
+ *
+ * Spell checking support for #GtkTextView.
+ */
+
 #define INLINE_CHECKER_KEY "gspell-text-view-inline-checker-key"
 
+/**
+ * gspell_text_view_set_inline_checking:
+ * @view: a #GtkTextView.
+ * @enable: whether to enable the inline spell checking.
+ *
+ * Enables or disables inline spell checking.
+ *
+ * If enabled, misspelled words are highlighted with a %PANGO_UNDERLINE_ERROR,
+ * usually a red wavy underline. Right-clicking a misspelled word pops up a
+ * context menu of suggested replacements. The context menu also contains an
+ * “Ignore All” item to add the misspelled word to the session dictionary. And
+ * an “Add” item to add the word to the personal dictionary.
+ *
+ * The spell is checked only on the visible region of the #GtkTextView. Note
+ * that if a same #GtkTextBuffer is used for several views, the misspelled words
+ * are visible in all views, because the highlighting is achieved with a
+ * #GtkTextTag added to the buffer.
+ *
+ * You need to call gspell_text_buffer_set_spell_checker() to associate a
+ * #GspellChecker to the #GtkTextBuffer. #GtkTextView:buffer changes are
+ * handled, as well as #GspellChecker changes.
+ */
 void
 gspell_text_view_set_inline_checking (GtkTextView *view,
                                      gboolean     enable)
@@ -48,6 +77,12 @@ gspell_text_view_set_inline_checking (GtkTextView *view,
        }
 }
 
+/**
+ * gspell_text_view_get_inline_checking:
+ * @view: a #GtkTextView.
+ *
+ * Returns: whether the inline spell checking is enabled for @view.
+ */
 gboolean
 gspell_text_view_get_inline_checking (GtkTextView *view)
 {


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