[cairo-commit] rcairo/samples pac.rb, 1.4, 1.5 pac2.rb, 1.4,
1.5 png.rb, 1.10, 1.11 scalable.rb, 1.1, 1.2 text-on-path.rb,
1.1, 1.2 text2.rb, 1.4, 1.5
Kouhei Sutou
commit at pdx.freedesktop.org
Sun Feb 4 01:53:05 PST 2007
Committed by: kou
Update of /cvs/cairo/rcairo/samples
In directory kemper:/tmp/cvs-serv24821/samples
Modified Files:
pac.rb pac2.rb png.rb scalable.rb text-on-path.rb text2.rb
Log Message:
* packages/cairo/ext/rb_cairo_surface.c: the first argument of
Cairo::ImageSurface#initialize, cairo_format_t, is optional.
* samples/*.rb: followed the change.
Index: pac.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/pac.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pac.rb 1 May 2006 07:44:42 -0000 1.4
+++ pac.rb 4 Feb 2007 09:53:00 -0000 1.5
@@ -4,8 +4,10 @@
Original: pac.rb in http://www.artima.com/rubycs/articles/pdf_writer3.html
=end
-$LOAD_PATH.unshift "../packages/cairo/ext/"
-$LOAD_PATH.unshift "../packages/cairo/lib/"
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require "cairo"
@@ -84,7 +86,7 @@
cr.show_page
end
-surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, WIDTH, HEIGHT)
+surface = Cairo::ImageSurface.new(WIDTH, HEIGHT)
cr = pac(surface)
cr.target.write_to_png("pac.png")
Index: pac2.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/pac2.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- pac2.rb 1 May 2006 07:44:42 -0000 1.4
+++ pac2.rb 4 Feb 2007 09:53:00 -0000 1.5
@@ -4,8 +4,10 @@
Original: pac.rb in http://www.artima.com/rubycs/articles/pdf_writer3.html
=end
-$LOAD_PATH.unshift "../packages/cairo/ext/"
-$LOAD_PATH.unshift "../packages/cairo/lib/"
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require "cairo"
@@ -155,7 +157,7 @@
width = 841.889763779528
height = 595.275590551181
-surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, width, height)
+surface = Cairo::ImageSurface.new(width, height)
cr = pac(surface, width, height)
cr.target.write_to_png("pac2.png")
Index: png.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/png.rb,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- png.rb 25 Jun 2006 14:29:24 -0000 1.10
+++ png.rb 4 Feb 2007 09:53:00 -0000 1.11
@@ -1,15 +1,16 @@
#!/usr/bin/env ruby
-$LOAD_PATH.unshift "../packages/cairo/ext/"
-$LOAD_PATH.unshift "../packages/cairo/lib/"
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require 'cairo'
-format = Cairo::FORMAT_ARGB32
width = 200
height = 200
-surface = Cairo::ImageSurface.new(format, width, height)
+surface = Cairo::ImageSurface.new(width, height)
cr = Cairo::Context.new(surface)
# fill background with white
Index: scalable.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/scalable.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- scalable.rb 1 May 2006 07:52:43 -0000 1.1
+++ scalable.rb 4 Feb 2007 09:53:00 -0000 1.2
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
-$LOAD_PATH.unshift "../packages/cairo/ext/"
-$LOAD_PATH.unshift "../packages/cairo/lib/"
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require 'cairo'
require 'stringio'
Index: text-on-path.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/text-on-path.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- text-on-path.rb 15 Dec 2006 08:45:19 -0000 1.1
+++ text-on-path.rb 4 Feb 2007 09:53:00 -0000 1.2
@@ -1,8 +1,9 @@
#!/usr/bin/env ruby
-base = File.expand_path(File.join(File.dirname(__FILE__), ".."))
-$LOAD_PATH.unshift File.join(base, "packages", "cairo", "ext")
-$LOAD_PATH.unshift File.join(base, "packages", "cairo", "lib")
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require 'cairo'
require 'pango'
@@ -52,7 +53,7 @@
end
def output
- surface = Cairo::ImageSurface.new(Cairo::FORMAT_ARGB32, 500, 500)
+ surface = Cairo::ImageSurface.new(500, 500)
render(surface)
surface.write_to_png("text-on-path.png")
end
Index: text2.rb
===================================================================
RCS file: /cvs/cairo/rcairo/samples/text2.rb,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- text2.rb 8 Jan 2007 10:29:13 -0000 1.4
+++ text2.rb 4 Feb 2007 09:53:00 -0000 1.5
@@ -1,7 +1,9 @@
#!/usr/bin/env ruby
-$LOAD_PATH.unshift "../packages/cairo/ext/"
-$LOAD_PATH.unshift "../packages/cairo/lib/"
+top = File.expand_path(File.join(File.dirname(__FILE__), ".."))
+base = File.join(top, "packages", "cairo")
+$LOAD_PATH.unshift File.join(base, "ext")
+$LOAD_PATH.unshift File.join(base, "lib")
require 'optparse'
require 'ostruct'
More information about the cairo-commit
mailing list