gtk: fix all uses of g_cclosure_marshal_generic

This adds specific marshallers for all of the locations where a generic
marshaller is being used. It also provides va_marshallers to reduce the
chances that we get stack traces from perf going through ffi_call_unix64.
This commit is contained in:
Christian Hergert 2019-05-31 13:11:43 -07:00
parent dd25499f1e
commit 44cdb20c10
16 changed files with 147 additions and 30 deletions

View File

@ -24,6 +24,7 @@
#include "gtkactionobservable.h"
#include "gtkactionobserver.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include <string.h>
@ -633,8 +634,16 @@ gtk_action_muxer_class_init (GObjectClass *class)
class->finalize = gtk_action_muxer_finalize;
class->dispose = gtk_action_muxer_dispose;
accel_signal = g_signal_new (I_("primary-accel-changed"), GTK_TYPE_ACTION_MUXER, G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL, G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
accel_signal = g_signal_new (I_("primary-accel-changed"),
GTK_TYPE_ACTION_MUXER,
G_SIGNAL_RUN_LAST,
0,
NULL, NULL,
_gtk_marshal_VOID__STRING_STRING,
G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING);
g_signal_set_va_marshaller (accel_signal,
G_TYPE_FROM_CLASS (class),
_gtk_marshal_VOID__STRING_STRINGv);
properties[PROP_PARENT] = g_param_spec_object ("parent", "Parent",
"The parent muxer",

View File

@ -32,6 +32,7 @@
#include "config.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#include "gtkwidgetprivate.h"
#include "gtkeventcontrollerprivate.h"
@ -182,8 +183,12 @@ gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
g_signal_new (I_("key-pressed"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, _gtk_boolean_handled_accumulator, NULL, NULL,
0, _gtk_boolean_handled_accumulator, NULL,
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGS,
G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
g_signal_set_va_marshaller (signals[KEY_PRESSED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGSv);
/**
* GtkEventControllerKey::key-released:
@ -200,15 +205,25 @@ gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
g_signal_new (I_("key-released"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL, NULL,
0, NULL, NULL,
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGS,
G_TYPE_NONE, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
g_signal_set_va_marshaller (signals[KEY_RELEASED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__UINT_UINT_FLAGSv);
signals[MODIFIERS] =
g_signal_new (I_("modifiers"),
GTK_TYPE_EVENT_CONTROLLER_KEY,
G_SIGNAL_RUN_LAST,
0, NULL, NULL,
g_cclosure_marshal_BOOLEAN__FLAGS,
0, NULL,
NULL,
_gtk_marshal_BOOLEAN__FLAGS,
G_TYPE_BOOLEAN, 1, GDK_TYPE_MODIFIER_TYPE);
g_signal_set_va_marshaller (signals[MODIFIERS],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__FLAGSv);
signals[IM_UPDATE] =
g_signal_new (I_("im-update"),
GTK_TYPE_EVENT_CONTROLLER_KEY,

View File

@ -31,6 +31,7 @@
#include "config.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkwidget.h"
#include "gtkeventcontrollerprivate.h"
#include "gtkeventcontrollermotion.h"
@ -139,8 +140,11 @@ gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass)
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[ENTER],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkEventControllerMotion::leave:
@ -153,7 +157,7 @@ gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass)
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
NULL,
G_TYPE_NONE, 0);
/**
@ -169,8 +173,11 @@ gtk_event_controller_motion_class_init (GtkEventControllerMotionClass *klass)
GTK_TYPE_EVENT_CONTROLLER_MOTION,
G_SIGNAL_RUN_FIRST,
0, NULL, NULL,
NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[MOTION],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
}
static void

View File

@ -124,6 +124,7 @@
#include "gtkprivate.h"
#include "gtkmain.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
typedef struct _GtkGesturePrivate GtkGesturePrivate;
typedef struct _PointData PointData;
@ -988,9 +989,13 @@ gtk_gesture_class_init (GtkGestureClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureClass, sequence_state_changed),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__BOXED_ENUM,
G_TYPE_NONE, 2, GDK_TYPE_EVENT_SEQUENCE,
GTK_TYPE_EVENT_SEQUENCE_STATE);
g_signal_set_va_marshaller (signals[SEQUENCE_STATE_CHANGED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__BOXED_ENUMv);
}
static void

View File

@ -34,6 +34,7 @@
#include "gtkgesturedrag.h"
#include "gtkgesturedragprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
typedef struct _GtkGestureDragPrivate GtkGestureDragPrivate;
typedef struct _EventData EventData;
@ -154,8 +155,12 @@ gtk_gesture_drag_class_init (GtkGestureDragClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureDragClass, drag_begin),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[DRAG_BEGIN],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureDrag::drag-update:
* @gesture: the object which received the signal
@ -171,8 +176,12 @@ gtk_gesture_drag_class_init (GtkGestureDragClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureDragClass, drag_update),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[DRAG_UPDATE],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureDrag::drag-end:
* @gesture: the object which received the signal
@ -188,8 +197,12 @@ gtk_gesture_drag_class_init (GtkGestureDragClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureDragClass, drag_end),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[DRAG_END],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
}
static void

View File

@ -40,6 +40,7 @@
#include "gtkdnd.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
typedef struct _GtkGestureLongPressPrivate GtkGestureLongPressPrivate;
@ -302,8 +303,12 @@ gtk_gesture_long_press_class_init (GtkGestureLongPressClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureLongPressClass, pressed),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[PRESSED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
/**
* GtkGestureLongPress::cancelled:
* @gesture: the object which received the signal

View File

@ -40,6 +40,7 @@
#include "gtkgesturemultipressprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
typedef struct _GtkGestureMultiPressPrivate GtkGestureMultiPressPrivate;
@ -336,9 +337,13 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureMultiPressClass, pressed),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__INT_DOUBLE_DOUBLE,
G_TYPE_NONE, 3, G_TYPE_INT,
G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[PRESSED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__INT_DOUBLE_DOUBLEv);
/**
* GtkGestureMultiPress::released:
@ -359,9 +364,13 @@ gtk_gesture_multi_press_class_init (GtkGestureMultiPressClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureMultiPressClass, released),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__INT_DOUBLE_DOUBLE,
G_TYPE_NONE, 3, G_TYPE_INT,
G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[RELEASED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__INT_DOUBLE_DOUBLEv);
/**
* GtkGestureMultiPress::stopped:
* @gesture: the object which received the signal

View File

@ -44,6 +44,7 @@
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
typedef struct _GtkGesturePanPrivate GtkGesturePanPrivate;
@ -256,9 +257,13 @@ gtk_gesture_pan_class_init (GtkGesturePanClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGesturePanClass, pan),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__ENUM_DOUBLE,
G_TYPE_NONE, 2, GTK_TYPE_PAN_DIRECTION,
G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[PAN],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__ENUM_DOUBLEv);
}
static void

View File

@ -232,8 +232,12 @@ gtk_gesture_rotate_class_init (GtkGestureRotateClass *klass)
GTK_TYPE_GESTURE_ROTATE,
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkGestureRotateClass, angle_changed),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[ANGLE_CHANGED],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
}
/**

View File

@ -32,6 +32,7 @@
#include "gtkgesturestylusprivate.h"
#include "gtkprivate.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkmain.h"
G_DEFINE_TYPE (GtkGestureStylus, gtk_gesture_stylus, GTK_TYPE_GESTURE_SINGLE)
@ -99,29 +100,48 @@ gtk_gesture_stylus_class_init (GtkGestureStylusClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, proximity),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[PROXIMITY],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
signals[DOWN] =
g_signal_new (I_("down"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, down),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[DOWN],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
signals[MOTION] =
g_signal_new (I_("motion"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, motion),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[MOTION],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
signals[UP] =
g_signal_new (I_("up"),
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureStylusClass, up),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[UP],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
}
static void

View File

@ -41,6 +41,7 @@
#include "gtkgestureprivate.h"
#include "gtkmarshalers.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#define CAPTURE_THRESHOLD_MS 150
@ -235,8 +236,12 @@ gtk_gesture_swipe_class_init (GtkGestureSwipeClass *klass)
G_TYPE_FROM_CLASS (klass),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGestureSwipeClass, swipe),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__DOUBLE_DOUBLE,
G_TYPE_NONE, 2, G_TYPE_DOUBLE, G_TYPE_DOUBLE);
g_signal_set_va_marshaller (signals[SWIPE],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__DOUBLE_DOUBLEv);
}
static void

View File

@ -23,6 +23,7 @@
#include "config.h"
#include "gtkglarea.h"
#include "gtkintl.h"
#include "gtkmarshalers.h"
#include "gtkstylecontext.h"
#include "gtkmarshalers.h"
#include "gtkprivate.h"
@ -913,9 +914,12 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkGLAreaClass, render),
_gtk_boolean_handled_accumulator, NULL,
NULL,
_gtk_marshal_BOOLEAN__OBJECT,
G_TYPE_BOOLEAN, 1,
GDK_TYPE_GL_CONTEXT);
g_signal_set_va_marshaller (area_signals[RENDER],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__OBJECTv);
/**
* GtkGLArea::resize:
@ -943,6 +947,9 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
NULL, NULL,
_gtk_marshal_VOID__INT_INT,
G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_INT);
g_signal_set_va_marshaller (area_signals[RESIZE],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_VOID__INT_INTv);
/**
* GtkGLArea::create-context:
@ -972,6 +979,9 @@ gtk_gl_area_class_init (GtkGLAreaClass *klass)
create_context_accumulator, NULL,
_gtk_marshal_OBJECT__VOID,
GDK_TYPE_GL_CONTEXT, 0);
g_signal_set_va_marshaller (area_signals[CREATE_CONTEXT],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_OBJECT__VOIDv);
}
static void

View File

@ -25,8 +25,10 @@ BOOLEAN:BOXED
BOOLEAN:BOXED,BOXED
BOOLEAN:ENUM
BOOLEAN:ENUM,BOOLEAN
BOOLEAN:ENUM,BOXED,BOXED,BOXED
BOOLEAN:ENUM,DOUBLE
BOOLEAN:ENUM,INT
BOOLEAN:FLAGS
BOOLEAN:OBJECT
BOOLEAN:OBJECT,UINT,FLAGS
BOOLEAN:OBJECT,INT,INT,UINT
@ -41,6 +43,7 @@ BOOLEAN:INT,INT
BOOLEAN:INT,INT,INT
BOOLEAN:INT,INT,BOOLEAN,OBJECT
BOOLEAN:UINT
BOOLEAN:UINT,UINT,FLAGS
BOOLEAN:VOID
BOOLEAN:BOOLEAN
BOOLEAN:BOOLEAN,BOOLEAN,BOOLEAN
@ -61,6 +64,7 @@ VOID:BOXED,UINT
VOID:BOXED,UINT,FLAGS
VOID:BOXED,UINT,UINT
VOID:ENUM,BOOLEAN
VOID:ENUM,DOUBLE
VOID:ENUM,ENUM
VOID:ENUM,FLOAT
VOID:ENUM,FLOAT,BOOLEAN
@ -70,6 +74,7 @@ VOID:ENUM,INT,INT
VOID:ENUM,BOXED
VOID:ENUM,STRING
VOID:INT,BOOLEAN
VOID:INT,DOUBLE,DOUBLE
VOID:INT,INT
VOID:INT,INT,BOXED
VOID:INT,INT,INT

View File

@ -2284,10 +2284,14 @@ gtk_places_view_class_init (GtkPlacesViewClass *klass)
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkPlacesViewClass, open_location),
NULL, NULL, NULL,
NULL, NULL,
_gtk_marshal_VOID__OBJECT_FLAGS,
G_TYPE_NONE, 2,
G_TYPE_OBJECT,
GTK_TYPE_PLACES_OPEN_FLAGS);
g_signal_set_va_marshaller (places_view_signals [OPEN_LOCATION],
G_TYPE_FROM_CLASS (object_class),
_gtk_marshal_VOID__OBJECT_FLAGSv);
/**
* GtkPlacesView::show-error-message:

View File

@ -851,8 +851,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
g_signal_new (I_("edge-overshot"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST, 0,
NULL, NULL,
g_cclosure_marshal_generic,
NULL, NULL, NULL,
G_TYPE_NONE, 1, GTK_TYPE_POSITION_TYPE);
/**
@ -876,8 +875,7 @@ gtk_scrolled_window_class_init (GtkScrolledWindowClass *class)
g_signal_new (I_("edge-reached"),
G_TYPE_FROM_CLASS (gobject_class),
G_SIGNAL_RUN_LAST, 0,
NULL, NULL,
g_cclosure_marshal_generic,
NULL, NULL, NULL,
G_TYPE_NONE, 1, GTK_TYPE_POSITION_TYPE);
binding_set = gtk_binding_set_by_class (class);

View File

@ -1442,12 +1442,15 @@ G_GNUC_END_IGNORE_DEPRECATIONS
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTextViewClass, extend_selection),
_gtk_boolean_handled_accumulator, NULL,
NULL, /* generic marshaller */
_gtk_marshal_BOOLEAN__ENUM_BOXED_BOXED_BOXED,
G_TYPE_BOOLEAN, 4,
GTK_TYPE_TEXT_EXTEND_SELECTION,
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE,
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE,
GTK_TYPE_TEXT_ITER | G_SIGNAL_TYPE_STATIC_SCOPE);
g_signal_set_va_marshaller (signals[EXTEND_SELECTION],
G_TYPE_FROM_CLASS (klass),
_gtk_marshal_BOOLEAN__ENUM_BOXED_BOXED_BOXEDv);
/**
* GtkTextView::insert-emoji: