Commit d85fb156 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/widgets/gimpblobeditor.c app/widgets/gimpbrushselect.c

2009-03-22  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpblobeditor.c
	* app/widgets/gimpbrushselect.c
	* app/widgets/gimpcolorbar.c
	* app/widgets/gimpcolordialog.c
	* app/widgets/gimpcolorframe.c
	* app/widgets/gimpcontainergridview.c
	* app/widgets/gimpcontainerpopup.c
	* app/widgets/gimpcontainertreeview.c
	* app/widgets/gimpcontrollereditor.c
	* app/widgets/gimpcontrollerlist.c
	* app/widgets/gimpcursor.c
	* app/widgets/gimpcurveview.c
	* app/widgets/gimpdasheditor.c
	* app/widgets/gimpdialogfactory.c
	* app/widgets/gimpdnd-xds.c
	* app/widgets/gimpdockable.c
	* app/widgets/gimperrordialog.c
	* app/widgets/gimpfgbgeditor.c
	* app/widgets/gimpfgbgview.c
	* app/widgets/gimpfiledialog.c
	* app/widgets/gimpfontselect.c
	* app/widgets/gimpgradienteditor.c
	* app/widgets/gimpgradientselect.c
	* app/widgets/gimphandlebar.c
	* app/widgets/gimphistogrambox.c
	* app/widgets/gimphistogramview.c
	* app/widgets/gimpmessagedialog.c
	* app/widgets/gimpnavigationview.c
	* app/widgets/gimppaletteselect.c
	* app/widgets/gimppaletteview.c
	* app/widgets/gimppatternselect.c
	* app/widgets/gimpprogressbox.c
	* app/widgets/gimpprogressdialog.c
	* app/widgets/gimpscalebutton.c
	* app/widgets/gimpselectiondata.c
	* app/widgets/gimpsessioninfo.c
	* app/widgets/gimpsettingsbox.c
	* app/widgets/gimpstrokeeditor.c
	* app/widgets/gimptexteditor.c
	* app/widgets/gimptoolbox.c
	* app/widgets/gimpuimanager.c
	* app/widgets/gimpview-popup.c
	* app/widgets/gimpview.c
	* app/widgets/gimpviewabledialog.c
	* app/widgets/gimpwidgets-utils.c: use accessors for various
	members of GTK+ structures that don't exist any longer when
	GSEAL_ENABLE is defined.


