[gtksourceview] Added smart-home-end signal emitted when cursor was moved smartly



commit 7a891b4b833b973524703a240371f6b5a01f8f3a
Author: Jesse van den Kieboom <jessevdk gnome org>
Date:   Sun May 16 19:56:04 2010 +0200

    Added smart-home-end signal emitted when cursor was moved smartly

 gtksourceview/gtksourceview-marshal.list |    1 +
 gtksourceview/gtksourceview.c            |   29 ++++++++++++++++++++++++++++-
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/gtksourceview/gtksourceview-marshal.list b/gtksourceview/gtksourceview-marshal.list
index 419eb75..ee06a8a 100644
--- a/gtksourceview/gtksourceview-marshal.list
+++ b/gtksourceview/gtksourceview-marshal.list
@@ -15,3 +15,4 @@ VOID:OBJECT,BOXED,POINTER
 BOOL:OBJECT,BOXED,OBJECT
 VOID:BOXED,POINTER
 VOID:INT
+VOID:BOXED,INT
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index 2c43e29..35e16fc 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -97,6 +97,7 @@ enum {
 	LINE_MARK_ACTIVATED,
 	MOVE_LINES,
 	MOVE_WORDS,
+	SMART_HOME_END,
 	LAST_SIGNAL
 };
 
@@ -490,6 +491,7 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
 			      _gtksourceview_marshal_VOID__VOID,
 			      G_TYPE_NONE,
 			      0);
+
 	signals [REDO] =
 		g_signal_new ("redo",
 			      G_TYPE_FROM_CLASS (klass),
@@ -500,7 +502,7 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
 			      _gtksourceview_marshal_VOID__VOID,
 			      G_TYPE_NONE,
 			      0);
-			    
+
 	/**
 	 * GtkSourceView::show-completion:
 	 * @view: The #GtkSourceView who emits the signal
@@ -570,6 +572,31 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
 			      G_TYPE_NONE, 1,
 			      G_TYPE_INT);
 
+	/**
+	 * GtkSourceView::smart-home-end:
+	 * @view: the #GtkSourceView
+	 * @iter: a #GtkTextIter
+	 * @step: the step size
+	 *
+	 * Emitted when a the cursor was moved according to the smart home
+	 * end setting. The signal is emitted after the cursor is moved, but
+	 * during the GtkTextView::move-cursor action. This can be used to find
+	 * out whether the cursor was moved by a normal home/end or by a smart
+	 * home/end.
+	 */
+	signals[SMART_HOME_END] =
+		g_signal_new ("smart-home-end",
+		              G_TYPE_FROM_CLASS (klass),
+		              G_SIGNAL_RUN_LAST,
+		              0,
+		              NULL,
+		              NULL,
+		              _gtksourceview_marshal_VOID__BOXED_INT,
+		              G_TYPE_NONE,
+		              2,
+		              GTK_TYPE_TEXT_ITER,
+		              G_TYPE_INT);
+
 	binding_set = gtk_binding_set_by_class (klass);
 
 	gtk_binding_entry_add_signal (binding_set,



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