Use accessors from GTK+ 2.20 instead of using sealed members directly

This commit is contained in:
Michael Natterer 2010-04-19 19:21:07 +02:00
parent a0358f7c64
commit a2c70822d4
23 changed files with 104 additions and 156 deletions

View File

@ -17,9 +17,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
@ -62,7 +59,7 @@ resolution_calibrate_dialog (GtkWidget *resolution_entry,
gint monitor;
g_return_if_fail (GIMP_IS_SIZE_ENTRY (resolution_entry));
g_return_if_fail (GTK_WIDGET_REALIZED (resolution_entry));
g_return_if_fail (gtk_widget_get_realized (resolution_entry));
g_return_if_fail (pixbuf == NULL || GDK_IS_PIXBUF (pixbuf));
/* this dialog can only exist once */

View File

@ -17,9 +17,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -344,7 +341,7 @@ gimp_canvas_gc_new (GimpCanvas *canvas,
GdkColor fg = { 0, 0, 0, 0 };
GdkColor bg = { 0, 0, 0, 0 };
if (! GTK_WIDGET_REALIZED (GTK_WIDGET (canvas)))
if (! gtk_widget_get_realized (GTK_WIDGET (canvas)))
return NULL;
switch (style)
@ -1052,7 +1049,7 @@ gimp_canvas_set_bg_color (GimpCanvas *canvas,
GdkColormap *colormap;
GdkColor gdk_color;
if (! GTK_WIDGET_REALIZED (widget))
if (! gtk_widget_get_realized (widget))
return;
gimp_rgb_get_gdk_color (color, &gdk_color);

View File

@ -613,7 +613,7 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
gboolean return_val = FALSE;
gboolean update_sw_cursor = FALSE;
g_return_val_if_fail (GTK_WIDGET_REALIZED (canvas), FALSE);
g_return_val_if_fail (gtk_widget_get_realized (canvas), FALSE);
/* are we in destruction? */
if (! shell->display || ! gimp_display_get_shell (shell->display))

View File

@ -17,9 +17,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gegl.h>
#include <gtk/gtk.h>
@ -923,7 +920,7 @@ gimp_image_window_shrink_wrap (GimpImageWindow *window,
private = GIMP_IMAGE_WINDOW_GET_PRIVATE (window);
if (! GTK_WIDGET_REALIZED (window))
if (! gtk_widget_get_realized (GTK_WIDGET (window)))
return;
/* FIXME this so needs cleanup and shell/window separation */

View File

@ -19,8 +19,6 @@
#include <string.h>
#undef GSEAL_ENABLE
/* FIXME: #undef GTK_DISABLE_DEPRECATED */
#undef GTK_DISABLE_DEPRECATED
@ -328,7 +326,7 @@ gimp_colormap_editor_set_image (GimpImageEditor *image_editor,
{
gtk_adjustment_set_upper (editor->index_adjustment, 0);
if (GTK_WIDGET_MAPPED (GTK_WIDGET (editor)))
if (gtk_widget_get_mapped (GTK_WIDGET (editor)))
gimp_colormap_editor_clear (editor, -1);
}
}

View File

@ -17,9 +17,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "widgets-types.h"
@ -812,7 +809,7 @@ gimp_cursor_set (GtkWidget *widget,
GdkCursor *cursor;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (GTK_WIDGET_REALIZED (widget));
g_return_if_fail (gtk_widget_get_realized (widget));
cursor = gimp_cursor_new (gtk_widget_get_display (widget),
cursor_format,

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <string.h>
#include <gtk/gtk.h>
@ -1263,7 +1260,7 @@ gimp_dockable_blink_cancel (GimpDockable *dockable)
static void
gimp_dockable_cursor_setup (GimpDockable *dockable)
{
if (! GTK_WIDGET_REALIZED (GTK_WIDGET (dockable)))
if (! gtk_widget_get_realized (GTK_WIDGET (dockable)))
return;
if (! dockable->p->title_window)

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "widgets-types.h"
@ -143,7 +140,7 @@ gimp_overlay_box_realize (GtkWidget *widget)
gint attributes_mask;
GList *list;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
@ -168,8 +165,7 @@ gimp_overlay_box_realize (GtkWidget *widget)
G_CALLBACK (gimp_overlay_box_pick_embedded_child),
widget);
widget->style = gtk_style_attach (gtk_widget_get_style (widget),
gtk_widget_get_window (widget));
gtk_widget_style_attach (widget);
gtk_style_set_background (gtk_widget_get_style (widget),
gtk_widget_get_window (widget),
GTK_STATE_NORMAL);
@ -216,7 +212,7 @@ gimp_overlay_box_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x,
allocation->y,

View File

@ -21,9 +21,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include <libgimpmath/gimpmath.h>
@ -81,7 +78,7 @@ gimp_overlay_child_new (GimpOverlayBox *box,
cairo_matrix_init_identity (&child->matrix);
if (GTK_WIDGET_REALIZED (box))
if (gtk_widget_get_realized (GTK_WIDGET (box)))
gimp_overlay_child_realize (box, child);
gtk_widget_set_parent (widget, GTK_WIDGET (box));
@ -98,7 +95,7 @@ gimp_overlay_child_free (GimpOverlayBox *box,
gtk_widget_unparent (child->widget);
if (GTK_WIDGET_REALIZED (box))
if (gtk_widget_get_realized (GTK_WIDGET (box)))
gimp_overlay_child_unrealize (box, child);
g_slice_free (GimpOverlayChild, child);
@ -245,7 +242,7 @@ gimp_overlay_child_size_allocate (GimpOverlayBox *box,
gtk_widget_get_allocation (child->widget, &child_allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (GTK_WIDGET (widget)))
{
GdkRectangle old_allocation;
GdkRectangle old_bounds;

View File

@ -22,8 +22,6 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
@ -1271,7 +1269,7 @@ gimp_tag_entry_expose (GtkWidget *widget,
const char *display_text;
/* eeeeeek */
if (event->window != GTK_ENTRY (widget)->text_area)
if (event->window != gtk_entry_get_text_window (GTK_ENTRY (widget)))
return FALSE;
if (! GIMP_TAG_ENTRY (widget)->description_shown)

View File

@ -204,6 +204,9 @@ gimp_tag_popup_constructor (GType type,
GObject *object;
GimpTagPopup *popup;
GimpFilteredContainer *container;
GtkWidget *entry;
GtkAllocation entry_allocation;
GtkStyle *frame_style;
gint x;
gint y;
gint width;
@ -227,12 +230,15 @@ gimp_tag_popup_constructor (GType type,
construct_params);
popup = GIMP_TAG_POPUP (object);
gtk_window_set_screen (GTK_WINDOW (popup),
gtk_widget_get_screen (GTK_WIDGET (popup->combo_entry)));
entry = GTK_WIDGET (popup->combo_entry);
gtk_window_set_screen (GTK_WINDOW (popup), gtk_widget_get_screen (entry));
popup->context = gtk_widget_create_pango_context (GTK_WIDGET (popup));
popup->layout = pango_layout_new (popup->context);
gtk_widget_get_allocation (entry, &entry_allocation);
gtk_widget_style_get (GTK_WIDGET (popup),
"scroll-arrow-vlength", &popup->scroll_arrow_height,
NULL);
@ -291,23 +297,25 @@ gimp_tag_popup_constructor (GType type,
popup);
}
width = (GTK_WIDGET (popup->combo_entry)->allocation.width -
2 * popup->frame->style->xthickness);
frame_style = gtk_widget_get_style (popup->frame);
width = (entry_allocation.width -
2 * frame_style->xthickness);
height = (gimp_tag_popup_layout_tags (popup, width) +
2 * popup->frame->style->ythickness);
2 * frame_style->ythickness);
gdk_window_get_origin (GTK_WIDGET (popup->combo_entry)->window, &x, &y);
gdk_window_get_origin (gtk_widget_get_window (entry), &x, &y);
max_height = GTK_WIDGET (popup->combo_entry)->allocation.height * 10;
max_height = entry_allocation.height * 10;
screen_height = gdk_screen_get_height (gtk_widget_get_screen (GTK_WIDGET (popup->combo_entry)));
screen_height = gdk_screen_get_height (gtk_widget_get_screen (entry));
popup_height = MIN (height, max_height);
popup_rects[0].x = x;
popup_rects[0].y = 0;
popup_rects[0].width = GTK_WIDGET (popup->combo_entry)->allocation.width;
popup_rects[0].height = y + GTK_WIDGET (popup->combo_entry)->allocation.height;
popup_rects[0].width = entry_allocation.width;
popup_rects[0].height = y + entry_allocation.height;
popup_rects[1].x = x;
popup_rects[1].y = y;
@ -330,14 +338,12 @@ gimp_tag_popup_constructor (GType type,
if (popup_rects[0].height >= popup_rects[1].height)
{
popup_rect = popup_rects[0];
popup_rect.y += (popup->scroll_arrow_height +
popup->frame->style->ythickness);
popup_rect.y += popup->scroll_arrow_height + frame_style->ythickness;
}
else
{
popup_rect = popup_rects[1];
popup_rect.y -= (popup->scroll_arrow_height +
popup->frame->style->ythickness);
popup_rect.y -= popup->scroll_arrow_height + frame_style->ythickness;
}
popup_height = popup_rect.height;
@ -648,6 +654,7 @@ gimp_tag_popup_border_event (GtkWidget *widget,
if (event->type == GDK_BUTTON_PRESS)
{
GdkEventButton *button_event = (GdkEventButton *) event;
GtkAllocation allocation;
gint x;
gint y;
@ -657,13 +664,15 @@ gimp_tag_popup_border_event (GtkWidget *widget,
return TRUE;
}
gtk_widget_get_allocation (widget, &allocation);
gdk_window_get_pointer (gtk_widget_get_window (widget), &x, &y, NULL);
if (button_event->window != gtk_widget_get_window (popup->tag_area) &&
(x < widget->allocation.y ||
y < widget->allocation.x ||
x > widget->allocation.x + widget->allocation.width ||
y > widget->allocation.y + widget->allocation.height))
(x < allocation.y ||
y < allocation.x ||
x > allocation.x + allocation.width ||
y > allocation.y + allocation.height))
{
/* user has clicked outside the popup area,
* which means it should be hidden.
@ -682,7 +691,8 @@ gimp_tag_popup_border_event (GtkWidget *widget,
gdk_window_get_pointer (gtk_widget_get_window (widget), &x, &y, NULL);
gimp_tag_popup_handle_scrolling (popup, x, y,
motion_event->window == widget->window,
motion_event->window ==
gtk_widget_get_window (widget),
TRUE);
}
else if (event->type == GDK_BUTTON_RELEASE)
@ -1496,7 +1506,7 @@ get_arrows_visible_area (GimpTagPopup *popup,
&padding_top, &padding_bottom,
&padding_left, &padding_right);
*border = widget->allocation;
gtk_widget_get_allocation (widget, border);
upper->x = border->x + padding_left;
upper->y = border->y;

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <string.h>
#include <gtk/gtk.h>
@ -377,7 +374,7 @@ gimp_view_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
gdk_window_move_resize (view->event_window,
allocation->x,
allocation->y,
@ -432,7 +429,7 @@ gimp_view_button_press_event (GtkWidget *widget,
! view->show_popup)
return FALSE;
if (! GTK_WIDGET_REALIZED (widget))
if (! gtk_widget_get_realized (widget))
return FALSE;
if (bevent->type == GDK_BUTTON_PRESS)
@ -780,19 +777,19 @@ static void
gimp_view_update_callback (GimpViewRenderer *renderer,
GimpView *view)
{
GtkWidget *widget = GTK_WIDGET (view);
gint width;
gint height;
GtkWidget *widget = GTK_WIDGET (view);
GtkRequisition requisition;
gint width;
gint height;
gtk_widget_get_requisition (widget, &requisition);
width = renderer->width + 2 * renderer->border_width;
height = renderer->height + 2 * renderer->border_width;
if (width != widget->requisition.width ||
height != widget->requisition.height)
if (width != requisition.width ||
height != requisition.height)
{
widget->requisition.width = width;
widget->requisition.height = height;
gtk_widget_queue_resize (widget);
}
else

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <string.h>
#include <gtk/gtk.h>
@ -139,7 +136,7 @@ gimp_button_menu_position (GtkWidget *button,
gint monitor;
g_return_if_fail (GTK_IS_WIDGET (button));
g_return_if_fail (GTK_WIDGET_REALIZED (button));
g_return_if_fail (gtk_widget_get_realized (button));
g_return_if_fail (GTK_IS_MENU (menu));
g_return_if_fail (x != NULL);
g_return_if_fail (y != NULL);
@ -820,12 +817,12 @@ gimp_window_get_native (GtkWindow *window)
#endif
#ifdef GDK_WINDOWING_WIN32
if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (window && gtk_widget_get_realized (GTK_WIDGET (window)))
return (GdkNativeWindow) GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
#ifdef GDK_WINDOWING_X11
if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (window && gtk_widget_get_realized (GTK_WIDGET (window)))
return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
@ -836,7 +833,7 @@ static void
gimp_window_transient_realized (GtkWidget *window,
GdkWindow *parent)
{
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (window))
gdk_window_set_transient_for (gtk_widget_get_window (window), parent);
}
@ -861,7 +858,7 @@ gimp_window_set_transient_for (GtkWindow *window,
if (! parent)
return;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_transient_for (gtk_widget_get_window (GTK_WIDGET (window)),
parent);

View File

@ -21,9 +21,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#ifdef GDK_WINDOWING_WIN32
@ -181,12 +178,12 @@ gimp_window_get_native (GtkWindow *window)
#endif
#ifdef GDK_WINDOWING_WIN32
if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (window && gtk_widget_get_realized (GTK_WIDGET (window)))
return GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (window)));
#endif
#ifdef GDK_WINDOWING_X11
if (window && GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (window && gtk_widget_get_realized (GTK_WIDGET (window)))
return GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (window)));
#endif

View File

@ -18,9 +18,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmodule/gimpmodule.h"
@ -274,7 +271,7 @@ static void
gimp_window_transient_realized (GtkWidget *window,
GdkWindow *parent)
{
if (GTK_WIDGET_REALIZED (window))
if (gtk_widget_get_realized (window))
gdk_window_set_transient_for (gtk_widget_get_window (window), parent);
}
@ -293,7 +290,7 @@ gimp_window_set_transient_for (GtkWindow *window,
if (! parent)
return;
if (GTK_WIDGET_REALIZED (GTK_WIDGET (window)))
if (gtk_widget_get_realized (GTK_WIDGET (window)))
gdk_window_set_transient_for (gtk_widget_get_window (GTK_WIDGET (window)),
parent);

View File

@ -21,9 +21,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpwidgets/gimpwidgets.h"
@ -567,7 +564,7 @@ gimp_zoom_preview_draw_thumb (GimpPreview *preview,
static void
gimp_zoom_preview_set_cursor (GimpPreview *preview)
{
if (! GTK_WIDGET_REALIZED (preview->area))
if (! gtk_widget_get_realized (preview->area))
return;
if (gimp_zoom_preview_get_factor (GIMP_ZOOM_PREVIEW (preview)) > 1.0)

View File

@ -2,8 +2,8 @@
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* gimpcolorscale.c
* Copyright (C) 2002 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
* Copyright (C) 2002-2010 Sven Neumann <sven@gimp.org>
* Michael Natterer <mitch@gimp.org>
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@ -24,8 +24,6 @@
#include <string.h>
#undef GSEAL_ENABLE
#include <gtk/gtk.h>
#include "libgimpcolor/gimpcolor.h"
@ -78,7 +76,7 @@ gimp_color_scale_init (GimpColorScale *scale)
{
GtkRange *range = GTK_RANGE (scale);
range->slider_size_fixed = TRUE;
gtk_range_set_slider_size_fixed (range, TRUE);
/* range->update_policy = GTK_UPDATE_DELAYED; */
gtk_range_set_flippable (GTK_RANGE (scale), TRUE);
@ -118,6 +116,7 @@ gimp_color_scale_size_allocate (GtkWidget *widget,
{
GimpColorScale *scale = GIMP_COLOR_SCALE (widget);
GtkRange *range = GTK_RANGE (widget);
GdkRectangle range_rect;
gint focus = 0;
gint trough_border;
gint scale_width;
@ -138,25 +137,28 @@ gimp_color_scale_size_allocate (GtkWidget *widget,
focus += focus_padding;
}
range->min_slider_size = (MIN (allocation->width,
allocation->height) - 2 * focus) / 2;
gtk_range_set_min_slider_size (range,
(MIN (allocation->width,
allocation->height) - 2 * focus) / 2);
if (GTK_WIDGET_CLASS (parent_class)->size_allocate)
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
scale_width = range->range_rect.width - 2 * (focus + trough_border);
scale_height = range->range_rect.height - 2 * (focus + trough_border);
gtk_range_get_range_rect (range, &range_rect);
scale_width = range_rect.width - 2 * (focus + trough_border);
scale_height = range_rect.height - 2 * (focus + trough_border);
switch (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)))
{
case GTK_ORIENTATION_HORIZONTAL:
scale_width -= range->min_slider_size - 1;
scale_width -= gtk_range_get_min_slider_size (range) - 1;
scale_height -= 2;
break;
case GTK_ORIENTATION_VERTICAL:
scale_width -= 2;
scale_height -= range->min_slider_size - 1;
scale_height -= gtk_range_get_min_slider_size (range) - 1;
break;
}
@ -243,10 +245,12 @@ gimp_color_scale_expose (GtkWidget *widget,
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
GtkAllocation allocation;
GdkRectangle range_rect;
GdkRectangle expose_area; /* Relative to widget->allocation */
GdkRectangle area;
gint focus = 0;
gint trough_border;
gint slider_start;
gint slider_size;
gint x, y;
gint w, h;
@ -254,18 +258,6 @@ gimp_color_scale_expose (GtkWidget *widget,
if (! scale->buf || ! gtk_widget_is_drawable (widget))
return FALSE;
/* This is ugly as it relies heavily on GTK+ internals, but I see no
* other way to force the range to recalculate its layout. Might
* break if GtkRange internals change.
*/
if (range->need_recalc)
{
GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED);
GTK_WIDGET_CLASS (parent_class)->size_allocate (widget,
&widget->allocation);
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
}
gtk_widget_style_get (widget,
"trough-border", &trough_border,
NULL);
@ -283,18 +275,21 @@ gimp_color_scale_expose (GtkWidget *widget,
gtk_widget_get_allocation (widget, &allocation);
x = allocation.x + range->range_rect.x + focus;
y = allocation.y + range->range_rect.y + focus;
w = range->range_rect.width - 2 * focus;
h = range->range_rect.height - 2 * focus;
gtk_range_get_range_rect (range, &range_rect);
gtk_range_get_slider_range (range, &slider_start, NULL);
slider_size = range->min_slider_size / 2;
x = allocation.x + range_rect.x + focus;
y = allocation.y + range_rect.y + focus;
w = range_rect.width - 2 * focus;
h = range_rect.height - 2 * focus;
slider_size = gtk_range_get_min_slider_size (range) / 2;
expose_area = event->area;
expose_area.x -= allocation.x;
expose_area.y -= allocation.y;
if (gdk_rectangle_intersect (&expose_area, &range->range_rect, &area))
if (gdk_rectangle_intersect (&expose_area, &range_rect, &area))
{
gboolean sensitive = gtk_widget_is_sensitive (widget);
@ -354,15 +349,15 @@ gimp_color_scale_expose (GtkWidget *widget,
if (gtk_widget_has_focus (widget))
gtk_paint_focus (style, window, gtk_widget_get_state (widget),
&area, widget, "trough",
allocation.x + range->range_rect.x,
allocation.y + range->range_rect.y,
range->range_rect.width,
range->range_rect.height);
allocation.x + range_rect.x,
allocation.y + range_rect.y,
range_rect.width,
range_rect.height);
switch (gtk_orientable_get_orientation (GTK_ORIENTABLE (range)))
{
case GTK_ORIENTATION_HORIZONTAL:
area.x = allocation.x + range->slider_start;
area.x = allocation.x + slider_start;
area.y = y + trough_border;
area.width = 2 * slider_size + 1;
area.height = h - 2 * trough_border;
@ -370,7 +365,7 @@ gimp_color_scale_expose (GtkWidget *widget,
case GTK_ORIENTATION_VERTICAL:
area.x = x + trough_border;
area.y = allocation.y + range->slider_start;
area.y = allocation.y + slider_start;
area.width = w - 2 * trough_border;
area.height = 2 * slider_size + 1;
break;

View File

@ -93,7 +93,7 @@ gimp_pixmap_set (GimpPixmap *pixmap,
GTK_WIDGET (pixmap)->requisition.width = 0;
GTK_WIDGET (pixmap)->requisition.height = 0;
if (! GTK_WIDGET_REALIZED (GTK_WIDGET (pixmap)))
if (! gtk_widget_get_realized (GTK_WIDGET (pixmap)))
{
if (xpm_data)
{

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
@ -477,7 +474,7 @@ gimp_preview_invalidate_now (GimpPreview *preview)
preview->timeout_id = 0;
if (toplevel && GTK_WIDGET_REALIZED (toplevel))
if (toplevel && gtk_widget_get_realized (toplevel))
{
gdk_window_set_cursor (gtk_widget_get_window (toplevel),
preview->cursor_busy);
@ -502,7 +499,7 @@ gimp_preview_invalidate_now (GimpPreview *preview)
static void
gimp_preview_real_set_cursor (GimpPreview *preview)
{
if (GTK_WIDGET_REALIZED (preview->area))
if (gtk_widget_get_realized (preview->area))
gdk_window_set_cursor (gtk_widget_get_window (preview->area),
preview->default_cursor);
}

View File

@ -20,9 +20,6 @@
#include <string.h>
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpbase/gimpbase.h"
@ -503,7 +500,7 @@ gimp_ruler_realize (GtkWidget *widget)
GdkWindowAttr attributes;
gint attributes_mask;
GTK_WIDGET_SET_FLAGS (ruler, GTK_REALIZED);
gtk_widget_set_realized (widget, TRUE);
gtk_widget_get_allocation (widget, &allocation);
@ -527,8 +524,7 @@ gimp_ruler_realize (GtkWidget *widget)
&attributes, attributes_mask));
gdk_window_set_user_data (gtk_widget_get_window (widget), ruler);
widget->style = gtk_style_attach (gtk_widget_get_style (widget),
gtk_widget_get_window (widget));
gtk_widget_style_attach (widget);
gtk_style_set_background (gtk_widget_get_style (widget),
gtk_widget_get_window (widget),
GTK_STATE_ACTIVE);
@ -571,7 +567,7 @@ gimp_ruler_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
if (GTK_WIDGET_REALIZED (widget))
if (gtk_widget_get_realized (widget))
{
gdk_window_move_resize (gtk_widget_get_window (widget),
allocation->x, allocation->y,

View File

@ -20,9 +20,6 @@
#include "config.h"
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
@ -780,7 +777,7 @@ gimp_scrolled_preview_nav_popup_expose (GtkWidget *widget,
static void
gimp_scrolled_preview_set_cursor (GimpPreview *preview)
{
if (! GTK_WIDGET_REALIZED (preview->area))
if (! gtk_widget_get_realized (preview->area))
return;
if (preview->xmax - preview->xmin > preview->width ||

View File

@ -35,9 +35,6 @@
#include <string.h>
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
@ -416,7 +413,7 @@ detach_callback (GtkToggleAction *action)
gtk_window_set_screen (GTK_WINDOW (shape_window),
gtk_widget_get_screen (drawing_area));
if (GTK_WIDGET_REALIZED (drawing_area))
if (gtk_widget_get_realized (drawing_area))
{
gint x, y;

View File

@ -34,9 +34,6 @@
#include <glib/gstdio.h>
#undef GSEAL_ENABLE
#undef GTK_DISABLE_DEPRECATED
#include <libgimp/gimp.h>
#include <libgimp/gimpui.h>
@ -2207,7 +2204,7 @@ design_op_update_callback (GtkRadioAction *action,
ifsDesign->op = gtk_radio_action_get_current_value (action);
/* cursor switch */
if (GTK_WIDGET_REALIZED (ifsDesign->area))
if (gtk_widget_get_realized (ifsDesign->area))
design_area_realize (ifsDesign->area);
}