pidgin: e75be2b3: Prepare Pidgin plugins for GTK+3.0. They...

qulogic at pidgin.im qulogic at pidgin.im
Tue Apr 13 19:35:40 EDT 2010


-----------------------------------------------------------------
Revision: e75be2b3231fe6c14d7cad09b93b2219775c88ab
Ancestor: 2c1bc219829d509bf58dce4961eaf614ec4b0629
Author: qulogic at pidgin.im
Date: 2010-04-13T23:22:31
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/e75be2b3231fe6c14d7cad09b93b2219775c88ab

Modified files:
        pidgin/plugins/convcolors.c pidgin/plugins/disco/gtkdisco.c
        pidgin/plugins/gestures/stroke-draw.c
        pidgin/plugins/notify.c pidgin/plugins/pidginrc.c
        pidgin/plugins/themeedit.c pidgin/plugins/ticker/gtkticker.c
        pidgin/plugins/timestamp_format.c
        pidgin/plugins/xmppconsole.c

ChangeLog: 

Prepare Pidgin plugins for GTK+3.0. They're almost GSeal-compliant, except
for a few things that aren't in GTK+ releases yet.

-------------- next part --------------
============================================================
--- pidgin/plugins/convcolors.c	0123c7830bce787a14d68809b533f61e27c37ead
+++ pidgin/plugins/convcolors.c	c9285eb2b5f6f9daace3c0edab2d62a56f0a3484
@@ -198,7 +198,12 @@ color_response(GtkDialog *color_dialog, 
 {
 	if (response == GTK_RESPONSE_OK)
 	{
+#if GTK_CHECK_VERSION(2,14,0)
+		GtkWidget *colorsel =
+			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog));
+#else
 		GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel;
+#endif
 		GdkColor color;
 		char colorstr[8];
 		char tmp[128];
@@ -232,8 +237,15 @@ set_color(GtkWidget *widget, const char 
 	g_snprintf(tmp, sizeof(tmp), "%s/color", data);
 	if (gdk_color_parse(purple_prefs_get_string(tmp), &color))
 	{
+#if GTK_CHECK_VERSION(2,14,0)
+		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
+			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))),
+			&color);
+#else
 		gtk_color_selection_set_current_color(
-				GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color);
+			GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel),
+			&color);
+#endif
 	}
 
 	gtk_window_present(GTK_WINDOW(color_dialog));
