/soc/2013/ankitkv/gobjectification: ed2518145911: Merged soc.201...

Ankit Vani a at nevitus.org
Wed Sep 25 09:59:29 EDT 2013


Changeset: ed2518145911d34fc903e5a9351a66f4e1372df9
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-09-25 19:29 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/ed2518145911

Description:

Merged soc.2013.gobjectification branch

diffstat:

 pidgin/gtkconv.c    |  386 ++++++++++++++++++++++++++--------------------------
 pidgin/gtkconv.h    |   12 +-
 pidgin/gtkconvwin.h |   76 +++++----
 3 files changed, 236 insertions(+), 238 deletions(-)

diffs (truncated from 898 to 300 lines):

diff --git a/pidgin/gtkconv.c b/pidgin/gtkconv.c
--- a/pidgin/gtkconv.c
+++ b/pidgin/gtkconv.c
@@ -1179,8 +1179,8 @@ menu_find_cb(GtkAction *action, gpointer
 {
 	PidginWindow *gtkwin = data;
 	PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(gtkwin);
-	gtk_widget_show_all(gtkconv->quickfind.container);
-	gtk_widget_grab_focus(gtkconv->quickfind.entry);
+	gtk_widget_show_all(gtkconv->quickfind_container);
+	gtk_widget_grab_focus(gtkconv->quickfind_entry);
 }
 
 #ifdef USE_VV
@@ -1193,9 +1193,9 @@ menu_initiate_media_call_cb(GtkAction *a
 
 	purple_protocol_initiate_media(account,
 			purple_conversation_get_name(conv),
-			action == win->menu.audio_call ? PURPLE_MEDIA_AUDIO :
-			action == win->menu.video_call ? PURPLE_MEDIA_VIDEO :
-			action == win->menu.audio_video_call ? PURPLE_MEDIA_AUDIO |
+			action == win->menu->audio_call ? PURPLE_MEDIA_AUDIO :
+			action == win->menu->video_call ? PURPLE_MEDIA_VIDEO :
+			action == win->menu->audio_video_call ? PURPLE_MEDIA_AUDIO |
 			PURPLE_MEDIA_VIDEO : PURPLE_MEDIA_NONE);
 }
 #endif
@@ -1220,7 +1220,7 @@ menu_get_attention_cb(GObject *obj, gpoi
 
 	if (PURPLE_IS_IM_CONVERSATION(conv)) {
 		int index;
-		if ((GtkAction *)obj == win->menu.get_attention)
+		if ((GtkAction *)obj == win->menu->get_attention)
 			index = 0;
 		else
 			index = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(obj), "index"));
@@ -2290,7 +2290,7 @@ pidgin_conv_switch_active_conversation(P
 	gtkconv->active_conv = conv;
 
 	purple_conversation_set_logging(conv,
-		gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(gtkconv->win->menu.logging)));
+		gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(gtkconv->win->menu->logging)));
 
 	entry = GTK_WEBVIEW(gtkconv->entry);
 	protocol_name = purple_account_get_protocol_name(purple_conversation_get_account(conv));
@@ -3235,18 +3235,18 @@ sound_method_pref_changed_cb(const char 
 
 	if (!strcmp(method, "none"))
 	{
-		gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.sounds),
+		gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds),
 		                             FALSE);
-		gtk_action_set_sensitive(win->menu.sounds, FALSE);
+		gtk_action_set_sensitive(win->menu->sounds, FALSE);
 	}
 	else
 	{
 		PidginConversation *gtkconv = pidgin_conv_window_get_active_gtkconv(win);
 
 		if (gtkconv != NULL)
-			gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu.sounds),
+			gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(win->menu->sounds),
 			                             gtkconv->make_sound);
-		gtk_action_set_sensitive(win->menu.sounds, TRUE);
+		gtk_action_set_sensitive(win->menu->sounds, TRUE);
 	}
 }
 
