[gspell/wip/text-view-class] text-view: rename :enabled -> :inline-spell-checking



commit 7a68b132c2a734e9613d59e893a6ff65863fb141
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Fri Mar 11 17:02:39 2016 +0100

    text-view: rename :enabled -> :inline-spell-checking

 docs/reference/gspell-1.0-sections.txt |    4 +-
 gspell/gspell-text-view.c              |   70 ++++++++++++++++----------------
 gspell/gspell-text-view.h              |    8 ++--
 tests/test-spell.c                     |    6 +-
 4 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/docs/reference/gspell-1.0-sections.txt b/docs/reference/gspell-1.0-sections.txt
index 71276de..1dc5e8f 100644
--- a/docs/reference/gspell-1.0-sections.txt
+++ b/docs/reference/gspell-1.0-sections.txt
@@ -55,8 +55,8 @@ GSPELL_TYPE_TEXT_BUFFER
 <TITLE>GspellTextView</TITLE>
 GspellTextView
 gspell_text_view_get_from_gtk_text_view
-gspell_text_view_get_enabled
-gspell_text_view_set_enabled
+gspell_text_view_get_inline_spell_checking
+gspell_text_view_set_inline_spell_checking
 <SUBSECTION Standard>
 GSPELL_TYPE_TEXT_VIEW
 GspellTextViewClass
diff --git a/gspell/gspell-text-view.c b/gspell/gspell-text-view.c
index 382a573..e206271 100644
--- a/gspell/gspell-text-view.c
+++ b/gspell/gspell-text-view.c
@@ -58,7 +58,7 @@ enum
 {
        PROP_0,
        PROP_VIEW,
-       PROP_ENABLED,
+       PROP_INLINE_SPELL_CHECKING,
 };
 
 #define GSPELL_TEXT_VIEW_KEY "gspell-text-view-key"
