[gtksourceview/gtksourcecompletion] Added gsc_context_move_window and gsc_move_window API



commit 8fcdba95087fc029c131b407eb6bc35b44ac770a
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sat Sep 19 17:16:38 2009 +0200

    Added gsc_context_move_window and gsc_move_window API
    
    Providers can now move the window to a new location if necessary. For
    example, a python completion provider can move the window when it
    is populated after a ','

 gtksourceview/gtksourcecompletion.c        |   17 +++++++++++++++++
 gtksourceview/gtksourcecompletion.h        |    3 +++
 gtksourceview/gtksourcecompletioncontext.c |   11 +++++++++++
 gtksourceview/gtksourcecompletioncontext.h |    3 +++
 4 files changed, 34 insertions(+), 0 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index 1dff913..47e10bb 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -2441,3 +2441,20 @@ gtk_source_completion_create_context (GtkSourceCompletion *completion,
 	
 	return context;
 }
+
+void
+gtk_source_completion_move_window (GtkSourceCompletion *completion,
+                                   GtkTextIter         *iter)
+{
+	g_return_if_fail (GTK_IS_SOURCE_COMPLETION (completion));
+	g_return_if_fail (iter != NULL);
+	
+	if (!GTK_WIDGET_VISIBLE (completion->priv->window))
+	{
+		return;
+	}
+	
+	gtk_source_completion_utils_move_to_iter (GTK_WINDOW (completion->priv->window),
+	                                          GTK_SOURCE_VIEW (completion->priv->view),
+	                                          iter);
+}
diff --git a/gtksourceview/gtksourcecompletion.h b/gtksourceview/gtksourcecompletion.h
index f4e9db9..7ef75e3 100644
--- a/gtksourceview/gtksourcecompletion.h
+++ b/gtksourceview/gtksourcecompletion.h
@@ -106,6 +106,9 @@ GtkSourceCompletionContext *
 		 gtk_source_completion_create_context		(GtkSourceCompletion           *completion,
 		 						 GtkTextIter                   *position);
 
+void		 gtk_source_completion_move_window		(GtkSourceCompletion           *completion,
+								 GtkTextIter                   *iter);
+
 void		 _gtk_source_completion_add_proposals		(GtkSourceCompletion           *completion,
 								 GtkSourceCompletionContext    *context,
 								 GtkSourceCompletionProvider   *provider,
diff --git a/gtksourceview/gtksourcecompletioncontext.c b/gtksourceview/gtksourcecompletioncontext.c
index e395ee8..e5c2a14 100644
--- a/gtksourceview/gtksourcecompletioncontext.c
+++ b/gtksourceview/gtksourcecompletioncontext.c
@@ -247,6 +247,17 @@ gtk_source_completion_context_get_default (GtkSourceCompletionContext *context)
 	
 }
 
+void 
+gtk_source_completion_context_move_window (GtkSourceCompletionContext *context,
+                                           GtkTextIter                *iter)
+{
+	g_return_if_fail (GTK_IS_SOURCE_COMPLETION_CONTEXT (context));
+	g_return_if_fail (iter != NULL);
+	
+	gtk_source_completion_move_window (context->priv->completion,
+	                                   iter);
+}
+
 void
 _gtk_source_completion_context_cancel (GtkSourceCompletionContext *context)
 {
diff --git a/gtksourceview/gtksourcecompletioncontext.h b/gtksourceview/gtksourcecompletioncontext.h
index 01b4429..29a02f6 100644
--- a/gtksourceview/gtksourcecompletioncontext.h
+++ b/gtksourceview/gtksourcecompletioncontext.h
@@ -72,6 +72,9 @@ void		 gtk_source_completion_context_get_iter		(GtkSourceCompletionContext
 gboolean	 gtk_source_completion_context_get_interactive	(GtkSourceCompletionContext          *context);
 gboolean	 gtk_source_completion_context_get_default	(GtkSourceCompletionContext          *context);
 
+void		 gtk_source_completion_context_move_window	(GtkSourceCompletionContext          *context,
+                                                                 GtkTextIter                         *iter);
+
 void		_gtk_source_completion_context_cancel		(GtkSourceCompletionContext          *context);
 
 G_END_DECLS



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