============================================================
--- pidgin/plugins/disco/gtkdisco.c	d9a63dace58cdebb6d795cfc3e21ca1c94e24ffa
+++ pidgin/plugins/disco/gtkdisco.c	b31dab5b2ef8b0a1647f6964af85b514f99dcd5a
@@ -430,7 +430,13 @@ disco_paint_tooltip(GtkWidget *tipwindow
 disco_paint_tooltip(GtkWidget *tipwindow, gpointer data)
 {
 	PangoLayout *layout = g_object_get_data(G_OBJECT(tipwindow), "tooltip-plugin");
+#if GTK_CHECK_VERSION(2,14,0)
+	gtk_paint_layout(gtk_widget_get_style(tipwindow),
+			gtk_widget_get_window(tipwindow),
+			GTK_STATE_NORMAL, FALSE,
+#else
 	gtk_paint_layout(tipwindow->style, tipwindow->window, GTK_STATE_NORMAL, FALSE,
+#endif
 			NULL, tipwindow, "tooltip",
 			6, 6, layout);
 	return TRUE;
============================================================
--- pidgin/plugins/gestures/stroke-draw.c	4101ccfbfe98a8cbb102e75bbf06d076b276962a
+++ pidgin/plugins/gestures/stroke-draw.c	b3160a797469a2ff940f2f77461a4da36e1f84c1
@@ -19,6 +19,9 @@
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
+#if !GTK_CHECK_VERSION(2,14,0)
+#define gtk_widget_get_window(x) x->window
+#endif
 
 static void gstroke_invisible_window_init (GtkWidget *widget);
 /*FIXME: Maybe these should be put in a structure, and not static...*/
@@ -75,7 +78,8 @@ record_stroke_segment (GtkWidget *widget
       /* FIXME: this does not work. It will only work if we create a
          corresponding GDK window for stroke_window and draw on
          that... */
-      gdk_draw_line (widget->window, widget->style->fg_gc[GTK_STATE_NORMAL],
+      gdk_draw_line (gtk_widget_get_window(widget),
+                     widget->style->fg_gc[GTK_STATE_NORMAL],
                      last_mouse_position.last_point.x,
                      last_mouse_position.last_point.y,
                      x,
@@ -156,7 +160,7 @@ process_event (GtkWidget *widget, GdkEve
 	  if (cursor == NULL)
 		  cursor = gdk_cursor_new(GDK_PENCIL);
 
-      gdk_pointer_grab (widget->window, FALSE,
+      gdk_pointer_grab (gtk_widget_get_window(widget), FALSE,
 			GDK_BUTTON_RELEASE_MASK, NULL, cursor,
 			event->button.time);
       timer_id = g_timeout_add (GSTROKE_TIMEOUT_DURATION,
@@ -334,8 +338,8 @@ gstroke_invisible_window_init (GtkWidget
   unsigned long mask, col_border, col_background;
   unsigned int border_width;
   XSizeHints hints;
-  Display *disp = GDK_WINDOW_XDISPLAY(widget->window);
-  Window wind = GDK_WINDOW_XWINDOW (widget->window);
+  Display *disp = GDK_WINDOW_XDISPLAY(gtk_widget_get_window(widget));
+  Window wind = GDK_WINDOW_XWINDOW (gtk_widget_get_window(widget));
   int screen = DefaultScreen (disp);
 
 	if (!gstroke_draw_strokes())
============================================================
--- pidgin/plugins/notify.c	536ff7f9432a6645d9a53fc4d2b574981cb17903
+++ pidgin/plugins/notify.c	60c2908a982740a10e96e569c9ee39fc8a7b7751
@@ -547,7 +547,11 @@ handle_count_xprop(PidginWindow *purplew
 	}
 
 	count = count_messages(purplewin);
+#if GTK_CHECK_VERSION(2,14,0)
+	gdkwin = gtk_widget_get_window(window);
+#else
 	gdkwin = window->window;
+#endif
 
 	gdk_property_change(gdkwin, _PurpleUnseenCount, _Cardinal, 32,
 	                    GDK_PROP_MODE_REPLACE, (guchar *) &count, 1);
============================================================
--- pidgin/plugins/pidginrc.c	24d31d7614fcf981225be1b8ec27c93af5e09030
+++ pidgin/plugins/pidginrc.c	c9783ad2a9a9dd6f2609f702c168f7031e596552
@@ -242,7 +242,12 @@ purplerc_color_response(GtkDialog *color
 	if (response == GTK_RESPONSE_OK) {
 		GdkColor color;
 		gchar colorstr[8];
+#if GTK_CHECK_VERSION(2,14,0)
+		GtkWidget *colorsel =
+			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog));
+#else
 		GtkWidget *colorsel = GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel;
+#endif
 
 		gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
 
@@ -273,7 +278,13 @@ purplerc_set_color(GtkWidget *widget, gp
 
 	if (pref != NULL && strcmp(pref, "")) {
 		if (gdk_color_parse(pref, &color)) {
+#if GTK_CHECK_VERSION(2,14,0)
+			gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
+				gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(color_dialog))),
+				&color);
+#else
 			gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(color_dialog)->colorsel), &color);
+#endif
 		}
 	}
 
@@ -327,7 +338,7 @@ purplerc_set_font(GtkWidget *widget, gpo
 	pref = purple_prefs_get_string(prefpath);
 
 	if (pref != NULL && strcmp(pref, "")) {
-		gtk_font_selection_set_font_name(GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(font_dialog)->fontsel), pref);
+		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(font_dialog), pref);
 	}
 
 	gtk_window_present(GTK_WINDOW(font_dialog));
============================================================
--- pidgin/plugins/themeedit.c	95e70f13d7a066ef54421dd0ea8fff8fa9ee2c40
+++ pidgin/plugins/themeedit.c	8040c6ce996163ba9d7015bfacc4d23e14a1961a
@@ -61,10 +61,17 @@ theme_color_selected(GtkDialog *dialog, 
 theme_color_selected(GtkDialog *dialog, gint response, const char *prop)
 {
 	if (response == GTK_RESPONSE_OK) {
+		GtkWidget *colorsel;
 		GdkColor color;
 		PidginBlistTheme *theme;
 
-		gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), &color);
+#if GTK_CHECK_VERSION(2,14,0)
+		colorsel =
+			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog));
+#else
+		colorsel = GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel;
+#endif
+		gtk_color_selection_get_current_color(GTK_COLOR_SELECTION(colorsel), &color);
 
 		theme = pidgin_blist_get_theme();
 
@@ -119,7 +126,7 @@ theme_font_select_face(GtkWidget *widget
 	face = pidgin_theme_font_get_font_face(font);
 	dialog = gtk_font_selection_dialog_new(_("Select Font"));
 	if (face && *face)
-		gtk_font_selection_set_font_name(GTK_FONT_SELECTION(GTK_FONT_SELECTION_DIALOG(dialog)->fontsel),
+		gtk_font_selection_dialog_set_font_name(GTK_FONT_SELECTION_DIALOG(dialog),
 				face);
 	g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_font_face_selected),
 			font);
@@ -145,9 +152,16 @@ theme_color_select(GtkWidget *widget, gp
 	}
 
 	dialog = gtk_color_selection_dialog_new(_("Select Color"));
+#if GTK_CHECK_VERSION(2,14,0)
 	if (color)
+		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(
+			gtk_color_selection_dialog_get_color_selection(GTK_COLOR_SELECTION_DIALOG(dialog))),
+			color);
+#else
+	if (color)
 		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel),
 				color);
+#endif
 	g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected),
 			prop);
 
