[gspell] text-view: add get_view()



commit 4cb4ed9c04794641d8b97bcaa9b3f5cf00ea0914
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Sat Mar 12 16:32:34 2016 +0100

    text-view: add get_view()

 docs/reference/gspell-1.0-sections.txt |    1 +
 gspell/gspell-text-view.c              |   26 +++++++++++++++++++-------
 gspell/gspell-text-view.h              |    2 ++
 3 files changed, 22 insertions(+), 7 deletions(-)
---
diff --git a/docs/reference/gspell-1.0-sections.txt b/docs/reference/gspell-1.0-sections.txt
index a2a2f56..45ce4ed 100644
--- a/docs/reference/gspell-1.0-sections.txt
+++ b/docs/reference/gspell-1.0-sections.txt
@@ -55,6 +55,7 @@ GSPELL_TYPE_TEXT_BUFFER
 <TITLE>GspellTextView</TITLE>
 GspellTextView
 gspell_text_view_get_from_gtk_text_view
+gspell_text_view_get_view
 gspell_text_view_get_inline_spell_checking
 gspell_text_view_set_inline_spell_checking
 <SUBSECTION Standard>
diff --git a/gspell/gspell-text-view.c b/gspell/gspell-text-view.c
index 3759d25..c822af1 100644
--- a/gspell/gspell-text-view.c
+++ b/gspell/gspell-text-view.c
@@ -149,16 +149,12 @@ gspell_text_view_get_property (GObject    *object,
                               GValue     *value,
                               GParamSpec *pspec)
 {
-       GspellTextView *gspell_view;
-       GspellTextViewPrivate *priv;
-
-       gspell_view = GSPELL_TEXT_VIEW (object);
-       priv = gspell_text_view_get_instance_private (gspell_view);
+       GspellTextView *gspell_view = GSPELL_TEXT_VIEW (object);
 
        switch (prop_id)
        {
                case PROP_VIEW:
-                       g_value_set_object (value, priv->view);
+                       g_value_set_object (value, gspell_text_view_get_view (gspell_view));
                        break;
 
                case PROP_INLINE_SPELL_CHECKING:
@@ -293,6 +289,23 @@ gspell_text_view_get_from_gtk_text_view (GtkTextView *gtk_view)
 }
 
 /**
+ * gspell_text_view_get_view:
+ * @gspell_view: a #GspellTextView.
+ *
+ * Returns: (transfer none): the #GtkTextView of @gspell_view.
+ */
+GtkTextView *
+gspell_text_view_get_view (GspellTextView *gspell_view)
+{
+       GspellTextViewPrivate *priv;
+
+       g_return_val_if_fail (GSPELL_IS_TEXT_VIEW (gspell_view), NULL);
+
+       priv = gspell_text_view_get_instance_private (gspell_view);
+       return priv->view;
+}
+
+/**
  * gspell_text_view_get_inline_spell_checking:
  * @gspell_view: a #GspellTextView.
  *
@@ -306,7 +319,6 @@ gspell_text_view_get_inline_spell_checking (GspellTextView *gspell_view)
        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;
 }
 
diff --git a/gspell/gspell-text-view.h b/gspell/gspell-text-view.h
index 806d64d..f178c88 100644
--- a/gspell/gspell-text-view.h
+++ b/gspell/gspell-text-view.h
@@ -43,6 +43,8 @@ struct _GspellTextViewClass
 
 GspellTextView *       gspell_text_view_get_from_gtk_text_view         (GtkTextView *gtk_view);
 
+GtkTextView *          gspell_text_view_get_view                       (GspellTextView *gspell_view);
+
 gboolean               gspell_text_view_get_inline_spell_checking      (GspellTextView *gspell_view);
 
 void                   gspell_text_view_set_inline_spell_checking      (GspellTextView *gspell_view,


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