[gtksourceview/wip/chergert/gsv-gtk4: 41/118] completion: move internal API to -private.h headers



commit f3d70129e9543fd38b47583843b50f159b15f85f
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jan 9 11:34:59 2020 -0800

    completion: move internal API to -private.h headers

 docs/reference/meson.build                         |  4 +-
 gtksourceview/gtksourcecompletion-private.h        |  9 +++-
 gtksourceview/gtksourcecompletion.c                |  9 ++--
 gtksourceview/gtksourcecompletion.h                | 54 ++++++++--------------
 .../gtksourcecompletioncontainer-private.h         | 37 +++++++++++++++
 gtksourceview/gtksourcecompletioncontainer.c       | 21 +++++----
 gtksourceview/gtksourcecompletioncontainer.h       | 54 ----------------------
 gtksourceview/gtksourcecompletioncontext-private.h | 33 +++++++++++++
 gtksourceview/gtksourcecompletioncontext.c         |  3 +-
 gtksourceview/gtksourcecompletioncontext.h         | 19 +++-----
 gtksourceview/gtksourcecompletioninfo-private.h    | 32 +++++++++++++
 gtksourceview/gtksourcecompletioninfo.c            |  3 +-
 gtksourceview/gtksourcecompletioninfo.h            |  3 --
 gtksourceview/gtksourceview.c                      |  2 +-
 14 files changed, 160 insertions(+), 123 deletions(-)
---
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
index 372262b4..2324b862 100644
--- a/docs/reference/meson.build
+++ b/docs/reference/meson.build
@@ -11,8 +11,10 @@ reference_private_h = [
   'gtksourcebufferinputstream-private.h',
   'gtksourcebufferinternal.h',
   'gtksourcebufferoutputstream.h',
-  'gtksourcecompletioncontainer.h',
+  'gtksourcecompletioncontainer-private.h',
+  'gtksourcecompletioncontext-private.h',
   'gtksourcecompletionmodel.h',
+  'gtksourcecompletioninfo-private.h',
   'gtksourcecompletion-private.h',
   'gtksourcecompletionwordsbuffer.h',
   'gtksourcecompletionwordslibrary.h',
diff --git a/gtksourceview/gtksourcecompletion-private.h b/gtksourceview/gtksourcecompletion-private.h
index 21a1cf26..2bca815b 100644
--- a/gtksourceview/gtksourcecompletion-private.h
+++ b/gtksourceview/gtksourcecompletion-private.h
@@ -24,4 +24,11 @@
 #include <gtksourceview/gtksourcetypes.h>
 
 G_GNUC_INTERNAL
-GtkSourceCompletion *gtk_source_completion_new (GtkSourceView *source_view);
+GtkSourceCompletion *_gtk_source_completion_new           (GtkSourceView               *source_view);
+G_GNUC_INTERNAL
+void                 _gtk_source_completion_add_proposals (GtkSourceCompletion         *completion,
+                                                           GtkSourceCompletionContext  *context,
+                                                           GtkSourceCompletionProvider *provider,
+                                                           GList                       *proposals,
+                                                           gboolean                     finished);
+
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 82a079b3..766fdcd6 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -104,10 +104,11 @@
 #include <glib/gi18n-lib.h>
 #include "gtksourcecompletionmodel.h"
 #include "gtksourcecompletioncontext.h"
-#include "gtksourcecompletioninfo.h"
+#include "gtksourcecompletioninfo-private.h"
 #include "gtksourcecompletionproposal.h"
 #include "gtksourcecompletionprovider.h"
-#include "gtksourcecompletioncontainer.h"
+#include "gtksourcecompletioncontainer-private.h"
+#include "gtksourcecompletioncontext-private.h"
 #include "gtksourcebuffer.h"
 #include "gtksource-marshal.h"
 #include "gtksourceview.h"
@@ -2857,7 +2858,7 @@ gtk_source_completion_error_quark (void)
 }
 
 /**
- * gtk_source_completion_new:
+ * _gtk_source_completion_new:
  * @view: a #GtkSourceView.
  *
  * Creates a new #GtkSourceCompletion associated with @view.
@@ -2865,7 +2866,7 @@ gtk_source_completion_error_quark (void)
  * Returns: a new #GtkSourceCompletion.
  */
 GtkSourceCompletion *
-gtk_source_completion_new (GtkSourceView *view)
+_gtk_source_completion_new (GtkSourceView *view)
 {
        g_return_val_if_fail (GTK_SOURCE_IS_VIEW (view), NULL);
 
diff --git a/gtksourceview/gtksourcecompletion.h b/gtksourceview/gtksourcecompletion.h
index 13e1a6f3..bdf3eaca 100644
--- a/gtksourceview/gtksourcecompletion.h
+++ b/gtksourceview/gtksourcecompletion.h
@@ -64,51 +64,33 @@ typedef enum _GtkSourceCompletionError
 } GtkSourceCompletionError;
 
 GTK_SOURCE_AVAILABLE_IN_ALL
