Debian Codegraph @

gtksourceview/gtksourcesnippet-private.h

raw symbols SCIP
1 /*
2 * This file is part of GtkSourceView
3 *
4 * Copyright 2020 Christian Hergert <[email protected]>
5 *
6 * GtkSourceView is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * GtkSourceView is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this library; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #pragma once
21
22 #include "gtksourcesnippet.h"
23 #include "gtksourcesnippetchunk.h"
24 #include "gtksourcesnippetcontext.h"
25
26 G_BEGIN_DECLS
27
28 struct _GtkSourceSnippet
29 {
30 GObject parent_instance;
31
32 GtkSourceSnippetContext *context;
33 GtkTextBuffer *buffer;
34
35 GQueue chunks;
36 GtkSourceSnippetChunk *current_chunk;
37
38 GtkTextMark *begin_mark;
39 GtkTextMark *end_mark;
40 gchar *trigger;
41 const gchar *language_id;
42 gchar *description;
43 gchar *name;
44
45 /* This is used to track the insert position within a snippet
46 * while we make transforms. We don't use marks here because
47 * the gravity of the mark is not enough o assure we end up
48 * at the correct position. So instead we are relative to the
49 * beginning of the snippet.
50 */
51 gint saved_insert_pos;
52
53 gint focus_position;
54 gint max_focus_position;
55
56 guint inserted : 1;
57 };
58
59
60 void _gtk_source_snippet_replace_current_chunk_text (GtkSourceSnippet *self,
61 const gchar *new_text);
62 gchar *_gtk_source_snippet_get_edited_text (GtkSourceSnippet *self);
63 gboolean _gtk_source_snippet_begin (GtkSourceSnippet *self,
64 GtkSourceBuffer *buffer,
65 GtkTextIter *iter);
66 void _gtk_source_snippet_finish (GtkSourceSnippet *self);
67 gboolean _gtk_source_snippet_move_next (GtkSourceSnippet *self);
68 gboolean _gtk_source_snippet_move_previous (GtkSourceSnippet *self);
69 void _gtk_source_snippet_after_insert_text (GtkSourceSnippet *self,
70 GtkTextBuffer *buffer,
71 GtkTextIter *iter,
72 const gchar *text,
73 gint len);
74 void _gtk_source_snippet_after_delete_range (GtkSourceSnippet *self,
75 GtkTextBuffer *buffer,
76 GtkTextIter *begin,
77 GtkTextIter *end);
78 gboolean _gtk_source_snippet_insert_set (GtkSourceSnippet *self,
79 GtkTextMark *mark);
80 guint _gtk_source_snippet_count_affected_chunks (GtkSourceSnippet *snippet,
81 const GtkTextIter *begin,
82 const GtkTextIter *end);
83 gboolean _gtk_source_snippet_contains_range (GtkSourceSnippet *snippet,
84 const GtkTextIter *begin,
85 const GtkTextIter *end);
86
87 G_END_DECLS