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

Kouhei Sutou commit at pdx.freedesktop.org
Mon May 21 04:02:56 PDT 2007


Committed by: kou

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

Modified Files:
	rb_cairo_matrix.c 
Log Message:
* src/rb_cairo_matrix.c: added accessors.


Index: rb_cairo_matrix.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/rb_cairo_matrix.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- rb_cairo_matrix.c	3 May 2007 02:47:39 -0000	1.2
+++ rb_cairo_matrix.c	21 May 2007 11:02:45 -0000	1.3
@@ -55,7 +55,7 @@
     {
       return Qnil;
     }
-}  
+}
 
 static VALUE
 cr_matrix_allocate (VALUE klass)
@@ -174,6 +174,85 @@
 }
 
 
+/* Accessors */
+static VALUE
+cr_matrix_get_xx (VALUE self)
+{
+  return rb_float_new (_SELF->xx);
+}
+
+static VALUE
+cr_matrix_set_xx (VALUE self, VALUE xx)
+{
+  _SELF->xx = NUM2DBL (xx);
+  return Qnil;
+}
+
+static VALUE
+cr_matrix_get_yx (VALUE self)
+{
+  return rb_float_new (_SELF->yx);
+}
+
+static VALUE
+cr_matrix_set_yx (VALUE self, VALUE yx)
+{
+  _SELF->yx = NUM2DBL (yx);
+  return Qnil;
+}
+
+static VALUE
+cr_matrix_get_xy (VALUE self)
+{
+  return rb_float_new (_SELF->xy);
+}
+
+static VALUE
+cr_matrix_set_xy (VALUE self, VALUE xy)
+{
+  _SELF->xy = NUM2DBL (xy);
+  return Qnil;
+}
+
+static VALUE
+cr_matrix_get_yy (VALUE self)
+{
+  return rb_float_new (_SELF->yy);
+}
+
+static VALUE
+cr_matrix_set_yy (VALUE self, VALUE yy)
+{
+  _SELF->yy = NUM2DBL (yy);
+  return Qnil;
+}
+
+static VALUE
+cr_matrix_get_x0 (VALUE self)
+{
+  return rb_float_new (_SELF->x0);
+}
+
+static VALUE
+cr_matrix_set_x0 (VALUE self, VALUE x0)
+{
+  _SELF->x0 = NUM2DBL (x0);
+  return Qnil;
+}
+
+static VALUE
+cr_matrix_get_y0 (VALUE self)
+{
+  return rb_float_new (_SELF->y0);
+}
+
+static VALUE
+cr_matrix_set_y0 (VALUE self, VALUE y0)
+{
+  _SELF->y0 = NUM2DBL (y0);
+  return Qnil;
+}
+
 /* Utilities */
 static VALUE
 cr_matrix_set (VALUE self,
@@ -247,6 +326,20 @@
   rb_define_method (rb_cCairo_Matrix, "transform_point",
                     cr_matrix_transform_point, 2);
 
+  /* Accessors */
+  rb_define_method (rb_cCairo_Matrix, "xx", cr_matrix_get_xx, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_xx", cr_matrix_set_xx, 1);
+  rb_define_method (rb_cCairo_Matrix, "yx", cr_matrix_get_yx, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_yx", cr_matrix_set_yx, 1);
+  rb_define_method (rb_cCairo_Matrix, "xy", cr_matrix_get_xy, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_xy", cr_matrix_set_xy, 1);
+  rb_define_method (rb_cCairo_Matrix, "yy", cr_matrix_get_yy, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_yy", cr_matrix_set_yy, 1);
+  rb_define_method (rb_cCairo_Matrix, "x0", cr_matrix_get_x0, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_x0", cr_matrix_set_x0, 1);
+  rb_define_method (rb_cCairo_Matrix, "y0", cr_matrix_get_y0, 0);
+  rb_define_method (rb_cCairo_Matrix, "set_y0", cr_matrix_set_y0, 1);
+
   /* Utilities */
   rb_define_method (rb_cCairo_Matrix, "set", cr_matrix_set, 6);
   rb_define_method (rb_cCairo_Matrix, "to_a", cr_matrix_to_a, 0);



More information about the cairo-commit mailing list