[cairo-commit] rcairo/src rb_cairo_surface.c,1.39,1.40

Kouhei Sutou commit at pdx.freedesktop.org
Thu Aug 14 01:21:59 PDT 2008


Committed by: kou

Update of /cvs/cairo/rcairo/src
In directory kemper:/tmp/cvs-serv22951/src

Modified Files:
	rb_cairo_surface.c 
Log Message:
        * src/rb_cairo_surface.c: support Cairo::Surface#fallback_resolution.

        * test/test_surface.rb (SurfaceTest#test_fallback_resolution): add
        a test for Cairo::Surface#fallback_resolution.


Index: rb_cairo_surface.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_surface.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- rb_cairo_surface.c	11 Aug 2008 12:53:33 -0000	1.39
+++ rb_cairo_surface.c	14 Aug 2008 08:21:57 -0000	1.40
@@ -544,6 +544,23 @@
   return self;
 }
 
+#if CAIRO_CHECK_VERSION(1, 7, 2)
+static VALUE
+cr_surface_get_fallback_resolution (VALUE self)
+{
+  double x_pixels_per_inch, y_pixels_per_inch;
+
+  cairo_surface_get_fallback_resolution (_SELF,
+                                         &x_pixels_per_inch,
+                                         &y_pixels_per_inch);
+  cr_surface_check_status (_SELF);
+  return rb_ary_new3 (2,
+                      rb_float_new (x_pixels_per_inch),
+                      rb_float_new (y_pixels_per_inch));
+}
+#endif
+
+
 #if CAIRO_CHECK_VERSION(1, 5, 2)
 static VALUE
 cr_surface_copy_page (VALUE self)
@@ -1189,6 +1206,10 @@
                     cr_surface_get_device_offset, 0);
   rb_define_method (rb_cCairo_Surface, "set_fallback_resolution",
                     cr_surface_set_fallback_resolution, 2);
+#if CAIRO_CHECK_VERSION(1, 7, 2)
+  rb_define_method (rb_cCairo_Surface, "fallback_resolution",
+                    cr_surface_get_fallback_resolution, 0);
+#endif
 #if CAIRO_CHECK_VERSION(1, 5, 2)
   rb_define_method (rb_cCairo_Surface, "copy_page",
                     cr_surface_copy_page, 2);



More information about the cairo-commit mailing list