[cairo-commit] rcairo/packages/cairo/lib cairo.rb,1.5,1.6
Oeyvind Kolaas
commit at pdx.freedesktop.org
Mon Feb 14 15:51:56 PST 2005
Committed by: pippin
Update of /cvs/cairo/rcairo/packages/cairo/lib
In directory gabe:/tmp/cvs-serv13901/packages/cairo/lib
Modified Files:
cairo.rb
Log Message:
adding pattern class
Index: cairo.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/lib/cairo.rb,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cairo.rb 10 Feb 2005 22:06:37 -0000 1.5
+++ cairo.rb 14 Feb 2005 23:51:54 -0000 1.6
@@ -102,6 +102,8 @@
alias miter_limit current_miter_limit
alias matrix= set_matrix
alias matrix current_matrix
+ alias pattern current_pattern
+ alias pattern= set_pattern
alias set_transform set_matrix
alias current_transform current_matrix
alias transform= set_transform
@@ -148,4 +150,43 @@
def *(other) ; Matrix.new.set_product(self, other) ; end
end
+class Pattern
+
+ alias matrix get_matrix
+ alias matrix= set_matrix
+ alias extend get_extend
+ alias extend= set_extend
+ alias filter get_filter
+ alias filter= set_filter
+
+ class << Pattern # singleton overrides
+ alias :create_linear_internal :create_linear
+ private :create_linear_internal
+
+ def create_linear(x0,y0,x1,y1)
+ if block_given?
+ pat = create_linear_internal(x0,y0,x1,y1)
+ yield pat
+ return pat
+ end
+ create_linear_internal(x0,y0,x1,y1)
+ end
+
+ alias :create_radial_internal :create_radial
+ private :create_radial_internal
+
+ def create_radial(cx0,cy0,r0,cx1,cy1,r1)
+ if block_given?
+ pat = create_radial_internal(cx0,cy0,r0,cx1,cy1,r1)
+ yield pat
+ return pat
+ end
+ create_radial_internal(cx0,cy0,r0,cx1,cy1,r1)
+ end
+
+ end
+
+
+
+end
end
More information about the cairo-commit
mailing list