[cairo-commit] rcairo/packages/cairo/ext cairo.c, 1.7,
1.8 gen-Cairo.c, 1.1, 1.2 gen-CairoMatrix.c, 1.1,
1.2 gen-CairoSurface.c, 1.1, 1.2 gen-constants.c, 1.1,
1.2 image.c, 1.3, 1.4 rbcairo.h, 1.4, 1.5 xlib.c, 1.3, 1.4
Oeyvind Kolaas
commit at pdx.freedesktop.org
Mon Nov 22 14:09:33 PST 2004
Committed by: pippin
Update of /cvs/cairo/rcairo/packages/cairo/ext
In directory gabe:/tmp/cvs-serv20068/packages/cairo/ext
Modified Files:
cairo.c gen-Cairo.c gen-CairoMatrix.c gen-CairoSurface.c
gen-constants.c image.c rbcairo.h xlib.c
Log Message:
code restructuring
Index: cairo.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/cairo.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- cairo.c 1 Sep 2004 15:29:25 -0000 1.7
+++ cairo.c 22 Nov 2004 22:09:30 -0000 1.8
@@ -1,7 +1,6 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
- *
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*/
#include "rbcairo.h"
@@ -10,257 +9,366 @@
VALUE mCairo, cCairo, cCairoSurface, cCairoMatrix;
cairo_t*
-rcairo_get_cairo(VALUE vcairo) {
- cairo_t *cr;
- Data_Get_Struct(vcairo, cairo_t, cr);
- return cr;
+rcairo_get_cairo (VALUE vcairo)
+{
+ cairo_t *cr;
+ Data_Get_Struct(vcairo, cairo_t, cr);
+ return cr;
}
+
VALUE
-rcairo_new_from(cairo_t *cr) {
- cairo_reference(cr);
- return Data_Wrap_Struct(cCairo, NULL, cairo_destroy, cr);
+rcairo_new_from (cairo_t *cr)
+{
+ cairo_reference(cr);
+ return Data_Wrap_Struct(cCairo, NULL, cairo_destroy, cr);
}
+
VALUE
-rcairo_new() {
- cairo_t *cr = cairo_create();
- return rcairo_new_from(cr);
+rcairo_new (void)
+{
+ cairo_t *cr = cairo_create();
+ return rcairo_new_from(cr);
}
+
static VALUE
-rcairo_rcairo_new(VALUE class) {
- return rcairo_new();
+rcairo_rcairo_new (VALUE class)
+{
+ return rcairo_new();
}
static VALUE
-rcairo_dup(VALUE vself) {
- VALUE vdest = rcairo_new();
- cairo_copy(rcairo_get_cairo(vdest), rcairo_get_cairo(vself));
- rb_iv_set(vdest, "@target_image", rb_iv_get(vself, "@target_image"));
- return vdest;
+rcairo_dup (VALUE vself)
+{
+ VALUE vdest = rcairo_new();
+ cairo_copy(rcairo_get_cairo(vdest), rcairo_get_cairo(vself));
+ rb_iv_set(vdest, "@target_image", rb_iv_get(vself, "@target_image"));
+ return vdest;
}
static VALUE
-rcairo_set_target_image(VALUE vself, VALUE vimage) {
- RCairoImage *img;
+rcairo_set_target_image (VALUE vself,
+ VALUE vimage)
+{
+ RCairoImage *img;
- img = rcairo_image_get_image(vimage);
- rb_iv_set(vself, "@target_image", vimage);
- cairo_set_target_image(rcairo_get_cairo(vself), img->data, img->format,
- img->width, img->height, img->stride);
- return Qnil;
+ img = rcairo_image_get_image(vimage);
+ rb_iv_set(vself, "@target_image", vimage);
+ cairo_set_target_image (rcairo_get_cairo(vself),
+ img->data, img->format,
+ img->width, img->height, img->stride);
+ return Qnil;
}
+
static FILE*
-set_output_file(VALUE vself, VALUE vfile) {
- OpenFile *rf;
- FILE *f;
+set_output_file (VALUE vself,
+ VALUE vfile)
+{
+ OpenFile *rf;
+ FILE *f;
- rb_check_type(vfile, T_FILE);
- rb_iv_set(vself, "@target_file", vfile);
+ rb_check_type(vfile, T_FILE);
+ rb_iv_set(vself, "@target_file", vfile);
- GetOpenFile(vfile, rf);
- f = GetWriteFile(rf);
+ GetOpenFile(vfile, rf);
+ f = GetWriteFile(rf);
- return f;
+ 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;
+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);
+ f = set_output_file(vself, vfile);
- cairo_set_target_ps(rcairo_get_cairo(vself), f,
- NUM2DBL(vwidth_inches), NUM2DBL(vheight_inches),
- NUM2DBL(vx_pixels_per_inch), NUM2DBL(vy_pixels_per_inch));
- return Qnil;
+ cairo_set_target_ps (rcairo_get_cairo(vself),
+ f,
+ NUM2DBL(vwidth_inches),
+ NUM2DBL(vheight_inches),
+ NUM2DBL(vx_pixels_per_inch),
+ NUM2DBL(vy_pixels_per_inch));
+ return Qnil;
}
+
static VALUE
-rcairo_set_target_png(VALUE vself, VALUE vfile, VALUE vformat,
- VALUE vwidth, VALUE vheight) {
- FILE *f;
+rcairo_set_target_png (VALUE vself,
+ VALUE vfile,
+ VALUE vformat,
+ VALUE vwidth,
+ VALUE vheight)
+{
+ FILE *f;
- f = set_output_file(vself, vfile);
+ f = set_output_file(vself, vfile);
- cairo_set_target_png(rcairo_get_cairo(vself), f, NUM2INT(vformat),
- NUM2DBL(vwidth), NUM2DBL(vheight));
- return Qnil;
+ cairo_set_target_png (rcairo_get_cairo(vself),
+ f,
+ NUM2INT(vformat),
+ NUM2DBL(vwidth),
+ NUM2DBL(vheight));
+ return Qnil;
}
static VALUE
-rcairo_set_dash(VALUE vself, VALUE vdashes, VALUE offset) {
- rb_notimplement();
- return Qnil;
+rcairo_set_dash (VALUE vself,
+ VALUE vdashes,
+ VALUE offset)
+{
+ rb_notimplement();
+ return Qnil;
}
static VALUE
-rcairo_run_pt_func(VALUE vself, VALUE pt, void (*f)(cairo_t*,double*,double*)) {
- double x = NUM2DBL(rb_ary_entry(pt, 0));
- double y = NUM2DBL(rb_ary_entry(pt, 1));
- f(rcairo_get_cairo(vself), &x, &y);
- return rb_ary_new3(2, rb_float_new(x), rb_float_new(y));
+rcairo_run_pt_func (VALUE vself,
+ VALUE pt,
+ void (*f)(cairo_t*,double*,double*))
+{
+ double x = NUM2DBL(rb_ary_entry(pt, 0));
+ double y = NUM2DBL(rb_ary_entry(pt, 1));
+
+ f(rcairo_get_cairo(vself), &x, &y);
+
+ return rb_ary_new3(2, rb_float_new(x), rb_float_new(y));
}
+
static VALUE
-rcairo_transform_point(VALUE vself, VALUE pt) {
- return rcairo_run_pt_func(vself, pt, cairo_transform_point);
+rcairo_transform_point (VALUE vself,
+ VALUE pt)
+{
+ return rcairo_run_pt_func (vself,
+ pt,
+ cairo_transform_point);
}
+
static VALUE
-rcairo_transform_distance(VALUE vself, VALUE pt) {
- return rcairo_run_pt_func(vself, pt, cairo_transform_distance);
+rcairo_transform_distance (VALUE vself,
+ VALUE pt)
+{
+ return rcairo_run_pt_func (vself,
+ pt, cairo_transform_distance);
}
+
static VALUE
-rcairo_inverse_transform_point(VALUE vself, VALUE pt) {
- return rcairo_run_pt_func(vself, pt, cairo_inverse_transform_point);
+rcairo_inverse_transform_point (VALUE vself,
+ VALUE pt)
+{
+ return rcairo_run_pt_func (vself,
+ pt,
+ cairo_inverse_transform_point);
}
+
static VALUE
-rcairo_inverse_transform_distance(VALUE vself, VALUE pt) {
- return rcairo_run_pt_func(vself, pt, cairo_inverse_transform_distance);
+rcairo_inverse_transform_distance (VALUE vself,
+ VALUE pt)
+{
+ return rcairo_run_pt_func (vself,
+ pt,
+ cairo_inverse_transform_distance);
}
/* Ruby-style functions. */
static VALUE
-rcairo_stack(VALUE vself) {
- cairo_t *cr = rcairo_get_cairo(vself);
- cairo_save(cr);
- rb_yield(Qnil);
- cairo_restore(cr);
- return Qnil;
+rcairo_stack (VALUE vself)
+{
+ cairo_t *cr = rcairo_get_cairo(vself);
+ cairo_save(cr);
+ rb_yield(Qnil);
+ cairo_restore(cr);
+ return Qnil;
}
static VALUE
-rcairo_run_path_func(VALUE vself, void (*f)(cairo_t *cr)) {
- cairo_t *cr = rcairo_get_cairo(vself);
- if (rb_block_given_p()) {
- cairo_new_path(cr);
- rb_yield(Qnil);
- }
- f(cr);
- return Qnil;
+rcairo_run_path_func (VALUE vself,
+ void (*f)(cairo_t *cr))
+{
+ cairo_t *cr = rcairo_get_cairo(vself);
+ if (rb_block_given_p()) {
+ cairo_new_path(cr);
+ rb_yield(Qnil);
+ }
+ f(cr);
+ return Qnil;
}
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;
+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;
}
static VALUE
-rcairo_fill(VALUE vself) {
- return rcairo_run_path_func(vself, cairo_fill);
+rcairo_fill (VALUE vself)
+{
+ return rcairo_run_path_func(vself, cairo_fill);
}
cairo_matrix_t*
-rmatrix_get_matrix(VALUE vmatrix) {
- cairo_matrix_t *cr;
- Data_Get_Struct(vmatrix, cairo_matrix_t, cr);
- return cr;
+rmatrix_get_matrix (VALUE vmatrix)
+{
+ cairo_matrix_t *cr;
+ Data_Get_Struct(vmatrix, cairo_matrix_t, cr);
+ return cr;
}
+
VALUE
-rmatrix_new() {
- cairo_matrix_t *cr = cairo_matrix_create();
- //cairo_matrix_reference(cr);
- return Data_Wrap_Struct(cCairoMatrix, NULL, cairo_matrix_destroy, cr);
+rmatrix_new ()
+{
+ cairo_matrix_t *cr = cairo_matrix_create();
+ //cairo_matrix_reference(cr);
+ return Data_Wrap_Struct(cCairoMatrix, NULL, cairo_matrix_destroy, cr);
}
+
static VALUE
-rmatrix_rmatrix_new(VALUE class) {
- return rmatrix_new();
+rmatrix_rmatrix_new (VALUE class)
+{
+ return rmatrix_new();
}
cairo_surface_t*
-rsurface_get_surface(VALUE vsurface) {
- cairo_surface_t *cr;
- Data_Get_Struct(vsurface, cairo_surface_t, cr);
- return cr;
+rsurface_get_surface (VALUE vsurface)
+{
+ cairo_surface_t *cr;
+ Data_Get_Struct(vsurface, cairo_surface_t, cr);
+ return cr;
}
+
VALUE
-rsurface_new_from(cairo_surface_t *surf) {
- cairo_surface_reference(surf);
- return Data_Wrap_Struct(cCairoSurface, NULL, cairo_surface_destroy, surf);
+rsurface_new_from (cairo_surface_t *surf)
+{
+ cairo_surface_reference(surf);
+ return Data_Wrap_Struct(cCairoSurface, NULL, cairo_surface_destroy, surf);
}
VALUE
-rcairo_in_fill(VALUE self, VALUE x, VALUE y) {
- return cairo_in_fill(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y))?
- Qtrue:Qfalse;
+rcairo_in_fill (VALUE self,
+ VALUE x, VALUE y)
+{
+ return cairo_in_fill (rcairo_get_cairo(self),
+ NUM2DBL(x), NUM2DBL(y))
+ ? Qtrue : Qfalse;
}
VALUE
-rcairo_in_stroke(VALUE self, VALUE x, VALUE y) {
- return cairo_in_stroke(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y))?
- Qtrue:Qfalse;
+rcairo_in_stroke (VALUE self,
+ VALUE x, VALUE y)
+{
+ return cairo_in_stroke (rcairo_get_cairo(self),
+ NUM2DBL(x), NUM2DBL(y))
+ ? Qtrue : Qfalse;
}
VALUE
-rcairo_text_extents(VALUE self, VALUE utf8) {
- VALUE hash;
- cairo_t *cr;
- cairo_text_extents_t extents;
+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 ();
+ 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));
+ 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;
+ return hash;
}
/*static VALUE
-rcairo_surface_new_for_image(VALUE class, VALUE image) {
- cairo_surface_t *surface;
- rcairoImage *img;
- Data_Get_Struct(image, rcairoImage, img);
- surface = cairo_surface_create_for_image(img->data, img->format,
- img->width, img->height, img->stride);
- return Data_Wrap_Struct(cCairoSurface, NULL, cairo_surface_destroy, surface);
+rcairo_surface_new_for_image (VALUE class,
+ VALUE image)
+{
+ cairo_surface_t *surface;
+ rcairoImage *img;
+ Data_Get_Struct(image, rcairoImage, img);
+ surface = cairo_surface_create_for_image(img->data, img->format,
+ img->width, img->height, img->stride);
+ return Data_Wrap_Struct(cCairoSurface, NULL, cairo_surface_destroy, surface);
}*/
void
-Init_cairo() {
- mCairo = rb_define_module("Cairo");
+Init_cairo ()
+{
+ mCairo = rb_define_module("Cairo");
- constants_init();
+ constants_init();
- cCairo = gen_Cairo();
- rb_define_singleton_method(cCairo, "new", rcairo_rcairo_new, 0);
- rb_define_method(cCairo, "dup", rcairo_dup, 0);
- 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);
- rb_define_method(cCairo, "transform_distance", rcairo_transform_distance, 1);
- rb_define_method(cCairo, "inverse_transform_point", rcairo_inverse_transform_point, 1);
- rb_define_method(cCairo, "inverse_transform_distance", rcairo_inverse_transform_distance, 1);
+ cCairo = gen_Cairo();
+ rb_define_singleton_method(cCairo, "new", rcairo_rcairo_new, 0);
- rb_define_method(cCairo, "stack", rcairo_stack, 0);
- rb_define_method(cCairo, "stroke", rcairo_stroke, 0);
- rb_define_method(cCairo, "fill", rcairo_fill, 0);
+ rb_define_method(cCairo, "dup",
+ rcairo_dup, 0);
- rb_define_method(cCairo, "in_stroke", rcairo_in_stroke, 2);
- rb_define_method(cCairo, "in_stroke?", rcairo_in_stroke, 2);
- rb_define_method(cCairo, "in_fill", rcairo_in_fill, 2);
- rb_define_method(cCairo, "in_fill?", rcairo_in_fill, 2);
+ rb_define_method(cCairo, "target_image=",
+ rcairo_set_target_image, 1);
- rb_define_method(cCairo, "text_extents", rcairo_text_extents, 1);
+ rb_define_method(cCairo, "set_target_ps",
+ rcairo_set_target_ps, 5);
- cCairoMatrix = gen_CairoMatrix();
+ rb_define_method(cCairo, "set_target_png",
+ rcairo_set_target_png, 4);
- cCairoSurface = gen_CairoSurface();
+ rb_define_method(cCairo, "set_dash",
+ rcairo_set_dash, 2);
- xlib_init();
- rcairo_image_init();
+ rb_define_method(cCairo, "transform_point",
+ rcairo_transform_point, 1);
- cCairoSurface = rb_define_class_under(mCairo, "Surface", rb_cObject);
- //rb_define_singleton_method(cCairoSurface, "new_for_image", rcairo_surface_new_for_image, 1);
+ rb_define_method(cCairo, "transform_distance",
+ rcairo_transform_distance, 1);
+
+ rb_define_method(cCairo, "inverse_transform_point",
+ rcairo_inverse_transform_point, 1);
+
+ rb_define_method(cCairo, "inverse_transform_distance",
+ rcairo_inverse_transform_distance, 1);
+
+ rb_define_method(cCairo, "stack",
+ rcairo_stack, 0);
+
+ rb_define_method(cCairo, "stroke",
+ rcairo_stroke, 0);
+
+ rb_define_method(cCairo, "fill",
+ rcairo_fill, 0);
+
+ rb_define_method(cCairo, "in_stroke",
+ rcairo_in_stroke, 2);
+
+ rb_define_method(cCairo, "in_stroke?",
+ rcairo_in_stroke, 2);
+
+ rb_define_method(cCairo, "in_fill",
+ rcairo_in_fill, 2);
+
+ rb_define_method(cCairo, "in_fill?",
+ rcairo_in_fill, 2);
+
+ rb_define_method(cCairo, "text_extents",
+ rcairo_text_extents, 1);
+
+ cCairoMatrix = gen_CairoMatrix();
+
+ cCairoSurface = gen_CairoSurface();
+
+ xlib_init();
+ rcairo_image_init();
+
+ cCairoSurface = rb_define_class_under(mCairo, "Surface", rb_cObject);
+ //rb_define_singleton_method(cCairoSurface, "new_for_image", rcairo_surface_new_for_image, 1);
}
Index: gen-Cairo.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/gen-Cairo.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gen-Cairo.c 1 Sep 2004 15:31:05 -0000 1.1
+++ gen-Cairo.c 22 Nov 2004 22:09:30 -0000 1.2
@@ -1,328 +1,636 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
-/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */
-
#include "rbcairo.h"
static VALUE
-rcairo_set_target_surface(VALUE self, VALUE surface) {
- cairo_set_target_surface(rcairo_get_cairo(self), rsurface_get_surface(surface));
- return Qnil;
+rcairo_set_target_surface (VALUE self,
+ VALUE surface)
+{
+ cairo_set_target_surface (rcairo_get_cairo(self),
+ rsurface_get_surface(surface));
+ return Qnil;
}
+
static VALUE
-rcairo_set_operator(VALUE self, VALUE op) {
- cairo_set_operator(rcairo_get_cairo(self), NUM2INT(op));
- return Qnil;
+rcairo_set_operator (VALUE self,
+ VALUE op)
+{
+ cairo_set_operator (rcairo_get_cairo(self),
+ NUM2INT(op));
+ return Qnil;
}
static VALUE
-rcairo_set_rgb_color(VALUE self, VALUE red, VALUE green, VALUE blue) {
- cairo_set_rgb_color(rcairo_get_cairo(self), NUM2DBL(red), NUM2DBL(green), NUM2DBL(blue));
- return Qnil;
+rcairo_set_rgb_color (VALUE self,
+ VALUE red,
+ VALUE green,
+ VALUE blue)
+{
+ cairo_set_rgb_color (rcairo_get_cairo(self),
+ NUM2DBL(red),
+ NUM2DBL(green),
+ NUM2DBL(blue));
+ return Qnil;
}
+
static VALUE
-rcairo_set_alpha(VALUE self, VALUE alpha) {
- cairo_set_alpha(rcairo_get_cairo(self), NUM2DBL(alpha));
- return Qnil;
+rcairo_set_alpha (VALUE self,
+ VALUE alpha)
+{
+ cairo_set_alpha (rcairo_get_cairo(self),
+ NUM2DBL(alpha));
+ return Qnil;
}
+
static VALUE
-rcairo_set_tolerance(VALUE self, VALUE tolerance) {
- cairo_set_tolerance(rcairo_get_cairo(self), NUM2DBL(tolerance));
- return Qnil;
+rcairo_set_tolerance (VALUE self,
+ VALUE tolerance)
+{
+ cairo_set_tolerance (rcairo_get_cairo(self),
+ NUM2DBL(tolerance));
+ return Qnil;
}
+
static VALUE
-rcairo_set_fill_rule(VALUE self, VALUE fill_rule) {
- cairo_set_fill_rule(rcairo_get_cairo(self), NUM2INT(fill_rule));
- return Qnil;
+rcairo_set_fill_rule (VALUE self,
+ VALUE fill_rule)
+{
+ cairo_set_fill_rule (rcairo_get_cairo(self),
+ NUM2INT(fill_rule));
+ return Qnil;
}
+
static VALUE
-rcairo_set_line_width(VALUE self, VALUE width) {
- cairo_set_line_width(rcairo_get_cairo(self), NUM2DBL(width));
- return Qnil;
+rcairo_set_line_width (VALUE self,
+ VALUE width)
+{
+ cairo_set_line_width (rcairo_get_cairo(self),
+ NUM2DBL(width));
+ return Qnil;
}
+
static VALUE
-rcairo_set_line_cap(VALUE self, VALUE line_cap) {
- cairo_set_line_cap(rcairo_get_cairo(self), NUM2INT(line_cap));
- return Qnil;
+rcairo_set_line_cap (VALUE self,
+ VALUE line_cap)
+{
+ cairo_set_line_cap (rcairo_get_cairo(self),
+ NUM2INT(line_cap));
+ return Qnil;
}
+
static VALUE
-rcairo_set_line_join(VALUE self, VALUE line_join) {
- cairo_set_line_join(rcairo_get_cairo(self), NUM2INT(line_join));
- return Qnil;
+rcairo_set_line_join (VALUE self,
+ VALUE line_join)
+{
+ cairo_set_line_join (rcairo_get_cairo(self),
+ NUM2INT(line_join));
+ return Qnil;
}
+
static VALUE
-rcairo_set_miter_limit(VALUE self, VALUE limit) {
- cairo_set_miter_limit(rcairo_get_cairo(self), NUM2DBL(limit));
- return Qnil;
+rcairo_set_miter_limit (VALUE self,
+ VALUE limit)
+{
+ cairo_set_miter_limit(rcairo_get_cairo(self), NUM2DBL(limit));
+ return Qnil;
}
+
static VALUE
-rcairo_set_matrix(VALUE self, VALUE matrix) {
- cairo_set_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
- return Qnil;
+rcairo_set_matrix (VALUE self,
+ VALUE matrix)
+{
+ cairo_set_matrix (rcairo_get_cairo(self),
+ rmatrix_get_matrix(matrix));
+ return Qnil;
}
static VALUE
-rcairo_current_operator(VALUE self) {
- return INT2FIX(cairo_current_operator(rcairo_get_cairo(self)));
+rcairo_current_operator (VALUE self)
+{
+ return INT2FIX(cairo_current_operator(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_alpha(VALUE self) {
- return rb_float_new(cairo_current_alpha(rcairo_get_cairo(self)));
+rcairo_current_alpha (VALUE self)
+{
+ return rb_float_new(cairo_current_alpha(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_tolerance(VALUE self) {
- return rb_float_new(cairo_current_tolerance(rcairo_get_cairo(self)));
+rcairo_current_tolerance (VALUE self)
+{
+ return rb_float_new(cairo_current_tolerance(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_fill_rule(VALUE self) {
- return INT2FIX(cairo_current_fill_rule(rcairo_get_cairo(self)));
+rcairo_current_fill_rule (VALUE self)
+{
+ return INT2FIX(cairo_current_fill_rule(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_line_width(VALUE self) {
- return rb_float_new(cairo_current_line_width(rcairo_get_cairo(self)));
+rcairo_current_line_width (VALUE self)
+{
+ return rb_float_new(cairo_current_line_width(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_line_cap(VALUE self) {
- return INT2FIX(cairo_current_line_cap(rcairo_get_cairo(self)));
+rcairo_current_line_cap (VALUE self)
+{
+ return INT2FIX(cairo_current_line_cap(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_line_join(VALUE self) {
- return INT2FIX(cairo_current_line_join(rcairo_get_cairo(self)));
+rcairo_current_line_join (VALUE self)
+{
+ return INT2FIX(cairo_current_line_join(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_miter_limit(VALUE self) {
- return rb_float_new(cairo_current_miter_limit(rcairo_get_cairo(self)));
+rcairo_current_miter_limit (VALUE self)
+{
+ return rb_float_new(cairo_current_miter_limit(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_current_target_surface(VALUE self) {
- return rsurface_new_from(cairo_current_target_surface(rcairo_get_cairo(self)));
+rcairo_current_target_surface (VALUE self)
+{
+ return rsurface_new_from(cairo_current_target_surface(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_status(VALUE self) {
- return INT2FIX(cairo_status(rcairo_get_cairo(self)));
+rcairo_status (VALUE self)
+{
+ return INT2FIX(cairo_status(rcairo_get_cairo(self)));
}
+
static VALUE
-rcairo_status_string(VALUE self) {
- return rb_str_new2(cairo_status_string(rcairo_get_cairo(self)));
+rcairo_status_string (VALUE self)
+{
+ return rb_str_new2(cairo_status_string(rcairo_get_cairo(self)));
}
static VALUE
-rcairo_save(VALUE self) {
- cairo_save(rcairo_get_cairo(self));
- return Qnil;
+rcairo_save (VALUE self)
+{
+ cairo_save(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_restore(VALUE self) {
- cairo_restore(rcairo_get_cairo(self));
- return Qnil;
+rcairo_restore (VALUE self)
+{
+ cairo_restore(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_translate(VALUE self, VALUE tx, VALUE ty) {
- cairo_translate(rcairo_get_cairo(self), NUM2DBL(tx), NUM2DBL(ty));
- return Qnil;
+rcairo_translate (VALUE self,
+ VALUE tx, VALUE ty)
+{
+ cairo_translate (rcairo_get_cairo(self),
+ NUM2DBL(tx), NUM2DBL(ty));
+ return Qnil;
}
+
static VALUE
-rcairo_scale(VALUE self, VALUE sx, VALUE sy) {
- cairo_scale(rcairo_get_cairo(self), NUM2DBL(sx), NUM2DBL(sy));
- return Qnil;
+rcairo_scale (VALUE self,
+ VALUE sx, VALUE sy)
+{
+ cairo_scale (rcairo_get_cairo(self),
+ NUM2DBL(sx), NUM2DBL(sy));
+ return Qnil;
}
+
static VALUE
-rcairo_rotate(VALUE self, VALUE angle) {
- cairo_rotate(rcairo_get_cairo(self), NUM2DBL(angle));
- return Qnil;
+rcairo_rotate (VALUE self,
+ VALUE angle)
+{
+ cairo_rotate (rcairo_get_cairo(self),
+ NUM2DBL(angle));
+ return Qnil;
}
+
static VALUE
-rcairo_concat_matrix(VALUE self, VALUE matrix) {
- cairo_concat_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
- return Qnil;
+rcairo_concat_matrix (VALUE self,
+ VALUE matrix)
+{
+ cairo_concat_matrix (rcairo_get_cairo(self),
+ rmatrix_get_matrix(matrix));
+ return Qnil;
}
+
static VALUE
-rcairo_default_matrix(VALUE self) {
- cairo_default_matrix(rcairo_get_cairo(self));
- return Qnil;
+rcairo_default_matrix (VALUE self)
+{
+ cairo_default_matrix (rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_identity_matrix(VALUE self) {
- cairo_identity_matrix(rcairo_get_cairo(self));
- return Qnil;
+rcairo_identity_matrix (VALUE self)
+{
+ cairo_identity_matrix (rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_new_path(VALUE self) {
- cairo_new_path(rcairo_get_cairo(self));
- return Qnil;
+rcairo_new_path (VALUE self)
+{
+ cairo_new_path (rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_move_to(VALUE self, VALUE x, VALUE y) {
- cairo_move_to(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y));
- return Qnil;
+rcairo_move_to (VALUE self,
+ VALUE x, VALUE y)
+{
+ cairo_move_to(rcairo_get_cairo(self),
+ NUM2DBL(x), NUM2DBL(y));
+ return Qnil;
}
+
static VALUE
-rcairo_line_to(VALUE self, VALUE x, VALUE y) {
- cairo_line_to(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y));
- return Qnil;
+rcairo_line_to (VALUE self,
+ VALUE x, VALUE y)
+{
+ cairo_line_to (rcairo_get_cairo(self),
+ NUM2DBL(x), NUM2DBL(y));
+ return Qnil;
}
+
static VALUE
-rcairo_curve_to(VALUE self, VALUE x1, VALUE y1, VALUE x2, VALUE y2, VALUE x3, VALUE y3) {
- cairo_curve_to(rcairo_get_cairo(self), NUM2DBL(x1), NUM2DBL(y1), NUM2DBL(x2), NUM2DBL(y2), NUM2DBL(x3), NUM2DBL(y3));
- return Qnil;
+rcairo_curve_to (VALUE self,
+ VALUE x1, VALUE y1,
+ VALUE x2, VALUE y2,
+ VALUE x3, VALUE y3)
+{
+ cairo_curve_to (rcairo_get_cairo(self),
+ NUM2DBL(x1), NUM2DBL(y1),
+ NUM2DBL(x2), NUM2DBL(y2),
+ NUM2DBL(x3), NUM2DBL(y3));
+ return Qnil;
}
+
static VALUE
-rcairo_arc(VALUE self, VALUE xc, VALUE yc, VALUE radius, VALUE angle1, VALUE angle2) {
- cairo_arc(rcairo_get_cairo(self), NUM2DBL(xc), NUM2DBL(yc), NUM2DBL(radius), NUM2DBL(angle1), NUM2DBL(angle2));
- return Qnil;
+rcairo_arc (VALUE self,
+ VALUE xc, VALUE yc,
+ VALUE radius,
+ VALUE angle1, VALUE angle2)
+{
+ cairo_arc (rcairo_get_cairo(self),
+ NUM2DBL(xc), NUM2DBL(yc),
+ NUM2DBL(radius),
+ NUM2DBL(angle1), NUM2DBL(angle2));
+ return Qnil;
}
static VALUE
-rcairo_arc_negative(VALUE self, VALUE xc, VALUE yc, VALUE radius, VALUE angle1, VALUE angle2) {
- cairo_arc_negative(rcairo_get_cairo(self), NUM2DBL(xc), NUM2DBL(yc), NUM2DBL(radius), NUM2DBL(angle1), NUM2DBL(angle2));
- return Qnil;
+rcairo_arc_negative (VALUE self,
+ VALUE xc, VALUE yc,
+ VALUE radius,
+ VALUE angle1, VALUE angle2)
+{
+ cairo_arc_negative (rcairo_get_cairo(self),
+ NUM2DBL(xc), NUM2DBL(yc),
+ NUM2DBL(radius),
+ NUM2DBL(angle1), NUM2DBL(angle2));
+ return Qnil;
}
+
static VALUE
-rcairo_rel_move_to(VALUE self, VALUE dx, VALUE dy) {
- cairo_rel_move_to(rcairo_get_cairo(self), NUM2DBL(dx), NUM2DBL(dy));
- return Qnil;
+rcairo_rel_move_to (VALUE self,
+ VALUE dx, VALUE dy)
+{
+ cairo_rel_move_to (rcairo_get_cairo(self),
+ NUM2DBL(dx), NUM2DBL(dy));
+ return Qnil;
}
static VALUE
-rcairo_rel_line_to(VALUE self, VALUE dx, VALUE dy) {
- cairo_rel_line_to(rcairo_get_cairo(self), NUM2DBL(dx), NUM2DBL(dy));
- return Qnil;
+rcairo_rel_line_to (VALUE self,
+ VALUE dx, VALUE dy)
+{
+ cairo_rel_line_to(rcairo_get_cairo(self), NUM2DBL(dx), NUM2DBL(dy));
+ return Qnil;
}
+
static VALUE
-rcairo_rel_curve_to(VALUE self, VALUE dx1, VALUE dy1, VALUE dx2, VALUE dy2, VALUE dx3, VALUE dy3) {
- cairo_rel_curve_to(rcairo_get_cairo(self), NUM2DBL(dx1), NUM2DBL(dy1), NUM2DBL(dx2), NUM2DBL(dy2), NUM2DBL(dx3), NUM2DBL(dy3));
- return Qnil;
+rcairo_rel_curve_to (VALUE self,
+ VALUE dx1, VALUE dy1,
+ VALUE dx2, VALUE dy2,
+ VALUE dx3, VALUE dy3)
+{
+ cairo_rel_curve_to (rcairo_get_cairo(self),
+ NUM2DBL(dx1), NUM2DBL(dy1),
+ NUM2DBL(dx2), NUM2DBL(dy2),
+ NUM2DBL(dx3), NUM2DBL(dy3));
+ return Qnil;
}
+
static VALUE
-rcairo_rectangle(VALUE self, VALUE x, VALUE y, VALUE width, VALUE height) {
- cairo_rectangle(rcairo_get_cairo(self), NUM2DBL(x), NUM2DBL(y), NUM2DBL(width), NUM2DBL(height));
- return Qnil;
+rcairo_rectangle (VALUE self,
+ VALUE x, VALUE y,
+ VALUE width, VALUE height)
+{
+ cairo_rectangle (rcairo_get_cairo(self),
+ NUM2DBL(x), NUM2DBL(y),
+ NUM2DBL(width), NUM2DBL(height));
+ return Qnil;
}
+
static VALUE
-rcairo_close_path(VALUE self) {
- cairo_close_path(rcairo_get_cairo(self));
- return Qnil;
+rcairo_close_path (VALUE self)
+{
+ cairo_close_path(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_copy_page(VALUE self) {
- cairo_copy_page(rcairo_get_cairo(self));
- return Qnil;
+rcairo_copy_page (VALUE self)
+{
+ cairo_copy_page(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_show_page(VALUE self) {
- cairo_show_page(rcairo_get_cairo(self));
- return Qnil;
+rcairo_show_page (VALUE self)
+{
+ cairo_show_page(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_init_clip(VALUE self) {
- cairo_init_clip(rcairo_get_cairo(self));
- return Qnil;
+rcairo_init_clip (VALUE self)
+{
+ cairo_init_clip(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_clip(VALUE self) {
- cairo_clip(rcairo_get_cairo(self));
- return Qnil;
+rcairo_clip(VALUE self)
+{
+ cairo_clip(rcairo_get_cairo(self));
+ return Qnil;
}
+
static VALUE
-rcairo_select_font(VALUE self, VALUE family, VALUE slant, VALUE weight) {
- cairo_select_font(rcairo_get_cairo(self), STR2CSTR(family), NUM2INT(slant), NUM2INT(weight));
- return Qnil;
+rcairo_select_font (VALUE self,
+ VALUE family,
+ VALUE slant,
+ VALUE weight)
+{
+ cairo_select_font (rcairo_get_cairo(self),
+ STR2CSTR(family),
+ NUM2INT(slant),
+ NUM2INT(weight));
+ return Qnil;
}
+
static VALUE
-rcairo_scale_font(VALUE self, VALUE scale) {
- cairo_scale_font(rcairo_get_cairo(self), NUM2DBL(scale));
- return Qnil;
+rcairo_scale_font (VALUE self,
+ VALUE scale)
+{
+ cairo_scale_font (rcairo_get_cairo(self),
+ NUM2DBL(scale));
+ return Qnil;
}
+
static VALUE
-rcairo_transform_font(VALUE self, VALUE matrix) {
- cairo_transform_font(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
- return Qnil;
+rcairo_transform_font (VALUE self,
+ VALUE matrix)
+{
+ cairo_transform_font (rcairo_get_cairo(self),
+ rmatrix_get_matrix(matrix));
+ return Qnil;
}
+
static VALUE
-rcairo_show_text(VALUE self, VALUE utf8) {
- cairo_show_text(rcairo_get_cairo(self), STR2CSTR(utf8));
- return Qnil;
+rcairo_show_text (VALUE self,
+ VALUE utf8)
+{
+ cairo_show_text (rcairo_get_cairo(self),
+ STR2CSTR(utf8));
+ return Qnil;
}
+
static VALUE
-rcairo_text_path(VALUE self, VALUE utf8) {
- cairo_text_path(rcairo_get_cairo(self), STR2CSTR(utf8));
- return Qnil;
+rcairo_text_path (VALUE self,
+ VALUE utf8)
+{
+ cairo_text_path (rcairo_get_cairo(self), STR2CSTR(utf8));
+ return Qnil;
}
+
static VALUE
-rcairo_show_surface(VALUE self, VALUE surface, VALUE width, VALUE height) {
- cairo_show_surface(rcairo_get_cairo(self), rsurface_get_surface(surface), FIX2INT(width), FIX2INT(height));
- return Qnil;
+rcairo_show_surface (VALUE self,
+ VALUE surface,
+ VALUE width, VALUE height)
+{
+ cairo_show_surface (rcairo_get_cairo(self),
+ rsurface_get_surface(surface),
+ FIX2INT(width), FIX2INT(height));
+ return Qnil;
}
static VALUE
-rcairo_current_matrix(VALUE self, VALUE matrix) {
- cairo_current_matrix(rcairo_get_cairo(self), rmatrix_get_matrix(matrix));
- return Qnil;
+rcairo_current_matrix (VALUE self,
+ VALUE matrix)
+{
+ cairo_current_matrix (rcairo_get_cairo(self),
+ rmatrix_get_matrix(matrix));
+ return Qnil;
}
-VALUE gen_Cairo(void) {
- cCairo = rb_define_class_under(mCairo, "Cairo", rb_cObject);
- rb_define_method(cCairo, "save", rcairo_save, 0);
- rb_define_method(cCairo, "restore", rcairo_restore, 0);
- rb_define_method(cCairo, "translate", rcairo_translate, 2);
- rb_define_method(cCairo, "scale", rcairo_scale, 2);
- rb_define_method(cCairo, "rotate", rcairo_rotate, 1);
- rb_define_method(cCairo, "concat_matrix", rcairo_concat_matrix, 1);
- rb_define_method(cCairo, "default_matrix", rcairo_default_matrix, 0);
- rb_define_method(cCairo, "identity_matrix", rcairo_identity_matrix, 0);
- rb_define_method(cCairo, "new_path", rcairo_new_path, 0);
- rb_define_method(cCairo, "move_to", rcairo_move_to, 2);
- rb_define_method(cCairo, "line_to", rcairo_line_to, 2);
- rb_define_method(cCairo, "curve_to", rcairo_curve_to, 6);
- rb_define_method(cCairo, "arc", rcairo_arc, 5);
- rb_define_method(cCairo, "arc_negative", rcairo_arc_negative, 5);
- rb_define_method(cCairo, "rel_move_to", rcairo_rel_move_to, 2);
- rb_define_method(cCairo, "rel_line_to", rcairo_rel_line_to, 2);
- rb_define_method(cCairo, "rel_curve_to", rcairo_rel_curve_to, 6);
- rb_define_method(cCairo, "rectangle", rcairo_rectangle, 4);
- rb_define_method(cCairo, "close_path", rcairo_close_path, 0);
- rb_define_method(cCairo, "copy_page", rcairo_copy_page, 0);
- rb_define_method(cCairo, "show_page", rcairo_show_page, 0);
- rb_define_method(cCairo, "init_clip", rcairo_init_clip, 0);
- rb_define_method(cCairo, "clip", rcairo_clip, 0);
- rb_define_method(cCairo, "select_font", rcairo_select_font, 3);
- rb_define_method(cCairo, "scale_font", rcairo_scale_font, 1);
- rb_define_method(cCairo, "transform_font", rcairo_transform_font, 1);
- rb_define_method(cCairo, "show_text", rcairo_show_text, 1);
- rb_define_method(cCairo, "text_path", rcairo_text_path, 1);
- rb_define_method(cCairo, "show_surface", rcairo_show_surface, 3);
- rb_define_method(cCairo, "current_matrix", rcairo_current_matrix, 1);
- rb_define_method(cCairo, "set_target_surface", rcairo_set_target_surface, 1);
- rb_define_method(cCairo, "target_surface=", rcairo_set_target_surface, 1);
- rb_define_method(cCairo, "set_operator", rcairo_set_operator, 1);
- rb_define_method(cCairo, "operator=", rcairo_set_operator, 1);
- rb_define_method(cCairo, "set_rgb_color", rcairo_set_rgb_color, 3);
- rb_define_method(cCairo, "set_alpha", rcairo_set_alpha, 1);
- rb_define_method(cCairo, "alpha=", rcairo_set_alpha, 1);
- rb_define_method(cCairo, "set_tolerance", rcairo_set_tolerance, 1);
- rb_define_method(cCairo, "tolerance=", rcairo_set_tolerance, 1);
- rb_define_method(cCairo, "set_fill_rule", rcairo_set_fill_rule, 1);
- rb_define_method(cCairo, "fill_rule=", rcairo_set_fill_rule, 1);
- rb_define_method(cCairo, "set_line_width", rcairo_set_line_width, 1);
- rb_define_method(cCairo, "line_width=", rcairo_set_line_width, 1);
- rb_define_method(cCairo, "set_line_cap", rcairo_set_line_cap, 1);
- rb_define_method(cCairo, "line_cap=", rcairo_set_line_cap, 1);
- rb_define_method(cCairo, "set_line_join", rcairo_set_line_join, 1);
- rb_define_method(cCairo, "line_join=", rcairo_set_line_join, 1);
- rb_define_method(cCairo, "set_miter_limit", rcairo_set_miter_limit, 1);
- rb_define_method(cCairo, "miter_limit=", rcairo_set_miter_limit, 1);
- rb_define_method(cCairo, "set_matrix", rcairo_set_matrix, 1);
- rb_define_method(cCairo, "matrix=", rcairo_set_matrix, 1);
- rb_define_method(cCairo, "operator", rcairo_current_operator, 0);
- rb_define_method(cCairo, "alpha", rcairo_current_alpha, 0);
- rb_define_method(cCairo, "tolerance", rcairo_current_tolerance, 0);
- rb_define_method(cCairo, "fill_rule", rcairo_current_fill_rule, 0);
- rb_define_method(cCairo, "line_width", rcairo_current_line_width, 0);
- rb_define_method(cCairo, "line_cap", rcairo_current_line_cap, 0);
- rb_define_method(cCairo, "line_join", rcairo_current_line_join, 0);
- rb_define_method(cCairo, "miter_limit", rcairo_current_miter_limit, 0);
- rb_define_method(cCairo, "target_surface", rcairo_current_target_surface, 0);
- rb_define_method(cCairo, "status", rcairo_status, 0);
- rb_define_method(cCairo, "status_string", rcairo_status_string, 0);
- return cCairo;
+VALUE gen_Cairo (void)
+{
+ VALUE cCairo = rb_define_class_under(mCairo, "Cairo", rb_cObject);
+
+ rb_define_method(cCairo, "save",
+ rcairo_save, 0);
+
+ rb_define_method(cCairo, "restore",
+ rcairo_restore, 0);
+
+ rb_define_method(cCairo, "translate",
+ rcairo_translate, 2);
+
+ rb_define_method(cCairo, "scale",
+ rcairo_scale, 2);
+
+ rb_define_method(cCairo, "rotate",
+ rcairo_rotate, 1);
+
+ rb_define_method(cCairo, "concat_matrix",
+ rcairo_concat_matrix, 1);
+
+ rb_define_method(cCairo, "default_matrix",
+ rcairo_default_matrix, 0);
+
+ rb_define_method(cCairo, "identity_matrix",
+ rcairo_identity_matrix, 0);
+
+ rb_define_method(cCairo, "new_path",
+ rcairo_new_path, 0);
+
+ rb_define_method(cCairo, "move_to",
+ rcairo_move_to, 2);
+
+ rb_define_method(cCairo, "line_to",
+ rcairo_line_to, 2);
+
+ rb_define_method(cCairo, "curve_to",
+ rcairo_curve_to, 6);
+
+ rb_define_method(cCairo, "arc",
+ rcairo_arc, 5);
+
+ rb_define_method(cCairo, "arc_negative",
+ rcairo_arc_negative, 5);
+
+ rb_define_method(cCairo, "rel_move_to",
+ rcairo_rel_move_to, 2);
+
+ rb_define_method(cCairo, "rel_line_to",
+ rcairo_rel_line_to, 2);
+
+ rb_define_method(cCairo, "rel_curve_to",
+ rcairo_rel_curve_to, 6);
+
+ rb_define_method(cCairo, "rectangle",
+ rcairo_rectangle, 4);
+
+ rb_define_method(cCairo, "close_path",
+ rcairo_close_path, 0);
+
+ rb_define_method(cCairo, "copy_page",
+ rcairo_copy_page, 0);
+
+ rb_define_method(cCairo, "show_page",
+ rcairo_show_page, 0);
+
+ rb_define_method(cCairo, "init_clip",
+ rcairo_init_clip, 0);
+
+ rb_define_method(cCairo, "clip",
+ rcairo_clip, 0);
+
+ rb_define_method(cCairo, "select_font",
+ rcairo_select_font, 3);
+
+ rb_define_method(cCairo, "scale_font",
+ rcairo_scale_font, 1);
+
+ rb_define_method(cCairo, "transform_font",
+ rcairo_transform_font, 1);
+
+ rb_define_method(cCairo, "show_text",
+ rcairo_show_text, 1);
+
+ rb_define_method(cCairo, "text_path",
+ rcairo_text_path, 1);
+
+ rb_define_method(cCairo, "show_surface",
+ rcairo_show_surface, 3);
+
+ rb_define_method(cCairo, "current_matrix",
+ rcairo_current_matrix, 1);
+
+ rb_define_method(cCairo, "set_target_surface",
+ rcairo_set_target_surface, 1);
+
+ rb_define_method(cCairo, "target_surface=",
+ rcairo_set_target_surface, 1);
+
+ rb_define_method(cCairo, "set_operator",
+ rcairo_set_operator, 1);
+
+ rb_define_method(cCairo, "operator=",
+ rcairo_set_operator, 1);
+
+ rb_define_method(cCairo, "set_rgb_color",
+ rcairo_set_rgb_color, 3);
+
+ rb_define_method(cCairo, "set_alpha",
+ rcairo_set_alpha, 1);
+
+ rb_define_method(cCairo, "alpha=",
+ rcairo_set_alpha, 1);
+
+ rb_define_method(cCairo, "set_tolerance",
+ rcairo_set_tolerance, 1);
+
+ rb_define_method(cCairo, "tolerance=",
+ rcairo_set_tolerance, 1);
+
+ rb_define_method(cCairo, "set_fill_rule",
+ rcairo_set_fill_rule, 1);
+
+ rb_define_method(cCairo, "fill_rule=",
+ rcairo_set_fill_rule, 1);
+
+ rb_define_method(cCairo, "set_line_width",
+ rcairo_set_line_width, 1);
+
+ rb_define_method(cCairo, "line_width=",
+ rcairo_set_line_width, 1);
+
+ rb_define_method(cCairo, "set_line_cap",
+ rcairo_set_line_cap, 1);
+
+ rb_define_method(cCairo, "line_cap=",
+ rcairo_set_line_cap, 1);
+
+ rb_define_method(cCairo, "set_line_join",
+ rcairo_set_line_join, 1);
+
+ rb_define_method(cCairo, "line_join=",
+ rcairo_set_line_join, 1);
+
+ rb_define_method(cCairo, "set_miter_limit",
+ rcairo_set_miter_limit, 1);
+
+ rb_define_method(cCairo, "miter_limit=",
+ rcairo_set_miter_limit, 1);
+
+ rb_define_method(cCairo, "set_matrix",
+ rcairo_set_matrix, 1);
+
+ rb_define_method(cCairo, "matrix=",
+ rcairo_set_matrix, 1);
+
+ rb_define_method(cCairo, "operator",
+ rcairo_current_operator, 0);
+
+ rb_define_method(cCairo, "alpha",
+ rcairo_current_alpha, 0);
+
+ rb_define_method(cCairo, "tolerance",
+ rcairo_current_tolerance, 0);
+
+ rb_define_method(cCairo, "fill_rule",
+ rcairo_current_fill_rule, 0);
+
+ rb_define_method(cCairo, "line_width",
+ rcairo_current_line_width, 0);
+
+ rb_define_method(cCairo, "line_cap",
+ rcairo_current_line_cap, 0);
+
+ rb_define_method(cCairo, "line_join",
+ rcairo_current_line_join, 0);
+
+ rb_define_method(cCairo, "miter_limit",
+ rcairo_current_miter_limit, 0);
+
+ rb_define_method(cCairo, "target_surface",
+ rcairo_current_target_surface, 0);
+
+ rb_define_method(cCairo, "status",
+ rcairo_status, 0);
+
+ rb_define_method(cCairo, "status_string",
+ rcairo_status_string, 0);
+
+ return cCairo;
}
Index: gen-CairoMatrix.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/gen-CairoMatrix.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gen-CairoMatrix.c 1 Sep 2004 15:31:05 -0000 1.1
+++ gen-CairoMatrix.c 22 Nov 2004 22:09:30 -0000 1.2
@@ -1,30 +1,39 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
-/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */
-
#include "rbcairo.h"
static VALUE
-rcairo_matrix_set_affine(VALUE self, VALUE a, VALUE b, VALUE c, VALUE d, VALUE tx, VALUE ty) {
- cairo_matrix_set_affine(rmatrix_get_matrix(self), NUM2DBL(a), NUM2DBL(b), NUM2DBL(c), NUM2DBL(d), NUM2DBL(tx), NUM2DBL(ty));
+rcairo_matrix_set_affine (VALUE self,
+ VALUE a, VALUE b,
+ VALUE c, VALUE d,
+ VALUE tx, VALUE ty)
+{
+ cairo_matrix_set_affine (rmatrix_get_matrix(self),
+ NUM2DBL(a), NUM2DBL(b),
+ NUM2DBL(c), NUM2DBL(d),
+ NUM2DBL(tx), NUM2DBL(ty));
return Qnil;
}
static VALUE
-rcairo_matrix_set_identity(VALUE self) {
+rcairo_matrix_set_identity (VALUE self)
+{
return INT2FIX(cairo_matrix_set_identity(rmatrix_get_matrix(self)));
}
+
static VALUE
-rcairo_matrix_invert(VALUE self) {
+rcairo_matrix_invert (VALUE self)
+{
return INT2FIX(cairo_matrix_invert(rmatrix_get_matrix(self)));
}
-VALUE gen_CairoMatrix(void) {
+VALUE gen_CairoMatrix (void)
+{
cCairoMatrix = rb_define_class_under(mCairo, "Matrix", rb_cObject);
rb_define_method(cCairoMatrix, "set_affine", rcairo_matrix_set_affine, 6);
rb_define_method(cCairoMatrix, "set_identity", rcairo_matrix_set_identity, 0);
Index: gen-CairoSurface.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/gen-CairoSurface.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gen-CairoSurface.c 1 Sep 2004 15:31:05 -0000 1.1
+++ gen-CairoSurface.c 22 Nov 2004 22:09:30 -0000 1.2
@@ -1,43 +1,68 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
-/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */
-
#include "rbcairo.h"
static VALUE
-rcairo_surface_set_repeat(VALUE self, VALUE repeat) {
- cairo_surface_set_repeat(rsurface_get_surface(self), FIX2INT(repeat));
- return Qnil;
+rcairo_surface_set_repeat (VALUE self,
+ VALUE repeat)
+{
+ cairo_surface_set_repeat (rsurface_get_surface(self),
+ FIX2INT(repeat));
+ return Qnil;
}
+
static VALUE
-rcairo_surface_set_matrix(VALUE self, VALUE matrix) {
- cairo_surface_set_matrix(rsurface_get_surface(self), rmatrix_get_matrix(matrix));
- return Qnil;
+rcairo_surface_set_matrix (VALUE self,
+ VALUE matrix)
+{
+ cairo_surface_set_matrix (rsurface_get_surface(self),
+ rmatrix_get_matrix(matrix));
+ return Qnil;
}
static VALUE
-rcairo_surface_set_filter(VALUE self, VALUE filter) {
- cairo_surface_set_filter(rsurface_get_surface(self), NUM2INT(filter));
- return Qnil;
+rcairo_surface_set_filter (VALUE self,
+ VALUE filter)
+{
+ cairo_surface_set_filter (rsurface_get_surface(self),
+ NUM2INT(filter));
+ return Qnil;
}
static VALUE
-rcairo_surface_get_filter(VALUE self) {
- return INT2FIX(cairo_surface_get_filter(rsurface_get_surface(self)));
+rcairo_surface_get_filter (VALUE self)
+{
+ return INT2FIX(cairo_surface_get_filter(rsurface_get_surface(self)));
}
-VALUE gen_CairoSurface(void) {
- cCairoSurface = rb_define_class_under(mCairo, "Surface", rb_cObject);
- rb_define_method(cCairoSurface, "set_repeat", rcairo_surface_set_repeat, 1);
- rb_define_method(cCairoSurface, "repeat=", rcairo_surface_set_repeat, 1);
- rb_define_method(cCairoSurface, "set_matrix", rcairo_surface_set_matrix, 1);
- rb_define_method(cCairoSurface, "matrix=", rcairo_surface_set_matrix, 1);
- rb_define_method(cCairoSurface, "set_filter", rcairo_surface_set_filter, 1);
- rb_define_method(cCairoSurface, "filter=", rcairo_surface_set_filter, 1);
- rb_define_method(cCairoSurface, "filter", rcairo_surface_get_filter, 0);
- return cCairoSurface;
+VALUE gen_CairoSurface (void)
+{
+ cCairoSurface = rb_define_class_under(mCairo, "Surface", rb_cObject);
+
+ rb_define_method(cCairoSurface, "set_repeat",
+ rcairo_surface_set_repeat, 1);
+
+ rb_define_method(cCairoSurface, "repeat=",
+ rcairo_surface_set_repeat, 1);
+
+ rb_define_method(cCairoSurface, "set_matrix",
+ rcairo_surface_set_matrix, 1);
+
+ rb_define_method(cCairoSurface, "matrix=",
+ rcairo_surface_set_matrix, 1);
+
+ rb_define_method(cCairoSurface, "set_filter",
+ rcairo_surface_set_filter, 1);
+
+ rb_define_method(cCairoSurface, "filter=",
+ rcairo_surface_set_filter, 1);
+
+ rb_define_method(cCairoSurface, "filter",
+ rcairo_surface_get_filter, 0);
+
+ return cCairoSurface;
}
Index: gen-constants.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/gen-constants.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- gen-constants.c 1 Sep 2004 15:31:05 -0000 1.1
+++ gen-constants.c 22 Nov 2004 22:09:30 -0000 1.2
@@ -1,122 +1,130 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
- *
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*/
-/* this file was autogenerated by gen.rb, available in the ruby-cairo cvs. */
-
#include "rbcairo.h"
static void
-init_cairo_fill_rule(void) {
- VALUE mCairoFillRule = rb_define_module_under(mCairo, "FillRule");
- rb_define_const(mCairoFillRule, "WINDING", INT2NUM(CAIRO_FILL_RULE_WINDING));
- rb_define_const(mCairoFillRule, "EVEN_ODD", INT2NUM(CAIRO_FILL_RULE_EVEN_ODD));
+init_cairo_fill_rule(void)
+{
+ VALUE mCairoFillRule = rb_define_module_under(mCairo, "FillRule");
+
+ rb_define_const(mCairoFillRule, "WINDING", INT2NUM(CAIRO_FILL_RULE_WINDING));
+ rb_define_const(mCairoFillRule, "EVEN_ODD", INT2NUM(CAIRO_FILL_RULE_EVEN_ODD));
}
static void
-init_cairo_format(void) {
- VALUE mCairoFormat = rb_define_module_under(mCairo, "Format");
- rb_define_const(mCairoFormat, "ARGB32", INT2NUM(CAIRO_FORMAT_ARGB32));
- rb_define_const(mCairoFormat, "RGB24", INT2NUM(CAIRO_FORMAT_RGB24));
- rb_define_const(mCairoFormat, "A8", INT2NUM(CAIRO_FORMAT_A8));
- rb_define_const(mCairoFormat, "A1", INT2NUM(CAIRO_FORMAT_A1));
+init_cairo_format(void)
+{
+ VALUE mCairoFormat = rb_define_module_under(mCairo, "Format");
+ rb_define_const(mCairoFormat, "ARGB32", INT2NUM(CAIRO_FORMAT_ARGB32));
+ rb_define_const(mCairoFormat, "RGB24", INT2NUM(CAIRO_FORMAT_RGB24));
+ rb_define_const(mCairoFormat, "A8", INT2NUM(CAIRO_FORMAT_A8));
+ rb_define_const(mCairoFormat, "A1", INT2NUM(CAIRO_FORMAT_A1));
}
static void
-init_cairo_filter(void) {
- VALUE mCairoFilter = rb_define_module_under(mCairo, "Filter");
- rb_define_const(mCairoFilter, "FAST", INT2NUM(CAIRO_FILTER_FAST));
- rb_define_const(mCairoFilter, "GOOD", INT2NUM(CAIRO_FILTER_GOOD));
- rb_define_const(mCairoFilter, "BEST", INT2NUM(CAIRO_FILTER_BEST));
- rb_define_const(mCairoFilter, "NEAREST", INT2NUM(CAIRO_FILTER_NEAREST));
- rb_define_const(mCairoFilter, "BILINEAR", INT2NUM(CAIRO_FILTER_BILINEAR));
- rb_define_const(mCairoFilter, "GAUSSIAN", INT2NUM(CAIRO_FILTER_GAUSSIAN));
+init_cairo_filter(void)
+{
+ VALUE mCairoFilter = rb_define_module_under(mCairo, "Filter");
+ rb_define_const(mCairoFilter, "FAST", INT2NUM(CAIRO_FILTER_FAST));
+ rb_define_const(mCairoFilter, "GOOD", INT2NUM(CAIRO_FILTER_GOOD));
+ rb_define_const(mCairoFilter, "BEST", INT2NUM(CAIRO_FILTER_BEST));
+ rb_define_const(mCairoFilter, "NEAREST", INT2NUM(CAIRO_FILTER_NEAREST));
+ rb_define_const(mCairoFilter, "BILINEAR", INT2NUM(CAIRO_FILTER_BILINEAR));
+ rb_define_const(mCairoFilter, "GAUSSIAN", INT2NUM(CAIRO_FILTER_GAUSSIAN));
}
static void
-init_cairo_status(void) {
- VALUE mCairoStatus = rb_define_module_under(mCairo, "Status");
- rb_define_const(mCairoStatus, "SUCCESS", INT2NUM(CAIRO_STATUS_SUCCESS));
- rb_define_const(mCairoStatus, "NO_MEMORY", INT2NUM(CAIRO_STATUS_NO_MEMORY));
- rb_define_const(mCairoStatus, "INVALID_RESTORE", INT2NUM(CAIRO_STATUS_INVALID_RESTORE));
- rb_define_const(mCairoStatus, "INVALID_POP_GROUP", INT2NUM(CAIRO_STATUS_INVALID_POP_GROUP));
- rb_define_const(mCairoStatus, "NO_CURRENT_POINT", INT2NUM(CAIRO_STATUS_NO_CURRENT_POINT));
- rb_define_const(mCairoStatus, "INVALID_MATRIX", INT2NUM(CAIRO_STATUS_INVALID_MATRIX));
- rb_define_const(mCairoStatus, "NO_TARGET_SURFACE", INT2NUM(CAIRO_STATUS_NO_TARGET_SURFACE));
- rb_define_const(mCairoStatus, "NULL_POINTER", INT2NUM(CAIRO_STATUS_NULL_POINTER));
+init_cairo_status(void)
+{
+ VALUE mCairoStatus = rb_define_module_under(mCairo, "Status");
+ rb_define_const(mCairoStatus, "SUCCESS", INT2NUM(CAIRO_STATUS_SUCCESS));
+ rb_define_const(mCairoStatus, "NO_MEMORY", INT2NUM(CAIRO_STATUS_NO_MEMORY));
+ rb_define_const(mCairoStatus, "INVALID_RESTORE", INT2NUM(CAIRO_STATUS_INVALID_RESTORE));
+ rb_define_const(mCairoStatus, "INVALID_POP_GROUP", INT2NUM(CAIRO_STATUS_INVALID_POP_GROUP));
+ rb_define_const(mCairoStatus, "NO_CURRENT_POINT", INT2NUM(CAIRO_STATUS_NO_CURRENT_POINT));
+ rb_define_const(mCairoStatus, "INVALID_MATRIX", INT2NUM(CAIRO_STATUS_INVALID_MATRIX));
+ rb_define_const(mCairoStatus, "NO_TARGET_SURFACE", INT2NUM(CAIRO_STATUS_NO_TARGET_SURFACE));
+ rb_define_const(mCairoStatus, "NULL_POINTER", INT2NUM(CAIRO_STATUS_NULL_POINTER));
}
static void
-init_cairo_line_join(void) {
- VALUE mCairoLineJoin = rb_define_module_under(mCairo, "LineJoin");
- rb_define_const(mCairoLineJoin, "MITER", INT2NUM(CAIRO_LINE_JOIN_MITER));
- rb_define_const(mCairoLineJoin, "ROUND", INT2NUM(CAIRO_LINE_JOIN_ROUND));
- rb_define_const(mCairoLineJoin, "BEVEL", INT2NUM(CAIRO_LINE_JOIN_BEVEL));
+init_cairo_line_join(void)
+{
+ VALUE mCairoLineJoin = rb_define_module_under(mCairo, "LineJoin");
+ rb_define_const(mCairoLineJoin, "MITER", INT2NUM(CAIRO_LINE_JOIN_MITER));
+ rb_define_const(mCairoLineJoin, "ROUND", INT2NUM(CAIRO_LINE_JOIN_ROUND));
+ rb_define_const(mCairoLineJoin, "BEVEL", INT2NUM(CAIRO_LINE_JOIN_BEVEL));
}
static void
-init_cairo_line_cap(void) {
- VALUE mCairoLineCap = rb_define_module_under(mCairo, "LineCap");
- rb_define_const(mCairoLineCap, "BUTT", INT2NUM(CAIRO_LINE_CAP_BUTT));
- rb_define_const(mCairoLineCap, "ROUND", INT2NUM(CAIRO_LINE_CAP_ROUND));
- rb_define_const(mCairoLineCap, "SQUARE", INT2NUM(CAIRO_LINE_CAP_SQUARE));
+init_cairo_line_cap(void)
+{
+ VALUE mCairoLineCap = rb_define_module_under(mCairo, "LineCap");
+ rb_define_const(mCairoLineCap, "BUTT", INT2NUM(CAIRO_LINE_CAP_BUTT));
+ rb_define_const(mCairoLineCap, "ROUND", INT2NUM(CAIRO_LINE_CAP_ROUND));
+ rb_define_const(mCairoLineCap, "SQUARE", INT2NUM(CAIRO_LINE_CAP_SQUARE));
}
static void
-init_cairo_operator(void) {
- VALUE mCairoOperator = rb_define_module_under(mCairo, "Operator");
- rb_define_const(mCairoOperator, "CLEAR", INT2NUM(CAIRO_OPERATOR_CLEAR));
- rb_define_const(mCairoOperator, "SRC", INT2NUM(CAIRO_OPERATOR_SRC));
- rb_define_const(mCairoOperator, "DST", INT2NUM(CAIRO_OPERATOR_DST));
- rb_define_const(mCairoOperator, "OVER", INT2NUM(CAIRO_OPERATOR_OVER));
- rb_define_const(mCairoOperator, "OVER_REVERSE", INT2NUM(CAIRO_OPERATOR_OVER_REVERSE));
- rb_define_const(mCairoOperator, "IN", INT2NUM(CAIRO_OPERATOR_IN));
- rb_define_const(mCairoOperator, "IN_REVERSE", INT2NUM(CAIRO_OPERATOR_IN_REVERSE));
- rb_define_const(mCairoOperator, "OUT", INT2NUM(CAIRO_OPERATOR_OUT));
- rb_define_const(mCairoOperator, "OUT_REVERSE", INT2NUM(CAIRO_OPERATOR_OUT_REVERSE));
- rb_define_const(mCairoOperator, "ATOP", INT2NUM(CAIRO_OPERATOR_ATOP));
- rb_define_const(mCairoOperator, "ATOP_REVERSE", INT2NUM(CAIRO_OPERATOR_ATOP_REVERSE));
- rb_define_const(mCairoOperator, "XOR", INT2NUM(CAIRO_OPERATOR_XOR));
- rb_define_const(mCairoOperator, "ADD", INT2NUM(CAIRO_OPERATOR_ADD));
- rb_define_const(mCairoOperator, "SATURATE", INT2NUM(CAIRO_OPERATOR_SATURATE));
+init_cairo_operator(void)
+{
+ VALUE mCairoOperator = rb_define_module_under(mCairo, "Operator");
+ rb_define_const(mCairoOperator, "CLEAR", INT2NUM(CAIRO_OPERATOR_CLEAR));
+ rb_define_const(mCairoOperator, "SRC", INT2NUM(CAIRO_OPERATOR_SRC));
+ rb_define_const(mCairoOperator, "DST", INT2NUM(CAIRO_OPERATOR_DST));
+ rb_define_const(mCairoOperator, "OVER", INT2NUM(CAIRO_OPERATOR_OVER));
+ rb_define_const(mCairoOperator, "OVER_REVERSE", INT2NUM(CAIRO_OPERATOR_OVER_REVERSE));
+ rb_define_const(mCairoOperator, "IN", INT2NUM(CAIRO_OPERATOR_IN));
+ rb_define_const(mCairoOperator, "IN_REVERSE", INT2NUM(CAIRO_OPERATOR_IN_REVERSE));
+ rb_define_const(mCairoOperator, "OUT", INT2NUM(CAIRO_OPERATOR_OUT));
+ rb_define_const(mCairoOperator, "OUT_REVERSE", INT2NUM(CAIRO_OPERATOR_OUT_REVERSE));
+ rb_define_const(mCairoOperator, "ATOP", INT2NUM(CAIRO_OPERATOR_ATOP));
+ rb_define_const(mCairoOperator, "ATOP_REVERSE", INT2NUM(CAIRO_OPERATOR_ATOP_REVERSE));
+ rb_define_const(mCairoOperator, "XOR", INT2NUM(CAIRO_OPERATOR_XOR));
+ rb_define_const(mCairoOperator, "ADD", INT2NUM(CAIRO_OPERATOR_ADD));
+ rb_define_const(mCairoOperator, "SATURATE", INT2NUM(CAIRO_OPERATOR_SATURATE));
}
static void
-init_cairo_extend(void) {
- VALUE mCairoExtend = rb_define_module_under(mCairo, "Extend");
- rb_define_const(mCairoExtend, "NONE", INT2NUM(CAIRO_EXTEND_NONE));
- rb_define_const(mCairoExtend, "REPEAT", INT2NUM(CAIRO_EXTEND_REPEAT));
- rb_define_const(mCairoExtend, "REFLECT", INT2NUM(CAIRO_EXTEND_REFLECT));
+init_cairo_extend(void)
+{
+ VALUE mCairoExtend = rb_define_module_under(mCairo, "Extend");
+ rb_define_const(mCairoExtend, "NONE", INT2NUM(CAIRO_EXTEND_NONE));
+ rb_define_const(mCairoExtend, "REPEAT", INT2NUM(CAIRO_EXTEND_REPEAT));
+ rb_define_const(mCairoExtend, "REFLECT", INT2NUM(CAIRO_EXTEND_REFLECT));
}
static void
-init_cairo_font_weight(void) {
- VALUE mCairoFontWeight = rb_define_module_under(mCairo, "FontWeight");
- rb_define_const(mCairoFontWeight, "NORMAL", INT2NUM(CAIRO_FONT_WEIGHT_NORMAL));
- rb_define_const(mCairoFontWeight, "BOLD", INT2NUM(CAIRO_FONT_WEIGHT_BOLD));
+init_cairo_font_weight(void)
+{
+ VALUE mCairoFontWeight = rb_define_module_under(mCairo, "FontWeight");
+ rb_define_const(mCairoFontWeight, "NORMAL", INT2NUM(CAIRO_FONT_WEIGHT_NORMAL));
+ rb_define_const(mCairoFontWeight, "BOLD", INT2NUM(CAIRO_FONT_WEIGHT_BOLD));
}
static void
-init_cairo_font_slant(void) {
- VALUE mCairoFontSlant = rb_define_module_under(mCairo, "FontSlant");
- rb_define_const(mCairoFontSlant, "NORMAL", INT2NUM(CAIRO_FONT_SLANT_NORMAL));
- rb_define_const(mCairoFontSlant, "ITALIC", INT2NUM(CAIRO_FONT_SLANT_ITALIC));
- rb_define_const(mCairoFontSlant, "OBLIQUE", INT2NUM(CAIRO_FONT_SLANT_OBLIQUE));
+init_cairo_font_slant(void)
+{
+ VALUE mCairoFontSlant = rb_define_module_under(mCairo, "FontSlant");
+ rb_define_const(mCairoFontSlant, "NORMAL", INT2NUM(CAIRO_FONT_SLANT_NORMAL));
+ rb_define_const(mCairoFontSlant, "ITALIC", INT2NUM(CAIRO_FONT_SLANT_ITALIC));
+ rb_define_const(mCairoFontSlant, "OBLIQUE", INT2NUM(CAIRO_FONT_SLANT_OBLIQUE));
}
-
void
-constants_init(void) {
- init_cairo_fill_rule();
- init_cairo_format();
- init_cairo_filter();
- init_cairo_status();
- init_cairo_line_join();
- init_cairo_line_cap();
- init_cairo_operator();
- init_cairo_extend();
- init_cairo_font_weight();
- init_cairo_font_slant();
+constants_init(void)
+{
+ init_cairo_fill_rule();
+ init_cairo_format();
+ init_cairo_filter();
+ init_cairo_status();
+ init_cairo_line_join();
+ init_cairo_line_cap();
+ init_cairo_operator();
+ init_cairo_extend();
+ init_cairo_font_weight();
+ init_cairo_font_slant();
}
Index: image.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/image.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- image.c 25 Nov 2003 04:35:42 -0000 1.3
+++ image.c 22 Nov 2004 22:09:30 -0000 1.4
@@ -1,7 +1,7 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
#include "rbcairo.h"
@@ -10,68 +10,76 @@
VALUE eCairoImageFormat;
static void
-rcairo_image_free(RCairoImage *img) {
- free(img->data); free(img);
+rcairo_image_free (RCairoImage *img)
+{
+ free(img->data); free(img);
}
RCairoImage*
-rcairo_image_get_image(VALUE vimage) {
- RCairoImage *img;
- Data_Get_Struct(vimage, RCairoImage, img);
- return img;
+rcairo_image_get_image (VALUE vimage)
+{
+ RCairoImage *img;
+ Data_Get_Struct(vimage, RCairoImage, img);
+ return img;
}
static VALUE
-rcairo_image_new(VALUE class, VALUE vformat, VALUE vwidth, VALUE vheight, VALUE vstride) {
- int format = FIX2INT(vformat);
- int bpp = 0;
- int datasize;
- RCairoImage *img;
-
- /* XXX only supports one format. */
- format = CAIRO_FORMAT_ARGB32;
- switch (format) {
- case CAIRO_FORMAT_ARGB32:
- bpp = 32;
- break;
- default:
- rb_raise(eCairoImageFormat, "unimplemented image format %d\n", format);
- return Qnil;
- }
- img = malloc(sizeof(RCairoImage));
- img->format = format;
- img->width = FIX2INT(vwidth);
- img->height = FIX2INT(vheight);
- img->stride = FIX2INT(vstride);
- datasize = img->stride * img->height * bpp/8;
- img->data = malloc(datasize);
- memset(img->data, 0, datasize);
- return Data_Wrap_Struct(cCairoImage, NULL, rcairo_image_free, img);
+rcairo_image_new (VALUE class,
+ VALUE vformat,
+ VALUE vwidth, VALUE vheight,
+ VALUE vstride)
+{
+ int format = FIX2INT(vformat);
+ int bpp = 0;
+ int datasize;
+ RCairoImage *img;
+
+ /* XXX only supports one format. */
+ format = CAIRO_FORMAT_ARGB32;
+ switch (format) {
+ case CAIRO_FORMAT_ARGB32:
+ bpp = 32;
+ break;
+ default:
+ rb_raise(eCairoImageFormat, "unimplemented image format %d\n", format);
+ return Qnil;
+ }
+ img = malloc(sizeof(RCairoImage));
+ img->format = format;
+ img->width = FIX2INT(vwidth);
+ img->height = FIX2INT(vheight);
+ img->stride = FIX2INT(vstride);
+ datasize = img->stride * img->height * bpp/8;
+ img->data = malloc(datasize);
+ memset(img->data, 0, datasize);
+ return Data_Wrap_Struct(cCairoImage, NULL, rcairo_image_free, img);
}
static VALUE
-rcairo_image_each_pixel(VALUE self) {
- RCairoImage *img = rcairo_image_get_image(self);
- unsigned int *data;
- int x, y;
+rcairo_image_each_pixel (VALUE self)
+{
+ RCairoImage *img = rcairo_image_get_image(self);
+ unsigned int *data;
+ int x, y;
- /* XXX assumes 32bpp format and stride == width. */
- data = (unsigned int*)img->data;
- for (y = 0; y < img->height; y++) {
- for (x = 0; x < img->width; x++) {
- rb_yield(rb_ary_new3(4, INT2FIX(x), INT2FIX(y), UINT2NUM(*data)));
- data++;
- }
- }
- return Qnil;
+ /* XXX assumes 32bpp format and stride == width. */
+ data = (unsigned int*)img->data;
+ for (y = 0; y < img->height; y++) {
+ for (x = 0; x < img->width; x++) {
+ rb_yield(rb_ary_new3(4, INT2FIX(x), INT2FIX(y), UINT2NUM(*data)));
+ data++;
+ }
+ }
+ return Qnil;
}
void
-rcairo_image_init(void) {
- cCairoImage = rb_define_class_under(mCairo, "Image", rb_cObject);
- rb_define_singleton_method(cCairoImage, "new", rcairo_image_new, 4);
- rb_define_method(cCairoImage, "each_pixel", rcairo_image_each_pixel, 0);
+rcairo_image_init (void)
+{
+ cCairoImage = rb_define_class_under(mCairo, "Image", rb_cObject);
+ rb_define_singleton_method(cCairoImage, "new", rcairo_image_new, 4);
+ rb_define_method(cCairoImage, "each_pixel", rcairo_image_each_pixel, 0);
- eCairoImageFormat = rb_define_class_under(mCairo, "ImageFormat", rb_eException);
+ eCairoImageFormat = rb_define_class_under(mCairo, "ImageFormat", rb_eException);
}
Index: rbcairo.h
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/rbcairo.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- rbcairo.h 28 May 2004 19:45:05 -0000 1.4
+++ rbcairo.h 22 Nov 2004 22:09:30 -0000 1.5
@@ -1,7 +1,7 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
#include <ruby.h>
@@ -11,32 +11,39 @@
void cairo_xlib_init(void);
void constants_init(void);
-extern VALUE mCairo, cCairo, cCairoSurface, cCairoMatrix, cCairoImage;
-extern VALUE cDisplay, eXlib;
+extern VALUE mCairo,
+ cCairo,
+ cCairoSurface,
+ cCairoMatrix,
+ cCairoImage;
+extern VALUE cDisplay,
+ eXlib;
/* A buffer for cairo to render images into. */
-typedef struct {
- char *data;
- cairo_format_t format;
- int width, height, stride;
-} RCairoImage;
+typedef struct
+{
+ char *data;
+ cairo_format_t format;
+ int width, height, stride;
+}
+RCairoImage;
-VALUE gen_Cairo(void);
-VALUE gen_CairoMatrix(void);
-VALUE gen_CairoSurface(void);
+VALUE gen_Cairo(void);
+VALUE gen_CairoMatrix(void);
+VALUE gen_CairoSurface(void);
-VALUE rcairo_display_new();
-Display* rcairo_display_get_display(VALUE rdpy);
+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);
+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);
+void rcairo_image_init(void);
+RCairoImage* rcairo_image_get_image(VALUE vimage);
-VALUE rmatrix_new();
-cairo_matrix_t* rmatrix_get_matrix(VALUE vmatrix);
+VALUE rmatrix_new();
+cairo_matrix_t* rmatrix_get_matrix(VALUE vmatrix);
VALUE rsurface_new_from();
cairo_surface_t* rsurface_get_surface(VALUE rcairo);
Index: xlib.c
===================================================================
RCS file: /cvs/cairo/rcairo/packages/cairo/ext/xlib.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- xlib.c 19 Apr 2004 21:35:57 -0000 1.3
+++ xlib.c 22 Nov 2004 22:09:30 -0000 1.4
@@ -1,7 +1,7 @@
/* ruby-cairo - Ruby bindings for Cairo.
* Copyright (C) 2003 Evan Martin <martine at danga.com>
+ * (C) 2004 Ãyvind KolÃ¥s <pippin at freedesktop.org>
*
- * vim: tabstop=4 shiftwidth=4 noexpandtab :
*/
#include "rbcairo.h"
@@ -9,205 +9,255 @@
VALUE mXlib, eXlib, cDisplay, cWindow;
VALUE
-rcairo_display_new() {
- Display *dpy;
- VALUE obj;
+rcairo_display_new()
+{
+ Display *dpy;
+ VALUE obj;
- dpy = XOpenDisplay(NULL);
- if (dpy == NULL) {
- rb_raise(eXlib, "XOpenDisplay: Unable to open display");
- return Qnil;
- }
+ dpy = XOpenDisplay(NULL);
+ if (dpy == NULL) {
+ rb_raise(eXlib, "XOpenDisplay: Unable to open display");
+ return Qnil;
+ }
- obj = Data_Wrap_Struct(cDisplay, 0, 0, dpy);
- rb_iv_set(obj, "@windows", rb_hash_new());
- rb_iv_set(obj, "@quit", Qfalse);
+ obj = Data_Wrap_Struct(cDisplay, 0, 0, dpy);
+ rb_iv_set(obj, "@windows", rb_hash_new());
+ rb_iv_set(obj, "@quit", Qfalse);
- return obj;
+ return obj;
}
+
Display*
-rcairo_display_get_display(VALUE rdpy) {
- Display *dpy;
- Data_Get_Struct(rdpy, Display, dpy);
- return dpy;
+rcairo_display_get_display(VALUE rdpy)
+{
+ Display *dpy;
+ Data_Get_Struct(rdpy, Display, dpy);
+ return dpy;
}
static VALUE
-display_new(VALUE class) {
- return rcairo_display_new();
+display_new(VALUE class)
+{
+ return rcairo_display_new();
}
static VALUE
-display_xconnection(VALUE self) {
- Display *dpy;
- Data_Get_Struct(self, Display, dpy);
- return INT2FIX(ConnectionNumber(dpy));
+display_xconnection(VALUE self)
+{
+ Display *dpy;
+ Data_Get_Struct(self, Display, dpy);
+ return INT2FIX(ConnectionNumber(dpy));
}
+
static VALUE
-display_width(VALUE self) {
- Display *dpy;
- Data_Get_Struct(self, Display, dpy);
- return INT2FIX(DisplayWidth(dpy, 0));
+display_width(VALUE self)
+{
+ Display *dpy;
+ Data_Get_Struct(self, Display, dpy);
+ return INT2FIX(DisplayWidth(dpy, 0));
}
+
static VALUE
-display_height(VALUE self) {
- Display *dpy;
- Data_Get_Struct(self, Display, dpy);
- return INT2FIX(DisplayHeight(dpy, 0));
+display_height(VALUE self)
+{
+ Display *dpy;
+ Data_Get_Struct(self, Display, dpy);
+ return INT2FIX(DisplayHeight(dpy, 0));
}
static void
-redraw(VALUE vwin, Display *dpy, Window win) {
- XClearWindow(dpy, win);
- rb_funcall(vwin, rb_intern("draw"), 0);
+redraw (VALUE vwin,
+ Display *dpy,
+ Window win)
+{
+ XClearWindow(dpy, win);
+ rb_funcall(vwin, rb_intern("draw"), 0);
}
static VALUE
-display_loop(VALUE vself) {
- Display *dpy = rcairo_display_get_display(vself);
- XEvent xev;
- VALUE vwindows, vwin;
+display_loop (VALUE vself)
+{
+ Display *dpy = rcairo_display_get_display(vself);
+ XEvent xev;
+ VALUE vwindows, vwin;
- vwindows = rb_iv_get(vself, "@windows");
+ vwindows = rb_iv_get(vself, "@windows");
- while (rb_iv_get(vself, "@quit") == Qfalse) {
- XNextEvent(dpy, &xev);
+ while (rb_iv_get(vself, "@quit") == Qfalse) {
+ XNextEvent(dpy, &xev);
- switch(xev.type) {
- case KeyPress: {
- XKeyEvent *kev = &xev.xkey;
- unsigned int sym = XKeycodeToKeysym(dpy, kev->keycode, 0);
- vwin = rb_hash_aref(vwindows, INT2FIX(kev->window));
- if (vwin == Qnil)
- continue;
- if (sym > 255) sym = 0;
- rb_funcall(vwin, rb_intern("keypress"), 1, INT2FIX(sym));
- redraw(vwin, dpy, kev->window);
- } break;
- case ConfigureNotify: {
- XConfigureEvent *cev = &xev.xconfigure;
- vwin = rb_hash_aref(vwindows, INT2FIX(cev->window));
- if (vwin == Qnil)
- continue;
- rb_iv_set(vwin, "@width", INT2FIX(cev->width));
- rb_iv_set(vwin, "@height", INT2FIX(cev->height));
- rb_funcall(vwin, rb_intern("resize"), 0);
- } break;
- case Expose: {
- XExposeEvent *eev = &xev.xexpose;
- vwin = rb_hash_aref(vwindows, INT2FIX(eev->window));
- if (vwin == Qnil)
- continue;
- if (eev->count == 0)
- redraw(vwin, dpy, eev->window);
- } break;
- }
- }
+ switch(xev.type) {
+ case KeyPress: {
+ XKeyEvent *kev = &xev.xkey;
+ unsigned int sym = XKeycodeToKeysym(dpy, kev->keycode, 0);
+ vwin = rb_hash_aref(vwindows, INT2FIX(kev->window));
+ if (vwin == Qnil)
+ continue;
+ if (sym > 255) sym = 0;
+ rb_funcall(vwin, rb_intern("keypress"), 1, INT2FIX(sym));
+ redraw(vwin, dpy, kev->window);
+ } break;
+ case ConfigureNotify: {
+ XConfigureEvent *cev = &xev.xconfigure;
+ vwin = rb_hash_aref(vwindows, INT2FIX(cev->window));
+ if (vwin == Qnil)
+ continue;
+ rb_iv_set(vwin, "@width", INT2FIX(cev->width));
+ rb_iv_set(vwin, "@height", INT2FIX(cev->height));
+ rb_funcall(vwin, rb_intern("resize"), 0);
+ } break;
+ case Expose: {
+ XExposeEvent *eev = &xev.xexpose;
+ vwin = rb_hash_aref(vwindows, INT2FIX(eev->window));
+ if (vwin == Qnil)
+ continue;
+ if (eev->count == 0)
+ redraw(vwin, dpy, eev->window);
+ } break;
+ }
+ }
- XCloseDisplay(dpy);
+ XCloseDisplay(dpy);
- return Qnil;
+ return Qnil;
}
static VALUE
-display_quit(VALUE vself) {
- rb_iv_set(vself, "@quit", Qtrue);
- return Qnil;
+display_quit (VALUE vself)
+{
+ rb_iv_set(vself, "@quit", Qtrue);
+ return Qnil;
}
void
-xlib_set_size_hints(Display *dpy, Window win, int width, int height) {
- XSizeHints hnt = {0};
+xlib_set_size_hints (Display *dpy,
+ Window win,
+ int width, int height)
+{
+ XSizeHints hnt = {0};
- hnt.flags = USSize | PSize | PMinSize | PMaxSize;
- hnt.width = width;
- hnt.min_width = width;
- hnt.max_width = width;
- hnt.height = height;
- hnt.min_height = height;
- hnt.max_height = height;
- XSetWMNormalHints(dpy, win, &hnt);
+ hnt.flags = USSize | PSize | PMinSize | PMaxSize;
+ hnt.width = width;
+ hnt.min_width = width;
+ hnt.max_width = width;
+ hnt.height = height;
+ hnt.min_height = height;
+ hnt.max_height = height;
+ XSetWMNormalHints(dpy, win, &hnt);
}
static VALUE
-window_create(VALUE vdpy, VALUE vwidth, VALUE vheight, VALUE vbg) {
- Display *dpy;
- Window root, win;
- int scr;
- int width, height;
- unsigned long color;
+window_create (VALUE vdpy,
+ VALUE vwidth, VALUE vheight,
+ VALUE vbg)
+{
+ Display *dpy;
+ Window root, win;
+ int scr;
+ int width, height;
+ unsigned long color;
- dpy = rcairo_display_get_display(vdpy);
+ dpy = rcairo_display_get_display(vdpy);
- XSynchronize(dpy, 1);
- root = DefaultRootWindow(dpy);
- scr = DefaultScreen(dpy);
- width = FIX2INT(vwidth);
- height = FIX2INT(vheight);
+ XSynchronize(dpy, 1);
+ root = DefaultRootWindow(dpy);
+ scr = DefaultScreen(dpy);
+ width = FIX2INT(vwidth);
+ height = FIX2INT(vheight);
- if (vbg == Qtrue)
- color = WhitePixel(dpy, scr);
- else
- color = BlackPixel(dpy, scr);
-
- win = XCreateSimpleWindow(dpy, root, 0, 0,
- width, height, 0,
- color, color);
-
- XSelectInput(dpy, win,
- KeyPressMask
- |StructureNotifyMask
- |ExposureMask);
+ if (vbg == Qtrue)
+ color = WhitePixel(dpy, scr);
+ else
+ color = BlackPixel(dpy, scr);
+
+ win = XCreateSimpleWindow(dpy, root, 0, 0,
+ width, height, 0,
+ color, color);
+
+ XSelectInput(dpy, win,
+ KeyPressMask
+ |StructureNotifyMask
+ |ExposureMask);
- XMapWindow(dpy, win);
- return INT2FIX(win);
+ XMapWindow(dpy, win);
+ return INT2FIX(win);
}
static VALUE
-window_init(VALUE vself, VALUE vdpy, VALUE vwidth, VALUE vheight, VALUE vbg) {
- VALUE vwin, vcairo;
+window_init (VALUE vself,
+ VALUE vdpy,
+ VALUE vwidth, VALUE vheight,
+ VALUE vbg)
+{
+ VALUE vwin, vcairo;
- rb_iv_set(vself, "@dpy", vdpy);
- vwin = window_create(vdpy, vwidth, vheight, vbg);
- rb_hash_aset(rb_iv_get(vdpy, "@windows"), vwin, vself);
- rb_iv_set(vself, "@win", vwin);
+ rb_iv_set(vself, "@dpy", vdpy);
+ vwin = window_create(vdpy, vwidth, vheight, vbg);
+ rb_hash_aset(rb_iv_get(vdpy, "@windows"), vwin, vself);
+ rb_iv_set(vself, "@win", vwin);
- vcairo = rcairo_new();
- rb_iv_set(vself, "@cairo", vcairo);
- cairo_set_target_drawable(rcairo_get_cairo(vcairo),
- rcairo_display_get_display(vdpy),
- FIX2INT(vwin));
+ vcairo = rcairo_new();
+ rb_iv_set(vself, "@cairo", vcairo);
+ cairo_set_target_drawable(rcairo_get_cairo(vcairo),
+ rcairo_display_get_display(vdpy),
+ FIX2INT(vwin));
- return vself;
+ return vself;
}
static VALUE
-window_nop(VALUE vself) {
- return Qnil;
+window_nop(VALUE vself)
+{
+ return Qnil;
}
void
-xlib_init() {
- VALUE mXlib = rb_define_module_under(mCairo, "Xlib");
- eXlib = rb_define_class_under(mXlib, "Exception", rb_eException);
- cDisplay = rb_define_class_under(mXlib, "Display", rb_cObject);
- rb_define_singleton_method(cDisplay, "new", display_new, 0);
- rb_define_method(cDisplay, "xconnection", display_xconnection, 0);
- rb_define_method(cDisplay, "width", display_width, 0);
- rb_define_method(cDisplay, "height", display_height, 0);
- rb_define_method(cDisplay, "mainloop", display_loop, 0);
- rb_define_method(cDisplay, "quit", display_quit, 0);
+xlib_init()
+{
+ VALUE mXlib = rb_define_module_under(mCairo, "Xlib");
+ eXlib = rb_define_class_under(mXlib, "Exception", rb_eException);
- cWindow = rb_define_class_under(mXlib, "Window", rb_cObject);
- rb_define_method(cWindow, "initialize", window_init, 4);
- rb_define_method(cWindow, "draw", window_nop, -1);
- rb_define_method(cWindow, "resize", window_nop, -1);
- rb_define_method(cWindow, "keypress", window_nop, -1);
+
+ cDisplay = rb_define_class_under(mXlib, "Display", rb_cObject);
+
+ rb_define_singleton_method(cDisplay, "new",
+ display_new, 0);
+
+ rb_define_method(cDisplay, "xconnection",
+ display_xconnection, 0);
+
+ rb_define_method(cDisplay, "width",
+ display_width, 0);
+
+ rb_define_method(cDisplay, "height",
+ display_height, 0);
+
+ rb_define_method(cDisplay, "mainloop",
+ display_loop, 0);
+
+ rb_define_method(cDisplay, "quit",
+ display_quit, 0);
+
+
+ cWindow = rb_define_class_under(mXlib, "Window", rb_cObject);
+
+ rb_define_method(cWindow, "initialize",
+ window_init, 4);
+
+ rb_define_method(cWindow, "draw",
+ window_nop, -1);
+
+ rb_define_method(cWindow, "resize",
+ window_nop, -1);
+
+ rb_define_method(cWindow, "keypress",
+ window_nop, -1);
}
Display*
-xlib_dpy_from_rb(VALUE display) {
- Display *dpy;
- Data_Get_Struct(display, Display, dpy);
- return dpy;
+xlib_dpy_from_rb (VALUE display)
+{
+ Display *dpy;
+ Data_Get_Struct(display, Display, dpy);
+ return dpy;
}
More information about the cairo-commit
mailing list