Patch GtkPrintSettings 2.16
- From: Emmanuel Rodriguez <emmanuel rodriguez gmail com>
- To: gtk-perl-list gnome org
- Subject: Patch GtkPrintSettings 2.16
- Date: Sat, 17 Jan 2009 18:42:22 +0100
Hi,
Here's the patch for GtkPrintSettings 2.16.
This was a trivial patch (at last!).
Emmanuel
Index: xs/GtkPrintSettings.xs
===================================================================
--- xs/GtkPrintSettings.xs (revision 2111)
+++ xs/GtkPrintSettings.xs (working copy)
@@ -120,3 +120,18 @@
gperl_croak_gerror (NULL, error);
#endif /* 2.14 */
+
+
+#if GTK_CHECK_VERSION (2, 15, 0)
+
+gdouble gtk_print_settings_get_printer_lpi (GtkPrintSettings *settings);
+
+gint gtk_print_settings_get_resolution_x (GtkPrintSettings *settings);
+
+gint gtk_print_settings_get_resolution_y (GtkPrintSettings *settings);
+
+void gtk_print_settings_set_printer_lpi (GtkPrintSettings *settings, gdouble lpi);
+
+void gtk_print_settings_set_resolution_xy (GtkPrintSettings *settings, gint resolution_x, gint resolution_y);
+
+#endif /* 2.16 */
Index: t/GtkPrintSettings.t
===================================================================
--- t/GtkPrintSettings.t (revision 2111)
+++ t/GtkPrintSettings.t (working copy)
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
use strict;
use Gtk2::TestHelper
- tests => 20,
+ tests => 26,
at_least_version => [2, 10, 0, 'GtkPrintSettings: it is new in 2.10'];
# $Id$
@@ -112,6 +112,23 @@
unlink $file;
}
+SKIP: {
+ skip 'new 2.16 stuff', 6
+ unless Gtk2->CHECK_VERSION(2, 15, 0);
+
+ my $settings = Gtk2::PrintSettings -> new();
+
+ is($settings -> get_printer_lpi(), 0);
+ $settings -> set_printer_lpi(3.1416);
+ is($settings -> get_printer_lpi(), 3.1416);
+
+ is($settings -> get_resolution_x(), 0);
+ is($settings -> get_resolution_y(), 0);
+ $settings -> set_resolution_xy(10, 20);
+ is($settings -> get_resolution_x(), 10);
+ is($settings -> get_resolution_y(), 20);
+}
+
__END__
Copyright (C) 2006 by the gtk2-perl team (see the file AUTHORS for the
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]