-GQuark          gtk_source_completion_error_quark              (void);
-
+GQuark                      gtk_source_completion_error_quark         (void);
 GTK_SOURCE_AVAILABLE_IN_ALL
-gboolean        gtk_source_completion_add_provider             (GtkSourceCompletion           *completion,
-                                                                GtkSourceCompletionProvider   *provider,
-                                                                GError                       **error);
-
+gboolean                    gtk_source_completion_add_provider        (GtkSourceCompletion          
*completion,
+                                                                       GtkSourceCompletionProvider  
*provider,
+                                                                       GError                      **error);
 GTK_SOURCE_AVAILABLE_IN_ALL
-gboolean        gtk_source_completion_remove_provider          (GtkSourceCompletion           *completion,
-                                                                GtkSourceCompletionProvider   *provider,
-                                                                GError                       **error);
-
+gboolean                    gtk_source_completion_remove_provider     (GtkSourceCompletion          
*completion,
+                                                                       GtkSourceCompletionProvider  
*provider,
+                                                                       GError                      **error);
 GTK_SOURCE_AVAILABLE_IN_ALL
-GList          *gtk_source_completion_get_providers            (GtkSourceCompletion           *completion);
-
+GList                      *gtk_source_completion_get_providers       (GtkSourceCompletion          
*completion);
 GTK_SOURCE_AVAILABLE_IN_ALL
-gboolean        gtk_source_completion_start                    (GtkSourceCompletion           *completion,
-                                                                GList                         *providers,
-                                                                GtkSourceCompletionContext    *context);
-
+gboolean                    gtk_source_completion_start               (GtkSourceCompletion          
*completion,
+                                                                       GList                        
*providers,
+                                                                       GtkSourceCompletionContext   
*context);
 GTK_SOURCE_AVAILABLE_IN_ALL
-void            gtk_source_completion_hide                     (GtkSourceCompletion           *completion);
-
+void                        gtk_source_completion_hide                (GtkSourceCompletion          
*completion);
 GTK_SOURCE_AVAILABLE_IN_ALL
-GtkSourceCompletionInfo *
-                gtk_source_completion_get_info_window          (GtkSourceCompletion           *completion);
-
+GtkSourceCompletionInfo    *gtk_source_completion_get_info_window     (GtkSourceCompletion          
*completion);
 GTK_SOURCE_AVAILABLE_IN_ALL
-GtkSourceView  *gtk_source_completion_get_view                 (GtkSourceCompletion           *completion);
-
+GtkSourceView              *gtk_source_completion_get_view            (GtkSourceCompletion          
*completion);
 GTK_SOURCE_AVAILABLE_IN_ALL
-GtkSourceCompletionContext *
-                gtk_source_completion_create_context           (GtkSourceCompletion           *completion,
-                                                                GtkTextIter                   *position);
-
+GtkSourceCompletionContext *gtk_source_completion_create_context      (GtkSourceCompletion          
*completion,
+                                                                       GtkTextIter                  
*position);
 GTK_SOURCE_AVAILABLE_IN_ALL
-void            gtk_source_completion_block_interactive        (GtkSourceCompletion           *completion);
-
+void                        gtk_source_completion_block_interactive   (GtkSourceCompletion          
*completion);
 GTK_SOURCE_AVAILABLE_IN_ALL
-void            gtk_source_completion_unblock_interactive      (GtkSourceCompletion           *completion);
+void                        gtk_source_completion_unblock_interactive (GtkSourceCompletion          
*completion);
 
-G_GNUC_INTERNAL
-void            _gtk_source_completion_add_proposals           (GtkSourceCompletion           *completion,
-                                                                GtkSourceCompletionContext    *context,
-                                                                GtkSourceCompletionProvider   *provider,
-                                                                GList                         *proposals,
-                                                                gboolean                       finished);
 G_END_DECLS
