/soc/2015/mmcc/main: 4e18974fa89d: removing GTK_CHECK_VERSION pr...
Michael McConville
mmcconville at mykolab.com
Tue Jun 23 16:02:34 EDT 2015
Changeset: 4e18974fa89de4b6830f81e70af2942b80851f97
Author: Michael McConville <mmcconville at mykolab.com>
Date: 2015-06-19 18:29 -0400
Branch: default
URL: https://hg.pidgin.im/soc/2015/mmcc/main/rev/4e18974fa89d
Description:
removing GTK_CHECK_VERSION preproc conditions
diffstat:
pidgin/gtk3compat.h | 211 --------------------------------
pidgin/gtkaccount.c | 63 ---------
pidgin/gtkblist-theme-loader.c | 3 -
pidgin/gtkblist.c | 219 +---------------------------------
pidgin/gtkcellrendererexpander.c | 35 -----
pidgin/gtkcertmgr.c | 4 -
pidgin/gtkconv.c | 87 -------------
pidgin/gtkdebug.c | 24 ---
pidgin/gtkdialogs.c | 5 -
pidgin/gtkdnd-hints.c | 37 -----
pidgin/gtkdocklet.c | 27 ----
pidgin/gtkmedia.c | 16 --
pidgin/gtkmenutray.c | 20 ---
pidgin/gtknotify.c | 3 -
pidgin/gtkplugin.c | 6 -
pidgin/gtkpluginpref.c | 3 -
pidgin/gtkpounce.c | 7 -
pidgin/gtkprefs.c | 41 ------
pidgin/gtkrequest.c | 3 -
pidgin/gtkroomlist.c | 39 ------
pidgin/gtksmiley-manager.c | 39 ------
pidgin/gtkstatusbox.c | 83 +------------
pidgin/gtkutils.c | 34 -----
pidgin/gtkwhiteboard.c | 53 --------
pidgin/gtkxfer.c | 4 -
pidgin/libpidgin.c | 12 -
pidgin/minidialog.c | 39 ------
pidgin/pidginstock.c | 11 -
pidgin/pidgintooltip.c | 25 ---
pidgin/plugins/disco/gtkdisco.c | 8 -
pidgin/plugins/gestures/stroke-draw.c | 20 ---
pidgin/plugins/screencap.c | 31 ----
pidgin/plugins/ticker/gtkticker.c | 69 ----------
pidgin/plugins/xmppconsole.c | 9 -
34 files changed, 2 insertions(+), 1288 deletions(-)
diffs (truncated from 2719 to 300 lines):
diff --git a/pidgin/gtk3compat.h b/pidgin/gtk3compat.h
--- a/pidgin/gtk3compat.h
+++ b/pidgin/gtk3compat.h
@@ -106,8 +106,6 @@ pidgin_color_chooser_get_rgb(GtkColorCho
#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)
{
@@ -145,49 +143,6 @@ gtk_grid_attach_full(GtkGrid *grid, GtkW
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
@@ -200,172 +155,6 @@ static inline GtkWidget * gtk_font_choos
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 */
- return gtk_vscale_new_with_range(min, max, step);
-}
-
-#if !GTK_CHECK_VERSION(2,24,0)
-
-#define gdk_x11_set_sm_client_id gdk_set_sm_client_id
-#define gdk_window_get_display gdk_drawable_get_display
-#define GtkComboBoxText GtkComboBox
-#define GTK_COMBO_BOX_TEXT GTK_COMBO_BOX
-#define gtk_combo_box_text_new gtk_combo_box_new_text
-#define gtk_combo_box_text_new_with_entry gtk_combo_box_entry_new_text
-#define gtk_combo_box_text_append_text gtk_combo_box_append_text
-#define gtk_combo_box_text_get_active_text gtk_combo_box_get_active_text
-#define gtk_combo_box_text_remove gtk_combo_box_remove_text
-
-static inline gint gdk_window_get_width(GdkWindow *x)
-{
- gint w;
- gdk_drawable_get_size(GDK_DRAWABLE(x), &w, NULL);
- return w;
-}
-
-static inline gint gdk_window_get_height(GdkWindow *x)
-{
- gint h;
- gdk_drawable_get_size(GDK_DRAWABLE(x), NULL, &h);
- return h;
-}
-
-#if !GTK_CHECK_VERSION(2,22,0)
-
-#define gdk_drag_context_get_actions(x) (x)->action
-#define gdk_drag_context_get_suggested_action(x) (x)->suggested_action
-#define gtk_text_view_get_vadjustment(x) (x)->vadjustment
-#define gtk_font_selection_dialog_get_font_selection(x) (x)->fontsel
-
-#if !GTK_CHECK_VERSION(2,20,0)
-
-#define gtk_widget_get_mapped GTK_WIDGET_MAPPED
-#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)
-#define gtk_widget_get_realized GTK_WIDGET_REALIZED
-#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)
-
-#endif /* 2.20.0 */
-
-#endif /* 2.22.0 */
-
-#endif /* 2.24.0 */
-
-#endif /* 3.0.0 */
-
#endif /* 3.2.0 */
#endif /* _PIDGINGTK3COMPAT_H_ */
-
diff --git a/pidgin/gtkaccount.c b/pidgin/gtkaccount.c
--- a/pidgin/gtkaccount.c
+++ b/pidgin/gtkaccount.c
@@ -114,11 +114,7 @@ typedef struct
GtkWidget *password_box;
gchar *password;
GtkWidget *username_entry;
-#if GTK_CHECK_VERSION(3,0,0)
GdkRGBA username_entry_hint_color;
-#else
- GdkColor *username_entry_hint_color;
-#endif
GtkWidget *password_entry;
GtkWidget *alias_entry;
GtkWidget *remember_pass_check;
@@ -325,11 +321,7 @@ username_focus_cb(GtkWidget *widget, Gdk
if(!strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), label)) {
gtk_entry_set_text(GTK_ENTRY(widget), "");
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(widget, GTK_STATE_NORMAL, NULL);
-#else
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL,NULL);
-#endif
}
g_hash_table_destroy(table);
@@ -355,11 +347,7 @@ username_nofocus_cb(GtkWidget *widget, G
gtk_entry_set_text(GTK_ENTRY(widget), label);
/* Make sure we can hit it again */
g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(widget, GTK_STATE_NORMAL, &dialog->username_entry_hint_color);
-#else
- gtk_widget_modify_text(widget, GTK_STATE_NORMAL, dialog->username_entry_hint_color);
-#endif
}
g_hash_table_destroy(table);
@@ -374,13 +362,8 @@ username_themechange_cb(GObject *widget,
GHashTable *table;
const char *label, *text;
char *temp_text = NULL;
-#if GTK_CHECK_VERSION(3,0,0)
GtkStyleContext *context;
GtkBorder border;
-#else
- GtkStyle *style;
- const GtkBorder *border = NULL;
-#endif
gint xsize;
table = purple_protocol_client_iface_get_account_text_table(dialog->protocol, NULL);
@@ -392,51 +375,25 @@ username_themechange_cb(GObject *widget,
if (strcmp(text, label)) {
temp_text = g_strdup(text);
gtk_entry_set_text(GTK_ENTRY(widget), label);
-#if GTK_CHECK_VERSION(3,0,0)
gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#else
- gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL);
-#endif
}
-#if GTK_CHECK_VERSION(3,0,0)
More information about the Commits
mailing list