@@ -3368,24 +3368,24 @@ regenerate_media_items(PidginWindow *win
 				purple_protocol_get_media_caps(account,
 				purple_conversation_get_name(conv));
 
-		gtk_action_set_sensitive(win->menu.audio_call,
+		gtk_action_set_sensitive(win->menu->audio_call,
 				caps & PURPLE_MEDIA_CAPS_AUDIO
 				? TRUE : FALSE);
-		gtk_action_set_sensitive(win->menu.video_call,
+		gtk_action_set_sensitive(win->menu->video_call,
 				caps & PURPLE_MEDIA_CAPS_VIDEO
 				? TRUE : FALSE);
-		gtk_action_set_sensitive(win->menu.audio_video_call,
+		gtk_action_set_sensitive(win->menu->audio_video_call,
 				caps & PURPLE_MEDIA_CAPS_AUDIO_VIDEO
 				? TRUE : FALSE);
 	} else if (PURPLE_IS_CHAT_CONVERSATION(conv)) {
 		/* for now, don't care about chats... */
-		gtk_action_set_sensitive(win->menu.audio_call, FALSE);
-		gtk_action_set_sensitive(win->menu.video_call, FALSE);
-		gtk_action_set_sensitive(win->menu.audio_video_call, FALSE);
+		gtk_action_set_sensitive(win->menu->audio_call, FALSE);
+		gtk_action_set_sensitive(win->menu->video_call, FALSE);
+		gtk_action_set_sensitive(win->menu->audio_video_call, FALSE);
 	} else {
-		gtk_action_set_sensitive(win->menu.audio_call, FALSE);
-		gtk_action_set_sensitive(win->menu.video_call, FALSE);
-		gtk_action_set_sensitive(win->menu.audio_video_call, FALSE);
+		gtk_action_set_sensitive(win->menu->audio_call, FALSE);
+		gtk_action_set_sensitive(win->menu->video_call, FALSE);
+		gtk_action_set_sensitive(win->menu->audio_video_call, FALSE);
 	}
 #endif
 }
@@ -3404,7 +3404,7 @@ regenerate_attention_items(PidginWindow 
 	if (!conv)
 		return;
 
-	attention = gtk_ui_manager_get_widget(win->menu.ui,
+	attention = gtk_ui_manager_get_widget(win->menu->ui,
 	                                      "/Conversation/ConversationMenu/GetAttention");
 
 	/* Remove the previous entries */
@@ -3454,7 +3454,7 @@ regenerate_options_items(PidginWindow *w
 	GtkWidget *more_menu;
 
 	gtkconv = pidgin_conv_window_get_active_gtkconv(win);
-	more_menu = gtk_ui_manager_get_widget(win->menu.ui,
+	more_menu = gtk_ui_manager_get_widget(win->menu->ui,
 	                                      "/Conversation/ConversationMenu/MoreMenu");
 	gtk_widget_show(more_menu);
 	menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(more_menu));
@@ -3513,7 +3513,7 @@ regenerate_plugins_items(PidginWindow *w
 		action_items = g_list_delete_link(action_items, action_items);
 	}
 
-	item = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/OptionsMenu");
+	item = gtk_ui_manager_get_widget(win->menu->ui, "/Conversation/OptionsMenu");
 	menu = gtk_menu_item_get_submenu(GTK_MENU_ITEM(item));
 
 	list = purple_conversation_get_extended_menu(conv);
@@ -3543,7 +3543,7 @@ static void menubar_activated(GtkWidget 
 	/* The following are to make sure the 'More' submenu is not regenerated every time
 	 * the focus shifts from 'Conversations' to some other menu and back. */
 	g_signal_handlers_block_by_func(G_OBJECT(item), G_CALLBACK(menubar_activated), data);
-	g_signal_connect(G_OBJECT(win->menu.menubar), "deactivate", G_CALLBACK(focus_out_from_menubar), data);
+	g_signal_connect(G_OBJECT(win->menu->menubar), "deactivate", G_CALLBACK(focus_out_from_menubar), data);
 }
 
 static void
@@ -3551,9 +3551,9 @@ focus_out_from_menubar(GtkWidget *wid, P
 {
 	/* The menubar has been deactivated. Make sure the 'More' submenu is regenerated next time
 	 * the 'Conversation' menu pops up. */
-	GtkWidget *menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
+	GtkWidget *menuitem = gtk_ui_manager_get_widget(win->menu->ui, "/Conversation/ConversationMenu");
 	g_signal_handlers_unblock_by_func(G_OBJECT(menuitem), G_CALLBACK(menubar_activated), win);
-	g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu.menubar),
+	g_signal_handlers_disconnect_by_func(G_OBJECT(win->menu->menubar),
 				G_CALLBACK(focus_out_from_menubar), win);
 }
 
@@ -3579,133 +3579,133 @@ setup_menubar(PidginWindow *win)
 	                                    G_N_ELEMENTS(menu_toggle_entries),
 	                                    win);
 
-	win->menu.ui = gtk_ui_manager_new();
-	gtk_ui_manager_insert_action_group(win->menu.ui, action_group, 0);
-
-	accel_group = gtk_ui_manager_get_accel_group(win->menu.ui);
+	win->menu->ui = gtk_ui_manager_new();
+	gtk_ui_manager_insert_action_group(win->menu->ui, action_group, 0);
+
+	accel_group = gtk_ui_manager_get_accel_group(win->menu->ui);
 	gtk_window_add_accel_group(GTK_WINDOW(win->window), accel_group);
 	g_signal_connect(G_OBJECT(accel_group), "accel-changed",
 	                 G_CALLBACK(pidgin_save_accels_cb), NULL);
 
 	error = NULL;
-	if (!gtk_ui_manager_add_ui_from_string(win->menu.ui, conversation_menu, -1, &error))
+	if (!gtk_ui_manager_add_ui_from_string(win->menu->ui, conversation_menu, -1, &error))
 	{
 		g_message("building menus failed: %s", error->message);
 		g_error_free(error);
 		exit(EXIT_FAILURE);
 	}
 
-	win->menu.menubar =
-		gtk_ui_manager_get_widget(win->menu.ui, "/Conversation");
+	win->menu->menubar =
+		gtk_ui_manager_get_widget(win->menu->ui, "/Conversation");
 
 	/* Make sure the 'Conversation -> More' menuitems are regenerated whenever
 	 * the 'Conversation' menu pops up because the entries can change after the
 	 * conversation is created. */
-	menuitem = gtk_ui_manager_get_widget(win->menu.ui, "/Conversation/ConversationMenu");
+	menuitem = gtk_ui_manager_get_widget(win->menu->ui, "/Conversation/ConversationMenu");
 	g_signal_connect(G_OBJECT(menuitem), "activate", G_CALLBACK(menubar_activated), win);
 
-	win->menu.view_log =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->view_log =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/ViewLog");
 
 #ifdef USE_VV
-	win->menu.audio_call =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->audio_call =
+		gtk_ui_manager_get_action(win->menu->ui,
 					    "/Conversation/ConversationMenu/MediaMenu/AudioCall");
-	win->menu.video_call =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->video_call =
+		gtk_ui_manager_get_action(win->menu->ui,
 					    "/Conversation/ConversationMenu/MediaMenu/VideoCall");
-	win->menu.audio_video_call =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->audio_video_call =
+		gtk_ui_manager_get_action(win->menu->ui,
 					    "/Conversation/ConversationMenu/MediaMenu/AudioVideoCall");
 #endif
 
 	/* --- */
 
-	win->menu.send_file =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->send_file =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/SendFile");
 
-	win->menu.get_attention =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->get_attention =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/GetAttention");
 
-	win->menu.add_pounce =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->add_pounce =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/AddBuddyPounce");
 
 	/* --- */
 
-	win->menu.get_info =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->get_info =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/GetInfo");
 
-	win->menu.invite =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->invite =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/Invite");
 
 	/* --- */
 
-	win->menu.alias =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->alias =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/Alias");
 
-	win->menu.block =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->block =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/Block");
 
-	win->menu.unblock =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->unblock =
+		gtk_ui_manager_get_action(win->menu->ui,
 					    "/Conversation/ConversationMenu/Unblock");
 
-	win->menu.add =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->add =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/Add");
 
-	win->menu.remove =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->remove =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/ConversationMenu/Remove");
 
 	/* --- */
 
-	win->menu.insert_link =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->insert_link =
+		gtk_ui_manager_get_action(win->menu->ui,
 				"/Conversation/ConversationMenu/InsertLink");
 
-	win->menu.insert_image =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->insert_image =
+		gtk_ui_manager_get_action(win->menu->ui,
 				"/Conversation/ConversationMenu/InsertImage");
 
 	/* --- */
 
-	win->menu.logging =
-		gtk_ui_manager_get_action(win->menu.ui,
+	win->menu->logging =
+		gtk_ui_manager_get_action(win->menu->ui,
 		                          "/Conversation/OptionsMenu/EnableLogging");
-	win->menu.sounds =
-		gtk_ui_manager_get_action(win->menu.ui,



More information about the Commits mailing list