diff --git a/gtksourceview/gtksourcecompletioncontainer-private.h 
b/gtksourceview/gtksourcecompletioncontainer-private.h
new file mode 100644
index 00000000..dbb5af44
--- /dev/null
+++ b/gtksourceview/gtksourcecompletioncontainer-private.h
@@ -0,0 +1,37 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *
+ * This file is part of GtkSourceView
+ *
+ * Copyright 2013 - Sébastien Wilmet <swilmet gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include <gtk/gtk.h>
+
+#include "gtksourcetypes-private.h"
+
+G_BEGIN_DECLS
+
+#define GTK_SOURCE_TYPE_COMPLETION_CONTAINER (_gtk_source_completion_container_get_type())
+
+G_GNUC_INTERNAL
+G_DECLARE_FINAL_TYPE (GtkSourceCompletionContainer, _gtk_source_completion_container, GTK_SOURCE, 
COMPLETION_CONTAINER, GtkScrolledWindow)
+
+G_GNUC_INTERNAL
+GtkSourceCompletionContainer *_gtk_source_completion_container_new (void);
+
+G_END_DECLS
diff --git a/gtksourceview/gtksourcecompletioncontainer.c b/gtksourceview/gtksourcecompletioncontainer.c
index 6f229f8f..54bc277d 100644
--- a/gtksourceview/gtksourcecompletioncontainer.c
+++ b/gtksourceview/gtksourcecompletioncontainer.c
@@ -31,14 +31,17 @@
 
 #include "config.h"
 
-#include "gtksourcecompletioncontainer.h"
+#include "gtksourcecompletioncontainer-private.h"
 
 #define UNREALIZED_WIDTH  350
 #define MAX_HEIGHT        180
 
-G_DEFINE_TYPE (GtkSourceCompletionContainer,
-              _gtk_source_completion_container,
-              GTK_TYPE_SCROLLED_WINDOW);
+struct _GtkSourceCompletionContainer
+{
+       GtkScrolledWindow parent_instnace;
+};
+
+G_DEFINE_TYPE (GtkSourceCompletionContainer, _gtk_source_completion_container, GTK_TYPE_SCROLLED_WINDOW);
 
 static gint
 get_max_width (GtkSourceCompletionContainer *container)
