[gnome-builder] GbEditorDocument: add file-mark-set signal for when save mark is loaded
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-builder] GbEditorDocument: add file-mark-set signal for when save mark is loaded
- Date: Thu, 11 Dec 2014 00:10:18 +0000 (UTC)
commit 4c8ab7a60c49f9aaf487ba431a15e6a3047e5e04
Author: Christian Hergert <christian hergert me>
Date: Mon Dec 8 02:28:00 2014 -0800
GbEditorDocument: add file-mark-set signal for when save mark is loaded
src/editor/gb-editor-document.c | 16 +++++++++++++++-
src/editor/gb-editor-document.h | 4 +++-
2 files changed, 18 insertions(+), 2 deletions(-)
---
diff --git a/src/editor/gb-editor-document.c b/src/editor/gb-editor-document.c
index 4c07750..bb08bdb 100644
--- a/src/editor/gb-editor-document.c
+++ b/src/editor/gb-editor-document.c
@@ -56,6 +56,7 @@ enum {
enum {
CURSOR_MOVED,
+ FILE_MARK_SET,
LAST_SIGNAL
};
@@ -708,6 +709,8 @@ gb_editor_document_restore_insert (GbEditorDocument *document)
gb_gtk_text_buffer_get_iter_at_line_and_offset (buffer, &iter, line, column);
gtk_text_buffer_select_range (buffer, &iter, &iter);
+
+ g_signal_emit (document, gSignals [FILE_MARK_SET], 0, &iter);
}
static void
@@ -987,7 +990,7 @@ gb_editor_document_class_init (GbEditorDocumentClass *klass)
g_object_class_install_property (object_class, PROP_TRIM_TRAILING_WHITESPACE,
gParamSpecs [PROP_TRIM_TRAILING_WHITESPACE]);
- gSignals[CURSOR_MOVED] =
+ gSignals [CURSOR_MOVED] =
g_signal_new ("cursor-moved",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
@@ -997,6 +1000,17 @@ gb_editor_document_class_init (GbEditorDocumentClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
+
+ gSignals [FILE_MARK_SET] =
+ g_signal_new ("file-mark-set",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (GbEditorDocumentClass, file_mark_set),
+ NULL, NULL,
+ g_cclosure_marshal_generic,
+ G_TYPE_NONE,
+ 1,
+ GTK_TYPE_TEXT_ITER);
}
static void
diff --git a/src/editor/gb-editor-document.h b/src/editor/gb-editor-document.h
index c5991d1..ce7a937 100644
--- a/src/editor/gb-editor-document.h
+++ b/src/editor/gb-editor-document.h
@@ -50,7 +50,9 @@ struct _GbEditorDocumentClass
{
GtkSourceBufferClass parent_class;
- void (*cursor_moved) (GbEditorDocument *document);
+ void (*cursor_moved) (GbEditorDocument *document);
+ void (*file_mark_set) (GbEditorDocument *document,
+ GtkTextIter *location);
};
GbEditorDocument *gb_editor_document_new (void);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]