[cairo-commit] rcairo/src/lib/cairo constants.rb,NONE,1.1
Kouhei Sutou
commit at pdx.freedesktop.org
Sat May 19 19:45:52 PDT 2007
- Previous message: [cairo-commit] rcairo/src cairo.def, 1.2, 1.3 rb_cairo.h, 1.4, 1.5 rb_cairo_constants.c, 1.3, 1.4 rb_cairo_font_face.c, 1.2, 1.3 rb_cairo_surface.c, 1.6, 1.7
- Next message: [cairo-commit] rcairo/src/lib/cairo/context circle.rb,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: kou
Update of /cvs/cairo/rcairo/src/lib/cairo
In directory kemper:/tmp/cvs-serv2361/src/lib/cairo
Added Files:
constants.rb
Log Message:
* src/rb_cairo.h, src/cairo.def, src/rb_cairo_constants.rb:
added a module for each enum type.
* src/lib/cairo/constants.rb: kept the backward compatibility.
--- NEW FILE: constants.rb ---
module Cairo
define_constants = Proc.new do |const_module, prefix, target|
target ||= self
const_module.constants.each do |const_name|
target.const_set([prefix, const_name].compact.join("_"),
const_module.const_get(const_name))
end
end
%w(operator antialias fill_rule line_cap line_join font_slant
font_weight subpixel_order hint_style hint_metrics font_type
content surface_type format pattern_type extend filter).each do |name|
module_name = name.split(/_/).collect {|component| component.capitalize}.join
define_constants.call(const_get(module_name), name.upcase)
end
define_constants.call(PathDataType, "PATH")
define_constants.call(PathDataType, nil, Path)
define_constants.call(SVGVersion, nil, SVGSurface)
define_constants.call(SVGVersion, "SVG")
end
- Previous message: [cairo-commit] rcairo/src cairo.def, 1.2, 1.3 rb_cairo.h, 1.4, 1.5 rb_cairo_constants.c, 1.3, 1.4 rb_cairo_font_face.c, 1.2, 1.3 rb_cairo_surface.c, 1.6, 1.7
- Next message: [cairo-commit] rcairo/src/lib/cairo/context circle.rb,1.1,1.2
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cairo-commit
mailing list