Index: gobject/gsignal.c
===================================================================
--- gobject/gsignal.c	(revision 7098)
+++ gobject/gsignal.c	(working copy)
@@ -3161,6 +3161,107 @@
   return continue_emission;
 }
 
+/**
+ * Signal emission hooks utility function
+ */
+typedef struct
+{
+  GCallback callback;
+  gpointer user_data;
+  GConnectFlags flags;
+  GQuark detail;
+} GObjectConnectHook;
+
+static gboolean
+signal_emission_hook_fn(GSignalInvocationHint *hint,
+			guint nparams,
+			const GValue *pvalues,
+			gpointer data)
+{
+  GObjectConnectHook *hook = data;
+  GObject *obj = G_OBJECT(g_value_get_object(pvalues + 0));
+  if (g_signal_handler_find(obj,
+	G_SIGNAL_MATCH_ID | G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA | G_SIGNAL_MATCH_DETAIL,
+	hint->signal_id, hook->detail, NULL,
+	hook->callback, hook->user_data) == 0)
+    {
+      gboolean swap = (hook->flags & G_CONNECT_SWAPPED);
+      gboolean after = (hook->flags & G_CONNECT_AFTER);
+      GClosure *closure = (swap ? g_cclosure_new_swap : g_cclosure_new)
+	(hook->callback, hook->user_data, NULL);
+      g_signal_connect_closure_by_id(obj, hint->signal_id, hook->detail, closure, after);
+      g_closure_invoke(closure, NULL, nparams, pvalues, hint);
+    }
+  return TRUE;
+}
+
+/**
+ * g_signal_connect_type_flags:
+ * @itype: Instance type.
+ * @detailed_signal: a string of the form "signal-name::detail".
+ * @callback: the #GCallback to connect.
+ * @data: data to pass to @callback calls.
+ * @flags: a combination of #GConnectFlags.
+ *
+ * Connect a #GCallback function to a signal for objects of a particular type.
+ * Similar to g_signal_connect_type, but allows specifying connection flags if
+ * you need <literal>..._after()</literal> or <literal>..._swapped()</literal>
+ * variants of g_signal_connect.
+ *
+ * Since: 2.17
+ *
+ * Returns: the hook id, for later use with g_signal_remove_emission_hook().
+ */
+gulong
+g_signal_connect_type_flags(GType itype,
+			    const char *detailed_signal,
+			    GCallback callback,
+			    gpointer data,
+			    GConnectFlags flags)
+{
+  GObjectConnectHook *hook;
+  guint signal_id;
+  GQuark detail;
+
+  g_type_class_unref(g_type_class_ref(itype));
+
+  if (!g_signal_parse_name(detailed_signal, itype, &signal_id, &detail, TRUE))
+    return 0;
+
+  SIGNAL_LOCK();
+  hook = g_new0(GObjectConnectHook, 1);
+  hook->callback = callback;
+  hook->user_data = data;
+  hook->flags = flags;
+  hook->detail = detail;
+  SIGNAL_UNLOCK();
+
+  return g_signal_add_emission_hook(signal_id, detail, signal_emission_hook_fn,
+      hook, g_free);
+}
+
+/**
+ * g_signal_connect_type:
+ * @itype: Instance type.
+ * @detailed_signal: a string of the form "signal-name::detail".
+ * @callback: the #GCallback to connect.
+ * @data: data to pass to @callback calls.
+ *
+ * Connect a #GCallback function to a signal for objects of a particular type.
+ *
+ * Since: 2.17
+ *
+ * Returns: the hook id, for later use with g_signal_remove_emission_hook().
+ */
+gulong
+g_signal_connect_type(GType itype,
+		      const char *detailed_signal,
+		      GCallback callback,
+		      gpointer data)
+{
+  return g_signal_connect_type_flags(itype, detailed_signal, callback, data, 0);
+}
+
 /* --- compile standard marshallers --- */
 #include "gmarshal.c"
 
Index: gobject/gsignal.h
===================================================================
--- gobject/gsignal.h	(revision 7098)
+++ gobject/gsignal.h	(working copy)
@@ -484,6 +484,17 @@
 					    const GValue          *handler_return,
 					    gpointer               dummy);
 
+gulong g_signal_connect_type(GType itype,
+			     const char *detailed_signal,
+			     GCallback callback,
+			     gpointer data);
+
+gulong g_signal_connect_type_flags(GType itype,
+				   const char *detailed_signal,
+				   GCallback callback,
+				   gpointer data,
+				   GConnectFlags flags);
+
 /*< private >*/
 void	 g_signal_handlers_destroy	      (gpointer		  instance);
 void	 _g_signals_destroy		      (GType		  itype);
