[gspell/wip/navig: 1/2] Rename GspellNavigatorGtv -> GspellNavigatorText



commit ee24267377b1e6a176fd43fe360558c10443ec1d
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Jan 14 11:10:17 2016 +0100

    Rename GspellNavigatorGtv -> GspellNavigatorText
    
    For GtkTextView, the suffix used in gspell is now "Text". In the future
    the support of GtkEntry will have the suffix "Entry". Text and Entry fit
    well together, whereas Gtv and Entry is awkward.
    
    The purpose of the suffix "Gtv" was meant to be able to distinguish it
    clearly from other text widgets from other libraries like WebKitGTK+.
    But gspell itself will not add support for other libraries, it should
    only depend on GTK+.

 docs/reference/gspell-1.0-sections.txt             |   12 +-
 docs/reference/gspell-docs.xml                     |    2 +-
 gspell/Makefile.am                                 |    4 +-
 ...ell-navigator-gtv.c => gspell-navigator-text.c} |  128 ++++++++++----------
 ...ell-navigator-gtv.h => gspell-navigator-text.h} |   16 ++--
 gspell/gspell-navigator.c                          |    2 +-
 gspell/gspell.h                                    |    2 +-
 po/POTFILES.in                                     |    2 +-
 tests/test-spell.c                                 |    2 +-
 9 files changed, 85 insertions(+), 85 deletions(-)
---
diff --git a/docs/reference/gspell-1.0-sections.txt b/docs/reference/gspell-1.0-sections.txt
index 813080a..f7adf88 100644
--- a/docs/reference/gspell-1.0-sections.txt
+++ b/docs/reference/gspell-1.0-sections.txt
@@ -78,13 +78,13 @@ GSPELL_TYPE_NAVIGATOR
 </SECTION>
 
 <SECTION>
-<FILE>navigator-gtv</FILE>
-<TITLE>GspellNavigatorGtv</TITLE>
-GspellNavigatorGtv
-gspell_navigator_gtv_new
+<FILE>navigator-text</FILE>
+<TITLE>GspellNavigatorText</TITLE>
+GspellNavigatorText
+gspell_navigator_text_new
 <SUBSECTION Standard>
-GSPELL_TYPE_NAVIGATOR_GTV
-GspellNavigatorGtvClass
+GSPELL_TYPE_NAVIGATOR_TEXT
+GspellNavigatorTextClass
 </SECTION>
 
 <SECTION>
diff --git a/docs/reference/gspell-docs.xml b/docs/reference/gspell-docs.xml
index c60b350..d3bee8e 100644
--- a/docs/reference/gspell-docs.xml
+++ b/docs/reference/gspell-docs.xml
@@ -35,7 +35,7 @@
       <title>External Checkers</title>
       <xi:include href="xml/checker-dialog.xml"/>
       <xi:include href="xml/navigator.xml"/>
-      <xi:include href="xml/navigator-gtv.xml"/>
+      <xi:include href="xml/navigator-text.xml"/>
     </chapter>
 
     <chapter>
diff --git a/gspell/Makefile.am b/gspell/Makefile.am
index 2178ee4..573dc6c 100644
--- a/gspell/Makefile.am
+++ b/gspell/Makefile.am
@@ -25,7 +25,7 @@ gspell_public_headers =                               \
        gspell-language-chooser-button.h        \
        gspell-language-chooser-dialog.h        \
        gspell-navigator.h                      \
-       gspell-navigator-gtv.h                  \
+       gspell-navigator-text.h                 \
        gspell-text-buffer.h
 
 gspell_public_c_files =                                \
@@ -37,7 +37,7 @@ gspell_public_c_files =                               \
        gspell-language-chooser-button.c        \
        gspell-language-chooser-dialog.c        \
        gspell-navigator.c                      \
-       gspell-navigator-gtv.c                  \
+       gspell-navigator-text.c                 \
        gspell-text-buffer.c
 
 gspell_private_headers =                       \
