[cairo-commit] rcairo/src rb_cairo_path.c,1.2,1.3

Kouhei Sutou commit at pdx.freedesktop.org
Wed May 2 19:17:41 PDT 2007


Committed by: kou

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

Modified Files:
	rb_cairo_path.c 
Log Message:
* src/rb_cairo_path.c (Cairo::PathData#each): added.


Index: rb_cairo_path.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_path.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rb_cairo_path.c	3 May 2007 02:03:06 -0000	1.2
+++ rb_cairo_path.c	3 May 2007 02:17:31 -0000	1.3
@@ -45,6 +45,13 @@
 }
 
 static VALUE
+cr_path_data_each (VALUE self)
+{
+  return rb_ary_each (rb_ivar_get (self, id_points));
+}
+
+
+static VALUE
 cr_path_data_to_a (VALUE self)
 {
   return rb_ary_new3 (2,
@@ -180,11 +187,15 @@
 
   rb_cCairo_PathData = rb_define_class_under (rb_mCairo, "PathData", rb_cObject);
 
+  rb_include_module (rb_cCairo_PathData, rb_mEnumerable);
+
   rb_define_attr (rb_cCairo_PathData, "type", CR_TRUE, CR_FALSE);
   rb_define_attr (rb_cCairo_PathData, "points", CR_TRUE, CR_FALSE);
   rb_define_method (rb_cCairo_PathData, "initialize",
                     cr_path_data_initialize, 2);
 
+  rb_define_method (rb_cCairo_PathData, "each", cr_path_data_each, 0);
+
   rb_define_method (rb_cCairo_PathData, "to_a", cr_path_data_to_a, 0);
   rb_define_alias (rb_cCairo_PathData, "to_ary", "to_a");
 



More information about the cairo-commit mailing list