[eog] EogPrintPreview: Replace deprecated Gdk function calls



commit 16f37f2ee7d20e47a7fc88793a4afd0f1bde2c3e
Author: Felix Riemann <friemann gnome org>
Date:   Wed Feb 15 15:10:36 2012 +0100

    EogPrintPreview: Replace deprecated Gdk function calls

 src/eog-print-preview.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/src/eog-print-preview.c b/src/eog-print-preview.c
index f30befc..5d33625 100644
--- a/src/eog-print-preview.c
+++ b/src/eog-print-preview.c
@@ -578,7 +578,6 @@ draw_cb (GtkDrawingArea *drawing_area,
 			 cairo_status_to_string (cairo_status (cr)));
 	}
 
-	gdk_window_get_pointer (gtk_widget_get_window (widget), NULL, NULL, NULL);
 	return TRUE;
 }
 
@@ -1009,7 +1008,7 @@ eog_print_preview_draw (EogPrintPreview *preview, cairo_t *cr)
 	GtkWidget *area;
 	GtkAllocation allocation;
 	gint x0, y0;
-	GtkStyle *style;
+	GdkRGBA color;
 	gboolean has_focus;
 
 	priv = preview->priv;
@@ -1017,17 +1016,17 @@ eog_print_preview_draw (EogPrintPreview *preview, cairo_t *cr)
 
 	has_focus = gtk_widget_has_focus (area);
 
-	style = gtk_widget_get_style (area);
-
 	gtk_widget_get_allocation (area, &allocation);
 
 	/* draw the page */
- 	gdk_cairo_set_source_color (cr, &style->white);
+	gdk_rgba_parse (&color, "white");
+	gdk_cairo_set_source_rgba (cr, &color);
  	cairo_rectangle (cr, 0, 0, allocation.width, allocation.height);
  	cairo_fill (cr);
 
 	/* draw the page margins */
-	gdk_cairo_set_source_color (cr, &style->black);
+	gdk_rgba_parse (&color, "black");
+	gdk_cairo_set_source_rgba (cr, &color);
 	cairo_set_line_width (cr, 0.1);
 	cairo_rectangle (cr,
 			 priv->l_rmargin, priv->t_rmargin,
@@ -1069,9 +1068,11 @@ eog_print_preview_draw (EogPrintPreview *preview, cairo_t *cr)
 	}
 
 	if (has_focus) {
-		gtk_paint_focus (style, cr,
-				 GTK_STATE_NORMAL, NULL, NULL,
-				 0, 0, allocation.width, allocation.height);
+		GtkStyleContext *ctx;
+
+		ctx = gtk_widget_get_style_context (area);
+		gtk_render_focus (ctx, cr, 0, 0,
+				  allocation.width, allocation.height);
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]