[anjuta] sourceview: Implemented "move-cursor" signal



commit 95cb846fbb2d24c66031c803794965bcb05f1b1d
Author: Dragos Dena <dragos dena gmail com>
Date:   Sun Aug 8 14:56:38 2010 +0300

    sourceview: Implemented "move-cursor" signal

 plugins/sourceview/sourceview.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/plugins/sourceview/sourceview.c b/plugins/sourceview/sourceview.c
index e396d40..d6bdfec 100644
--- a/plugins/sourceview/sourceview.c
+++ b/plugins/sourceview/sourceview.c
@@ -285,6 +285,19 @@ static void on_insert_text (GtkTextBuffer* buffer,
 	}
 }
 
+static void 
+on_cursor_position_changed (GObject    *buffer_obj,
+                            GParamSpec *param_spec,
+                            gpointer    user_data)
+{
+
+	/* Assertions */
+	g_return_if_fail (ANJUTA_IS_SOURCEVIEW (user_data));
+
+	g_signal_emit_by_name (G_OBJECT (user_data), "cursor-moved");
+
+}
+
 /* Called whenever the document is changed */
 static void on_document_modified_changed(GtkTextBuffer* buffer, Sourceview* sv)
 {
@@ -659,6 +672,8 @@ sourceview_instance_init(Sourceview* sv)
 					 G_CALLBACK(on_mark_set),sv);
 	g_signal_connect_after (G_OBJECT(sv->priv->document), "insert-text",
 					  G_CALLBACK(on_insert_text), sv);
+	g_signal_connect (G_OBJECT (sv->priv->document), "notify::cursor-position",
+	                  G_CALLBACK (on_cursor_position_changed), sv);
 					 
 	/* Create View instance */
 	sv->priv->view = ANJUTA_VIEW(anjuta_view_new(sv));



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