============================================================
--- pidgin/plugins/ticker/gtkticker.c	1d0526efbd5a3cf05fd1c72ac9e3eaacc88a57d3
+++ pidgin/plugins/ticker/gtkticker.c	6e5e2026bc01bc541d82f5ac3594472cd3d85e0c
@@ -21,9 +21,37 @@
  * GtkTicker Copyright 2000 Syd Logan
  */
 
+/* FIXME: GTK+ deprecated GTK_WIDGET_MAPPED/REALIZED, but don't provide
+          accessor functions yet. */
+#undef GSEAL_ENABLE
+
 #include "gtkticker.h"
 #include <gtk/gtk.h>
 
+/* These don't seem to be in a release yet. See BZ #69872 */
+#define gtk_widget_is_mapped(x) GTK_WIDGET_MAPPED(x)
+#define gtk_widget_is_realized(x) GTK_WIDGET_REALIZED(x)
+#define gtk_widget_set_realized(x,y) do {\
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_REALIZED); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_REALIZED); \
+} while(0)
+#define gtk_widget_set_mapped(x,y) do {\
+	if (y) \
+		GTK_WIDGET_SET_FLAGS(x, GTK_MAPPED); \
+	else \
+		GTK_WIDGET_UNSET_FLAGS(x, GTK_MAPPED); \
+} while(0)
+
+#if !GTK_CHECK_VERSION(2,18,0)
+#define gtk_widget_get_visible(x) GTK_WIDGET_VISIBLE(x)
+
+#if !GTK_CHECK_VERSION(2,14,0)
+#define gtk_widget_get_window(x) x->window
+#endif
+#endif
+
 static void gtk_ticker_compute_offsets (GtkTicker    *ticker);
 static void gtk_ticker_class_init    (GtkTickerClass    *klass);
 static void gtk_ticker_init          (GtkTicker         *ticker);