diff --git a/gspell/gspell-navigator-gtv.c b/gspell/gspell-navigator-text.c
similarity index 77%
rename from gspell/gspell-navigator-gtv.c
rename to gspell/gspell-navigator-text.c
index d933c0f..87ccc85 100644
--- a/gspell/gspell-navigator-gtv.c
+++ b/gspell/gspell-navigator-text.c
@@ -18,18 +18,18 @@
  */
 
 #include "config.h"
-#include "gspell-navigator-gtv.h"
+#include "gspell-navigator-text.h"
 #include <glib/gi18n-lib.h>
 #include "gspell-text-buffer.h"
 #include "gspell-utils.h"
 
 /**
- * SECTION:navigator-gtv
+ * SECTION:navigator-text
  * @Short_description: A GspellNavigator implementation for GtkTextView
- * @Title: GspellNavigatorGtv
+ * @Title: GspellNavigatorText
  * @See_also: #GspellNavigator, #GspellCheckerDialog
  *
- * #GspellNavigatorGtv is a simple implementation of the
+ * #GspellNavigatorText is a simple implementation of the
  * #GspellNavigator interface for the #GtkTextView widget.
  *
  * If a selection exists in the #GtkTextView, only the selected text is spell
@@ -46,9 +46,9 @@
  * #GspellChecker to the #GtkTextBuffer.
  */
 
-typedef struct _GspellNavigatorGtvPrivate GspellNavigatorGtvPrivate;
+typedef struct _GspellNavigatorTextPrivate GspellNavigatorTextPrivate;
 
-struct _GspellNavigatorGtvPrivate
+struct _GspellNavigatorTextPrivate
 {
        GtkTextView *view;
        GtkTextBuffer *buffer;
@@ -70,21 +70,21 @@ enum
 
 static void gspell_navigator_iface_init (gpointer g_iface, gpointer iface_data);
 
-G_DEFINE_TYPE_WITH_CODE (GspellNavigatorGtv,
-                        gspell_navigator_gtv,
+G_DEFINE_TYPE_WITH_CODE (GspellNavigatorText,
+                        gspell_navigator_text,
                         G_TYPE_OBJECT,
-                        G_ADD_PRIVATE (GspellNavigatorGtv)
+                        G_ADD_PRIVATE (GspellNavigatorText)
                         G_IMPLEMENT_INTERFACE (GSPELL_TYPE_NAVIGATOR,
                                                gspell_navigator_iface_init))
 
 static void
-init_boundaries (GspellNavigatorGtv *navigator)
+init_boundaries (GspellNavigatorText *navigator)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
        GtkTextIter start;
        GtkTextIter end;
 
-       priv = gspell_navigator_gtv_get_instance_private (navigator);
+       priv = gspell_navigator_text_get_instance_private (navigator);
 
        g_return_if_fail (priv->start_boundary == NULL);
        g_return_if_fail (priv->end_boundary == NULL);
@@ -111,12 +111,12 @@ init_boundaries (GspellNavigatorGtv *navigator)
 }
 
 static void
-set_view (GspellNavigatorGtv *navigator,
-         GtkTextView        *view)
+set_view (GspellNavigatorText *navigator,
+         GtkTextView         *view)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
 
-       priv = gspell_navigator_gtv_get_instance_private (navigator);
+       priv = gspell_navigator_text_get_instance_private (navigator);
 
        g_return_if_fail (priv->view == NULL);
        g_return_if_fail (priv->buffer == NULL);
@@ -130,14 +130,14 @@ set_view (GspellNavigatorGtv *navigator,
 }
 
 static void
-gspell_navigator_gtv_get_property (GObject    *object,
-                                  guint       prop_id,
-                                  GValue     *value,
-                                  GParamSpec *pspec)
+gspell_navigator_text_get_property (GObject    *object,
+                                   guint       prop_id,
+                                   GValue     *value,
+                                   GParamSpec *pspec)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
 
-       priv = gspell_navigator_gtv_get_instance_private (GSPELL_NAVIGATOR_GTV (object));
+       priv = gspell_navigator_text_get_instance_private (GSPELL_NAVIGATOR_TEXT (object));
 
        switch (prop_id)
        {
@@ -152,12 +152,12 @@ gspell_navigator_gtv_get_property (GObject    *object,
 }
 
 static void
-gspell_navigator_gtv_set_property (GObject      *object,
-                                  guint         prop_id,
-                                  const GValue *value,
-                                  GParamSpec   *pspec)
+gspell_navigator_text_set_property (GObject      *object,
+                                   guint         prop_id,
+                                   const GValue *value,
+                                   GParamSpec   *pspec)
 {
-       GspellNavigatorGtv *navigator = GSPELL_NAVIGATOR_GTV (object);
+       GspellNavigatorText *navigator = GSPELL_NAVIGATOR_TEXT (object);
 
        switch (prop_id)
        {
@@ -172,11 +172,11 @@ gspell_navigator_gtv_set_property (GObject      *object,
 }
 
 static void
-gspell_navigator_gtv_dispose (GObject *object)
+gspell_navigator_text_dispose (GObject *object)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
 
-       priv = gspell_navigator_gtv_get_instance_private (GSPELL_NAVIGATOR_GTV (object));
+       priv = gspell_navigator_text_get_instance_private (GSPELL_NAVIGATOR_TEXT (object));
 
        g_clear_object (&priv->view);
 
@@ -210,20 +210,20 @@ gspell_navigator_gtv_dispose (GObject *object)
                priv->buffer = NULL;
        }
 
-       G_OBJECT_CLASS (gspell_navigator_gtv_parent_class)->dispose (object);
+       G_OBJECT_CLASS (gspell_navigator_text_parent_class)->dispose (object);
 }
 
 static void
-gspell_navigator_gtv_class_init (GspellNavigatorGtvClass *klass)
+gspell_navigator_text_class_init (GspellNavigatorTextClass *klass)
 {
        GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
-       object_class->get_property = gspell_navigator_gtv_get_property;
-       object_class->set_property = gspell_navigator_gtv_set_property;
-       object_class->dispose = gspell_navigator_gtv_dispose;
+       object_class->get_property = gspell_navigator_text_get_property;
+       object_class->set_property = gspell_navigator_text_set_property;
+       object_class->dispose = gspell_navigator_text_dispose;
 
        /**
-        * GspellNavigatorGtv:view:
+        * GspellNavigatorText:view:
         *
         * The #GtkTextView. The buffer is not sufficient, the view is needed to
         * scroll to the misspelled words.
@@ -240,18 +240,18 @@ gspell_navigator_gtv_class_init (GspellNavigatorGtvClass *klass)
 }
 
 static void
-gspell_navigator_gtv_init (GspellNavigatorGtv *self)
+gspell_navigator_text_init (GspellNavigatorText *self)
 {
 }
 
 static void
-select_misspelled_word (GspellNavigatorGtv *navigator)
+select_misspelled_word (GspellNavigatorText *navigator)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
        GtkTextIter word_start;
        GtkTextIter word_end;
 
-       priv = gspell_navigator_gtv_get_instance_private (navigator);
+       priv = gspell_navigator_text_get_instance_private (navigator);
 
        gtk_text_buffer_get_iter_at_mark (priv->buffer, &word_start, priv->word_start);
        gtk_text_buffer_get_iter_at_mark (priv->buffer, &word_end, priv->word_end);
@@ -269,18 +269,18 @@ select_misspelled_word (GspellNavigatorGtv *navigator)
 }
 
 static gboolean
-gspell_navigator_gtv_goto_next (GspellNavigator  *navigator,
-                               gchar           **word_p,
-                               GspellChecker   **spell_checker_p,
-                               GError          **error_p)
+gspell_navigator_text_goto_next (GspellNavigator  *navigator,
+                                gchar           **word_p,
+                                GspellChecker   **spell_checker_p,
+                                GError          **error_p)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
        GspellChecker *spell_checker;
        GtkTextIter word_start;
        GtkTextIter end;
        GtkTextTag *no_spell_check_tag;
 
-       priv = gspell_navigator_gtv_get_instance_private (GSPELL_NAVIGATOR_GTV (navigator));
+       priv = gspell_navigator_text_get_instance_private (GSPELL_NAVIGATOR_TEXT (navigator));
 
        g_assert ((priv->word_start == NULL && priv->word_end == NULL) ||
                  (priv->word_start != NULL && priv->word_end != NULL));
@@ -393,7 +393,7 @@ gspell_navigator_gtv_goto_next (GspellNavigator  *navigator,
                        gtk_text_buffer_move_mark (priv->buffer, priv->word_start, &word_start);
                        gtk_text_buffer_move_mark (priv->buffer, priv->word_end, &word_end);
 
-                       select_misspelled_word (GSPELL_NAVIGATOR_GTV (navigator));
+                       select_misspelled_word (GSPELL_NAVIGATOR_TEXT (navigator));
 
                        if (spell_checker_p != NULL)
                        {
@@ -420,16 +420,16 @@ gspell_navigator_gtv_goto_next (GspellNavigator  *navigator,
 }
 
 static void
-gspell_navigator_gtv_change (GspellNavigator *navigator,
-                            const gchar     *word,
-                            const gchar     *change_to)
+gspell_navigator_text_change (GspellNavigator *navigator,
+                             const gchar     *word,
+                             const gchar     *change_to)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
        GtkTextIter word_start;
        GtkTextIter word_end;
        gchar *word_in_buffer = NULL;
 
-       priv = gspell_navigator_gtv_get_instance_private (GSPELL_NAVIGATOR_GTV (navigator));
+       priv = gspell_navigator_text_get_instance_private (GSPELL_NAVIGATOR_TEXT (navigator));
 
        g_return_if_fail (GTK_IS_TEXT_MARK (priv->word_start));
        g_return_if_fail (GTK_IS_TEXT_MARK (priv->word_end));
@@ -451,14 +451,14 @@ gspell_navigator_gtv_change (GspellNavigator *navigator,
 }
 
 static void
-gspell_navigator_gtv_change_all (GspellNavigator *navigator,
-                                const gchar     *word,
-                                const gchar     *change_to)
+gspell_navigator_text_change_all (GspellNavigator *navigator,
+                                 const gchar     *word,
+                                 const gchar     *change_to)
 {
-       GspellNavigatorGtvPrivate *priv;
+       GspellNavigatorTextPrivate *priv;
        GtkTextIter iter;
 
-       priv = gspell_navigator_gtv_get_instance_private (GSPELL_NAVIGATOR_GTV (navigator));
+       priv = gspell_navigator_text_get_instance_private (GSPELL_NAVIGATOR_TEXT (navigator));
 
        g_return_if_fail (GTK_IS_TEXT_MARK (priv->start_boundary));
        g_return_if_fail (GTK_IS_TEXT_MARK (priv->end_boundary));
@@ -508,23 +508,23 @@ gspell_navigator_iface_init (gpointer g_iface,
 {
        GspellNavigatorInterface *iface = g_iface;
 
-       iface->goto_next = gspell_navigator_gtv_goto_next;
-       iface->change = gspell_navigator_gtv_change;
-       iface->change_all = gspell_navigator_gtv_change_all;
+       iface->goto_next = gspell_navigator_text_goto_next;
+       iface->change = gspell_navigator_text_change;
+       iface->change_all = gspell_navigator_text_change_all;
 }
 
 /**
- * gspell_navigator_gtv_new:
+ * gspell_navigator_text_new:
  * @view: a #GtkTextView.
  *
- * Returns: (transfer full): a new #GspellNavigatorGtv object.
+ * Returns: (transfer full): a new #GspellNavigatorText object.
  */
 GspellNavigator *
-gspell_navigator_gtv_new (GtkTextView *view)
+gspell_navigator_text_new (GtkTextView *view)
 {
        g_return_val_if_fail (GTK_IS_TEXT_VIEW (view), NULL);
 
-       return g_object_new (GSPELL_TYPE_NAVIGATOR_GTV,
+       return g_object_new (GSPELL_TYPE_NAVIGATOR_TEXT,
                             "view", view,
                             NULL);
 }
diff --git a/gspell/gspell-navigator-gtv.h b/gspell/gspell-navigator-text.h
similarity index 75%
rename from gspell/gspell-navigator-gtv.h
rename to gspell/gspell-navigator-text.h
index 451b7e1..0cc7801 100644
--- a/gspell/gspell-navigator-gtv.h
+++ b/gspell/gspell-navigator-text.h
@@ -17,8 +17,8 @@
  * along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __GSPELL_NAVIGATOR_GTV_H__
-#define __GSPELL_NAVIGATOR_GTV_H__
+#ifndef __GSPELL_NAVIGATOR_TEXT_H__
+#define __GSPELL_NAVIGATOR_TEXT_H__
 
 #if !defined (__GSPELL_H_INSIDE__) && !defined (GSPELL_COMPILATION)
 #error "Only <gspell/gspell.h> can be included directly."
@@ -30,12 +30,12 @@
 
 G_BEGIN_DECLS
 
-#define GSPELL_TYPE_NAVIGATOR_GTV (gspell_navigator_gtv_get_type ())
-G_DECLARE_DERIVABLE_TYPE (GspellNavigatorGtv, gspell_navigator_gtv,
-                         GSPELL, NAVIGATOR_GTV,
+#define GSPELL_TYPE_NAVIGATOR_TEXT (gspell_navigator_text_get_type ())
+G_DECLARE_DERIVABLE_TYPE (GspellNavigatorText, gspell_navigator_text,
+                         GSPELL, NAVIGATOR_TEXT,
                          GObject)
 
-struct _GspellNavigatorGtvClass
+struct _GspellNavigatorTextClass
 {
        GObjectClass parent_class;
 
@@ -43,10 +43,10 @@ struct _GspellNavigatorGtvClass
        gpointer padding[8];
 };
 
-GspellNavigator *      gspell_navigator_gtv_new                (GtkTextView *view);
+GspellNavigator *      gspell_navigator_text_new               (GtkTextView *view);
 
 G_END_DECLS
 
-#endif /* __GSPELL_NAVIGATOR_GTV_H__ */
+#endif /* __GSPELL_NAVIGATOR_TEXT_H__ */
 
 /* ex:set ts=8 noet: */
diff --git a/gspell/gspell-navigator.c b/gspell/gspell-navigator.c
index ae1bf03..564bae7 100644
--- a/gspell/gspell-navigator.c
+++ b/gspell/gspell-navigator.c
@@ -23,7 +23,7 @@
  * SECTION:navigator
  * @Short_description: Interface to navigate through misspelled words
  * @Title: GspellNavigator
- * @See_also: #GspellNavigatorGtv, #GspellCheckerDialog
+ * @See_also: #GspellNavigatorText, #GspellCheckerDialog
  *
  * #GspellNavigator is an interface to navigate through misspelled words,
  * and correct the mistakes.
diff --git a/gspell/gspell.h b/gspell/gspell.h
index b635a81..3c3641b 100644
--- a/gspell/gspell.h
+++ b/gspell/gspell.h
@@ -30,7 +30,7 @@
 #include <gspell/gspell-language-chooser-button.h>
 #include <gspell/gspell-language-chooser-dialog.h>
 #include <gspell/gspell-navigator.h>
-#include <gspell/gspell-navigator-gtv.h>
+#include <gspell/gspell-navigator-text.h>
 #include <gspell/gspell-text-buffer.h>
 
 #undef __GSPELL_H_INSIDE__
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 656133b..71ae3d8 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -9,7 +9,7 @@ gspell/gspell-language-chooser.c
 gspell/gspell-language-chooser-button.c
 gspell/gspell-language-chooser-dialog.c
 gspell/gspell-navigator.c
-gspell/gspell-navigator-gtv.c
+gspell/gspell-navigator-text.c
 gspell/gspell-osx.c
 gspell/gspell-text-buffer.c
 gspell/gspell-utils.c
diff --git a/tests/test-spell.c b/tests/test-spell.c
index cf306fd..a757fc9 100644
--- a/tests/test-spell.c
+++ b/tests/test-spell.c
@@ -59,7 +59,7 @@ checker_button_clicked_cb (GtkButton *checker_button,
                g_return_if_reached ();
        }
 
-       navigator = gspell_navigator_gtv_new (spell->view);
+       navigator = gspell_navigator_text_new (spell->view);
        checker_dialog = gspell_checker_dialog_new (GTK_WINDOW (window), navigator);
        g_object_unref (navigator);
 


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