Mercurial > pidgin
comparison libpurple/media.c @ 24987:c7d4b67b3332
Add initiator property to PurpleMedia.
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Sun, 04 Jan 2009 05:19:54 +0000 |
parents | ee2a2a9dda01 |
children | 7caa7e2ce870 |
comparison
equal
deleted
inserted
replaced
24986:f0c2e27c7ae7 | 24987:c7d4b67b3332 |
---|---|
71 }; | 71 }; |
72 | 72 |
73 struct _PurpleMediaPrivate | 73 struct _PurpleMediaPrivate |
74 { | 74 { |
75 FsConference *conference; | 75 FsConference *conference; |
76 gboolean initiator; | |
76 | 77 |
77 GHashTable *sessions; /* PurpleMediaSession table */ | 78 GHashTable *sessions; /* PurpleMediaSession table */ |
78 GHashTable *participants; /* FsParticipant table */ | 79 GHashTable *participants; /* FsParticipant table */ |
79 | 80 |
80 GList *streams; /* PurpleMediaStream table */ | 81 GList *streams; /* PurpleMediaStream table */ |
122 static guint purple_media_signals[LAST_SIGNAL] = {0}; | 123 static guint purple_media_signals[LAST_SIGNAL] = {0}; |
123 | 124 |
124 enum { | 125 enum { |
125 PROP_0, | 126 PROP_0, |
126 PROP_CONFERENCE, | 127 PROP_CONFERENCE, |
128 PROP_INITIATOR, | |
127 }; | 129 }; |
128 | 130 |
129 GType | 131 GType |
130 purple_media_get_type() | 132 purple_media_get_type() |
131 { | 133 { |
162 g_object_class_install_property(gobject_class, PROP_CONFERENCE, | 164 g_object_class_install_property(gobject_class, PROP_CONFERENCE, |
163 g_param_spec_object("conference", | 165 g_param_spec_object("conference", |
164 "Farsight conference", | 166 "Farsight conference", |
165 "The FsConference associated with this media.", | 167 "The FsConference associated with this media.", |
166 FS_TYPE_CONFERENCE, | 168 FS_TYPE_CONFERENCE, |
169 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); | |
170 | |
171 g_object_class_install_property(gobject_class, PROP_INITIATOR, | |
172 g_param_spec_boolean("initiator", | |
173 "initiator", | |
174 "If the local user initiated the conference.", | |
175 FALSE, | |
167 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); | 176 G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE)); |
168 | 177 |
169 purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), | 178 purple_media_signals[ERROR] = g_signal_new("error", G_TYPE_FROM_CLASS(klass), |
170 G_SIGNAL_RUN_LAST, 0, NULL, NULL, | 179 G_SIGNAL_RUN_LAST, 0, NULL, NULL, |
171 g_cclosure_marshal_VOID__STRING, | 180 g_cclosure_marshal_VOID__STRING, |
309 if (media->priv->conference) | 318 if (media->priv->conference) |
310 g_object_unref(media->priv->conference); | 319 g_object_unref(media->priv->conference); |
311 media->priv->conference = g_value_get_object(value); | 320 media->priv->conference = g_value_get_object(value); |
312 g_object_ref(media->priv->conference); | 321 g_object_ref(media->priv->conference); |
313 break; | 322 break; |
323 case PROP_INITIATOR: | |
324 media->priv->initiator = g_value_get_boolean(value); | |
325 break; | |
314 default: | 326 default: |
315 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 327 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
316 break; | 328 break; |
317 } | 329 } |
318 } | 330 } |
326 media = PURPLE_MEDIA(object); | 338 media = PURPLE_MEDIA(object); |
327 | 339 |
328 switch (prop_id) { | 340 switch (prop_id) { |
329 case PROP_CONFERENCE: | 341 case PROP_CONFERENCE: |
330 g_value_set_object(value, media->priv->conference); | 342 g_value_set_object(value, media->priv->conference); |
343 break; | |
344 case PROP_INITIATOR: | |
345 g_value_set_boolean(value, media->priv->initiator); | |
331 break; | 346 break; |
332 default: | 347 default: |
333 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | 348 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); |
334 break; | 349 break; |
335 } | 350 } |