@@ -70,8 +73,8 @@ get_max_width (GtkSourceCompletionContainer *container)
 
 static void
 _gtk_source_completion_container_get_preferred_width (GtkWidget *widget,
-                                                     gint      *min_width,
-                                                     gint      *nat_width)
+                                                      gint      *min_width,
+                                                      gint      *nat_width)
 {
        GtkSourceCompletionContainer *container = GTK_SOURCE_COMPLETION_CONTAINER (widget);
        GtkWidget *child;
@@ -109,7 +112,7 @@ _gtk_source_completion_container_get_preferred_width (GtkWidget *widget,
 
 static gint
 get_row_height (GtkSourceCompletionContainer *container,
-               gint                          tree_view_height)
+                gint                          tree_view_height)
 {
        GtkWidget *tree_view;
        GtkTreeModel *model;
@@ -151,8 +154,8 @@ get_row_height (GtkSourceCompletionContainer *container,
 /* Return a height at a row boundary of the GtkTreeView. */
 static void
 _gtk_source_completion_container_get_preferred_height (GtkWidget *widget,
-                                                      gint      *min_height,
-                                                      gint      *nat_height)
+                                                       gint      *min_height,
+                                                       gint      *nat_height)
 {
        GtkSourceCompletionContainer *container = GTK_SOURCE_COMPLETION_CONTAINER (widget);
        GtkWidget *child;
diff --git a/gtksourceview/gtksourcecompletioncontext-private.h 
b/gtksourceview/gtksourcecompletioncontext-private.h
new file mode 100644
index 00000000..cee96257
--- /dev/null
+++ b/gtksourceview/gtksourcecompletioncontext-private.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *
+ * This file is part of GtkSourceView
+ *
+ * Copyright 2009 - Jesse van den Kieboom <jessevdk gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "gtksourcecompletioncontext.h"
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+GtkSourceCompletionContext *_gtk_source_completion_context_new    (GtkSourceCompletion        *completion,
+                                                                   GtkTextIter                *position);
+G_GNUC_INTERNAL
+void                        _gtk_source_completion_context_cancel (GtkSourceCompletionContext *context);
+
+G_END_DECLS
diff --git a/gtksourceview/gtksourcecompletioncontext.c b/gtksourceview/gtksourcecompletioncontext.c
index 1a843727..9e3a722a 100644
--- a/gtksourceview/gtksourcecompletioncontext.c
+++ b/gtksourceview/gtksourcecompletioncontext.c
@@ -61,7 +61,8 @@
 
 #include "config.h"
 
-#include "gtksourcecompletioncontext.h"
+#include "gtksourcecompletion-private.h"
+#include "gtksourcecompletioncontext-private.h"
 #include "gtksource-enumtypes.h"
 #include "gtksourcecompletionprovider.h"
 #include "gtksourcecompletion.h"
diff --git a/gtksourceview/gtksourcecompletioncontext.h b/gtksourceview/gtksourcecompletioncontext.h
index da04f8b1..7aa7e774 100644
--- a/gtksourceview/gtksourcecompletioncontext.h
+++ b/gtksourceview/gtksourcecompletioncontext.h
@@ -52,19 +52,14 @@ typedef enum _GtkSourceCompletionActivation
 } GtkSourceCompletionActivation;
 
 GTK_SOURCE_AVAILABLE_IN_ALL
-void                           gtk_source_completion_context_add_proposals  (GtkSourceCompletionContext  
*context,
-                                                                             GtkSourceCompletionProvider 
*provider,
-                                                                             GList                       
*proposals,
-                                                                             gboolean                     
finished);
+void                          gtk_source_completion_context_add_proposals  (GtkSourceCompletionContext  
*context,
+                                                                            GtkSourceCompletionProvider 
*provider,
+                                                                            GList                       
*proposals,
+                                                                            gboolean                     
finished);
 GTK_SOURCE_AVAILABLE_IN_ALL
-gboolean                       gtk_source_completion_context_get_iter       (GtkSourceCompletionContext  
*context,
-                                                                             GtkTextIter                 
*iter);
+gboolean                      gtk_source_completion_context_get_iter       (GtkSourceCompletionContext  
*context,
+                                                                            GtkTextIter                 
*iter);
 GTK_SOURCE_AVAILABLE_IN_ALL
-GtkSourceCompletionActivation  gtk_source_completion_context_get_activation (GtkSourceCompletionContext  
*context);
-G_GNUC_INTERNAL
-GtkSourceCompletionContext    *_gtk_source_completion_context_new           (GtkSourceCompletion         
*completion,
-                                                                             GtkTextIter                 
*position);
-G_GNUC_INTERNAL
-void                           _gtk_source_completion_context_cancel        (GtkSourceCompletionContext  
*context);
+GtkSourceCompletionActivation gtk_source_completion_context_get_activation (GtkSourceCompletionContext  
*context);
 
 G_END_DECLS
diff --git a/gtksourceview/gtksourcecompletioninfo-private.h b/gtksourceview/gtksourcecompletioninfo-private.h
new file mode 100644
index 00000000..d5998818
--- /dev/null
+++ b/gtksourceview/gtksourcecompletioninfo-private.h
@@ -0,0 +1,32 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; coding: utf-8 -*-
+ *
+ * This file is part of GtkSourceView
+ *
+ * Copyright 2007 - 2009 Jesús Barbero Rodríguez <chuchiperriman gmail com>
+ * Copyright 2009 - Jesse van den Kieboom <jessevdk gnome org>
+ *
+ * GtkSourceView is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * GtkSourceView is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this library; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#include "gtksourcecompletioninfo.h"
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL
+void _gtk_source_completion_info_set_xoffset (GtkSourceCompletionInfo *info,
+                                              gint                     xoffset);
+
+G_END_DECLS
diff --git a/gtksourceview/gtksourcecompletioninfo.c b/gtksourceview/gtksourcecompletioninfo.c
index b8d2db00..93884df5 100644
--- a/gtksourceview/gtksourcecompletioninfo.c
+++ b/gtksourceview/gtksourcecompletioninfo.c
@@ -57,9 +57,10 @@
 
 #include "config.h"
 
-#include "gtksourcecompletioninfo.h"
 #include <glib/gi18n-lib.h>
 
+#include "gtksourcecompletioninfo-private.h"
+
 struct _GtkSourceCompletionInfo
 {
        GtkWindow parent_instance;
diff --git a/gtksourceview/gtksourcecompletioninfo.h b/gtksourceview/gtksourcecompletioninfo.h
index 423dce7e..25be7392 100644
--- a/gtksourceview/gtksourcecompletioninfo.h
+++ b/gtksourceview/gtksourcecompletioninfo.h
@@ -41,8 +41,5 @@ GTK_SOURCE_AVAILABLE_IN_ALL
 void                     gtk_source_completion_info_move_to_iter (GtkSourceCompletionInfo *info,
                                                                   GtkTextView             *view,
                                                                   GtkTextIter             *iter);
-G_GNUC_INTERNAL
-void                     _gtk_source_completion_info_set_xoffset (GtkSourceCompletionInfo *info,
-                                                                  gint                     xoffset);
 
 G_END_DECLS
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index baa8750c..aaede543 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -4951,7 +4951,7 @@ gtk_source_view_get_completion (GtkSourceView *view)
 
        if (priv->completion == NULL)
        {
-               priv->completion = gtk_source_completion_new (view);
+               priv->completion = _gtk_source_completion_new (view);
        }
 
        return priv->completion;


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