[cairo-commit:00147] rcairo/rcairo [master] Define Cairo::MeshPattern#get_path

null+rcairo at clear-code.com null+rcairo at clear-code.com
Tue Mar 20 14:38:51 UTC 2012


Kouhei Sutou	2012-03-20 23:38:51 +0900 (Tue, 20 Mar 2012)

  New Revision: 4f5a82b6a35b2b2814209f0e7ea38a88f8ac920d

  Log:
    Define Cairo::MeshPattern#get_path

  Modified files:
    ext/cairo/rb_cairo_pattern.c

  Modified: ext/cairo/rb_cairo_pattern.c (+14 -0)
===================================================================
--- ext/cairo/rb_cairo_pattern.c    2012-03-20 23:33:47 +0900 (5fee574)
+++ ext/cairo/rb_cairo_pattern.c    2012-03-20 23:38:51 +0900 (849d558)
@@ -604,6 +604,18 @@ cr_mesh_pattern_get_patch_count (VALUE self)
   rb_cairo_check_status (status);
   return UINT2NUM (count);
 }
+
+static VALUE
+cr_mesh_pattern_get_path (VALUE self, VALUE nth_patch)
+{
+  cairo_pattern_t *pattern;
+  cairo_path_t *path;
+
+  pattern = _SELF (self);
+  path = cairo_mesh_pattern_get_path (pattern, NUM2UINT (nth_patch));
+  rb_cairo_check_status (path->status);
+  return CRPATH2RVAL (path);
+}
 #endif
 
 void
@@ -729,6 +741,8 @@ Init_cairo_pattern (void)
                    "set_corner_color_rgba", "set_corner_color");
   rb_define_method (rb_cCairo_MeshPattern, "patch_count",
                     cr_mesh_pattern_get_patch_count, 0);
+  rb_define_method (rb_cCairo_MeshPattern, "get_path",
+                    cr_mesh_pattern_get_path, 1);
 #endif
   RB_CAIRO_DEF_SETTERS (rb_cCairo_MeshPattern);
 }



More information about the cairo-commit mailing list