pidgin.vv: e8eb025c: Rename state-changed enum and values.

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sat Mar 21 05:16:03 EDT 2009


-----------------------------------------------------------------
Revision: e8eb025c98fcbebbe47363c29426e81abbf78130
Ancestor: d270a8327348660c6b993347f32f33beafbdd800
Author: maiku at soc.pidgin.im
Date: 2009-03-21T03:49:11
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/e8eb025c98fcbebbe47363c29426e81abbf78130

Modified files:
        finch/gntmedia.c libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/google.c
        libpurple/protocols/jabber/jingle/rtp.c pidgin/gtkmedia.c

ChangeLog: 

Rename state-changed enum and values.

-------------- next part --------------
============================================================
--- finch/gntmedia.c	50105a4b0faa7ebc384073a6f55e7134cad402bb
+++ finch/gntmedia.c	e6b136fcfa4ddb1bf03f700481fc0e3366ef3d3c
@@ -226,14 +226,13 @@ static void
 }
 
 static void
-finch_media_state_changed_cb(PurpleMedia *media,
-		PurpleMediaStateChangedType type,
+finch_media_state_changed_cb(PurpleMedia *media, PurpleMediaState state,
 		gchar *sid, gchar *name, FinchMedia *gntmedia)
 {
-	purple_debug_info("gntmedia", "type: %d sid: %s name: %s\n",
-			type, sid, name);
+	purple_debug_info("gntmedia", "state: %d sid: %s name: %s\n",
+			state, sid, name);
 	if (sid == NULL && name == NULL) {
-		if (type == PURPLE_MEDIA_STATE_CHANGED_END) {
+		if (state == PURPLE_MEDIA_STATE_END) {
 			finch_media_emit_message(gntmedia,
 					_("The call has been terminated."));
 			finch_conversation_set_info_widget(
@@ -245,10 +244,10 @@ finch_media_state_changed_cb(PurpleMedia
 			 */
 			g_object_unref(gntmedia);
 		}
-	} else if (type == PURPLE_MEDIA_STATE_CHANGED_NEW
+	} else if (state == PURPLE_MEDIA_STATE_NEW
 			&& sid != NULL && name != NULL) {
 		finch_media_ready_cb(media, gntmedia);
-	} else if (type == PURPLE_MEDIA_STATE_CHANGED_CONNECTED) {
+	} else if (state == PURPLE_MEDIA_STATE_CONNECTED) {
 		finch_media_accept_cb(media, gntmedia);
 	}
 }
============================================================
--- libpurple/media.c	e37920ee3d4d08806b30b792311e12d7793e8736
+++ libpurple/media.c	200e976ea57afc4c04c91d188d8f00f6ba3f55af
@@ -171,12 +171,15 @@ purple_media_state_changed_get_type()
 	static GType type = 0;
 	if (type == 0) {
 		static const GEnumValue values[] = {
-			{ PURPLE_MEDIA_STATE_CHANGED_NEW, "PURPLE_MEDIA_STATE_CHANGED_NEW", "new" },
-			{ PURPLE_MEDIA_STATE_CHANGED_CONNECTED, "PURPLE_MEDIA_STATE_CHANGED_CONNECTED", "connected" },
-			{ PURPLE_MEDIA_STATE_CHANGED_END, "PURPLE_MEDIA_STATE_CHANGED_END", "end" },
+			{ PURPLE_MEDIA_STATE_NEW,
+				"PURPLE_MEDIA_STATE_NEW", "new" },
+			{ PURPLE_MEDIA_STATE_CONNECTED,
+				"PURPLE_MEDIA_STATE_CONNECTED", "connected" },
+			{ PURPLE_MEDIA_STATE_END,
+				"PURPLE_MEDIA_STATE_END", "end" },
 			{ 0, NULL, NULL }
 		};
-		type = g_enum_register_static("PurpleMediaStateChangedType", values);
+		type = g_enum_register_static("PurpleMediaState", values);
 	}
 	return type;
 }
@@ -271,7 +274,7 @@ purple_media_class_init (PurpleMediaClas
 	purple_media_signals[STATE_CHANGED] = g_signal_new("state-changed", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					 purple_smarshal_VOID__ENUM_STRING_STRING,
-					 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE_CHANGED,
+					 G_TYPE_NONE, 3, PURPLE_MEDIA_TYPE_STATE,
 					 G_TYPE_STRING, G_TYPE_STRING);
 	purple_media_signals[STREAM_INFO] = g_signal_new("stream-info", G_TYPE_FROM_CLASS(klass),
 					 G_SIGNAL_RUN_LAST, 0, NULL, NULL,
@@ -1450,7 +1453,7 @@ purple_media_end(PurpleMedia *media,
 	g_return_if_fail(PURPLE_IS_MEDIA(media));
 	if (session_id == NULL && participant == NULL) {
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-				0, PURPLE_MEDIA_STATE_CHANGED_END,
+				0, PURPLE_MEDIA_STATE_END,
 				NULL, NULL);
 		g_object_unref(media);
 	}
@@ -1767,7 +1770,7 @@ purple_media_connected_cb(PurpleMediaStr
 
 	g_signal_emit(stream->session->media,
 			purple_media_signals[STATE_CHANGED],
-			0, PURPLE_MEDIA_STATE_CHANGED_CONNECTED,
+			0, PURPLE_MEDIA_STATE_CONNECTED,
 			stream->session->id, stream->participant);
 	return FALSE;
 }
@@ -1907,7 +1910,7 @@ purple_media_add_stream_internal(PurpleM
 
 		purple_media_add_session(media, session);
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-				0, PURPLE_MEDIA_STATE_CHANGED_NEW,
+				0, PURPLE_MEDIA_STATE_NEW,
 				session->id, NULL);
 
 		session_type = purple_media_from_fs(type, FS_DIRECTION_SEND);
@@ -1928,7 +1931,7 @@ purple_media_add_stream_internal(PurpleM
 		return FALSE;
 	} else {
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-				0, PURPLE_MEDIA_STATE_CHANGED_NEW,
+				0, PURPLE_MEDIA_STATE_NEW,
 				NULL, who);
 	}
 
@@ -2029,7 +2032,7 @@ purple_media_add_stream_internal(PurpleM
 				 "src-pad-added", G_CALLBACK(purple_media_src_pad_added_cb), stream);
 
 		g_signal_emit(media, purple_media_signals[STATE_CHANGED],
-				0, PURPLE_MEDIA_STATE_CHANGED_NEW,
+				0, PURPLE_MEDIA_STATE_NEW,
 				session->id, who);
 	} else if (*direction != type_direction) {	
 		/* change direction */
============================================================
--- libpurple/media.h	85d3643c15bc655c404b3f91e178f91eda66a7a8
+++ libpurple/media.h	a369a914f5238f257a51980a5d93fcd920893370
@@ -44,7 +44,7 @@ G_BEGIN_DECLS
 #define PURPLE_IS_MEDIA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), PURPLE_TYPE_MEDIA))
 #define PURPLE_MEDIA_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS((obj), PURPLE_TYPE_MEDIA, PurpleMediaClass))
 
-#define PURPLE_MEDIA_TYPE_STATE_CHANGED	(purple_media_state_changed_get_type())
+#define PURPLE_MEDIA_TYPE_STATE      (purple_media_state_changed_get_type())
 #define PURPLE_MEDIA_TYPE_INFO_TYPE	(purple_media_info_type_get_type())
 
 /** @copydoc _PurpleMedia */
@@ -91,10 +91,10 @@ typedef enum {
 
 /** Media state-changed types */
 typedef enum {
-	PURPLE_MEDIA_STATE_CHANGED_NEW = 0,
-	PURPLE_MEDIA_STATE_CHANGED_CONNECTED,
-	PURPLE_MEDIA_STATE_CHANGED_END,
-} PurpleMediaStateChangedType;
+	PURPLE_MEDIA_STATE_NEW = 0,
+	PURPLE_MEDIA_STATE_CONNECTED,
+	PURPLE_MEDIA_STATE_END,
+} PurpleMediaState;
 
 /** Media info types */
 typedef enum {
============================================================
--- libpurple/protocols/jabber/google.c	34a6e4d43196714fbd6a3e592e2a3d25dfe0cbec
+++ libpurple/protocols/jabber/google.c	cba9b2be74268aa3825bdb66016d353be40d6e8a
@@ -217,12 +217,11 @@ static void
 }
 
 static void
-google_session_state_changed_cb(PurpleMedia *media,
-		PurpleMediaStateChangedType type,
+google_session_state_changed_cb(PurpleMedia *media, PurpleMediaState state,
 		gchar *sid, gchar *name, GoogleSession *session)
 {
 	if (sid == NULL && name == NULL) {
-		if (type == PURPLE_MEDIA_STATE_CHANGED_END) {
+		if (state == PURPLE_MEDIA_STATE_END) {
 			google_session_destroy(session);
 		}
 	}
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	6b58a3c2385b5d2420b74f3e9c92188bc03fae1a
+++ libpurple/protocols/jabber/jingle/rtp.c	ad16b3e0684052d3059e6f7bdde74a5a3a6d7fd7
@@ -435,10 +435,11 @@ static void
 }
 
 static void
-jingle_rtp_state_changed_cb(PurpleMedia *media, PurpleMediaStateChangedType type,
+jingle_rtp_state_changed_cb(PurpleMedia *media, PurpleMediaState state,
 		gchar *sid, gchar *name, JingleSession *session)
 {
-	purple_debug_info("jingle-rtp", "state-changed: type %d id: %s name: %s\n", type, sid, name);
+	purple_debug_info("jingle-rtp", "state-changed: state %d "
+			"id: %s name: %s\n", state, sid, name);
 }
 
 static void
============================================================
--- pidgin/gtkmedia.c	766f8e1b45748007d5f231bde29ed83953c1ae2d
+++ pidgin/gtkmedia.c	f77c3f634a74d3a72f1ae58cb609bcaafc10e77f
@@ -660,22 +660,21 @@ static void
 }
 
 static void
-pidgin_media_state_changed_cb(PurpleMedia *media,
-		PurpleMediaStateChangedType type,
+pidgin_media_state_changed_cb(PurpleMedia *media, PurpleMediaState state,
 		gchar *sid, gchar *name, PidginMedia *gtkmedia)
 {
-	purple_debug_info("gtkmedia", "type: %d sid: %s name: %s\n",
-			type, sid, name);
+	purple_debug_info("gtkmedia", "state: %d sid: %s name: %s\n",
+			state, sid, name);
 	if (sid == NULL && name == NULL) {
-		if (type == PURPLE_MEDIA_STATE_CHANGED_END) {
+		if (state == PURPLE_MEDIA_STATE_END) {
 			pidgin_media_emit_message(gtkmedia,
 					_("The call has been terminated."));
 			gtk_widget_destroy(GTK_WIDGET(gtkmedia));
 		}
-	} else if (type == PURPLE_MEDIA_STATE_CHANGED_NEW &&
+	} else if (state == PURPLE_MEDIA_STATE_NEW &&
 			sid != NULL && name != NULL) {
 		pidgin_media_ready_cb(media, gtkmedia, sid);
-	} else if (type == PURPLE_MEDIA_STATE_CHANGED_CONNECTED &&
+	} else if (state == PURPLE_MEDIA_STATE_CONNECTED &&
 			purple_media_get_session_type(media, sid) &
 			PURPLE_MEDIA_RECV_AUDIO) {
 		GstElement *media_sink = purple_media_get_sink(media,


More information about the Commits mailing list