[gtksourceview/wip/chergert/gsv-gtk4] snippets: move definition to private header



commit 0d84cbc446f020625cfde5a0549f8e0fba2a52eb
Author: Christian Hergert <chergert redhat com>
Date:   Wed Sep 9 14:33:07 2020 -0700

    snippets: move definition to private header
    
    We can access this in various places to avoid extra internal API.

 gtksourceview/gtksourcesnippet-private.h | 51 +++++++++++++++++++++++---------
 gtksourceview/gtksourcesnippet.c         | 31 -------------------
 2 files changed, 37 insertions(+), 45 deletions(-)
---
diff --git a/gtksourceview/gtksourcesnippet-private.h b/gtksourceview/gtksourcesnippet-private.h
index cdcafc86..b6137691 100644
--- a/gtksourceview/gtksourcesnippet-private.h
+++ b/gtksourceview/gtksourcesnippet-private.h
@@ -17,46 +17,69 @@
  * along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 
- #pragma once
+#pragma once
 
- #include "gtksourcesnippet.h"
+#include "gtksourcesnippet.h"
+#include "gtksourcesnippetchunk.h"
+#include "gtksourcesnippetcontext.h"
+
+G_BEGIN_DECLS
+
+struct _GtkSourceSnippet
+{
+       GObject                  parent_instance;
+
+       GtkSourceSnippetContext *context;
+       GtkTextBuffer           *buffer;
+
+       GQueue                   chunks;
+       GtkSourceSnippetChunk   *current_chunk;
+
+       GtkTextMark             *begin_mark;
+       GtkTextMark             *end_mark;
+       gchar                   *trigger;
+       const gchar             *language_id;
+       gchar                   *description;
+       gchar                   *name;
+
+       /* This is used to track the insert position within a snippet
+        * while we make transforms. We don't use marks here because
+        * the gravity of the mark is not enought o assure we end up
+        * at the correct position. So instead we are relative to the
+        * beginning of the snippet.
+        */
+       gint                     saved_insert_pos;
+
+       gint                     focus_position;
+       gint                     max_focus_position;
+
+       guint                    inserted : 1;
+};
 
- G_BEGIN_DECLS
 
-G_GNUC_INTERNAL
 void         _gtk_source_snippet_replace_current_chunk_text (GtkSourceSnippet  *self,
                                                              const gchar       *new_text);
-G_GNUC_INTERNAL
 gchar       *_gtk_source_snippet_get_edited_text            (GtkSourceSnippet  *self);
-G_GNUC_INTERNAL
 gboolean     _gtk_source_snippet_begin                      (GtkSourceSnippet  *self,
                                                              GtkSourceBuffer   *buffer,
                                                              GtkTextIter       *iter);
-G_GNUC_INTERNAL
 void         _gtk_source_snippet_finish                     (GtkSourceSnippet  *self);
-G_GNUC_INTERNAL
 gboolean     _gtk_source_snippet_move_next                  (GtkSourceSnippet  *self);
-G_GNUC_INTERNAL
 gboolean     _gtk_source_snippet_move_previous              (GtkSourceSnippet  *self);
-G_GNUC_INTERNAL
 void         _gtk_source_snippet_after_insert_text          (GtkSourceSnippet  *self,
                                                              GtkTextBuffer     *buffer,
                                                              GtkTextIter       *iter,
                                                              const gchar       *text,
                                                              gint               len);
-G_GNUC_INTERNAL
 void         _gtk_source_snippet_after_delete_range         (GtkSourceSnippet  *self,
                                                              GtkTextBuffer     *buffer,
                                                              GtkTextIter       *begin,
                                                              GtkTextIter       *end);
-G_GNUC_INTERNAL
 gboolean     _gtk_source_snippet_insert_set                 (GtkSourceSnippet  *self,
                                                              GtkTextMark       *mark);
-G_GNUC_INTERNAL
 guint        _gtk_source_snippet_count_affected_chunks      (GtkSourceSnippet  *snippet,
                                                              const GtkTextIter *begin,
                                                              const GtkTextIter *end);
-G_GNUC_INTERNAL
 gboolean     _gtk_source_snippet_contains_range             (GtkSourceSnippet  *snippet,
                                                              const GtkTextIter *begin,
                                                              const GtkTextIter *end);
diff --git a/gtksourceview/gtksourcesnippet.c b/gtksourceview/gtksourcesnippet.c
index b1bc5912..4010b14d 100644
--- a/gtksourceview/gtksourcesnippet.c
+++ b/gtksourceview/gtksourcesnippet.c
@@ -47,37 +47,6 @@
  * Since: 5.0
  */
 
-struct _GtkSourceSnippet
-{
-       GObject                  parent_instance;
-
-       GtkSourceSnippetContext *context;
-       GtkTextBuffer           *buffer;
-
-       GQueue                   chunks;
-       GtkSourceSnippetChunk   *current_chunk;
-
-       GtkTextMark             *begin_mark;
-       GtkTextMark             *end_mark;
-       gchar                   *trigger;
-       const gchar             *language_id;
-       gchar                   *description;
-       gchar                   *name;
-
-       /* This is used to track the insert position within a snippet
-        * while we make transforms. We don't use marks here because
-        * the gravity of the mark is not enought o assure we end up
-        * at the correct position. So instead we are relative to the
-        * beginning of the snippet.
-        */
-       gint                     saved_insert_pos;
-
-       gint                     focus_position;
-       gint                     max_focus_position;
-
-       guint                    inserted : 1;
-};
-
 G_DEFINE_TYPE (GtkSourceSnippet, gtk_source_snippet, G_TYPE_OBJECT)
 
 enum {


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