[gtksourceview/wip/chergert/gsv-gtk4: 105/192] view: track changes for line-mark-activated




commit 4d597422bccdcdec35b28b0e0f12c104c652ac0f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 15 15:08:05 2020 -0800

    view: track changes for line-mark-activated
    
    The signature of GtkSourceGutterRendererMarks::line-mark-activated has
    changed and we need to redirect that from the sourceview for consumers.

 gtksourceview/gtksourcemarshalers.list |  1 +
 gtksourceview/gtksourceview.c          | 37 ++++++++++++++++++----------------
 gtksourceview/gtksourceview.h          | 18 +++++++++--------
 3 files changed, 31 insertions(+), 25 deletions(-)
---
diff --git a/gtksourceview/gtksourcemarshalers.list b/gtksourceview/gtksourcemarshalers.list
index 0567eacce..2236f2b8e 100644
--- a/gtksourceview/gtksourcemarshalers.list
+++ b/gtksourceview/gtksourcemarshalers.list
@@ -5,6 +5,7 @@ STRING:OBJECT
 VOID:BOXED,BOXED
 VOID:BOXED,BOXED,BOXED
 VOID:BOXED,BOXED,FLAGS
+VOID:BOXED,UINT,FLAGS,INT
 VOID:BOXED,BOXED,UINT,FLAGS,INT
 VOID:BOXED,ENUM
 VOID:BOXED,INT
diff --git a/gtksourceview/gtksourceview.c b/gtksourceview/gtksourceview.c
index f2afb14a8..c9e20aeec 100644
--- a/gtksourceview/gtksourceview.c
+++ b/gtksourceview/gtksourceview.c
@@ -727,7 +727,9 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
         * GtkSourceView::line-mark-activated:
         * @view: the #GtkSourceView
         * @iter: a #GtkTextIter
-        * @event: the #GdkEvent that activated the event
+        * @button: the button that was pressed
+        * @state: the modifier state, if any
+        * @n_presses: the number of presses
         *
         * Emitted when a line mark has been activated (for instance when there
         * was a button press in the line marks gutter). You can use @iter to
@@ -735,18 +737,20 @@ gtk_source_view_class_init (GtkSourceViewClass *klass)
         */
        signals[LINE_MARK_ACTIVATED] =
                g_signal_new ("line-mark-activated",
-                             G_TYPE_FROM_CLASS (klass),
-                             G_SIGNAL_RUN_LAST,
-                             G_STRUCT_OFFSET (GtkSourceViewClass, line_mark_activated),
-                             NULL, NULL,
-                             _gtk_source_marshal_VOID__BOXED_BOXED,
-                             G_TYPE_NONE,
-                             2,
-                             GTK_TYPE_TEXT_ITER,
-                             GDK_TYPE_EVENT | G_SIGNAL_TYPE_STATIC_SCOPE);
+                             G_TYPE_FROM_CLASS (klass),
+                             G_SIGNAL_RUN_LAST,
+                             G_STRUCT_OFFSET (GtkSourceViewClass, line_mark_activated),
+                             NULL, NULL,
+                             _gtk_source_marshal_VOID__BOXED_UINT_FLAGS_INT,
+                             G_TYPE_NONE,
+                             4,
+                             GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE,
+                             G_TYPE_UINT,
+                             GDK_TYPE_MODIFIER_TYPE,
+                             G_TYPE_INT);
        g_signal_set_va_marshaller (signals[LINE_MARK_ACTIVATED],
                                    G_TYPE_FROM_CLASS (klass),
-                                   _gtk_source_marshal_VOID__BOXED_BOXEDv);
+                                   _gtk_source_marshal_VOID__BOXED_UINT_FLAGS_INTv);
 
        /**
         * GtkSourceView::move-lines:
@@ -2922,14 +2926,13 @@ static void
 gutter_renderer_marks_activate (GtkSourceGutterRenderer *renderer,
                                 GtkTextIter             *iter,
                                 const GdkRectangle      *area,
-                                GdkEvent                *event,
+                                guint                    button,
+                                GdkModifierType          state,
+                                gint                     n_presses,
                                 GtkSourceView           *view)
 {
-       g_signal_emit (view,
-                      signals[LINE_MARK_ACTIVATED],
-                      0,
-                      iter,
-                      event);
+       g_signal_emit (view, signals[LINE_MARK_ACTIVATED], 0,
+                      iter, button, state, n_presses);
 }
 
 /**
diff --git a/gtksourceview/gtksourceview.h b/gtksourceview/gtksourceview.h
index ab3efff1d..76b07f15e 100644
--- a/gtksourceview/gtksourceview.h
+++ b/gtksourceview/gtksourceview.h
@@ -87,14 +87,16 @@ struct _GtkSourceViewClass
 {
        GtkTextViewClass parent_class;
 
-       void (*line_mark_activated) (GtkSourceView *view,
-                                    GtkTextIter   *iter,
-                                    GdkEvent      *event);
-       void (*show_completion)     (GtkSourceView *view);
-       void (*move_lines)          (GtkSourceView *view,
-                                    gboolean       down);
-       void (*move_words)          (GtkSourceView *view,
-                                    gint           step);
+       void (*line_mark_activated) (GtkSourceView     *view,
+                                    const GtkTextIter *iter,
+                                    guint              button,
+                                    GdkModifierType    state,
+                                    gint               n_presses);
+       void (*show_completion)     (GtkSourceView     *view);
+       void (*move_lines)          (GtkSourceView     *view,
+                                    gboolean           down);
+       void (*move_words)          (GtkSourceView     *view,
+                                    gint               step);
 
        /*< private >*/
        gpointer _reserved[20];


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