svn path=/trunk/; revision=28193
parent d3dcff66
2009-03-22 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpblobeditor.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimpcolorbar.c
* app/widgets/gimpcolordialog.c
* app/widgets/gimpcolorframe.c
* app/widgets/gimpcontainergridview.c
* app/widgets/gimpcontainerpopup.c
* app/widgets/gimpcontainertreeview.c
* app/widgets/gimpcontrollereditor.c
* app/widgets/gimpcontrollerlist.c
* app/widgets/gimpcursor.c
* app/widgets/gimpcurveview.c
* app/widgets/gimpdasheditor.c
* app/widgets/gimpdialogfactory.c
* app/widgets/gimpdnd-xds.c
* app/widgets/gimpdockable.c
* app/widgets/gimperrordialog.c
* app/widgets/gimpfgbgeditor.c
* app/widgets/gimpfgbgview.c
* app/widgets/gimpfiledialog.c
* app/widgets/gimpfontselect.c
* app/widgets/gimpgradienteditor.c
* app/widgets/gimpgradientselect.c
* app/widgets/gimphandlebar.c
* app/widgets/gimphistogrambox.c
* app/widgets/gimphistogramview.c
* app/widgets/gimpmessagedialog.c
* app/widgets/gimpnavigationview.c
* app/widgets/gimppaletteselect.c
* app/widgets/gimppaletteview.c
* app/widgets/gimppatternselect.c
* app/widgets/gimpprogressbox.c
* app/widgets/gimpprogressdialog.c
* app/widgets/gimpscalebutton.c
* app/widgets/gimpselectiondata.c
* app/widgets/gimpsessioninfo.c
* app/widgets/gimpsettingsbox.c
* app/widgets/gimpstrokeeditor.c
* app/widgets/gimptexteditor.c
* app/widgets/gimptoolbox.c
* app/widgets/gimpuimanager.c
* app/widgets/gimpview-popup.c
* app/widgets/gimpview.c
* app/widgets/gimpviewabledialog.c
* app/widgets/gimpwidgets-utils.c: use accessors for various
members of GTK+ structures that don't exist any longer when
GSEAL_ENABLE is defined.
2009-03-22 Michael Natterer <mitch@gimp.org>
* app/display/gimpcanvas.c
......
......@@ -197,7 +197,7 @@ gimp_blob_editor_expose (GtkWidget *widget,
if (r0 < 2)
return TRUE;
cr = gdk_cairo_create (widget->window);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
gimp_blob_editor_draw_blob (editor, cr,
widget->allocation.width / 2.0,
......
......@@ -132,6 +132,7 @@ gimp_brush_select_constructor (GType type,
GObject *object;
GimpPdbDialog *dialog;
GimpBrushSelect *select;
GtkWidget *content_area;
GtkWidget *table;
GtkAdjustment *spacing_adj;
......@@ -163,7 +164,9 @@ gimp_brush_select_constructor (GType type,
5 * (GIMP_VIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->view);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (content_area), dialog->view);
gtk_widget_show (dialog->view);
/* Create the frame and the table for the options */
......
......@@ -204,7 +204,7 @@ gimp_color_bar_expose (GtkWidget *widget,
break;
}
gdk_draw_rgb_image (widget->window, style->black_gc,
gdk_draw_rgb_image (gtk_widget_get_window (widget), style->black_gc,
widget->allocation.x + x, widget->allocation.y + y,
width, height,
GDK_RGB_DITHER_NORMAL,
......
......@@ -126,7 +126,7 @@ gimp_color_dialog_init (GimpColorDialog *dialog)
dialog->selection = gimp_color_selection_new ();
gtk_container_set_border_width (GTK_CONTAINER (dialog->selection), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox),
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
dialog->selection);
gtk_widget_show (dialog->selection);
......@@ -277,10 +277,19 @@ gimp_color_dialog_new (GimpViewable *viewable,
NULL);
if (viewable)
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (dialog),
viewable, context);
{
gimp_viewable_dialog_set_viewable (GIMP_VIEWABLE_DIALOG (dialog),
viewable, context);
}
else
gtk_widget_hide (GIMP_VIEWABLE_DIALOG (dialog)->icon->parent->parent);
{
GtkWidget *parent;
parent = gtk_widget_get_parent (GIMP_VIEWABLE_DIALOG (dialog)->icon);
parent = gtk_widget_get_parent (parent);
gtk_widget_hide (parent);
}
dialog->wants_updates = wants_updates;
......
......@@ -277,7 +277,7 @@ gimp_color_frame_expose (GtkWidget *widget,
gint w, h;
gdouble scale;
cr = gdk_cairo_create (widget->window);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_set_source_color (cr, &style->light[GTK_STATE_NORMAL]);
g_snprintf (buf, sizeof (buf), "%d", frame->number);
......
......@@ -359,7 +359,7 @@ gimp_container_grid_view_menu_position (GtkMenu *menu,
else
widget = GTK_WIDGET (grid_view->wrap_box);
gdk_window_get_origin (widget->window, x, y);
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
if (GTK_WIDGET_NO_WINDOW (widget))
{
......
......@@ -185,12 +185,13 @@ gimp_container_popup_map (GtkWidget *widget)
* receive events. we filter away events outside this toplevel
* away in button_press()
*/
if (gdk_pointer_grab (widget->window, TRUE,
if (gdk_pointer_grab (gtk_widget_get_window (widget), TRUE,
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK |
GDK_POINTER_MOTION_MASK,
NULL, NULL, GDK_CURRENT_TIME) == 0)
{
if (gdk_keyboard_grab (widget->window, TRUE, GDK_CURRENT_TIME) == 0)
if (gdk_keyboard_grab (gtk_widget_get_window (widget), TRUE,
GDK_CURRENT_TIME) == 0)
{
gtk_grab_add (widget);
return;
......@@ -402,7 +403,7 @@ gimp_container_popup_show (GimpContainerPopup *popup,
g_return_if_fail (GTK_IS_WIDGET (widget));
gtk_widget_size_request (GTK_WIDGET (popup), &requisition);
gdk_window_get_origin (widget->window, &orig_x, &orig_y);
gdk_window_get_origin (gtk_widget_get_window (widget), &orig_x, &orig_y);
if (GTK_WIDGET_NO_WINDOW (widget))
{
......
......@@ -315,7 +315,7 @@ gimp_container_tree_view_menu_position (GtkMenu *menu,
GtkWidget *widget = GTK_WIDGET (tree_view->view);
GtkTreeIter selected_iter;
gdk_window_get_origin (widget->window, x, y);
gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
if (GTK_WIDGET_NO_WINDOW (widget))
{
......
......@@ -696,7 +696,7 @@ gimp_controller_editor_edit_clicked (GtkWidget *button,
view = gimp_action_editor_new (gimp_ui_managers_from_name ("<Image>")->data,
action_name, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (view), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (editor->edit_dialog)->vbox),
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (editor->edit_dialog))),
view);
gtk_widget_show (view);
......
......@@ -645,7 +645,8 @@ gimp_controller_list_edit_clicked (GtkWidget *button,
editor = gimp_controller_editor_new (list->dest_info,
gimp_get_user_context (list->gimp));
gtk_container_set_border_width (GTK_CONTAINER (editor), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), editor);
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
editor);
gtk_widget_show (editor);
g_object_set_data (G_OBJECT (list->dest_info), "gimp-controller-editor-dialog",
......
......@@ -816,6 +816,6 @@ gimp_cursor_set (GtkWidget *widget,
cursor_type,
tool_cursor,
modifier);
gdk_window_set_cursor (widget->window, cursor);
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
gdk_cursor_unref (cursor);
}
......@@ -356,7 +356,7 @@ gimp_curve_view_expose (GtkWidget *widget,
width = widget->allocation.width - 2 * border - 1;
height = widget->allocation.height - 2 * border - 1;
cr = gdk_cairo_create (widget->window);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_region (cr, event->region);
cairo_clip (cr);
......@@ -508,7 +508,7 @@ set_cursor (GimpCurveView *view,
GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (view));
GdkCursor *cursor = gdk_cursor_new_for_display (display, new_cursor);
gdk_window_set_cursor (GTK_WIDGET (view)->window, cursor);
gdk_window_set_cursor (gtk_widget_get_window (GTK_WIDGET (view)), cursor);
gdk_cursor_unref (cursor);
view->cursor_type = new_cursor;
......
......@@ -238,7 +238,7 @@ gimp_dash_editor_expose (GtkWidget *widget,
{
GimpDashEditor *editor = GIMP_DASH_EDITOR (widget);
GtkStyle *style = gtk_widget_get_style (widget);
cairo_t *cr = gdk_cairo_create (widget->window);
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
gint x;
gint w, h;
......@@ -348,7 +348,7 @@ gimp_dash_editor_button_press (GtkWidget *widget,
if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS)
{
gdk_pointer_grab (widget->window, FALSE,
gdk_pointer_grab (gtk_widget_get_window (widget), FALSE,
GDK_BUTTON_RELEASE_MASK | GDK_BUTTON1_MOTION_MASK,
NULL, NULL, bevent->time);
index = dash_x_to_index (editor, bevent->x);
......
......@@ -1505,7 +1505,7 @@ gimp_dialog_factories_show_foreach (gconstpointer key,
gtk_widget_show (widget);
if (GTK_WIDGET_VISIBLE (widget))
gdk_window_raise (widget->window);
gdk_window_raise (gtk_widget_get_window (widget));
}
}
}
......@@ -1540,8 +1540,8 @@ gimp_dialog_factories_set_busy_foreach (gconstpointer key,
GIMP_CURSOR_MODIFIER_NONE);
}
if (widget->window)
gdk_window_set_cursor (widget->window, cursor);
if (gtk_widget_get_window (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget), cursor);
}
}
......@@ -1562,8 +1562,8 @@ gimp_dialog_factories_unset_busy_foreach (gconstpointer key,
if (GTK_IS_WIDGET (widget) && GTK_WIDGET_TOPLEVEL (widget))
{
if (widget->window)
gdk_window_set_cursor (widget->window, NULL);
if (gtk_widget_get_window (widget))
gdk_window_set_cursor (gtk_widget_get_window (widget), NULL);
}
}
}
......
......@@ -157,13 +157,15 @@ gimp_dnd_xds_save_image (GdkDragContext *context,
uri, proc, GIMP_RUN_INTERACTIVE, FALSE,
&error) == GIMP_PDB_SUCCESS)
{
gtk_selection_data_set (selection, selection->target, 8,
(const guchar *) "S", 1);
gtk_selection_data_set (selection,
gtk_selection_data_get_target (selection),
8, (const guchar *) "S", 1);
}
else
{
gtk_selection_data_set (selection, selection->target, 8,
(const guchar *) "E", 1);
gtk_selection_data_set (selection,
gtk_selection_data_get_target (selection),
8, (const guchar *) "E", 1);
if (error)
{
......@@ -183,8 +185,9 @@ gimp_dnd_xds_save_image (GdkDragContext *context,
}
else
{
gtk_selection_data_set (selection, selection->target, 8,
(const guchar *) "E", 1);
gtk_selection_data_set (selection,
gtk_selection_data_get_target (selection),
8, (const guchar *) "E", 1);
gimp_message_literal (image->gimp, NULL, GIMP_MESSAGE_ERROR,
_("The given filename does not have any known "
......
......@@ -430,7 +430,7 @@ gimp_dockable_realize (GtkWidget *widget)
GDK_BUTTON_MOTION_MASK |
gtk_widget_get_events (widget));
dockable->title_window = gdk_window_new (widget->window,
dockable->title_window = gdk_window_new (gtk_widget_get_window (widget),
&attributes,
(GDK_WA_X |
GDK_WA_Y |
......@@ -561,7 +561,7 @@ gimp_dockable_expose_event (GtkWidget *widget,
if (dockable->blink_counter & 1)
{
gtk_paint_box (style, widget->window,
gtk_paint_box (style, gtk_widget_get_window (widget),
GTK_STATE_SELECTED, GTK_SHADOW_NONE,
&expose_area, widget, "",
title_area.x, title_area.y,
......@@ -589,7 +589,7 @@ gimp_dockable_expose_event (GtkWidget *widget,
text_y = title_area.y + (title_area.height - layout_height) / 2;
gtk_paint_layout (style, widget->window,
gtk_paint_layout (style, gtk_widget_get_window (widget),
(dockable->blink_counter & 1) ?
GTK_STATE_SELECTED : widget->state, TRUE,
&expose_area, widget, NULL,
......@@ -1314,6 +1314,7 @@ gimp_dockable_title_changed (GimpDocked *docked,
gimp_dockable_get_title_area (dockable, &area);
gdk_window_invalidate_rect (GTK_WIDGET (dockable)->window, &area, FALSE);
gdk_window_invalidate_rect (gtk_widget_get_window (GTK_WIDGET (dockable)),
&area, FALSE);
}
}
......@@ -71,7 +71,7 @@ gimp_error_dialog_init (GimpErrorDialog *dialog)
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
dialog->vbox = gtk_vbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox),
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
dialog->vbox, TRUE, TRUE, 0);
gtk_widget_show (dialog->vbox);
......
......@@ -286,6 +286,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
{
GimpFgBgEditor *editor = GIMP_FG_BG_EDITOR (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
gint width, height;
gint default_w, default_h;
gint swap_w, swap_h;
......@@ -308,7 +309,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
default_h = gdk_pixbuf_get_height (editor->default_icon);
if (default_w < width / 2 && default_h < height / 2)
gdk_draw_pixbuf (widget->window, NULL, editor->default_icon,
gdk_draw_pixbuf (window, NULL, editor->default_icon,
0, 0, 0, height - default_h, default_w, default_h,
GDK_RGB_DITHER_NORMAL, 0, 0);
else
......@@ -324,7 +325,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
swap_h = gdk_pixbuf_get_height (editor->swap_icon);
if (swap_w < width / 2 && swap_h < height / 2)
gdk_draw_pixbuf (widget->window, NULL, editor->swap_icon,
gdk_draw_pixbuf (window, NULL, editor->swap_icon,
0, 0, width - swap_w, 0, swap_w, swap_h,
GDK_RGB_DITHER_NORMAL, 0, 0);
else
......@@ -347,7 +348,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
{
gimp_context_get_background (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
window,
style->fg_gc[0],
(width - rect_w),
(height - rect_h),
......@@ -355,7 +356,7 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
&color);
}
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
gtk_paint_shadow (style, window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_FOREGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
......@@ -370,14 +371,14 @@ gimp_fg_bg_editor_expose (GtkWidget *widget,
{
gimp_context_get_foreground (editor->context, &color);
gimp_fg_bg_editor_draw_rect (editor,
widget->window,
window,
style->fg_gc[0],
0, 0,
rect_w, rect_h,
&color);
}
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
gtk_paint_shadow (style, window, GTK_STATE_NORMAL,
editor->active_color == GIMP_ACTIVE_COLOR_BACKGROUND ?
GTK_SHADOW_OUT : GTK_SHADOW_IN,
NULL, widget, NULL,
......
......@@ -205,8 +205,9 @@ static gboolean
gimp_fg_bg_view_expose (GtkWidget *widget,
GdkEventExpose *eevent)
{
GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GimpFgBgView *view = GIMP_FG_BG_VIEW (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
gint x, y;
gint width, height;
gint rect_w, rect_h;
......@@ -228,8 +229,7 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
if (view->context)
{
gimp_context_get_background (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
gimp_fg_bg_view_draw_rect (view, window,
style->fg_gc[0],
x + width - rect_w + 1,
y + height - rect_h + 1,
......@@ -237,7 +237,7 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
&color);
}
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
gtk_paint_shadow (style, window, GTK_STATE_NORMAL,
GTK_SHADOW_IN,
NULL, widget, NULL,
x + width - rect_w, y + height - rect_h, rect_w, rect_h);
......@@ -247,15 +247,14 @@ gimp_fg_bg_view_expose (GtkWidget *widget,
if (view->context)
{
gimp_context_get_foreground (view->context, &color);
gimp_fg_bg_view_draw_rect (view,
widget->window,
gimp_fg_bg_view_draw_rect (view, window,
style->fg_gc[0],
x + 1, y + 1,
rect_w - 2, rect_h - 2,
&color);
}
gtk_paint_shadow (style, widget->window, GTK_STATE_NORMAL,
gtk_paint_shadow (style, window, GTK_STATE_NORMAL,
GTK_SHADOW_OUT,
NULL, widget, NULL,
x, y, rect_w, rect_h);
......
......@@ -354,7 +354,7 @@ gimp_file_dialog_new (Gimp *gimp,
if (GIMP_GUI_CONFIG (gimp->config)->show_help_button && help_id)
{
GtkWidget *action_area = GTK_DIALOG (dialog)->action_area;
GtkWidget *action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
GtkWidget *button = gtk_button_new_from_stock (GTK_STOCK_HELP);
gtk_box_pack_end (GTK_BOX (action_area), button, FALSE, TRUE, 0);
......@@ -384,8 +384,8 @@ gimp_file_dialog_new (Gimp *gimp,
automatic_help_id);
dialog->progress = gimp_progress_box_new ();
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), dialog->progress,
FALSE, FALSE, 0);
gtk_box_pack_end (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))),
dialog->progress, FALSE, FALSE, 0);
return GTK_WIDGET (dialog);
}
......@@ -394,8 +394,9 @@ void
gimp_file_dialog_set_sensitive (GimpFileDialog *dialog,
gboolean sensitive)
{
GList *children;
GList *list;
GtkWidget *content_area;
GList *children;
GList *list;
g_return_if_fail (GIMP_IS_FILE_DIALOG (dialog));
......@@ -403,8 +404,9 @@ gimp_file_dialog_set_sensitive (GimpFileDialog *dialog,
if (! dialog->progress)
return;
children =
gtk_container_get_children (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox));
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
children = gtk_container_get_children (GTK_CONTAINER (content_area));
for (list = children; list; list = g_list_next (list))
{
......
......@@ -77,6 +77,7 @@ gimp_font_select_constructor (GType type,
{
GObject *object;
GimpPdbDialog *dialog;
GtkWidget *content_area;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
......@@ -93,7 +94,9 @@ gimp_font_select_constructor (GType type,
6 * (GIMP_VIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->view);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (content_area), dialog->view);
gtk_widget_show (dialog->view);
return object;
......
......@@ -777,7 +777,7 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment,
str2 = g_strdup_printf (_("Displaying [%0.4f, %0.4f]"),
gtk_adjustment_get_value (adjustment),
gtk_adjustment_get_value (adjustment) +
adjustment->page_size);
gtk_adjustment_get_page_size (adjustment));
gradient_editor_set_hint (editor, str1, str2, NULL, NULL);
......@@ -789,7 +789,7 @@ gradient_editor_scrollbar_update (GtkAdjustment *adjustment,
gimp_view_renderer_gradient_set_offsets (renderer,
gtk_adjustment_get_value (adjustment),
gtk_adjustment_get_value (adjustment) +
adjustment->page_size,
gtk_adjustment_get_page_size (adjustment),
editor->instant_update);
gimp_gradient_editor_update (editor);
}
......@@ -1223,11 +1223,11 @@ control_expose (GtkWidget *widget,
GimpGradientEditor *editor)
{
GtkAdjustment *adj = GTK_ADJUSTMENT (editor->scroll_data);
cairo_t *cr = gdk_cairo_create (widget->window);
cairo_t *cr = gdk_cairo_create (gtk_widget_get_window (widget));
gint width;
gint height;
gdk_drawable_get_size (widget->window, &width, &height);
gdk_drawable_get_size (gtk_widget_get_window (widget), &width, &height);
control_draw (editor,
GIMP_GRADIENT (GIMP_DATA_EDITOR (editor)->data),
......@@ -1235,7 +1235,7 @@ control_expose (GtkWidget *widget,
width, height,
gtk_adjustment_get_value (adj),
gtk_adjustment_get_value (adj) +
adj->page_size);
gtk_adjustment_get_page_size (adj));
cairo_destroy (cr);
......@@ -1894,7 +1894,8 @@ control_calc_p_pos (GimpGradientEditor *editor,
* and the gradient control's handles.
*/
return RINT ((pwidth - 1) * (pos - adjustment->value) / adjustment->page_size);
return RINT ((pwidth - 1) * (pos - gtk_adjustment_get_value (adjustment)) /
gtk_adjustment_get_page_size (adjustment));
}
static gdouble
......@@ -1906,7 +1907,8 @@ control_calc_g_pos (GimpGradientEditor *editor,
/* Calculate the gradient position that corresponds to widget's coordinates */
return adjustment->page_size * pos / (pwidth - 1) + adjustment->value;
return (gtk_adjustment_get_page_size (adjustment) * pos / (pwidth - 1) +
gtk_adjustment_get_value (adjustment));
}
/***** Segment functions *****/
......
......@@ -95,6 +95,7 @@ gimp_gradient_select_constructor (GType type,
{
GObject *object;
GimpPdbDialog *dialog;
GtkWidget *content_area;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
......@@ -114,7 +115,9 @@ gimp_gradient_select_constructor (GType type,
6 * (GIMP_VIEW_SIZE_MEDIUM + 2));
gtk_container_set_border_width (GTK_CONTAINER (dialog->view), 12);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), dialog->view);
content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
gtk_container_add (GTK_CONTAINER (content_area), dialog->view);
gtk_widget_show (dialog->view);
return object;
......
......@@ -161,7 +161,7 @@ gimp_handle_bar_expose (GtkWidget *widget,
y += widget->allocation.y;
}
cr = gdk_cairo_create (widget->window);
cr = gdk_cairo_create (gtk_widget_get_window (widget));
gdk_cairo_region (cr, eevent->region);
cairo_clip (cr);
......@@ -176,7 +176,7 @@ gimp_handle_bar_expose (GtkWidget *widget,
if (bar->slider_adj[i])
{
bar->slider_pos[i] = ROUND ((gdouble) width *
(bar->slider_adj[i]->value - bar->lower) /
(gtk_adjustment_get_value (bar->slider_adj[i]) - bar->lower) /
(bar->upper - bar->lower + 1));
cairo_set_source_rgb (cr, 0.5 * i, 0.5 * i, 0.5 * i);
......@@ -325,14 +325,14 @@ gimp_handle_bar_set_adjustment (GimpHandleBar *bar,
}
if (bar->slider_adj[0])
bar->lower = bar->slider_adj[0]->lower;
bar->lower = gtk_adjustment_get_lower (bar->slider_adj[0]);
else
bar->lower = bar->slider_adj[handle_no]->lower;
bar->lower = gtk_adjustment_get_lower (bar->slider_adj[handle_no]);
if (bar->slider_adj[2])
bar->upper = bar->slider_adj[2]->upper;
bar->upper = gtk_adjustment_get_upper (bar->slider_adj[2]);
else
bar->upper = bar->slider_adj[handle_no]->upper;
bar->upper = gtk_adjustment_get_upper (bar->slider_adj[handle_no]);
gimp_handle_bar_adjustment_changed (bar->slider_adj[handle_no], bar);
}
......
......@@ -196,8 +196,7 @@ gimp_histogram_box_low_adj_update (GtkAdjustment *adjustment,
if (box->view->start != value)
{
box->high_adj->lower = value;
gtk_adjustment_changed (box->high_adj);
gtk_adjustment_set_lower (box->high_adj, value);
gimp_histogram_view_set_range (box->view, value, box->view->end);
}
......@@ -211,8 +210,7 @@ gimp_histogram_box_high_adj_update (GtkAdjustment *adjustment,
if (box->view->end != value)
{
box->low_adj->upper = value;
gtk_adjustment_changed (box->low_adj);
gtk_adjustment_set_upper (box->low_adj, value);
gimp_histogram_view_set_range (box->view, box->view->start, value);
}
......@@ -224,10 +222,8 @@ gimp_histogram_box_histogram_range (GimpHistogramView *view,
gint end,
GimpHistogramBox *box)
{
box->high_adj->lower = start;
box->low_adj->upper = end;
gtk_adjustment_changed (box->high_adj);
gtk_adjustment_changed (box->low_adj);
gtk_adjustment_set_lower (box->high_adj, start);
gtk_adjustment_set_upper (box->low_adj, end);
gtk_adjustment_set_value (box->low_adj, start);
gtk_adjustment_set_value (box->high_adj, end);
......
......@@ -278,8 +278,9 @@ static gboolean
gimp_histogram_view_expose (GtkWidget *widget,
GdkEventExpose *event)
{
GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GimpHistogramView *view = GIMP_HISTOGRAM_VIEW (widget);
GtkStyle *style = gtk_widget_get_style (widget);
GdkWindow *window = gtk_widget_get_window (widget);
gint x;
gint x1, x2;
gint border;
......@@ -303,14 +304,14 @@ gimp_histogram_view_expose (GtkWidget *widget,
x1 = CLAMP (MIN (view->start, view->end), 0, 255);
x2 = CLAMP (MAX (view->start, view->end), 0, 255);
gdk_draw_rectangle (widget->window,
gdk_draw_rectangle (window,
style->base_gc[GTK_STATE_NORMAL], TRUE,
0, 0,
widget->allocation.width,
widget->allocation.height);
/* Draw the outer border */
gdk_draw_rectangle (widget->window,
gdk_draw_rectangle (window,
style->dark_gc[GTK_STATE_NORMAL], FALSE,
b