X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/9a99599695e04ad9f217f4199da8a48d1e924e63..23d6216c871ca648a093bd992f25fd9ce18f971d:/src/print-preview.c?ds=sidebyside diff --git a/src/print-preview.c b/src/print-preview.c index b7c8b710..0ac7ab62 100644 --- a/src/print-preview.c +++ b/src/print-preview.c @@ -21,8 +21,6 @@ #include -#if GTK_CHECK_VERSION(2,10,0) - #include "print-preview.h" @@ -346,7 +344,7 @@ vik_print_preview_realize (GtkWidget *widget) cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget), GDK_FLEUR); - gdk_window_set_cursor (widget->window, cursor); + gdk_window_set_cursor (gtk_widget_get_window(widget), cursor); gdk_cursor_unref (cursor); } @@ -367,7 +365,7 @@ vik_print_preview_event (GtkWidget *widget, switch (event->type) { case GDK_BUTTON_PRESS: - gdk_pointer_grab (widget->window, FALSE, + gdk_pointer_grab (gtk_widget_get_window(widget), FALSE, (GDK_BUTTON1_MOTION_MASK | GDK_BUTTON_RELEASE_MASK), NULL, NULL, event->button.time); @@ -456,18 +454,18 @@ vik_print_preview_expose_event (GtkWidget *widget, &top_margin, &bottom_margin); - cr = gdk_cairo_create (widget->window); + cr = gdk_cairo_create (gtk_widget_get_window(widget)); scale = vik_print_preview_get_scale (preview); /* draw background */ cairo_scale (cr, scale, scale); - gdk_cairo_set_source_color (cr, &widget->style->white); + gdk_cairo_set_source_color (cr, >k_widget_get_style(widget)->white); cairo_rectangle (cr, 0, 0, paper_width, paper_height); cairo_fill (cr); /* draw page_margins */ - gdk_cairo_set_source_color (cr, &widget->style->black); + gdk_cairo_set_source_color (cr, >k_widget_get_style(widget)->black); cairo_rectangle (cr, left_margin, top_margin, @@ -497,8 +495,10 @@ vik_print_preview_expose_event (GtkWidget *widget, if (preview->pixbuf == NULL) { - gint width = MIN (widget->allocation.width, 1024); - gint height = MIN (widget->allocation.height, 1024); + GtkAllocation allocation; + gtk_widget_get_allocation ( widget, &allocation ); + gint width = MIN (allocation.width, 1024); + gint height = MIN (allocation.height, 1024); preview->pixbuf = get_thumbnail(drawable, width, height); } @@ -588,5 +588,3 @@ print_preview_queue_draw (VikPrintPreview *preview) { gtk_widget_queue_draw (GTK_WIDGET (preview->area)); } - -#endif