[cairo-commit] rcairo/packages/cairo/ext MANIFEST, NONE, 1.1 cairo.c, 1.6, 1.7 extconf.rb, 1.2, 1.3

OEyvind Kolaas commit at pdx.freedesktop.org
Wed Sep 1 08:29:27 PDT 2004


Committed by: pippin

Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv31156/packages/cairo/ext

Modified Files:
	cairo.c extconf.rb 
Added Files:
	MANIFEST 
Log Message:
changed to use setup.rb from Minero Aoki, also directory reorganization


--- NEW FILE: MANIFEST ---

Index: cairo.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/cairo.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** cairo.c	23 Aug 2004 08:23:32 -0000	1.6
--- cairo.c	1 Sep 2004 15:29:25 -0000	1.7
***************
*** 189,193 ****
  }
  
- 
  VALUE
  rcairo_in_stroke(VALUE self, VALUE x, VALUE y) {
--- 189,192 ----
***************
*** 196,199 ****
--- 195,218 ----
  }
  
+ VALUE
+ rcairo_text_extents(VALUE self, VALUE utf8) {
+ 	VALUE hash;
+ 	cairo_t *cr;
+ 	cairo_text_extents_t extents;
+ 
+ 	cr = rcairo_get_cairo(self);
+ 	cairo_text_extents (cr, STR2CSTR(utf8), &extents);
+ 	hash = rb_hash_new ();
+ 
+ 	rb_hash_aset (hash, rb_str_new2("width"),  rb_float_new(extents.width));
+ 	rb_hash_aset (hash, rb_str_new2("height"), rb_float_new(extents.height));
+ 	rb_hash_aset (hash, rb_str_new2("x_bearing"), rb_float_new(extents.x_bearing));
+ 	rb_hash_aset (hash, rb_str_new2("y_bearing"), rb_float_new(extents.y_bearing));
+ 	rb_hash_aset (hash, rb_str_new2("x_advance"), rb_float_new(extents.x_advance));
+ 	rb_hash_aset (hash, rb_str_new2("y_advance"), rb_float_new(extents.y_advance));
+ 
+ 	return hash;
+ }
+ 
  /*static VALUE
  rcairo_surface_new_for_image(VALUE class, VALUE image) {
***************
*** 233,236 ****
--- 252,257 ----
  	rb_define_method(cCairo, "in_fill?", rcairo_in_fill, 2);
  
+ 	rb_define_method(cCairo, "text_extents", rcairo_text_extents, 1);
+ 
  	cCairoMatrix = gen_CairoMatrix();
  

Index: extconf.rb
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/extconf.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** extconf.rb	28 May 2004 19:45:05 -0000	1.2
--- extconf.rb	1 Sep 2004 15:29:25 -0000	1.3
***************
*** 5,10 ****
  $LDFLAGS << " `pkg-config --libs cairo`"
  
! # remove autogenerated files
! $distcleanfiles << 'gen-*.c'
  
  create_makefile("cairo")
--- 5,10 ----
  $LDFLAGS << " `pkg-config --libs cairo`"
  
! ## remove autogenerated files
! #$distcleanfiles << 'gen-*.c'
  
  create_makefile("cairo")




More information about the cairo-commit mailing list