@@ -119,7 +147,11 @@ static void gtk_ticker_init (GtkTicker *
 
 static void gtk_ticker_init (GtkTicker *ticker)
 {
+#if GTK_CHECK_VERSION(2,18,0)
+	gtk_widget_set_has_window (GTK_WIDGET (ticker), TRUE);
+#else
 	GTK_WIDGET_UNSET_FLAGS (ticker, GTK_NO_WINDOW);
+#endif
 
 	ticker->interval = (guint) 200;
 	ticker->scootch = (guint) 2;
@@ -149,12 +181,13 @@ static void gtk_ticker_put (GtkTicker *t
 
 	ticker->children = g_list_append (ticker->children, child_info);
 
-	if (GTK_WIDGET_REALIZED (ticker))
+	if (gtk_widget_is_realized (ticker))
 		gtk_widget_realize (widget);
 
-	if (GTK_WIDGET_VISIBLE (ticker) && GTK_WIDGET_VISIBLE (widget))
+	if (gtk_widget_get_visible (GTK_WIDGET (ticker)) &&
+		gtk_widget_get_visible (widget))
 	{
-		if (GTK_WIDGET_MAPPED (ticker))
+		if (gtk_widget_is_mapped (GTK_WIDGET (ticker)))
 			gtk_widget_map (widget);
 
 		gtk_widget_queue_resize (GTK_WIDGET (ticker));
@@ -213,7 +246,7 @@ static int ticker_timeout(gpointer data)
 {
 	GtkTicker *ticker = (GtkTicker *) data;
 
-	if (GTK_WIDGET_VISIBLE (ticker))
+	if (gtk_widget_get_visible (GTK_WIDGET (ticker)))
 		gtk_widget_queue_resize (GTK_WIDGET (ticker));
 
 	return( TRUE );
@@ -255,7 +288,7 @@ static void gtk_ticker_map (GtkWidget *w
 	g_return_if_fail (widget != NULL);
 	g_return_if_fail (GTK_IS_TICKER (widget));
 
-	GTK_WIDGET_SET_FLAGS (widget, GTK_MAPPED);
+	gtk_widget_set_mapped (widget, TRUE);
 	ticker = GTK_TICKER (widget);
 
 	children = ticker->children;
@@ -264,29 +297,42 @@ static void gtk_ticker_map (GtkWidget *w
 		child = children->data;
 		children = children->next;
 
-		if (GTK_WIDGET_VISIBLE (child->widget) &&
-				!GTK_WIDGET_MAPPED (child->widget))
+		if (gtk_widget_get_visible (child->widget) &&
+				!gtk_widget_is_mapped (child->widget))
 			gtk_widget_map (child->widget);
 	}
 
-	gdk_window_show (widget->window);
+	gdk_window_show (gtk_widget_get_window (widget));
 }
 
 static void gtk_ticker_realize (GtkWidget *widget)
 {
 	GdkWindowAttr attributes;
 	gint attributes_mask;
+	GdkWindow *window;
+	GtkStyle *style;
+#if GTK_CHECK_VERSION(2,18,0)
+	GtkAllocation allocation;
+#endif
 
 	g_return_if_fail (widget != NULL);
 	g_return_if_fail (GTK_IS_TICKER (widget));
 
-	GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
+	gtk_widget_set_realized (widget, TRUE);
 
 	attributes.window_type = GDK_WINDOW_CHILD;
+#if GTK_CHECK_VERSION(2,18,0)
+	gtk_widget_get_allocation (widget, &allocation);
+	attributes.x = allocation.x;
+	attributes.y = allocation.y;
+	attributes.width = allocation.width;
+	attributes.height = allocation.height;
+#else
 	attributes.x = widget->allocation.x;
 	attributes.y = widget->allocation.y;
 	attributes.width = widget->allocation.width;
 	attributes.height = widget->allocation.height;
+#endif
 	attributes.wclass = GDK_INPUT_OUTPUT;
 	attributes.visual = gtk_widget_get_visual (widget);
 	attributes.colormap = gtk_widget_get_colormap (widget);
@@ -295,12 +341,23 @@ static void gtk_ticker_realize (GtkWidge
 
 	attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_COLORMAP;
 
-	widget->window = gdk_window_new (gtk_widget_get_parent_window (widget),
+	window = gdk_window_new (gtk_widget_get_parent_window (widget),
 			&attributes, attributes_mask);
-	gdk_window_set_user_data (widget->window, widget);
+#if GTK_CHECK_VERSION(2,14,0)
+	gtk_widget_set_window (widget, window);
+#else
+	widget->window = window;
+#endif
+	gdk_window_set_user_data (window, widget);
 
-	widget->style = gtk_style_attach (widget->style, widget->window);
-	gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
+#if GTK_CHECK_VERSION(2,14,0)
+	style = gtk_widget_get_style (widget);
+	style = gtk_style_attach (style, window);
+	gtk_widget_set_style (widget, style);
+#else
+	style = widget->style = gtk_style_attach (widget->style, window);
+#endif
+	gtk_style_set_background (style, window, GTK_STATE_NORMAL);
 }
 
 static void gtk_ticker_size_request (GtkWidget *widget, GtkRequisition *requisition)
@@ -309,6 +366,7 @@ static void gtk_ticker_size_request (Gtk
 	GtkTickerChild *child;
 	GList *children;
 	GtkRequisition child_requisition;
+	guint border_width;
 
 	g_return_if_fail (widget != NULL);
 	g_return_if_fail (GTK_IS_TICKER (widget));
@@ -324,7 +382,7 @@ static void gtk_ticker_size_request (Gtk
 		child = children->data;
 		children = children->next;
 
-		if (GTK_WIDGET_VISIBLE (child->widget))
+		if (gtk_widget_get_visible (child->widget))
 		{
 			gtk_widget_size_request (child->widget, &child_requisition);
 
@@ -336,8 +394,9 @@ static void gtk_ticker_size_request (Gtk
 	if ( requisition->width > ticker->spacing )
 		requisition->width -= ticker->spacing;
 
-	requisition->height += GTK_CONTAINER (ticker)->border_width * 2;
-	requisition->width += GTK_CONTAINER (ticker)->border_width * 2;
+	border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
+	requisition->height += border_width * 2;
+	requisition->width += border_width * 2;
 }
 
 static void gtk_ticker_compute_offsets (GtkTicker *ticker)
@@ -350,16 +409,24 @@ static void gtk_ticker_compute_offsets (
 	g_return_if_fail (ticker != NULL);
 	g_return_if_fail (GTK_IS_TICKER(ticker));
 
-	border_width = GTK_CONTAINER (ticker)->border_width;
+	border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
 
+#if GTK_CHECK_VERSION(2,18,0)
+	{
+		GtkAllocation allocation;
+		gtk_widget_get_allocation (GTK_WIDGET (ticker), &allocation);
+		ticker->width = allocation.width;
+	}
+#else
 	ticker->width = GTK_WIDGET(ticker)->allocation.width;
+#endif
 	ticker->total = 0;
 	children = ticker->children;
 	while (children) {
 		child = children->data;
 
 		child->x = 0;
-		if (GTK_WIDGET_VISIBLE (child->widget)) {
+		if (gtk_widget_get_visible (child->widget)) {
 			gtk_widget_get_child_requisition (child->widget, &child_requisition);
 			child->offset = ticker->total;
 			ticker->total +=
@@ -386,22 +453,35 @@ static void gtk_ticker_size_allocate (Gt
 
 	ticker = GTK_TICKER (widget);
 
+#if GTK_CHECK_VERSION(2,18,0)
+	{
+		GtkAllocation a;
+		gtk_widget_get_allocation (GTK_WIDGET (ticker), &a);
+		if ( a.width != ticker->width )
+			ticker->dirty = TRUE;
+	}
+#else
 	if ( GTK_WIDGET(ticker)->allocation.width != ticker->width )
 		ticker->dirty = TRUE;
+#endif
 
 	if ( ticker->dirty == TRUE ) {
 		gtk_ticker_compute_offsets( ticker );
 	}
 
+#if GTK_CHECK_VERSION(2,18,0)
+	gtk_widget_set_allocation (widget, allocation);
+#else
 	widget->allocation = *allocation;
-	if (GTK_WIDGET_REALIZED (widget))
-		gdk_window_move_resize (widget->window,
+#endif
+	if (gtk_widget_is_realized (widget))
+		gdk_window_move_resize (gtk_widget_get_window (widget),
 				allocation->x,
 				allocation->y,
 				allocation->width,
 				allocation->height);
 
-	border_width = GTK_CONTAINER (ticker)->border_width;
+	border_width = gtk_container_get_border_width (GTK_CONTAINER (ticker));
 
 	children = ticker->children;
 	while (children)
@@ -409,16 +489,16 @@ static void gtk_ticker_size_allocate (Gt
 		child = children->data;
 		child->x -= ticker->scootch;
 
-		if (GTK_WIDGET_VISIBLE (child->widget)) {
+		if (gtk_widget_get_visible (child->widget)) {
 			gtk_widget_get_child_requisition (child->widget, &child_requisition);
 			child_allocation.width = child_requisition.width;
 			child_allocation.x = child->offset + border_width + child->x;
-			if ( ( child_allocation.x + child_allocation.width ) < GTK_WIDGET(ticker)->allocation.x  ) {
-				if ( ticker->total >=  GTK_WIDGET(ticker)->allocation.width ) {
-					child->x += GTK_WIDGET(ticker)->allocation.x + GTK_WIDGET(ticker)->allocation.width + ( ticker->total - ( GTK_WIDGET(ticker)->allocation.x + GTK_WIDGET(ticker)->allocation.width ) );
+			if ( ( child_allocation.x + child_allocation.width ) < allocation->x  ) {
+				if ( ticker->total >=  allocation->width ) {
+					child->x += allocation->x + allocation->width + ( ticker->total - ( allocation->x + allocation->width ) );
 				}
 				else {
-					child->x += GTK_WIDGET(ticker)->allocation.x + GTK_WIDGET(ticker)->allocation.width;
+					child->x += allocation->x + allocation->width;
 				}
 			}
 			child_allocation.y = border_width;
@@ -469,7 +549,7 @@ static void gtk_ticker_remove_real(GtkCo
 
 		if (child->widget == widget)
 		{
-			gboolean was_visible = GTK_WIDGET_VISIBLE (widget);
+			gboolean was_visible = gtk_widget_get_visible (widget);
 
 			gtk_widget_unparent (widget);
 
@@ -477,7 +557,7 @@ static void gtk_ticker_remove_real(GtkCo
 			g_list_free (children);
 			g_free (child);
 
-			if (was_visible && GTK_WIDGET_VISIBLE (container))
+			if (was_visible && gtk_widget_get_visible (GTK_WIDGET (container)))
 				gtk_widget_queue_resize (GTK_WIDGET (container));
 
 			break;
============================================================
--- pidgin/plugins/timestamp_format.c	68d7519889ecefb176639c1ef066bf8d233ac357
+++ pidgin/plugins/timestamp_format.c	079009d4ec89d3f4a3af8d2a049c5b85158bd027
@@ -122,7 +122,11 @@ menu_cb(GtkWidget *item, gpointer data)
 			GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
 			NULL);
 	g_signal_connect_after(G_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), dialog);
+#if GTK_CHECK_VERSION(2,14,0)
+	gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(dialog))), frame);
+#else
 	gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), frame);
+#endif
 	gtk_window_set_role(GTK_WINDOW(dialog), "plugin_config");
 	gtk_window_set_title(GTK_WINDOW(dialog), _(purple_plugin_get_name(plugin)));
 	gtk_widget_show_all(dialog);
@@ -141,8 +145,13 @@ textview_emission_hook(GSignalInvocation
 	if (!GTK_IS_IMHTML(view))
 		return TRUE;
 
+#if GTK_CHECK_VERSION(2,14,0)
+	if (!gdk_window_get_pointer(gtk_widget_get_window(GTK_WIDGET(view)), &cx, &cy, NULL))
+		return TRUE;
+#else
 	if (!gdk_window_get_pointer(GTK_WIDGET(view)->window, &cx, &cy, NULL))
 		return TRUE;
+#endif
 
 	buffer = gtk_text_view_get_buffer(view);
 
============================================================
--- pidgin/plugins/xmppconsole.c	c0a21312f8fd6062c4727d92ff7d91927c8a7124
+++ pidgin/plugins/xmppconsole.c	ed14baf080859bd25c58c7ef3b825ba3f0d1d136
@@ -258,7 +258,7 @@ static void iq_clicked_cb(GtkWidget *w, 
 
 static void iq_clicked_cb(GtkWidget *w, gpointer nul)
 {
-	GtkWidget *hbox, *to_entry, *label, *type_combo;
+	GtkWidget *vbox, *hbox, *to_entry, *label, *type_combo;
 	GtkSizeGroup *sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
 	GtkTextIter iter;
 	GtkTextBuffer *buffer;
@@ -277,9 +277,14 @@ static void iq_clicked_cb(GtkWidget *w, 
 	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
 	gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 	gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
+#if GTK_CHECK_VERSION(2,14,0)
+	vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+#else
+	vbox = GTK_DIALOG(dialog)->vbox;
+#endif
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("To:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -291,7 +296,7 @@ static void iq_clicked_cb(GtkWidget *w, 
 	gtk_box_pack_start(GTK_BOX(hbox), to_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	label = gtk_label_new("Type:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 
@@ -305,7 +310,7 @@ static void iq_clicked_cb(GtkWidget *w, 
 	gtk_combo_box_set_active(GTK_COMBO_BOX(type_combo), 0);
 	gtk_box_pack_start(GTK_BOX(hbox), type_combo, FALSE, FALSE, 0);
 
-	gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
+	gtk_widget_show_all(vbox);
 
 	result = gtk_dialog_run(GTK_DIALOG(dialog));
 	if (result != GTK_RESPONSE_ACCEPT) {
@@ -334,6 +339,7 @@ static void presence_clicked_cb(GtkWidge
 
 static void presence_clicked_cb(GtkWidget *w, gpointer nul)
 {
+	GtkWidget *vbox;
 	GtkWidget *hbox;
 	GtkWidget *to_entry;
 	GtkWidget *status_entry;
@@ -359,9 +365,14 @@ static void presence_clicked_cb(GtkWidge
 	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
 	gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 	gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
+#if GTK_CHECK_VERSION(2,14,0)
+	vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+#else
+	vbox = GTK_DIALOG(dialog)->vbox;
+#endif
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("To:");
 	gtk_size_group_add_widget(sg, label);
@@ -373,7 +384,7 @@ static void presence_clicked_cb(GtkWidge
 	gtk_box_pack_start(GTK_BOX(hbox), to_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	label = gtk_label_new("Type:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_size_group_add_widget(sg, label);
@@ -391,7 +402,7 @@ static void presence_clicked_cb(GtkWidge
 	gtk_box_pack_start(GTK_BOX(hbox), type_combo, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	label = gtk_label_new("Show:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_size_group_add_widget(sg, label);
@@ -407,7 +418,7 @@ static void presence_clicked_cb(GtkWidge
 	gtk_box_pack_start(GTK_BOX(hbox), show_combo, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("Status:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -419,7 +430,7 @@ static void presence_clicked_cb(GtkWidge
 	gtk_box_pack_start(GTK_BOX(hbox), status_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("Priority:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -430,7 +441,7 @@ static void presence_clicked_cb(GtkWidge
 	gtk_spin_button_set_value(GTK_SPIN_BUTTON(priority_entry), 0);
 	gtk_box_pack_start(GTK_BOX(hbox), priority_entry, FALSE, FALSE, 0);
 
-	gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
+	gtk_widget_show_all(vbox);
 
 	result = gtk_dialog_run(GTK_DIALOG(dialog));
 	if (result != GTK_RESPONSE_ACCEPT) {
@@ -486,6 +497,7 @@ static void message_clicked_cb(GtkWidget
 
 static void message_clicked_cb(GtkWidget *w, gpointer nul)
 {
+	GtkWidget *vbox;
 	GtkWidget *hbox;
 	GtkWidget *to_entry;
 	GtkWidget *body_entry;
@@ -511,9 +523,14 @@ static void message_clicked_cb(GtkWidget
 	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
 	gtk_dialog_set_default_response (GTK_DIALOG(dialog), GTK_RESPONSE_ACCEPT);
 	gtk_container_set_border_width(GTK_CONTAINER(dialog), 12);
+#if GTK_CHECK_VERSION(2,14,0)
+	vbox = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
+#else
+	vbox = GTK_DIALOG(dialog)->vbox;
+#endif
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("To:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -525,7 +542,7 @@ static void message_clicked_cb(GtkWidget
 	gtk_box_pack_start(GTK_BOX(hbox), to_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	label = gtk_label_new("Type:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
 	gtk_size_group_add_widget(sg, label);
@@ -540,7 +557,7 @@ static void message_clicked_cb(GtkWidget
 	gtk_box_pack_start(GTK_BOX(hbox), type_combo, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("Body:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -552,7 +569,7 @@ static void message_clicked_cb(GtkWidget
 	gtk_box_pack_start(GTK_BOX(hbox), body_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("Subject:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -564,7 +581,7 @@ static void message_clicked_cb(GtkWidget
 	gtk_box_pack_start(GTK_BOX(hbox), subject_entry, FALSE, FALSE, 0);
 
 	hbox = gtk_hbox_new(FALSE, 3);
-	gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), hbox, FALSE, FALSE, 0);
+	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 
 	label = gtk_label_new("Thread:");
 	gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
@@ -575,7 +592,7 @@ static void message_clicked_cb(GtkWidget
 	gtk_entry_set_activates_default (GTK_ENTRY (thread_entry), TRUE);
 	gtk_box_pack_start(GTK_BOX(hbox), thread_entry, FALSE, FALSE, 0);
 
-	gtk_widget_show_all(GTK_DIALOG(dialog)->vbox);
+	gtk_widget_show_all(vbox);
 
 	result = gtk_dialog_run(GTK_DIALOG(dialog));
 	if (result != GTK_RESPONSE_ACCEPT) {


More information about the Commits mailing list