diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-09-28 11:33:48 +0200 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-09-28 11:33:48 +0200 |
commit | 6ff85337ef55c8f0e8a26f77f7177ff349948f87 (patch) | |
tree | e9e8e224113d2b127c6197ba35c01569b66e49dd /telepathy-glib | |
parent | ef2f8ce5e5ebd8c9b84c9e6e07d7672690dea04a (diff) | |
download | telepathy-glib-6ff85337ef55c8f0e8a26f77f7177ff349948f87.tar.gz |
tube-conn: add 'closed' signal
Diffstat (limited to 'telepathy-glib')
-rw-r--r-- | telepathy-glib/stream-tube-connection-internal.h | 3 | ||||
-rw-r--r-- | telepathy-glib/stream-tube-connection.c | 33 |
2 files changed, 36 insertions, 0 deletions
diff --git a/telepathy-glib/stream-tube-connection-internal.h b/telepathy-glib/stream-tube-connection-internal.h index 6564d3179..5e980e17c 100644 --- a/telepathy-glib/stream-tube-connection-internal.h +++ b/telepathy-glib/stream-tube-connection-internal.h @@ -41,6 +41,9 @@ TpStreamTubeConnection * _tp_stream_tube_connection_new ( void _tp_stream_tube_connection_set_contact (TpStreamTubeConnection *self, TpContact *contact); +void _tp_stream_tube_connection_fire_closed (TpStreamTubeConnection *self, + GError *error); + G_END_DECLS #endif diff --git a/telepathy-glib/stream-tube-connection.c b/telepathy-glib/stream-tube-connection.c index e2513cd20..01548f903 100644 --- a/telepathy-glib/stream-tube-connection.c +++ b/telepathy-glib/stream-tube-connection.c @@ -64,6 +64,14 @@ enum { N_PROPS }; +enum /* signals */ +{ + CLOSED, + LAST_SIGNAL +}; + +static guint _signals[LAST_SIGNAL] = { 0, }; + struct _TpStreamTubeConnectionPrivate { GSocketConnection *connection; @@ -193,6 +201,24 @@ tp_stream_tube_connection_class_init (TpStreamTubeConnectionClass *cls) TP_TYPE_CONTACT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_CONTACT, param_spec); + + /** + * TpStreamTubeConnection::closed + * @self: the #TpStreamTubeConnection + * @error: (transfer none): the error reported by the connection manager + * + * The ::closed signal is emitted when the connection manager reports that + * a tube connection has been closed. + * + * Since: 0.13.UNRELEASED + */ + _signals[CLOSED] = g_signal_new ("closed", + G_OBJECT_CLASS_TYPE (cls), + G_SIGNAL_RUN_LAST, + 0, NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, + 1, G_TYPE_POINTER); } TpStreamTubeConnection * @@ -245,3 +271,10 @@ _tp_stream_tube_connection_set_contact (TpStreamTubeConnection *self, self->priv->contact = g_object_ref (contact); g_object_notify (G_OBJECT (self), "contact"); } + +void +_tp_stream_tube_connection_fire_closed (TpStreamTubeConnection *self, + GError *error) +{ + g_signal_emit (self, _signals[CLOSED], 0, error); +} |