[cairo-commit] rcairo/packages/cairo/ext rb_cairo_pattern.c, 1.16, 1.17

Kouhei Sutou commit at pdx.freedesktop.org
Tue Dec 19 06:28:52 PST 2006


Committed by: kou

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory kemper:/tmp/cvs-serv20673/packages/cairo/ext

Modified Files:
	rb_cairo_pattern.c 
Log Message:
* packages/cairo/ext/rb_cairo_pattern.c:
  - moved Cairo::SurfacePattern#{extend,filter}{,=} to
    Cairo::Pattern. I can't remember why I defined them in
    Cairo::SurfacePattern...
  - defined Cairo::Pattern#__extend__ as alias of Object#extend to
    avoid discarding.


Index: rb_cairo_pattern.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rb_cairo_pattern.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- rb_cairo_pattern.c	15 Oct 2006 07:12:33 -0000	1.16
+++ rb_cairo_pattern.c	19 Dec 2006 14:28:48 -0000	1.17
@@ -279,9 +279,8 @@
   return CRMATRIX2RVAL (&matrix);
 }
 
-/* Cairo::SurfacePattern */
 static VALUE
-cr_surface_pattern_set_extend (VALUE self, VALUE extend)
+cr_pattern_set_extend (VALUE self, VALUE extend)
 {
   cairo_pattern_set_extend (_SELF (self), RVAL2CREXTEND (extend));
   cr_pattern_check_status (_SELF (self));
@@ -289,13 +288,13 @@
 }
 
 static VALUE
-cr_surface_pattern_get_extend (VALUE self)
+cr_pattern_get_extend (VALUE self)
 {
   return INT2NUM (cairo_pattern_get_extend (_SELF (self)));
 }
 
 static VALUE
-cr_surface_pattern_set_filter (VALUE self, VALUE filter)
+cr_pattern_set_filter (VALUE self, VALUE filter)
 {
   cairo_pattern_set_filter (_SELF (self), RVAL2CRFILTER (filter));
   cr_pattern_check_status (_SELF (self));
@@ -303,11 +302,14 @@
 }
 
 static VALUE
-cr_surface_pattern_get_filter (VALUE self)
+cr_pattern_get_filter (VALUE self)
 {
   return INT2NUM (cairo_pattern_get_filter (_SELF (self)));
 }
 
+/* Cairo::SurfacePattern */
+/* none */
+
 void
 Init_cairo_pattern (void)
 {
@@ -321,6 +323,11 @@
 
   rb_define_method (rb_cCairo_Pattern, "set_matrix", cr_pattern_set_matrix, 1);
   rb_define_method (rb_cCairo_Pattern, "matrix", cr_pattern_get_matrix, 0);
+  rb_define_method (rb_cCairo_Pattern, "set_extend", cr_pattern_set_extend, 1);
+  rb_alias (rb_cCairo_Pattern, rb_intern ("__extend__"), rb_intern ("extend"));
+  rb_define_method (rb_cCairo_Pattern, "extend", cr_pattern_get_extend, 0);
+  rb_define_method (rb_cCairo_Pattern, "set_filter", cr_pattern_set_filter, 1);
+  rb_define_method (rb_cCairo_Pattern, "filter", cr_pattern_get_filter, 0);
 
   RB_CAIRO_DEF_SETTERS (rb_cCairo_Pattern);
 
@@ -338,15 +345,6 @@
   rb_define_method (rb_cCairo_SurfacePattern, "initialize",
                     cr_surface_pattern_initialize, 1);
 
-  rb_define_method (rb_cCairo_SurfacePattern, "set_extend",
-                    cr_surface_pattern_set_extend, 1);
-  rb_define_method (rb_cCairo_SurfacePattern, "extend",
-                    cr_surface_pattern_get_extend, 0);
-  rb_define_method (rb_cCairo_SurfacePattern, "set_filter",
-                    cr_surface_pattern_set_filter, 1);
-  rb_define_method (rb_cCairo_SurfacePattern, "filter",
-                    cr_surface_pattern_get_filter, 0);
-
   RB_CAIRO_DEF_SETTERS (rb_cCairo_SurfacePattern);
 
   rb_cCairo_GradientPattern =



More information about the cairo-commit mailing list