[gtksourceview/wip/chergert/snippets] consistent naming, fix some movement bugs
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/snippets] consistent naming, fix some movement bugs
- Date: Fri, 24 Jan 2020 22:26:47 +0000 (UTC)
commit 0e0243e463df55a9148ae3eef4ff56fa62aff382
Author: Christian Hergert <chergert redhat com>
Date: Fri Jan 24 14:26:49 2020 -0800
consistent naming, fix some movement bugs
gtksourceview/gtksourcesnippet.c | 502 ++++++++++++++++++++-------------------
gtksourceview/gtksourcesnippet.h | 24 +-
2 files changed, 274 insertions(+), 252 deletions(-)
---
diff --git a/gtksourceview/gtksourcesnippet.c b/gtksourceview/gtksourcesnippet.c
index 187916c2..bc490551 100644
--- a/gtksourceview/gtksourcesnippet.c
+++ b/gtksourceview/gtksourcesnippet.c
@@ -73,14 +73,14 @@ enum {
static GParamSpec *properties [N_PROPS];
static void gtk_source_snippet_update_marks (GtkSourceSnippet *snippet);
-static void gtk_source_snippet_update_tags (GtkSourceSnippet *self);
+static void gtk_source_snippet_update_tags (GtkSourceSnippet *snippet);
static inline void
-print_chunk_positions (GtkSourceSnippet *self)
+print_chunk_positions (GtkSourceSnippet *snippet)
{
guint i = 0;
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
GtkTextIter begin, end;
@@ -88,13 +88,14 @@ print_chunk_positions (GtkSourceSnippet *self)
if (_gtk_source_snippet_chunk_get_bounds (chunk, &begin, &end))
{
gchar *real_text = gtk_text_iter_get_slice (&begin, &end);
- g_printerr (" Chunk %-2u: %u:%u to %u:%u - %s\n",
+ g_printerr (" Chunk %-2u: %u:%u to %u:%u - %s (text-set=%d)\n",
i,
gtk_text_iter_get_line (&begin),
gtk_text_iter_get_line_offset (&begin),
gtk_text_iter_get_line (&end),
gtk_text_iter_get_line_offset (&end),
- real_text);
+ real_text,
+ gtk_source_snippet_chunk_get_text_set (chunk));
g_free (real_text);
}
@@ -173,7 +174,7 @@ gtk_source_snippet_new (const gchar *trigger,
/**
* gtk_source_snippet_copy:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Does a deep copy of the snippet.
*
@@ -182,19 +183,19 @@ gtk_source_snippet_new (const gchar *trigger,
* Since: 5.0
*/
GtkSourceSnippet *
-gtk_source_snippet_copy (GtkSourceSnippet *self)
+gtk_source_snippet_copy (GtkSourceSnippet *snippet)
{
GtkSourceSnippet *ret;
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
ret = g_object_new (GTK_SOURCE_TYPE_SNIPPET,
- "trigger", self->trigger,
- "language-id", self->language_id,
- "description", self->description,
+ "trigger", snippet->trigger,
+ "language-id", snippet->language_id,
+ "description", snippet->description,
NULL);
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *old_chunk = l->data;
GtkSourceSnippetChunk *new_chunk = gtk_source_snippet_chunk_copy (old_chunk);
@@ -207,7 +208,7 @@ gtk_source_snippet_copy (GtkSourceSnippet *self)
/**
* gtk_source_snippet_get_focus_position:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Gets the current focus for the snippet. This is changed
* as the user tabs through focus locations.
@@ -217,16 +218,16 @@ gtk_source_snippet_copy (GtkSourceSnippet *self)
* Since: 5.0
*/
gint
-gtk_source_snippet_get_focus_position (GtkSourceSnippet *self)
+gtk_source_snippet_get_focus_position (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), -1);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), -1);
- return self->focus_position;
+ return snippet->focus_position;
}
/**
* gtk_source_snippet_get_n_chunks:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Gets the number of chunks in the snippet.
*
@@ -237,16 +238,16 @@ gtk_source_snippet_get_focus_position (GtkSourceSnippet *self)
* Since: 5.0
*/
guint
-gtk_source_snippet_get_n_chunks (GtkSourceSnippet *self)
+gtk_source_snippet_get_n_chunks (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), 0);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), 0);
- return self->chunks.length;
+ return snippet->chunks.length;
}
/**
* gtk_source_snippet_get_nth_chunk:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
* @nth: the nth chunk to get
*
* Gets the chunk at @nth.
@@ -256,20 +257,20 @@ gtk_source_snippet_get_n_chunks (GtkSourceSnippet *self)
* Since: 5.0
*/
GtkSourceSnippetChunk *
-gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *self,
+gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *snippet,
guint nth)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), 0);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), 0);
- if (nth < self->chunks.length)
- return g_queue_peek_nth (&self->chunks, nth);
+ if (nth < snippet->chunks.length)
+ return g_queue_peek_nth (&snippet->chunks, nth);
return NULL;
}
/**
* gtk_source_snippet_get_trigger:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Gets the trigger for the source snippet. A trigger is
* a word that can be expanded into the full snippet when
@@ -280,16 +281,16 @@ gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *self,
* Since: 5.0
*/
const gchar *
-gtk_source_snippet_get_trigger (GtkSourceSnippet *self)
+gtk_source_snippet_get_trigger (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- return self->trigger;
+ return snippet->trigger;
}
/**
* gtk_source_snippet_set_trigger:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
* @trigger: the trigger word
*
* Sets the trigger for the snippet.
@@ -297,23 +298,23 @@ gtk_source_snippet_get_trigger (GtkSourceSnippet *self)
* Since: 5.0
*/
void
-gtk_source_snippet_set_trigger (GtkSourceSnippet *self,
+gtk_source_snippet_set_trigger (GtkSourceSnippet *snippet,
const gchar *trigger)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- if (g_strcmp0 (trigger, self->trigger) != 0)
+ if (g_strcmp0 (trigger, snippet->trigger) != 0)
{
- g_free (self->trigger);
- self->trigger = g_strdup (trigger);
- g_object_notify_by_pspec (G_OBJECT (self),
+ g_free (snippet->trigger);
+ snippet->trigger = g_strdup (trigger);
+ g_object_notify_by_pspec (G_OBJECT (snippet),
properties [PROP_TRIGGER]);
}
}
/**
* gtk_source_snippet_get_language_id:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Gets the language-id used for the source snippet.
*
@@ -325,16 +326,16 @@ gtk_source_snippet_set_trigger (GtkSourceSnippet *self,
* Since: 5.0
*/
const gchar *
-gtk_source_snippet_get_language_id (GtkSourceSnippet *self)
+gtk_source_snippet_get_language_id (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- return self->language_id;
+ return snippet->language_id;
}
/**
* gtk_source_snippet_set_language_id:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
* @language_id: the language identifier for the snippet
*
* Sets the language identifier for the snippet.
@@ -344,40 +345,40 @@ gtk_source_snippet_get_language_id (GtkSourceSnippet *self)
* Since: 5.0
*/
void
-gtk_source_snippet_set_language_id (GtkSourceSnippet *self,
+gtk_source_snippet_set_language_id (GtkSourceSnippet *snippet,
const gchar *language_id)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
language_id = g_intern_string (language_id);
- if (language_id != self->language_id)
+ if (language_id != snippet->language_id)
{
- self->language_id = language_id;
- g_object_notify_by_pspec (G_OBJECT (self),
+ snippet->language_id = language_id;
+ g_object_notify_by_pspec (G_OBJECT (snippet),
properties [PROP_LANGUAGE_ID]);
}
}
/**
* gtk_source_snippet_get_description:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
*
* Gets the description for the snippet.
*
* Since: 5.0
*/
const gchar *
-gtk_source_snippet_get_description (GtkSourceSnippet *self)
+gtk_source_snippet_get_description (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- return self->description;
+ return snippet->description;
}
/**
* gtk_source_snippet_set_description:
- * @self: a #GtkSourceSnippet
+ * @snippet: a #GtkSourceSnippet
* @description: the snippet description
*
* Sets the description for the snippet.
@@ -385,36 +386,36 @@ gtk_source_snippet_get_description (GtkSourceSnippet *self)
* Since: 5.0
*/
void
-gtk_source_snippet_set_description (GtkSourceSnippet *self,
+gtk_source_snippet_set_description (GtkSourceSnippet *snippet,
const gchar *description)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- if (g_strcmp0 (description, self->description) != 0)
+ if (g_strcmp0 (description, snippet->description) != 0)
{
- g_free (self->description);
- self->description = g_strdup (description);
- g_object_notify_by_pspec (G_OBJECT (self),
+ g_free (snippet->description);
+ snippet->description = g_strdup (description);
+ g_object_notify_by_pspec (G_OBJECT (snippet),
properties [PROP_DESCRIPTION]);
}
}
gboolean
-_gtk_source_snippet_insert_set (GtkSourceSnippet *self,
+_gtk_source_snippet_insert_set (GtkSourceSnippet *snippet,
GtkTextMark *mark)
{
GtkTextIter begin;
GtkTextIter end;
GtkTextIter iter;
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), FALSE);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), FALSE);
g_return_val_if_fail (GTK_IS_TEXT_MARK (mark), FALSE);
- g_return_val_if_fail (self->current_chunk != NULL, FALSE);
- g_return_val_if_fail (self->buffer != NULL, FALSE);
+ g_return_val_if_fail (snippet->current_chunk != NULL, FALSE);
+ g_return_val_if_fail (snippet->buffer != NULL, FALSE);
- gtk_text_buffer_get_iter_at_mark (self->buffer, &iter, mark);
+ gtk_text_buffer_get_iter_at_mark (snippet->buffer, &iter, mark);
- if (_gtk_source_snippet_chunk_get_bounds (self->current_chunk, &begin, &end))
+ if (_gtk_source_snippet_chunk_get_bounds (snippet->current_chunk, &begin, &end))
{
return gtk_text_iter_compare (&begin, &iter) <= 0 &&
gtk_text_iter_compare (&end, &iter) >= 0;
@@ -424,13 +425,13 @@ _gtk_source_snippet_insert_set (GtkSourceSnippet *self,
}
static void
-gtk_source_snippet_select_chunk (GtkSourceSnippet *self,
+gtk_source_snippet_select_chunk (GtkSourceSnippet *snippet,
GtkSourceSnippetChunk *chunk)
{
GtkTextIter begin;
GtkTextIter end;
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
g_return_if_fail (GTK_SOURCE_IS_SNIPPET_CHUNK (chunk));
_gtk_source_snippet_chunk_get_bounds (chunk, &begin, &end);
@@ -444,16 +445,16 @@ gtk_source_snippet_select_chunk (GtkSourceSnippet *self,
gtk_text_iter_get_offset (&begin),
gtk_text_iter_get_offset (&end) - gtk_text_iter_get_offset (&begin));
- self->current_chunk = chunk;
+ snippet->current_chunk = chunk;
- gtk_text_buffer_select_range (self->buffer, &begin, &end);
+ gtk_text_buffer_select_range (snippet->buffer, &begin, &end);
#ifndef G_DISABLE_ASSERT
{
GtkTextIter set_begin;
GtkTextIter set_end;
- gtk_text_buffer_get_selection_bounds (self->buffer, &set_begin, &set_end);
+ gtk_text_buffer_get_selection_bounds (snippet->buffer, &set_begin, &set_end);
g_assert (gtk_text_iter_equal (&set_begin, &begin));
g_assert (gtk_text_iter_equal (&set_end, &end));
@@ -462,74 +463,76 @@ gtk_source_snippet_select_chunk (GtkSourceSnippet *self,
}
gboolean
-_gtk_source_snippet_move_next (GtkSourceSnippet *self)
+_gtk_source_snippet_move_next (GtkSourceSnippet *snippet)
{
GtkTextIter iter;
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), FALSE);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), FALSE);
- self->focus_position++;
+ print_chunk_positions (snippet);
- for (const GList *l = self->chunks.head; l; l = l->next)
+ snippet->focus_position++;
+
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
- if (gtk_source_snippet_chunk_get_focus_position (chunk) == self->focus_position)
+ if (gtk_source_snippet_chunk_get_focus_position (chunk) == snippet->focus_position)
{
- gtk_source_snippet_select_chunk (self, chunk);
+ gtk_source_snippet_select_chunk (snippet, chunk);
return TRUE;
}
}
- for (const GList *l = self->chunks.tail; l; l = l->prev)
+ for (const GList *l = snippet->chunks.tail; l; l = l->prev)
{
GtkSourceSnippetChunk *chunk = l->data;
if (gtk_source_snippet_chunk_get_focus_position (chunk) == 0)
{
- gtk_source_snippet_select_chunk (self, chunk);
+ gtk_source_snippet_select_chunk (snippet, chunk);
return FALSE;
}
}
g_debug ("No more tab stops, moving to end of snippet");
- self->current_chunk = NULL;
- gtk_text_buffer_get_iter_at_mark (self->buffer, &iter, self->mark_end);
- gtk_text_buffer_select_range (self->buffer, &iter, &iter);
+ snippet->current_chunk = NULL;
+ gtk_text_buffer_get_iter_at_mark (snippet->buffer, &iter, snippet->mark_end);
+ gtk_text_buffer_select_range (snippet->buffer, &iter, &iter);
return FALSE;
}
gboolean
-_gtk_source_snippet_move_previous (GtkSourceSnippet *self)
+_gtk_source_snippet_move_previous (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), FALSE);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), FALSE);
- if (self->focus_position <= 1)
+ if (snippet->focus_position <= 1)
{
GtkTextIter iter;
/* Nothing to select before this position, just move
* the insertion mark to the beginning of the snippet.
*/
- gtk_text_buffer_get_iter_at_mark (self->buffer,
+ gtk_text_buffer_get_iter_at_mark (snippet->buffer,
&iter,
- self->mark_begin);
- gtk_text_buffer_select_range (self->buffer, &iter, &iter);
+ snippet->mark_begin);
+ gtk_text_buffer_select_range (snippet->buffer, &iter, &iter);
return FALSE;
}
- self->focus_position--;
+ snippet->focus_position--;
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
- if (gtk_source_snippet_chunk_get_focus_position (chunk) == self->focus_position)
+ if (gtk_source_snippet_chunk_get_focus_position (chunk) == snippet->focus_position)
{
- gtk_source_snippet_select_chunk (self, chunk);
+ gtk_source_snippet_select_chunk (snippet, chunk);
return TRUE;
}
}
@@ -538,22 +541,22 @@ _gtk_source_snippet_move_previous (GtkSourceSnippet *self)
}
static void
-gtk_source_snippet_update_context (GtkSourceSnippet *self)
+gtk_source_snippet_update_context (GtkSourceSnippet *snippet)
{
GtkSourceSnippetContext *context;
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- if (self->chunks.length == 0)
+ if (snippet->chunks.length == 0)
{
return;
}
- context = gtk_source_snippet_get_context (self);
+ context = gtk_source_snippet_get_context (snippet);
_gtk_source_snippet_context_emit_changed (context);
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
gint focus_position;
@@ -582,21 +585,21 @@ gtk_source_snippet_update_context (GtkSourceSnippet *self)
}
static void
-gtk_source_snippet_clear_tags (GtkSourceSnippet *self)
+gtk_source_snippet_clear_tags (GtkSourceSnippet *snippet)
{
- g_assert (GTK_SOURCE_IS_SNIPPET (self));
+ g_assert (GTK_SOURCE_IS_SNIPPET (snippet));
- if (self->mark_begin != NULL && self->mark_end != NULL)
+ if (snippet->mark_begin != NULL && snippet->mark_end != NULL)
{
GtkTextBuffer *buffer;
GtkTextIter begin;
GtkTextIter end;
GtkTextTag *tag;
- buffer = gtk_text_mark_get_buffer (self->mark_begin);
+ buffer = gtk_text_mark_get_buffer (snippet->mark_begin);
- gtk_text_buffer_get_iter_at_mark (buffer, &begin, self->mark_begin);
- gtk_text_buffer_get_iter_at_mark (buffer, &end, self->mark_end);
+ gtk_text_buffer_get_iter_at_mark (buffer, &begin, snippet->mark_begin);
+ gtk_text_buffer_get_iter_at_mark (buffer, &end, snippet->mark_end);
tag = _gtk_source_buffer_get_snippet_focus_tag (GTK_SOURCE_BUFFER (buffer));
@@ -605,19 +608,19 @@ gtk_source_snippet_clear_tags (GtkSourceSnippet *self)
}
static void
-gtk_source_snippet_update_tags (GtkSourceSnippet *self)
+gtk_source_snippet_update_tags (GtkSourceSnippet *snippet)
{
GtkTextBuffer *buffer;
GtkTextTag *tag;
- g_assert (GTK_SOURCE_IS_SNIPPET (self));
+ g_assert (GTK_SOURCE_IS_SNIPPET (snippet));
- gtk_source_snippet_clear_tags (self);
+ gtk_source_snippet_clear_tags (snippet);
- buffer = gtk_text_mark_get_buffer (self->mark_begin);
+ buffer = gtk_text_mark_get_buffer (snippet->mark_begin);
tag = _gtk_source_buffer_get_snippet_focus_tag (GTK_SOURCE_BUFFER (buffer));
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
gint focus_position = gtk_source_snippet_chunk_get_focus_position (chunk);
@@ -634,39 +637,39 @@ gtk_source_snippet_update_tags (GtkSourceSnippet *self)
}
gboolean
-_gtk_source_snippet_begin (GtkSourceSnippet *self,
+_gtk_source_snippet_begin (GtkSourceSnippet *snippet,
GtkTextBuffer *buffer,
GtkTextIter *iter)
{
GtkSourceSnippetContext *context;
GtkTextMark *mark;
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), FALSE);
- g_return_val_if_fail (!self->buffer, FALSE);
- g_return_val_if_fail (!self->mark_begin, FALSE);
- g_return_val_if_fail (!self->mark_end, FALSE);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), FALSE);
+ g_return_val_if_fail (!snippet->buffer, FALSE);
+ g_return_val_if_fail (!snippet->mark_begin, FALSE);
+ g_return_val_if_fail (!snippet->mark_end, FALSE);
g_return_val_if_fail (GTK_IS_TEXT_BUFFER (buffer), FALSE);
g_return_val_if_fail (iter, FALSE);
- self->inserted = TRUE;
+ snippet->inserted = TRUE;
- context = gtk_source_snippet_get_context (self);
+ context = gtk_source_snippet_get_context (snippet);
- gtk_source_snippet_update_context (self);
+ gtk_source_snippet_update_context (snippet);
_gtk_source_snippet_context_emit_changed (context);
- gtk_source_snippet_update_context (self);
+ gtk_source_snippet_update_context (snippet);
- self->buffer = g_object_ref (buffer);
+ snippet->buffer = g_object_ref (buffer);
mark = gtk_text_buffer_create_mark (buffer, NULL, iter, TRUE);
- self->mark_begin = g_object_ref (mark);
+ snippet->mark_begin = g_object_ref (mark);
mark = gtk_text_buffer_create_mark (buffer, NULL, iter, FALSE);
- self->mark_end = g_object_ref (mark);
+ snippet->mark_end = g_object_ref (mark);
gtk_text_buffer_begin_user_action (buffer);
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
GtkTextMark *begin;
@@ -683,54 +686,56 @@ _gtk_source_snippet_begin (GtkSourceSnippet *self,
if (text != NULL && text[0] != 0)
{
- self->current_chunk = chunk;
+ snippet->current_chunk = chunk;
gtk_text_buffer_insert (buffer, iter, text, -1);
- gtk_source_snippet_update_marks (self);
+ gtk_source_snippet_update_marks (snippet);
}
}
- self->current_chunk = NULL;
+ snippet->current_chunk = NULL;
gtk_text_buffer_end_user_action (buffer);
- gtk_source_snippet_update_tags (self);
+ gtk_source_snippet_update_tags (snippet);
- return _gtk_source_snippet_move_next (self);
+ print_chunk_positions (snippet);
+
+ return _gtk_source_snippet_move_next (snippet);
}
void
-_gtk_source_snippet_finish (GtkSourceSnippet *self)
+_gtk_source_snippet_finish (GtkSourceSnippet *snippet)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- gtk_source_snippet_clear_tags (self);
+ gtk_source_snippet_clear_tags (snippet);
- g_clear_object (&self->mark_begin);
- g_clear_object (&self->mark_end);
- g_clear_object (&self->buffer);
+ g_clear_object (&snippet->mark_begin);
+ g_clear_object (&snippet->mark_end);
+ g_clear_object (&snippet->buffer);
}
void
-gtk_source_snippet_add_chunk (GtkSourceSnippet *self,
+gtk_source_snippet_add_chunk (GtkSourceSnippet *snippet,
GtkSourceSnippetChunk *chunk)
{
gint focus_position;
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
g_return_if_fail (GTK_SOURCE_IS_SNIPPET_CHUNK (chunk));
- g_return_if_fail (!self->inserted);
+ g_return_if_fail (!snippet->inserted);
g_return_if_fail (chunk->link.data != NULL);
g_return_if_fail (chunk->link.prev == NULL);
g_return_if_fail (chunk->link.next == NULL);
g_object_ref_sink (chunk);
- g_queue_push_tail_link (&self->chunks, &chunk->link);
+ g_queue_push_tail_link (&snippet->chunks, &chunk->link);
- gtk_source_snippet_chunk_set_context (chunk, self->context);
+ gtk_source_snippet_chunk_set_context (chunk, snippet->context);
focus_position = gtk_source_snippet_chunk_get_focus_position (chunk);
- self->max_focus_position = MAX (self->max_focus_position, focus_position);
+ snippet->max_focus_position = MAX (snippet->max_focus_position, focus_position);
}
static void
@@ -811,7 +816,7 @@ gtk_source_snippet_update_marks (GtkSourceSnippet *snippet)
}
}
- for (const GList *l = current->link.next; l; l = l->prev)
+ for (const GList *l = current->link.next; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
GtkTextMark *mark;
@@ -838,15 +843,15 @@ gtk_source_snippet_update_marks (GtkSourceSnippet *snippet)
}
static void
-gtk_source_snippet_rewrite_updated_chunks (GtkSourceSnippet *self)
+gtk_source_snippet_rewrite_updated_chunks (GtkSourceSnippet *snippet)
{
- GtkSourceSnippetChunk *current;
+ GtkSourceSnippetChunk *saved;
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- current = self->current_chunk;
+ saved = snippet->current_chunk;
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
GtkTextIter begin;
@@ -857,7 +862,7 @@ gtk_source_snippet_rewrite_updated_chunks (GtkSourceSnippet *self)
/* Temporarily set current chunk to help other utilities
* to adjust marks appropriately.
*/
- self->current_chunk = chunk;
+ snippet->current_chunk = chunk;
_gtk_source_snippet_chunk_get_bounds (chunk, &begin, &end);
real_text = gtk_text_iter_get_slice (&begin, &end);
@@ -866,42 +871,42 @@ gtk_source_snippet_rewrite_updated_chunks (GtkSourceSnippet *self)
if (g_strcmp0 (text, real_text) != 0)
{
- gtk_text_buffer_delete (self->buffer, &begin, &end);
- gtk_text_buffer_insert (self->buffer, &begin, real_text, -1);
- gtk_source_snippet_update_marks (self);
+ gtk_text_buffer_delete (snippet->buffer, &begin, &end);
+ gtk_text_buffer_insert (snippet->buffer, &begin, real_text, -1);
+ gtk_source_snippet_update_marks (snippet);
}
g_free (real_text);
}
- self->current_chunk = current;
+ snippet->current_chunk = saved;
}
void
-_gtk_source_snippet_before_insert_text (GtkSourceSnippet *self,
+_gtk_source_snippet_before_insert_text (GtkSourceSnippet *snippet,
GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
- g_return_if_fail (self->current_chunk != NULL);
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
+ g_return_if_fail (snippet->current_chunk != NULL);
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
}
void
-_gtk_source_snippet_after_insert_text (GtkSourceSnippet *self,
+_gtk_source_snippet_after_insert_text (GtkSourceSnippet *snippet,
GtkTextBuffer *buffer,
GtkTextIter *iter,
const gchar *text,
gint len)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
- g_return_if_fail (self->current_chunk != NULL);
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
+ g_return_if_fail (snippet->current_chunk != NULL);
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (iter != NULL);
- g_return_if_fail (self->current_chunk != NULL);
+ g_return_if_fail (snippet->current_chunk != NULL);
/* This function is guaranteed to only be called once for the
* actual insert by gtksourceview-snippets.c. That allows us
@@ -912,39 +917,39 @@ _gtk_source_snippet_after_insert_text (GtkSourceSnippet *self,
/* Save our insert position so we can restore it after updating
* linked chunks (which could be rewritten).
*/
- gtk_source_snippet_save_insert (self);
+ gtk_source_snippet_save_insert (snippet);
/* Now save the modified text for the iter in question */
- _gtk_source_snippet_chunk_save_text (self->current_chunk);
+ _gtk_source_snippet_chunk_save_text (snippet->current_chunk);
/* First we want to update marks from the inserted text */
- gtk_source_snippet_update_marks (self);
+ gtk_source_snippet_update_marks (snippet);
/* Update the context (two passes to ensure that we handle chunks
* referencing chunks which come after themselves in the array).
*/
- gtk_source_snippet_update_context (self);
- gtk_source_snippet_update_context (self);
+ gtk_source_snippet_update_context (snippet);
+ gtk_source_snippet_update_context (snippet);
/* Now go and rewrite each chunk that has changed. This may also
* update marks after each pass so that text marks don't overlap.
*/
- gtk_source_snippet_rewrite_updated_chunks (self);
+ gtk_source_snippet_rewrite_updated_chunks (snippet);
/* Now we can apply tags for the given chunks */
- gtk_source_snippet_update_tags (self);
+ gtk_source_snippet_update_tags (snippet);
/* Place the insertion cursor back where the user expects it */
- gtk_source_snippet_restore_insert (self);
+ gtk_source_snippet_restore_insert (snippet);
}
void
-_gtk_source_snippet_before_delete_range (GtkSourceSnippet *self,
+_gtk_source_snippet_before_delete_range (GtkSourceSnippet *snippet,
GtkTextBuffer *buffer,
GtkTextIter *begin,
GtkTextIter *end)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (begin != NULL);
g_return_if_fail (end != NULL);
@@ -952,42 +957,42 @@ _gtk_source_snippet_before_delete_range (GtkSourceSnippet *self,
}
void
-_gtk_source_snippet_after_delete_range (GtkSourceSnippet *self,
+_gtk_source_snippet_after_delete_range (GtkSourceSnippet *snippet,
GtkTextBuffer *buffer,
GtkTextIter *begin,
GtkTextIter *end)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
g_return_if_fail (begin != NULL);
g_return_if_fail (end != NULL);
- g_return_if_fail (self->current_chunk != NULL);
+ g_return_if_fail (snippet->current_chunk != NULL);
/* Now save the modified text for the iter in question */
- _gtk_source_snippet_chunk_save_text (self->current_chunk);
+ _gtk_source_snippet_chunk_save_text (snippet->current_chunk);
/* Stash our cursor position so we can restore it after changes */
- gtk_source_snippet_save_insert (self);
+ gtk_source_snippet_save_insert (snippet);
/* First update mark positions based on the deletions */
- gtk_source_snippet_update_marks (self);
+ gtk_source_snippet_update_marks (snippet);
/* Update the context (two passes to ensure that we handle chunks
* referencing chunks which come after themselves in the array).
*/
- gtk_source_snippet_update_context (self);
- gtk_source_snippet_update_context (self);
+ gtk_source_snippet_update_context (snippet);
+ gtk_source_snippet_update_context (snippet);
/* Now go and rewrite each chunk that has changed. This may also
* update marks after each pass so that text marks don't overlap.
*/
- gtk_source_snippet_rewrite_updated_chunks (self);
+ gtk_source_snippet_rewrite_updated_chunks (snippet);
/* Now update any scheme styling for focus positions */
- gtk_source_snippet_update_tags (self);
+ gtk_source_snippet_update_tags (snippet);
/* Place the insertion cursor back where the user expects it */
- gtk_source_snippet_restore_insert (self);
+ gtk_source_snippet_restore_insert (snippet);
}
guint
@@ -1001,6 +1006,11 @@ _gtk_source_snippet_count_affected_chunks (GtkSourceSnippet *snippet,
g_return_val_if_fail (begin != NULL, FALSE);
g_return_val_if_fail (end != NULL, FALSE);
+ if (gtk_text_iter_equal (begin, end))
+ {
+ return 0;
+ }
+
for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
@@ -1011,16 +1021,28 @@ _gtk_source_snippet_count_affected_chunks (GtkSourceSnippet *snippet,
{
/* We only care about this chunk if it's non-empty. As
* we may have multiple "empty" chunks if they are right
- * next to each other. Those can be safely ignored unless
- * we have a chunk after them which is also overlapped.
+ * next to each other. Those can be safely ignored
+ * unless we have a chunk after them which is also
+ * overlapped.
*/
- if (!gtk_text_iter_equal (&chunk_begin, &chunk_end))
+ if (gtk_text_iter_equal (&chunk_begin, &chunk_end))
+ {
+ continue;
+ }
+
+ /* Special case when we are deleting a whole chunk
+ * content that is non-empty.
+ */
+ if (gtk_text_iter_equal (begin, &chunk_begin) &&
+ gtk_text_iter_equal (end, &chunk_end))
+ {
+ return 1;
+ }
+
+ if (gtk_text_iter_compare (end, &chunk_begin) >= 0 &&
+ gtk_text_iter_compare (begin, &chunk_end) <= 0)
{
- if (gtk_text_iter_compare (end, &chunk_begin) >= 0 &&
- gtk_text_iter_compare (begin, &chunk_end) <= 0)
- {
- count++;
- }
+ count++;
}
}
}
@@ -1029,24 +1051,24 @@ _gtk_source_snippet_count_affected_chunks (GtkSourceSnippet *snippet,
}
GtkTextMark *
-_gtk_source_snippet_get_mark_begin (GtkSourceSnippet *self)
+_gtk_source_snippet_get_mark_begin (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- return self->mark_begin;
+ return snippet->mark_begin;
}
GtkTextMark *
-_gtk_source_snippet_get_mark_end (GtkSourceSnippet *self)
+_gtk_source_snippet_get_mark_end (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- return self->mark_end;
+ return snippet->mark_end;
}
/**
* gtk_source_snippet_get_context:
- * @self: an #GtkSourceSnippet
+ * @snippet: an #GtkSourceSnippet
*
* Get's the context used for expanding the snippet.
*
@@ -1055,52 +1077,52 @@ _gtk_source_snippet_get_mark_end (GtkSourceSnippet *self)
* Since: 5.0
*/
GtkSourceSnippetContext *
-gtk_source_snippet_get_context (GtkSourceSnippet *self)
+gtk_source_snippet_get_context (GtkSourceSnippet *snippet)
{
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- if (self->context == NULL)
+ if (snippet->context == NULL)
{
- self->context = gtk_source_snippet_context_new ();
+ snippet->context = gtk_source_snippet_context_new ();
- for (const GList *l = self->chunks.head; l; l = l->next)
+ for (const GList *l = snippet->chunks.head; l; l = l->next)
{
GtkSourceSnippetChunk *chunk = l->data;
- gtk_source_snippet_chunk_set_context (chunk, self->context);
+ gtk_source_snippet_chunk_set_context (chunk, snippet->context);
}
}
- return self->context;
+ return snippet->context;
}
static void
gtk_source_snippet_dispose (GObject *object)
{
- GtkSourceSnippet *self = (GtkSourceSnippet *)object;
+ GtkSourceSnippet *snippet = (GtkSourceSnippet *)object;
- if (self->mark_begin != NULL)
+ if (snippet->mark_begin != NULL)
{
- gtk_text_buffer_delete_mark (self->buffer, self->mark_begin);
- g_clear_object (&self->mark_begin);
+ gtk_text_buffer_delete_mark (snippet->buffer, snippet->mark_begin);
+ g_clear_object (&snippet->mark_begin);
}
- if (self->mark_end != NULL)
+ if (snippet->mark_end != NULL)
{
- gtk_text_buffer_delete_mark (self->buffer, self->mark_end);
- g_clear_object (&self->mark_end);
+ gtk_text_buffer_delete_mark (snippet->buffer, snippet->mark_end);
+ g_clear_object (&snippet->mark_end);
}
- while (self->chunks.length > 0)
+ while (snippet->chunks.length > 0)
{
- GtkSourceSnippetChunk *chunk = self->chunks.head->data;
+ GtkSourceSnippetChunk *chunk = snippet->chunks.head->data;
- g_queue_unlink (&self->chunks, &chunk->link);
+ g_queue_unlink (&snippet->chunks, &chunk->link);
g_object_unref (chunk);
}
- g_clear_object (&self->buffer);
- g_clear_object (&self->context);
+ g_clear_object (&snippet->buffer);
+ g_clear_object (&snippet->context);
G_OBJECT_CLASS (gtk_source_snippet_parent_class)->dispose (object);
}
@@ -1108,11 +1130,11 @@ gtk_source_snippet_dispose (GObject *object)
static void
gtk_source_snippet_finalize (GObject *object)
{
- GtkSourceSnippet *self = (GtkSourceSnippet *)object;
+ GtkSourceSnippet *snippet = (GtkSourceSnippet *)object;
- g_clear_pointer (&self->description, g_free);
- g_clear_pointer (&self->trigger, g_free);
- g_clear_object (&self->buffer);
+ g_clear_pointer (&snippet->description, g_free);
+ g_clear_pointer (&snippet->trigger, g_free);
+ g_clear_object (&snippet->buffer);
G_OBJECT_CLASS (gtk_source_snippet_parent_class)->finalize (object);
}
@@ -1123,36 +1145,36 @@ gtk_source_snippet_get_property (GObject *object,
GValue *value,
GParamSpec *pspec)
{
- GtkSourceSnippet *self = GTK_SOURCE_SNIPPET (object);
+ GtkSourceSnippet *snippet = GTK_SOURCE_SNIPPET (object);
switch (prop_id)
{
case PROP_BUFFER:
- g_value_set_object (value, self->buffer);
+ g_value_set_object (value, snippet->buffer);
break;
case PROP_MARK_BEGIN:
- g_value_set_object (value, self->mark_begin);
+ g_value_set_object (value, snippet->mark_begin);
break;
case PROP_MARK_END:
- g_value_set_object (value, self->mark_end);
+ g_value_set_object (value, snippet->mark_end);
break;
case PROP_TRIGGER:
- g_value_set_string (value, self->trigger);
+ g_value_set_string (value, snippet->trigger);
break;
case PROP_LANGUAGE_ID:
- g_value_set_string (value, self->language_id);
+ g_value_set_string (value, snippet->language_id);
break;
case PROP_DESCRIPTION:
- g_value_set_string (value, self->description);
+ g_value_set_string (value, snippet->description);
break;
case PROP_POSITION:
- g_value_set_uint (value, self->focus_position);
+ g_value_set_uint (value, snippet->focus_position);
break;
default:
@@ -1166,20 +1188,20 @@ gtk_source_snippet_set_property (GObject *object,
const GValue *value,
GParamSpec *pspec)
{
- GtkSourceSnippet *self = GTK_SOURCE_SNIPPET (object);
+ GtkSourceSnippet *snippet = GTK_SOURCE_SNIPPET (object);
switch (prop_id)
{
case PROP_TRIGGER:
- gtk_source_snippet_set_trigger (self, g_value_get_string (value));
+ gtk_source_snippet_set_trigger (snippet, g_value_get_string (value));
break;
case PROP_LANGUAGE_ID:
- gtk_source_snippet_set_language_id (self, g_value_get_string (value));
+ gtk_source_snippet_set_language_id (snippet, g_value_get_string (value));
break;
case PROP_DESCRIPTION:
- gtk_source_snippet_set_description (self, g_value_get_string (value));
+ gtk_source_snippet_set_description (snippet, g_value_get_string (value));
break;
default:
@@ -1264,53 +1286,53 @@ gtk_source_snippet_class_init (GtkSourceSnippetClass *klass)
}
static void
-gtk_source_snippet_init (GtkSourceSnippet *self)
+gtk_source_snippet_init (GtkSourceSnippet *snippet)
{
- self->max_focus_position = -1;
+ snippet->max_focus_position = -1;
}
gchar *
-_gtk_source_snippet_get_edited_text (GtkSourceSnippet *self)
+_gtk_source_snippet_get_edited_text (GtkSourceSnippet *snippet)
{
GtkTextIter begin;
GtkTextIter end;
- g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (self), NULL);
+ g_return_val_if_fail (GTK_SOURCE_IS_SNIPPET (snippet), NULL);
- if (self->mark_begin == NULL || self->mark_end == NULL)
+ if (snippet->mark_begin == NULL || snippet->mark_end == NULL)
{
return NULL;
}
- gtk_text_buffer_get_iter_at_mark (self->buffer, &begin, self->mark_begin);
- gtk_text_buffer_get_iter_at_mark (self->buffer, &end, self->mark_end);
+ gtk_text_buffer_get_iter_at_mark (snippet->buffer, &begin, snippet->mark_begin);
+ gtk_text_buffer_get_iter_at_mark (snippet->buffer, &end, snippet->mark_end);
return gtk_text_iter_get_slice (&begin, &end);
}
void
-_gtk_source_snippet_replace_current_chunk_text (GtkSourceSnippet *self,
+_gtk_source_snippet_replace_current_chunk_text (GtkSourceSnippet *snippet,
const gchar *new_text)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
- if (self->current_chunk != NULL)
+ if (snippet->current_chunk != NULL)
{
- gtk_source_snippet_chunk_set_text (self->current_chunk, new_text);
- gtk_source_snippet_chunk_set_text_set (self->current_chunk, TRUE);
+ gtk_source_snippet_chunk_set_text (snippet->current_chunk, new_text);
+ gtk_source_snippet_chunk_set_text_set (snippet->current_chunk, TRUE);
}
}
void
-_gtk_source_snippet_pause (GtkSourceSnippet *self)
+_gtk_source_snippet_pause (GtkSourceSnippet *snippet)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
}
void
-_gtk_source_snippet_unpause (GtkSourceSnippet *self)
+_gtk_source_snippet_unpause (GtkSourceSnippet *snippet)
{
- g_return_if_fail (GTK_SOURCE_IS_SNIPPET (self));
+ g_return_if_fail (GTK_SOURCE_IS_SNIPPET (snippet));
}
diff --git a/gtksourceview/gtksourcesnippet.h b/gtksourceview/gtksourcesnippet.h
index 85588023..b3618009 100644
--- a/gtksourceview/gtksourcesnippet.h
+++ b/gtksourceview/gtksourcesnippet.h
@@ -38,33 +38,33 @@ GTK_SOURCE_AVAILABLE_IN_5_0
GtkSourceSnippet *gtk_source_snippet_new (const gchar *trigger,
const gchar *language_id);
GTK_SOURCE_AVAILABLE_IN_5_0
-GtkSourceSnippet *gtk_source_snippet_copy (GtkSourceSnippet *self);
+GtkSourceSnippet *gtk_source_snippet_copy (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-const gchar *gtk_source_snippet_get_trigger (GtkSourceSnippet *self);
+const gchar *gtk_source_snippet_get_trigger (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-void gtk_source_snippet_set_trigger (GtkSourceSnippet *self,
+void gtk_source_snippet_set_trigger (GtkSourceSnippet *snippet,
const gchar *trigger);
GTK_SOURCE_AVAILABLE_IN_5_0
-const gchar *gtk_source_snippet_get_language_id (GtkSourceSnippet *self);
+const gchar *gtk_source_snippet_get_language_id (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-void gtk_source_snippet_set_language_id (GtkSourceSnippet *self,
+void gtk_source_snippet_set_language_id (GtkSourceSnippet *snippet,
const gchar *language_id);
GTK_SOURCE_AVAILABLE_IN_5_0
-const gchar *gtk_source_snippet_get_description (GtkSourceSnippet *self);
+const gchar *gtk_source_snippet_get_description (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-void gtk_source_snippet_set_description (GtkSourceSnippet *self,
+void gtk_source_snippet_set_description (GtkSourceSnippet *snippet,
const gchar *description);
GTK_SOURCE_AVAILABLE_IN_5_0
-void gtk_source_snippet_add_chunk (GtkSourceSnippet *self,
+void gtk_source_snippet_add_chunk (GtkSourceSnippet *snippet,
GtkSourceSnippetChunk *chunk);
GTK_SOURCE_AVAILABLE_IN_5_0
-guint gtk_source_snippet_get_n_chunks (GtkSourceSnippet *self);
+guint gtk_source_snippet_get_n_chunks (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-gint gtk_source_snippet_get_focus_position (GtkSourceSnippet *self);
+gint gtk_source_snippet_get_focus_position (GtkSourceSnippet *snippet);
GTK_SOURCE_AVAILABLE_IN_5_0
-GtkSourceSnippetChunk *gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *self,
+GtkSourceSnippetChunk *gtk_source_snippet_get_nth_chunk (GtkSourceSnippet *snippet,
guint nth);
GTK_SOURCE_AVAILABLE_IN_5_0
-GtkSourceSnippetContext *gtk_source_snippet_get_context (GtkSourceSnippet *self);
+GtkSourceSnippetContext *gtk_source_snippet_get_context (GtkSourceSnippet *snippet);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]