[cairo-commit] rcairo/src .cvsignore, 1.1, 1.2 cairo.c, 1.4,
1.5 extconf.rb, 1.1, 1.2 rbcairo.h, 1.3, 1.4
Evan Martin
commit at pdx.freedesktop.org
Fri May 28 12:45:08 PDT 2004
Committed by: martine
Update of /cvs/cairo/rcairo/src
In directory pdx:/tmp/cvs-serv30582/src
Modified Files:
.cvsignore cairo.c extconf.rb rbcairo.h
Log Message:
changes to allow me to use arch upstream
Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/rcairo/src/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/.cvsignore 28 Oct 2003 23:31:06 -0000 1.1
--- b/.cvsignore 28 May 2004 19:45:05 -0000 1.2
***************
*** 1,2 ****
--- 1,3 ----
Makefile
gen-*.c
+ .arch-ids
Index: cairo.c
===================================================================
RCS file: /cvs/cairo/rcairo/src/cairo.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** a/cairo.c 25 Nov 2003 04:35:42 -0000 1.4
--- b/cairo.c 28 May 2004 19:45:05 -0000 1.5
***************
*** 49,64 ****
return Qnil;
}
! static VALUE
! rcairo_set_target_ps(VALUE vself, VALUE vfile,
! VALUE vwidth_inches, VALUE vheight_inches,
! VALUE vx_pixels_per_inch, VALUE vy_pixels_per_inch) {
OpenFile *rf;
FILE *f;
rb_check_type(vfile, T_FILE);
GetOpenFile(vfile, rf);
f = GetWriteFile(rf);
! rb_iv_set(vself, "@target_file", vfile);
cairo_set_target_ps(rcairo_get_cairo(vself), f,
NUM2DBL(vwidth_inches), NUM2DBL(vheight_inches),
--- 49,73 ----
return Qnil;
}
! static FILE*
! set_output_file(VALUE vself, VALUE vfile) {
OpenFile *rf;
FILE *f;
rb_check_type(vfile, T_FILE);
+ rb_iv_set(vself, "@target_file", vfile);
+
GetOpenFile(vfile, rf);
f = GetWriteFile(rf);
! return f;
! }
! static VALUE
! rcairo_set_target_ps(VALUE vself, VALUE vfile,
! VALUE vwidth_inches, VALUE vheight_inches,
! VALUE vx_pixels_per_inch, VALUE vy_pixels_per_inch) {
! FILE *f;
!
! f = set_output_file(vself, vfile);
!
cairo_set_target_ps(rcairo_get_cairo(vself), f,
NUM2DBL(vwidth_inches), NUM2DBL(vheight_inches),
***************
*** 66,69 ****
--- 75,89 ----
return Qnil;
}
+ static VALUE
+ rcairo_set_target_png(VALUE vself, VALUE vfile, VALUE vformat,
+ VALUE vwidth, VALUE vheight) {
+ FILE *f;
+
+ f = set_output_file(vself, vfile);
+
+ cairo_set_target_png(rcairo_get_cairo(vself), f, NUM2INT(vformat),
+ NUM2DBL(vwidth), NUM2DBL(vheight));
+ return Qnil;
+ }
static VALUE
***************
*** 120,124 ****
static VALUE
rcairo_stroke(VALUE vself) {
! return rcairo_run_path_func(vself, cairo_stroke);
}
--- 140,150 ----
static VALUE
rcairo_stroke(VALUE vself) {
! cairo_t *cr = rcairo_get_cairo(vself);
! if (rb_block_given_p()) {
! cairo_new_path(cr);
! rb_yield(Qnil);
! }
! cairo_stroke(cr);
! return Qnil;
}
***************
*** 179,182 ****
--- 205,209 ----
rb_define_method(cCairo, "target_image=", rcairo_set_target_image, 1);
rb_define_method(cCairo, "set_target_ps", rcairo_set_target_ps, 5);
+ rb_define_method(cCairo, "set_target_png", rcairo_set_target_png, 4);
rb_define_method(cCairo, "set_dash", rcairo_set_dash, 2);
rb_define_method(cCairo, "transform_point", rcairo_transform_point, 1);
Index: extconf.rb
===================================================================
RCS file: /cvs/cairo/rcairo/src/extconf.rb,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** a/extconf.rb 28 Oct 2003 18:27:22 -0000 1.1
--- b/extconf.rb 28 May 2004 19:45:05 -0000 1.2
***************
*** 4,6 ****
--- 4,10 ----
$CFLAGS << " -g -Wall `pkg-config --cflags cairo`"
$LDFLAGS << " `pkg-config --libs cairo`"
+
+ # remove autogenerated files
+ $distcleanfiles << 'gen-*.c'
+
create_makefile("cairo")
Index: rbcairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/src/rbcairo.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** a/rbcairo.h 19 Apr 2004 21:35:57 -0000 1.3
--- b/rbcairo.h 28 May 2004 19:45:05 -0000 1.4
***************
*** 15,18 ****
--- 15,19 ----
extern VALUE cDisplay, eXlib;
+ /* A buffer for cairo to render images into. */
typedef struct {
char *data;
***************
*** 25,41 ****
VALUE gen_CairoSurface(void);
! VALUE rcairo_display_new();
Display* rcairo_display_get_display(VALUE rdpy);
! VALUE rcairo_new_from(cairo_t *cr);
! VALUE rcairo_new();
cairo_t* rcairo_get_cairo(VALUE rcairo);
! void rcairo_image_init(void);
RCairoImage* rcairo_image_get_image(VALUE vimage);
! VALUE rmatrix_new();
cairo_matrix_t* rmatrix_get_matrix(VALUE vmatrix);
! VALUE rsurface_new_from();
cairo_surface_t* rsurface_get_surface(VALUE rcairo);
--- 26,43 ----
VALUE gen_CairoSurface(void);
! VALUE rcairo_display_new();
Display* rcairo_display_get_display(VALUE rdpy);
! VALUE rcairo_new_from(cairo_t *cr);
! VALUE rcairo_new();
cairo_t* rcairo_get_cairo(VALUE rcairo);
! void rcairo_image_init(void);
RCairoImage* rcairo_image_get_image(VALUE vimage);
! VALUE rmatrix_new();
cairo_matrix_t* rmatrix_get_matrix(VALUE vmatrix);
! VALUE rsurface_new_from();
cairo_surface_t* rsurface_get_surface(VALUE rcairo);
+
More information about the cairo-commit
mailing list