Commit d7c1d477 authored by Christian Hergert's avatar Christian Hergert

gdbusobjectmanager: store signal ids for re-use

Having access to the signal-id is useful when we want to specify additional
signal related settings (such as va_marshaller).
parent 266a292a
......@@ -51,6 +51,16 @@
typedef GDBusObjectManagerIface GDBusObjectManagerInterface;
G_DEFINE_INTERFACE (GDBusObjectManager, g_dbus_object_manager, G_TYPE_OBJECT)
enum {
OBJECT_ADDED,
OBJECT_REMOVED,
INTERFACE_ADDED,
INTERFACE_REMOVED,
N_SIGNALS
};
static guint signals[N_SIGNALS];
static void
g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
{
......@@ -63,16 +73,17 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
g_signal_new (I_("object-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_added),
NULL,
NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
G_TYPE_DBUS_OBJECT);
signals[OBJECT_ADDED] =
g_signal_new (I_("object-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_added),
NULL,
NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
G_TYPE_DBUS_OBJECT);
/**
* GDBusObjectManager::object-removed:
......@@ -83,16 +94,17 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
g_signal_new (I_("object-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_removed),
NULL,
NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
G_TYPE_DBUS_OBJECT);
signals[OBJECT_REMOVED] =
g_signal_new (I_("object-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, object_removed),
NULL,
NULL,
g_cclosure_marshal_VOID__OBJECT,
G_TYPE_NONE,
1,
G_TYPE_DBUS_OBJECT);
/**
* GDBusObjectManager::interface-added:
......@@ -107,17 +119,18 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
g_signal_new (I_("interface-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_added),
NULL,
NULL,
NULL,
G_TYPE_NONE,
2,
G_TYPE_DBUS_OBJECT,
G_TYPE_DBUS_INTERFACE);
signals[INTERFACE_ADDED] =
g_signal_new (I_("interface-added"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_added),
NULL,
NULL,
NULL,
G_TYPE_NONE,
2,
G_TYPE_DBUS_OBJECT,
G_TYPE_DBUS_INTERFACE);
/**
* GDBusObjectManager::interface-removed:
......@@ -132,17 +145,18 @@ g_dbus_object_manager_default_init (GDBusObjectManagerIface *iface)
*
* Since: 2.30
*/
g_signal_new (I_("interface-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_removed),
NULL,
NULL,
NULL,
G_TYPE_NONE,
2,
G_TYPE_DBUS_OBJECT,
G_TYPE_DBUS_INTERFACE);
signals[INTERFACE_REMOVED] =
g_signal_new (I_("interface-removed"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GDBusObjectManagerIface, interface_removed),
NULL,
NULL,
NULL,
G_TYPE_NONE,
2,
G_TYPE_DBUS_OBJECT,
G_TYPE_DBUS_INTERFACE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment