[cairo-commit] rcairo/src/lib/cairo color.rb,1.6,1.7
Kouhei Sutou
commit at pdx.freedesktop.org
Tue May 1 04:49:52 PDT 2007
Committed by: kou
Update of /cvs/cairo/rcairo/src/lib/cairo
In directory kemper:/tmp/cvs-serv29202/src/lib/cairo
Modified Files:
color.rb
Log Message:
* src/rb_cairo_private.[ch] (rb_cairo__const_get,
Init_cairo_private): added.
* src/rb_cairo.c: moved Init_* declarations to rb_cairo_private.h.
* src/rb_cairo_constants.c: supported abbrev notation for constant
name. We can write just like
context.antialias = :none
instead of
context.antialias = Cairo::ANTIALIAS_NONE
* src/lib/cairo.rb (Cairo.normalize_const_name): added.
* src/lib/cairo/color.rb: used Cairo.normalize_const_name.
Index: color.rb
===================================================================
RCS file: /cvs/cairo/rcairo/src/lib/cairo/color.rb,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- color.rb 18 Apr 2007 11:57:43 -0000 1.6
+++ color.rb 1 May 2007 11:49:43 -0000 1.7
@@ -17,7 +17,7 @@
when /\A#/ #
parse_hex_color(value)
when String, Symbol
- name = value.to_s.gsub(/[\s\-]+/, '_').upcase
+ name = Cairo.normalize_const_name(value)
begin
const_get(name).dup
rescue NameError
More information about the cairo-commit
mailing list