From af57bc3d9e5bb15f9e6f786b32ca98f734129f5d Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sat, 7 May 2011 10:35:47 -0700 Subject: [PATCH] gui: Use GTK+ accessor functions instead of deprecated macros. These are now available on all GTK+ versions due to the wrapper added in the previous commit. --- src/ui/gui/customentry.c | 14 +++++++------- src/ui/gui/psppire-buttonbox.c | 2 +- src/ui/gui/psppire-dialog.c | 2 +- src/ui/gui/psppire-hbuttonbox.c | 4 ++-- src/ui/gui/psppire-keypad.c | 4 ++-- src/ui/gui/psppire-output-window.c | 6 +++--- src/ui/gui/psppire-vbuttonbox.c | 4 ++-- src/ui/gui/text-data-import-dialog.c | 2 +- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/ui/gui/customentry.c b/src/ui/gui/customentry.c index a376a7fb..04e738f2 100644 --- a/src/ui/gui/customentry.c +++ b/src/ui/gui/customentry.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2005, 2007, 2010 Free Software Foundation + Copyright (C) 2005, 2007, 2010, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -106,7 +106,7 @@ psppire_custom_entry_get_type (void) static void psppire_custom_entry_map (GtkWidget *widget) { - if (GTK_WIDGET_REALIZED (widget) && !GTK_WIDGET_MAPPED (widget)) + if (gtk_widget_get_realized (widget) && !gtk_widget_get_mapped (widget)) { GTK_WIDGET_CLASS (parent_class)->map (widget); gdk_window_show (PSPPIRE_CUSTOM_ENTRY (widget)->panel); @@ -116,7 +116,7 @@ psppire_custom_entry_map (GtkWidget *widget) static void psppire_custom_entry_unmap (GtkWidget *widget) { - if (GTK_WIDGET_MAPPED (widget)) + if (gtk_widget_get_mapped (widget)) { gdk_window_hide (PSPPIRE_CUSTOM_ENTRY (widget)->panel); GTK_WIDGET_CLASS (parent_class)->unmap (widget); @@ -232,7 +232,7 @@ psppire_custom_entry_redraw (PsppireCustomEntry *custom_entry) widget = GTK_WIDGET (custom_entry); - if (GTK_WIDGET_DRAWABLE (widget)) + if (gtk_widget_is_drawable (widget)) { gtk_widget_queue_draw (widget); @@ -253,7 +253,7 @@ psppire_custom_entry_expose (GtkWidget *widget, g_return_val_if_fail (PSPPIRE_IS_CUSTOM_ENTRY (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); - if (GTK_WIDGET_DRAWABLE (widget)) + if (gtk_widget_is_drawable (widget)) { gboolean is_editable; GtkShadowType shadow_type; @@ -368,7 +368,7 @@ psppire_custom_entry_button_press (GtkWidget *widget, if (event->window == ce->panel) { gboolean is_editable ; - if (!GTK_WIDGET_HAS_FOCUS (widget)) + if (!gtk_widget_has_focus (widget)) gtk_widget_grab_focus (widget); g_object_get (ce, "editable", &is_editable, NULL); @@ -425,7 +425,7 @@ psppire_custom_entry_size_allocate (GtkWidget *widget, GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, &entry_allocation); - if (GTK_WIDGET_REALIZED (widget)) + if (gtk_widget_get_realized (widget)) { gdk_window_move_resize (PSPPIRE_CUSTOM_ENTRY (widget)->panel, panel_allocation.x, diff --git a/src/ui/gui/psppire-buttonbox.c b/src/ui/gui/psppire-buttonbox.c index a6b00689..de265e1f 100644 --- a/src/ui/gui/psppire-buttonbox.c +++ b/src/ui/gui/psppire-buttonbox.c @@ -431,7 +431,7 @@ _psppire_button_box_child_requisition (GtkWidget *widget, child = children->data; children = children->next; - if (GTK_WIDGET_VISIBLE (child->widget)) + if (gtk_widget_get_visible (child->widget)) { nchildren += 1; gtk_widget_size_request (child->widget, &child_requisition); diff --git a/src/ui/gui/psppire-dialog.c b/src/ui/gui/psppire-dialog.c index 5cef8be4..e7e0ad04 100644 --- a/src/ui/gui/psppire-dialog.c +++ b/src/ui/gui/psppire-dialog.c @@ -298,7 +298,7 @@ configure_event_callback (GtkDialog *dialog, PsppireConf *conf = psppire_conf_new (); - if ( ! GTK_WIDGET_MAPPED (dialog)) + if ( ! gtk_widget_get_mapped (GTK_WIDGET (dialog))) return FALSE; base = gtk_buildable_get_name (GTK_BUILDABLE (dialog)); diff --git a/src/ui/gui/psppire-hbuttonbox.c b/src/ui/gui/psppire-hbuttonbox.c index 0e62d509..2d036a41 100644 --- a/src/ui/gui/psppire-hbuttonbox.c +++ b/src/ui/gui/psppire-hbuttonbox.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2010 Free Software Foundation + Copyright (C) 2007, 2010, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -243,7 +243,7 @@ gtk_hbutton_box_size_allocate (GtkWidget *widget, child = children->data; children = children->next; - if (GTK_WIDGET_VISIBLE (child->widget)) + if (gtk_widget_get_visible (child->widget)) { child_allocation.width = child_width; child_allocation.height = child_height; diff --git a/src/ui/gui/psppire-keypad.c b/src/ui/gui/psppire-keypad.c index 84107c74..6f7865eb 100644 --- a/src/ui/gui/psppire-keypad.c +++ b/src/ui/gui/psppire-keypad.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2010 Free Software Foundation, Inc. + Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -217,7 +217,7 @@ key_release_callback (GtkWidget *widget, GdkEventKey *event, gpointer user_data) { - if ( ! (GTK_WIDGET_FLAGS (widget) & GTK_HAS_FOCUS) ) + if ( ! gtk_widget_has_focus (widget)) return FALSE; switch (event->keyval) diff --git a/src/ui/gui/psppire-output-window.c b/src/ui/gui/psppire-output-window.c index 658d36a4..b6abd050 100644 --- a/src/ui/gui/psppire-output-window.c +++ b/src/ui/gui/psppire-output-window.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2008, 2009, 2010 Free Software Foundation + Copyright (C) 2008, 2009, 2010, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -483,7 +483,7 @@ on_combo_change (GtkFileChooser *chooser) int x = 0; gchar *fn = gtk_file_chooser_get_filename (chooser); - if (combo && GTK_WIDGET_REALIZED (combo)) + if (combo && gtk_widget_get_realized (combo)) x = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); if (fn == NULL) @@ -519,7 +519,7 @@ on_file_chooser_change (GObject *w, GParamSpec *pspec, gpointer data) GtkFileChooser *chooser = data; const gchar *name = g_param_spec_get_name (pspec); - if ( ! GTK_WIDGET_REALIZED (chooser)) + if ( ! gtk_widget_get_realized (GTK_WIDGET (chooser))) return; /* Ignore this one. It causes recursion. */ diff --git a/src/ui/gui/psppire-vbuttonbox.c b/src/ui/gui/psppire-vbuttonbox.c index 66d0dda3..e1496576 100644 --- a/src/ui/gui/psppire-vbuttonbox.c +++ b/src/ui/gui/psppire-vbuttonbox.c @@ -1,5 +1,5 @@ /* PSPPIRE - a graphical user interface for PSPP. - Copyright (C) 2007, 2010 Free Software Foundation + Copyright (C) 2007, 2010, 2011 Free Software Foundation This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -242,7 +242,7 @@ gtk_vbutton_box_size_allocate (GtkWidget *widget, child = children->data; children = children->next; - if (GTK_WIDGET_VISIBLE (child->widget)) + if (gtk_widget_get_visible (child->widget)) { child_allocation.width = child_width; child_allocation.height = child_height; diff --git a/src/ui/gui/text-data-import-dialog.c b/src/ui/gui/text-data-import-dialog.c index ee42b7d8..215a444c 100644 --- a/src/ui/gui/text-data-import-dialog.c +++ b/src/ui/gui/text-data-import-dialog.c @@ -1882,7 +1882,7 @@ get_tooltip_location (GtkWidget *widget, gint wx, gint wy, to make the data related to the tool tips part of a GObject that only gets destroyed when all references are released, but this solution appears to be effective too. */ - if (!GTK_WIDGET_MAPPED (widget)) + if (!gtk_widget_get_mapped (widget)) return FALSE; gtk_tree_view_convert_widget_to_bin_window_coords (tree_view, -- 2.30.2