[cairo-commit] rcairo/src rb_cairo_path.c,1.5,1.6

Kouhei Sutou commit at pdx.freedesktop.org
Wed May 2 20:04:01 PDT 2007


Committed by: kou

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

Modified Files:
	rb_cairo_path.c 
Log Message:
* src/rb_cairo_path.c
  (Cairo::PathData#move_to?, Cairo::PathData#line_to?,
  Cairo::PathData#curve_to?, Cairo::PathData#close_path?): added.


Index: rb_cairo_path.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_path.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- rb_cairo_path.c	3 May 2007 02:47:39 -0000	1.5
+++ rb_cairo_path.c	3 May 2007 03:03:47 -0000	1.6
@@ -45,6 +45,34 @@
 }
 
 static VALUE
+cr_path_data_move_to_p (VALUE self)
+{
+  return CBOOL2RVAL (RVAL2CRPATHDATATYPE (rb_ivar_get (self, id_type)) ==
+                     CAIRO_PATH_MOVE_TO);
+}
+
+static VALUE
+cr_path_data_line_to_p (VALUE self)
+{
+  return CBOOL2RVAL (RVAL2CRPATHDATATYPE (rb_ivar_get (self, id_type)) ==
+                     CAIRO_PATH_LINE_TO);
+}
+
+static VALUE
+cr_path_data_curve_to_p (VALUE self)
+{
+  return CBOOL2RVAL (RVAL2CRPATHDATATYPE (rb_ivar_get (self, id_type)) ==
+                     CAIRO_PATH_CURVE_TO);
+}
+
+static VALUE
+cr_path_data_close_path_p (VALUE self)
+{
+  return CBOOL2RVAL (RVAL2CRPATHDATATYPE (rb_ivar_get (self, id_type)) ==
+                     CAIRO_PATH_CLOSE_PATH);
+}
+
+static VALUE
 cr_path_data_each (VALUE self)
 {
   return rb_ary_each (rb_ivar_get (self, id_points));
@@ -227,6 +255,13 @@
   rb_define_method (rb_cCairo_PathData, "initialize",
                     cr_path_data_initialize, 2);
 
+  rb_define_method (rb_cCairo_PathData, "move_to?", cr_path_data_move_to_p, 0);
+  rb_define_method (rb_cCairo_PathData, "line_to?", cr_path_data_line_to_p, 0);
+  rb_define_method (rb_cCairo_PathData, "curve_to?",
+                    cr_path_data_curve_to_p, 0);
+  rb_define_method (rb_cCairo_PathData, "close_path?",
+                    cr_path_data_close_path_p, 0);
+
   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);



More information about the cairo-commit mailing list