[gtksourceview] Added gtksourcecompletion_block/unblock_interactive



commit d2fea3cb6f5ad602d3b0a828013b95a46cd81d0c
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date:   Sat Jan 2 14:52:57 2010 +0100

    Added gtksourcecompletion_block/unblock_interactive

 docs/reference/gtksourceview-2.0-sections.txt |    2 +
 gtksourceview/gtksourcecompletion.c           |   42 +++++++++++++++++++++++++
 gtksourceview/gtksourcecompletion.h           |    6 +++-
 3 files changed, 49 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtksourceview-2.0-sections.txt b/docs/reference/gtksourceview-2.0-sections.txt
index 6e4df8c..452e0a7 100644
--- a/docs/reference/gtksourceview-2.0-sections.txt
+++ b/docs/reference/gtksourceview-2.0-sections.txt
@@ -340,6 +340,8 @@ gtk_source_completion_get_info_window
 gtk_source_completion_get_view
 gtk_source_completion_create_context
 gtk_source_completion_move_window
+gtk_source_completion_block_interactive
+gtk_source_completion_unblock_interactive
 <SUBSECTION Standard>
 GTK_IS_SOURCE_COMPLETION
 GTK_IS_SOURCE_COMPLETION_CLASS
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 470ba7c..441679c 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -3519,3 +3519,45 @@ gtk_source_completion_move_window (GtkSourceCompletion *completion,
 	                                          GTK_SOURCE_VIEW (completion->priv->view),
 	                                          iter);
 }
+
+/**
+ * gtk_source_completion_block_interactive:
+ * @completion: A # GtkSourceCompletion
+ *
+ * Block interactive completion. This can be used to disable interactive
+ * completion when inserting or deleting text from the buffer associated with
+ * the completion. Use #gtk_source_completion_unblock_interactive to enable
+ * interactive completion again.
+ *
+ **/
+void
+gtk_source_completion_block_interactive (GtkSourceCompletion *completion)
+{
+	GtkSourceBuffer *buffer;
+
+	g_return_if_fail (GTK_IS_SOURCE_COMPLETION (completion));
+
+	buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (completion->priv->view)));
+	completion_begin_block (completion, buffer);
+}
+
+/**
+ * gtk_source_completion_unblock_interactive:
+ * @completion: A # GtkSourceCompletion
+ *
+ * Unblock interactive completion. This can be used after using
+ * #gtk_source_completion_block_interactive to enable interactive completion
+ * again.
+ *
+ **/
+void
+gtk_source_completion_unblock_interactive (GtkSourceCompletion *completion)
+{
+	GtkSourceBuffer *buffer;
+
+	g_return_if_fail (GTK_IS_SOURCE_COMPLETION (completion));
+
+	buffer = GTK_SOURCE_BUFFER (gtk_text_view_get_buffer (GTK_TEXT_VIEW (completion->priv->view)));
+	completion_end_block (completion, buffer);
+}
+
diff --git a/gtksourceview/gtksourcecompletion.h b/gtksourceview/gtksourcecompletion.h
index 37df6c1..30049f7 100644
--- a/gtksourceview/gtksourcecompletion.h
+++ b/gtksourceview/gtksourcecompletion.h
@@ -121,7 +121,11 @@ void		 _gtk_source_completion_add_proposals		(GtkSourceCompletion           *com
 								 GtkSourceCompletionContext    *context,
 								 GtkSourceCompletionProvider   *provider,
 								 GList                         *proposals,
-		 						 gboolean                       finished);
+								 gboolean                       finished);
+
+void		 gtk_source_completion_block_interactive	(GtkSourceCompletion           *completion);
+void		 gtk_source_completion_unblock_interactive	(GtkSourceCompletion           *completion);
+
 G_END_DECLS
 
 #endif /* __GTK_SOURCE_COMPLETION_H__ */



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