[cairo-commit] rcairo/packages/cairo/lib cairo.rb,1.4,1.5

Oeyvind Kolaas commit at pdx.freedesktop.org
Thu Feb 10 14:06:45 PST 2005


Committed by: pippin

Update of /cvs/cairo/rcairo/packages/cairo/lib
In directory gabe:/tmp/cvs-serv10864/packages/cairo/lib

Modified Files:
	cairo.rb 
Log Message:
added optional handler parameters to current_path functions

Index: cairo.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/lib/cairo.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- cairo.rb	10 Feb 2005 22:02:01 -0000	1.4
+++ cairo.rb	10 Feb 2005 22:06:37 -0000	1.5
@@ -43,16 +43,24 @@
     end
 
     private :current_path_array
-    def current_path
+    def current_path(handler=nil)
         array = current_path_array
-        array.each {|op| yield op } if block_given?
+        if handler.nil?
+            array.each {|event| yield event } if block_given?
+        else
+            array.each {|event| handler.send(*event) }
+        end
         array
     end
 
     private :current_path_flat_array
-    def current_path_flat
+    def current_path_flat(handler=nil)
         array = current_path_flat_array
-        array.each {|op| yield op } if block_given?
+        if handler.nil?
+            array.each {|event| yield event } if block_given?
+        else
+            array.each {|event| handler.send(*event) }
+        end
         array
     end
 




More information about the cairo-commit mailing list