/pidgin/main: c21651e4f58e: Merged in qulogic/pidgin (pull reque...
Gary Kramlich <[email protected]> Tue, 06 Sep 2016 15:45:53 -0400
| Newsgroups | gmane.comp.gnome.gaim.cvs |
|---|---|
| Message-ID | <[email protected]> |
Changeset: c21651e4f58e7daa1a877b02bdcb6c2753ef5502 Author: Gary Kramlich <[email protected]> Date: 2016-09-06 14:45 -0500 Branch: default URL: https://hg.pidgin.im/pidgin/main/rev/c21651e4f58e Description: Merged in qulogic/pidgin (pull request #120) Cleanup GTK+ deprecations diffstat: configure.ac | 4 +- pidgin/gtk3compat.h | 330 +------------------------ pidgin/gtkaccount.c | 120 --------- pidgin/gtkblist-theme-loader.c | 27 +- pidgin/gtkblist-theme.c | 77 +++-- pidgin/gtkblist-theme.h | 24 +- pidgin/gtkblist.c | 55 ++- pidgin/gtkcellrendererexpander.c | 80 +---- pidgin/gtkcertmgr.c | 1 - pidgin/gtkconv-theme.c | 7 +- pidgin/gtkconv.c | 211 +++++++++------ pidgin/gtkdialogs.c | 3 +- pidgin/gtklog.c | 6 +- pidgin/gtkmedia.c | 17 +- pidgin/gtknickcolors.h | 50 +- pidgin/gtknotify.c | 20 +- pidgin/gtkplugin.c | 23 +- pidgin/gtkpluginpref.c | 9 +- pidgin/gtkpounce.c | 116 ++++---- pidgin/gtkprefs.c | 34 +- pidgin/gtkprivacy.c | 2 +- pidgin/gtkrequest.c | 120 ++++---- pidgin/gtksavedstatuses.c | 4 +- pidgin/gtkscrollbook.c | 18 +- pidgin/gtkstatusbox.c | 32 +- pidgin/gtkutils.c | 42 ++- pidgin/gtkutils.h | 6 +- pidgin/gtkwebview.c | 2 +- pidgin/gtkwebviewtoolbar.c | 119 ++------ pidgin/gtkwebviewtoolbar.h | 4 +- pidgin/gtkwhiteboard.c | 34 +- pidgin/gtkxfer.c | 35 +- pidgin/libpidgin.c | 3 +- pidgin/minidialog.c | 14 +- pidgin/minidialog.h | 6 +- pidgin/plugins/cap/cap.c | 61 +-- pidgin/plugins/contact_priority.c | 3 +- pidgin/plugins/gestures/stroke-draw.c | 6 +- pidgin/plugins/gevolution/add_buddy_dialog.c | 3 +- pidgin/plugins/gevolution/assoc-buddy.c | 3 +- pidgin/plugins/gevolution/gevolution.c | 2 +- pidgin/plugins/gevolution/new_person_dialog.c | 10 +- pidgin/plugins/screencap.c | 42 ++- pidgin/plugins/win32/transparency/win2ktrans.c | 8 +- pidgin/plugins/win32/winprefs/winprefs.c | 2 +- pidgin/plugins/xmppconsole.c | 35 +- 46 files changed, 699 insertions(+), 1131 deletions(-) diffs (truncated from 4196 to 300 lines): diff --git a/configure.ac b/configure.ac --- a/configure.ac +++ b/configure.ac @@ -572,10 +572,10 @@ dnl #################################### dnl Check Pidgin dependencies dnl ####################################################################### if test "x$enable_gtkui" = "xyes" ; then - PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.0.0], , [ + PKG_CHECK_MODULES(GTK, [gtk+-3.0 >= 3.4.2], , [ AC_MSG_RESULT(no) AC_MSG_ERROR([ -You must have GTK+ 3.0.0 or newer development headers installed to compile +You must have GTK+ 3.4.2 or newer development headers installed to compile Pidgin. If you want to build only Finch then specify --disable-gtkui when running configure. ])]) diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h --- a/pidgin/gtk3compat.h +++ b/pidgin/gtk3compat.h @@ -32,340 +32,22 @@ */ #include <gtk/gtk.h> -#include <math.h> -#if !GTK_CHECK_VERSION(3,4,0) - -#define gtk_color_chooser_dialog_new(title, parent) \ - gtk_color_selection_dialog_new(title) -#define GTK_COLOR_CHOOSER(widget) (GTK_WIDGET(widget)) +#if !GTK_CHECK_VERSION(3,16,0) static inline void -gtk_color_chooser_set_use_alpha(GtkWidget *widget, gboolean use_alpha) +gtk_label_set_xalign(GtkLabel *label, gfloat xalign) { - if (GTK_IS_COLOR_BUTTON(widget)) { - gtk_color_button_set_use_alpha(GTK_COLOR_BUTTON(widget), - use_alpha); - } + g_object_set(label, "xalign", xalign, NULL); } static inline void -pidgin_color_chooser_set_rgb(GtkWidget *widget, const GdkColor *color) +gtk_label_set_yalign(GtkLabel *label, gfloat yalign) { - if (GTK_IS_COLOR_SELECTION_DIALOG(widget)) { - GtkWidget *colorsel; - - colorsel = gtk_color_selection_dialog_get_color_selection( - GTK_COLOR_SELECTION_DIALOG(widget)); - gtk_color_selection_set_current_color( - GTK_COLOR_SELECTION(colorsel), color); - } else - gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), color); + g_object_set(label, "yalign", yalign, NULL); } -static inline void -pidgin_color_chooser_get_rgb(GtkWidget *widget, GdkColor *color) -{ - if (GTK_IS_COLOR_SELECTION_DIALOG(widget)) { - GtkWidget *colorsel; - - colorsel = gtk_color_selection_dialog_get_color_selection( - GTK_COLOR_SELECTION_DIALOG(widget)); - gtk_color_selection_get_current_color( - GTK_COLOR_SELECTION(colorsel), color); - } else - gtk_color_button_get_color(GTK_COLOR_BUTTON(widget), color); -} - -#else /* 3.4.0 */ - -static inline void -pidgin_color_chooser_set_rgb(GtkColorChooser *chooser, const GdkColor *rgb) -{ - GdkRGBA rgba; - - rgba.red = rgb->red / 65535.0; - rgba.green = rgb->green / 65535.0; - rgba.blue = rgb->blue / 65535.0; - rgba.alpha = 1.0; - - gtk_color_chooser_set_rgba(chooser, &rgba); -} - -static inline void -pidgin_color_chooser_get_rgb(GtkColorChooser *chooser, GdkColor *rgb) -{ - GdkRGBA rgba; - - gtk_color_chooser_get_rgba(chooser, &rgba); - rgb->red = (int)round(rgba.red * 65535.0); - rgb->green = (int)round(rgba.green * 65535.0); - rgb->blue = (int)round(rgba.blue * 65535.0); -} - -#endif /* 3.4.0 and gtk_color_chooser_ */ - - -#if GTK_CHECK_VERSION(3,0,0) - -static inline GtkWidget * -gtk_grid_table_new(guint rows, guint columns) -{ - return gtk_grid_new(); -} - -static inline void -gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top, - gint width, gint height) -{ - gtk_grid_attach(grid, child, left, top, width, height); - gtk_widget_set_hexpand(child, TRUE); - gtk_widget_set_vexpand(child, TRUE); -} - -static inline void -gtk_grid_attach_full(GtkGrid *grid, GtkWidget *child, guint left, guint top, - guint width, guint height, GtkAttachOptions xoptions, - GtkAttachOptions yoptions, guint xpadding, guint ypadding) -{ - gtk_grid_attach(grid, child, left, top, width, height); - - if (xoptions & GTK_EXPAND) - gtk_widget_set_hexpand(child, TRUE); - if (!(xoptions & GTK_FILL)) - gtk_widget_set_halign(child, GTK_ALIGN_CENTER); - gtk_widget_set_margin_left(child, xpadding); - gtk_widget_set_margin_right(child, xpadding); - - if (yoptions & GTK_EXPAND) - gtk_widget_set_vexpand(child, TRUE); - if (!(yoptions & GTK_FILL)) - gtk_widget_set_valign(child, GTK_ALIGN_CENTER); - gtk_widget_set_margin_top(child, ypadding); - gtk_widget_set_margin_bottom(child, ypadding); -} - -#else /* 3.0.0 and gtk_grid_ */ - -#define GTK_GRID GTK_TABLE -#define GtkGrid GtkTable - -static inline GtkWidget * -gtk_grid_table_new(guint rows, guint columns) -{ - return gtk_table_new(rows, columns, FALSE); -} - -static inline void -gtk_grid_set_row_spacing(GtkGrid *grid, guint spacing) -{ - gtk_table_set_row_spacings(grid, spacing); -} - -static inline void -gtk_grid_set_column_spacing(GtkGrid *grid, guint spacing) -{ - gtk_table_set_col_spacings(grid, spacing); -} - -static inline void -gtk_grid_attach_defaults(GtkGrid *grid, GtkWidget *child, gint left, gint top, - gint width, gint height) -{ - gtk_table_attach_defaults(grid, child, left, left + width, - top, top + height); -} - -static inline void -gtk_grid_attach_full(GtkGrid *grid, GtkWidget *child, guint left, guint top, - guint width, guint height, GtkAttachOptions xoptions, - GtkAttachOptions yoptions, guint xpadding, guint ypadding) -{ - gtk_table_attach(grid, child, left, left + width, top, top + height, - xoptions, yoptions, xpadding, ypadding); -} - -#endif /* 3.0.0 and gtk_grid_ */ - - -#if !GTK_CHECK_VERSION(3,2,0) - -#define GTK_FONT_CHOOSER GTK_FONT_SELECTION_DIALOG -#define gtk_font_chooser_get_font gtk_font_selection_dialog_get_font_name -#define gtk_font_chooser_set_font gtk_font_selection_dialog_set_font_name - -static inline GtkWidget * gtk_font_chooser_dialog_new(const gchar *title, - GtkWindow *parent) -{ - return gtk_font_selection_dialog_new(title); -} - -#if !GTK_CHECK_VERSION(3,0,0) - -#define gdk_x11_window_get_xid GDK_WINDOW_XWINDOW -#define gtk_widget_get_preferred_size(x,y,z) gtk_widget_size_request(x,z) - -#ifdef GDK_WINDOWING_X11 -#define GDK_IS_X11_WINDOW(window) TRUE -#endif -#ifdef GDK_WINDOWING_WIN32 -#define GDK_IS_WIN32_WINDOW(window) TRUE -#endif -#ifdef GDK_WINDOWING_QUARTZ -#define GDK_IS_QUARTZ_WINDOW(window) TRUE -#endif - -static inline GdkPixbuf * -gdk_pixbuf_get_from_surface(cairo_surface_t *surface, gint src_x, gint src_y, - gint width, gint height) -{ - GdkPixmap *pixmap; - GdkPixbuf *pixbuf; - cairo_t *cr; - - pixmap = gdk_pixmap_new(NULL, width, height, 24); - - cr = gdk_cairo_create(pixmap); - cairo_set_source_surface(cr, surface, -src_x, -src_y); - cairo_paint(cr); - cairo_destroy(cr); - - pixbuf = gdk_pixbuf_get_from_drawable(NULL, pixmap, - gdk_drawable_get_colormap(pixmap), 0, 0, 0, 0, width, height); - - g_object_unref(pixmap); - - return pixbuf; -} - -static inline GdkPixbuf * -gdk_pixbuf_get_from_window(GdkWindow *window, gint src_x, gint src_y, - gint width, gint height) -{ - return gdk_pixbuf_get_from_drawable(NULL, window, NULL, - src_x, src_y, 0, 0, width, height); -} - -static inline GtkWidget * -gtk_box_new(GtkOrientation orientation, gint spacing) -{ - g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || - orientation == GTK_ORIENTATION_VERTICAL, NULL); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - return gtk_hbox_new(FALSE, spacing); - else /* GTK_ORIENTATION_VERTICAL */ - return gtk_vbox_new(FALSE, spacing); -} - -static inline GtkWidget * -gtk_separator_new(GtkOrientation orientation) -{ - g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || - orientation == GTK_ORIENTATION_VERTICAL, NULL); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - return gtk_hseparator_new(); - else /* GTK_ORIENTATION_VERTICAL */ - return gtk_vseparator_new(); -} - -static inline GtkWidget * -gtk_button_box_new(GtkOrientation orientation) -{ - g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || - orientation == GTK_ORIENTATION_VERTICAL, NULL); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - return gtk_hbutton_box_new(); - else /* GTK_ORIENTATION_VERTICAL */ - return gtk_vbutton_box_new(); -} - -static inline GtkWidget * -gtk_paned_new(GtkOrientation orientation) -{ - g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || - orientation == GTK_ORIENTATION_VERTICAL, NULL); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - return gtk_hpaned_new(); - else /* GTK_ORIENTATION_VERTICAL */ - return gtk_vpaned_new(); -} - -static inline GtkWidget * -gtk_scale_new_with_range(GtkOrientation orientation, gdouble min, gdouble max, - gdouble step) -{ - g_return_val_if_fail(orientation == GTK_ORIENTATION_HORIZONTAL || - orientation == GTK_ORIENTATION_VERTICAL, NULL); - - if (orientation == GTK_ORIENTATION_HORIZONTAL) - return gtk_hscale_new_with_range(min, max, step); - else /* GTK_ORIENTATION_VERTICAL */ _______________________________________________ Commits mailing list [email protected] https://pidgin.im/cgi-bin/mailman/listinfo/commits