src/output/cairo.c (xr_chart_renderer): Set the chart size to 0.8 of the smallest...
[pspp] / src / ui / gui / pspp-widget-facade.c
index cae55ab12a9494e6f37f7ee8ccdd9a6cfe8c6076..a95040bdf77f8b31397bb42e3dcb8467fb0e8ea8 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2011, 2012, 2014 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
@@ -23,6 +23,8 @@
 #include <stdlib.h>
 #include <string.h>
 
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+
 static void
 inset_rectangle (const GdkRectangle *src,
                  const GtkBorder *inset,
@@ -270,9 +272,7 @@ get_layout_location (GtkWidget *base,
   PangoRectangle logical;
   GtkRequisition req;
 
-  if (gtk_widget_get_direction (base) == GTK_TEXT_DIR_LTR)
-    xalign = xalign;
-  else
+  if (gtk_widget_get_direction (base) == GTK_TEXT_DIR_RTL)
     xalign = 1.0 - xalign;
 
   pango_layout_get_pixel_extents (layout, NULL, &logical);
@@ -313,10 +313,8 @@ get_layout_location (GtkWidget *base,
 
 void
 facade_button_render (GtkWidget *base,
-                      GdkWindow   *window,
-                      GdkRectangle *expose_area,
-
-                      GdkRectangle *button_area,
+                      cairo_t *cr,
+                      const GdkRectangle *button_area,
                       gint border_width,
                       GtkStyle *button_style,
                       GtkStateType state_type,
@@ -334,9 +332,9 @@ facade_button_render (GtkWidget *base,
   gint x, y;
 
   /* Paint the button. */
-  gtk_paint_box (button_style, window,
+  gtk_paint_box (button_style, cr,
                  state_type,
-                 GTK_SHADOW_OUT, expose_area, base, "button",
+                 GTK_SHADOW_OUT, base, "button",
                  button_area->x + border_width,
                  button_area->y + border_width,
                  button_area->width - border_width * 2,
@@ -350,8 +348,10 @@ facade_button_render (GtkWidget *base,
   layout = facade_label_get_layout (base, label);
   get_layout_location (base, &label_area, layout, xpad, ypad, xalign, yalign,
                        &x, &y);
-  gtk_paint_layout (label_style, window, state_type, FALSE, expose_area,
+
+  gtk_paint_layout (label_style, cr, state_type, FALSE,
                     base, "label", x, y, layout);
+
   g_object_unref (layout);
 }