@@ -159,8 +159,8 @@ gspell_text_view_get_property (GObject    *object,
                        g_value_set_object (value, priv->view);
                        break;
 
-               case PROP_ENABLED:
-                       g_value_set_boolean (value, gspell_text_view_get_enabled (gspell_view));
+               case PROP_INLINE_SPELL_CHECKING:
+                       g_value_set_boolean (value, gspell_text_view_get_inline_spell_checking (gspell_view));
                        break;
 
                default:
@@ -183,8 +183,8 @@ gspell_text_view_set_property (GObject      *object,
                        set_view (gspell_view, g_value_get_object (value));
                        break;
 
-               case PROP_ENABLED:
-                       gspell_text_view_set_enabled (gspell_view, g_value_get_boolean (value));
+               case PROP_INLINE_SPELL_CHECKING:
+                       gspell_text_view_set_inline_spell_checking (gspell_view, g_value_get_boolean (value));
                        break;
 
                default:
@@ -237,14 +237,14 @@ gspell_text_view_class_init (GspellTextViewClass *klass)
                                                              G_PARAM_STATIC_STRINGS));
 
        /**
-        * GspellTextView:enabled:
+        * GspellTextView:inline-spell-checking:
         *
         * Whether the inline spell checking is enabled.
         */
        g_object_class_install_property (object_class,
-                                        PROP_ENABLED,
-                                        g_param_spec_boolean ("enabled",
-                                                              "Enabled",
+                                        PROP_INLINE_SPELL_CHECKING,
+                                        g_param_spec_boolean ("inline-spell-checking",
+                                                              "Inline Spell Checking",
                                                               "",
                                                               FALSE,
                                                               G_PARAM_READWRITE |
@@ -291,26 +291,44 @@ gspell_text_view_get_from_gtk_text_view (GtkTextView *gtk_view)
 }
 
 /**
- * gspell_text_view_set_enabled:
+ * gspell_text_view_get_inline_spell_checking:
  * @gspell_view: a #GspellTextView.
- * @enabled: the new state.
+ *
+ * Returns: whether the inline spell checking is enabled.
+ */
+gboolean
+gspell_text_view_get_inline_spell_checking (GspellTextView *gspell_view)
+{
+       GspellTextViewPrivate *priv;
+
+       g_return_val_if_fail (GSPELL_IS_TEXT_VIEW (gspell_view), FALSE);
+
+       priv = gspell_text_view_get_instance_private (gspell_view);
+
+       return priv->inline_checker != NULL;
+}
+
+/**
+ * gspell_text_view_set_inline_spell_checking:
+ * @gspell_view: a #GspellTextView.
+ * @enable: the new state.
  *
  * Enables or disables the inline spell checking.
  */
 void
-gspell_text_view_set_enabled (GspellTextView *gspell_view,
-                             gboolean        enabled)
+gspell_text_view_set_inline_spell_checking (GspellTextView *gspell_view,
+                                           gboolean        enable)
 {
        g_return_if_fail (GSPELL_IS_TEXT_VIEW (gspell_view));
 
-       enabled = enabled != FALSE;
+       enable = enable != FALSE;
 
-       if (enabled == gspell_text_view_get_enabled (gspell_view))
+       if (enable == gspell_text_view_get_inline_spell_checking (gspell_view))
        {
                return;
        }
 
-       if (enabled)
+       if (enable)
        {
                create_inline_checker (gspell_view);
        }
@@ -319,25 +337,7 @@ gspell_text_view_set_enabled (GspellTextView *gspell_view,
                destroy_inline_checker (gspell_view);
        }
 
-       g_object_notify (G_OBJECT (gspell_view), "enabled");
-}
-
-/**
- * gspell_text_view_get_enabled:
- * @gspell_view: a #GspellTextView.
- *
- * Returns: whether the inline spell checking is enabled.
- */
-gboolean
-gspell_text_view_get_enabled (GspellTextView *gspell_view)
-{
-       GspellTextViewPrivate *priv;
-
-       g_return_val_if_fail (GSPELL_IS_TEXT_VIEW (gspell_view), FALSE);
-
-       priv = gspell_text_view_get_instance_private (gspell_view);
-
-       return priv->inline_checker != NULL;
+       g_object_notify (G_OBJECT (gspell_view), "inline-spell-checking");
 }
 
 /* ex:set ts=8 noet: */
diff --git a/gspell/gspell-text-view.h b/gspell/gspell-text-view.h
index b5cf101..806d64d 100644
--- a/gspell/gspell-text-view.h
+++ b/gspell/gspell-text-view.h
@@ -41,12 +41,12 @@ struct _GspellTextViewClass
        gpointer padding[8];
 };
 
-GspellTextView *       gspell_text_view_get_from_gtk_text_view (GtkTextView *gtk_view);
+GspellTextView *       gspell_text_view_get_from_gtk_text_view         (GtkTextView *gtk_view);
 
-void                   gspell_text_view_set_enabled            (GspellTextView *gspell_view,
-                                                                gboolean        enabled);
+gboolean               gspell_text_view_get_inline_spell_checking      (GspellTextView *gspell_view);
 
-gboolean               gspell_text_view_get_enabled            (GspellTextView *gspell_view);
+void                   gspell_text_view_set_inline_spell_checking      (GspellTextView *gspell_view,
+                                                                        gboolean        enable);
 
 G_END_DECLS
 
diff --git a/tests/test-spell.c b/tests/test-spell.c
index e748634..4a12e05 100644
--- a/tests/test-spell.c
+++ b/tests/test-spell.c
@@ -103,7 +103,7 @@ get_sidebar (TestSpell *spell)
        GtkWidget *change_buffer_button;
        GspellChecker *checker;
        const GspellLanguage *language;
-       GspellTextView *inline_checker;
+       GspellTextView *gspell_view;
 
        sidebar = gtk_grid_new ();
 
@@ -142,9 +142,9 @@ get_sidebar (TestSpell *spell)
        gtk_container_add (GTK_CONTAINER (sidebar),
                           highlight_checkbutton);
 
-       inline_checker = gspell_text_view_get_from_gtk_text_view (spell->view);
+       gspell_view = gspell_text_view_get_from_gtk_text_view (spell->view);
        g_object_bind_property (highlight_checkbutton, "active",
-                               inline_checker, "enabled",
+                               gspell_view, "inline-spell-checking",
                                G_BINDING_DEFAULT);
 
        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (highlight_checkbutton), TRUE);


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